/* ==========================================================================
   Fancy City: shared design system for fluffyhandsome.com
   Transit-signage look: black sign bands, white ground, red + blue used
   like train-line colors. Approved in the Phase 0 mock-up.
   ========================================================================== */

:root {
  --ink: #0e0e10;
  --paper: #ffffff;
  --red: #dd2a1b;      /* Fluffy red: reading, main actions */
  --blue: #0b4bb3;     /* Insider blue: books, Patreon */
  --slime: #6fdc2a;    /* BrainRot slime: always with ink text */
  --advisory: #ffd21f; /* service advisories */
  --mute: #5f636c;
  --rule: #d9dadf;
  --gallery: #121214;  /* reader's dark mode */
  --on-ink-mute: #c5c6cc;

  --sans: "Hanken Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --measure: 62ch;
  --page-max: 1120px;

  color-scheme: light;
}

/* --- base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
h1, h2, h3 { margin: 0; text-wrap: balance; line-height: 1.02; letter-spacing: -0.015em; }
p { margin: 0; }
[hidden] { display: none !important; }

.wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.label { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.mute { color: var(--mute); }
.prose { max-width: var(--measure); display: grid; gap: 1em; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 20; background: var(--paper); padding: 8px 12px; }

/* --- signage header ------------------------------------------------------ */
.sign { background: var(--ink); color: var(--paper); position: sticky; top: 0; z-index: 10; padding-top: env(safe-area-inset-top, 0px); }
.sign .wrap { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; padding-block: 14px; flex-wrap: wrap; }
.wordmark { font-weight: 900; font-size: 26px; letter-spacing: .02em; text-decoration: none; }
.nav { display: flex; gap: 4px 22px; flex-wrap: wrap; font-weight: 700; font-size: 15px; }
.nav a { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; text-underline-offset: 5px; text-decoration-thickness: 2px; }
.nav a:hover, .nav a[aria-current="page"] { text-decoration: underline; }

/* --- line bullets: one per series ---------------------------------------
   red = Fluffy, blue = IN(ner)SANITIES, slime = BadAss BrainRot, ring = Patreon */
.bullet { flex: none; width: 1.55em; height: 1.55em; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: .8em; line-height: 1; color: var(--paper); background: var(--ink); }
.bullet.red { background: var(--red); }
.bullet.blue { background: var(--blue); }
.bullet.slime { background: var(--slime); color: var(--ink); }
.bullet.ring { background: transparent; color: currentColor; box-shadow: inset 0 0 0 2.5px currentColor; }
.bullet.lg { font-size: 30px; }

/* --- buttons and tags ---------------------------------------------------- */
.btns { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 12px; font: inherit; font-weight: 800; font-size: 16px; padding: 14px 18px; text-decoration: none; border: 0; border-radius: 0; cursor: pointer; }
.btn .arr { display: inline-grid; place-items: center; width: 26px; height: 26px; background: var(--paper); color: var(--ink); font-size: 16px; }
.btn.red { background: var(--red); color: var(--paper); }
.btn.blue { background: var(--blue); color: var(--paper); }
.btn.ink { background: var(--ink); color: var(--paper); }
.btn.slime { background: var(--slime); color: var(--ink); }
.btn.slime .arr { background: var(--ink); color: var(--slime); }
.btn.outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2.5px var(--ink); }
.btn.outline .arr { background: var(--ink); color: var(--paper); }
.btn:hover { filter: brightness(1.12); }
.tag { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: 7px 10px; background: var(--paper); box-shadow: inset 0 0 0 2px var(--ink); }
.tag.stripe { background: repeating-linear-gradient(-45deg, var(--paper) 0 8px, #ececef 8px 16px); }

/* --- sections ------------------------------------------------------------ */
.section { padding-block: 64px; border-bottom: 1px solid var(--rule); }
.page-title { padding-block: 56px 40px; border-bottom: 1px solid var(--rule); }
.page-title .line { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.page-title h1 { font-size: clamp(42px, 6.4vw, 84px); font-weight: 900; letter-spacing: -0.035em; }
.page-title p { margin-top: 18px; font-size: 19px; max-width: 40ch; color: var(--mute); }

/* --- Insider band (Patreon) ---------------------------------------------- */
.insider { background: var(--blue); color: var(--paper); padding-block: 64px; }
.insider .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.insider h2 { font-size: clamp(28px, 4vw, 44px); font-weight: 900; max-width: 18ch; }
.insider p { max-width: 40ch; margin-top: 10px; opacity: .9; }
.insider .btn { background: var(--paper); color: var(--blue); }
.insider .btn .arr { background: var(--blue); color: var(--paper); }

/* --- footer --------------------------------------------------------------- */
.site-foot { background: var(--ink); color: var(--paper); padding-block: 48px calc(48px + env(safe-area-inset-bottom, 0px)); }
.site-foot .wrap { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 32px; }
.site-foot p { max-width: 54ch; color: var(--on-ink-mute); }
.site-foot .sig { margin-top: 14px; font-weight: 800; color: var(--paper); }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-weight: 700; align-content: start; }
.site-foot a { text-decoration: none; }
.site-foot a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* --- placeholder marker (content still to be written) -------------------- */
.ph { background: #fff4c2; padding: 0 3px; }

@media (max-width: 760px) {
  .section, .insider { padding-block: 44px; }
  .site-foot .wrap { grid-template-columns: minmax(0, 1fr); }
  .sign .wrap { padding-block: 10px; }
  .wordmark { font-size: 22px; }
  .nav { font-size: 14px; gap: 4px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* --- books ---------------------------------------------------------------- */
.shelf { display: grid; gap: 72px; padding-block: 64px; }
.book { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 48px; align-items: start; scroll-margin-top: 90px; }
.book:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 340px); }
.book:nth-child(even) .cover { order: 2; }
.book-text { display: grid; gap: 16px; min-width: 0; justify-items: start; }
.book-text .line { display: flex; gap: 12px; align-items: center; }
.book-text h2 { font-size: clamp(30px, 4vw, 44px); font-weight: 900; }
.book-text .sub { color: var(--mute); font-weight: 600; }
.book-text .blurb { max-width: var(--measure); }
.book-text blockquote { margin: 0; padding-left: 16px; border-left: 4px solid var(--ink); font-size: 18px; font-weight: 600; max-width: var(--measure); }
.book-text blockquote cite { display: block; margin-top: 6px; font-style: normal; font-size: 13px; color: var(--mute); font-weight: 500; }
.price { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.price span { font-size: 15px; font-weight: 600; color: var(--mute); }
.specs { font-size: 13px; color: var(--mute); font-variant-numeric: tabular-nums; }

/* covers: a real image when there is one, a placeholder in the book's own shape otherwise */
.cover { container-type: inline-size; position: relative; max-width: 100%; aspect-ratio: 1 / 1; box-shadow: 0 18px 30px -18px rgb(0 0 0 / .55), 0 2px 4px rgb(0 0 0 / .15); overflow: hidden; }
.cover.landscape { aspect-ratio: 11 / 8.5; }
.cover.portrait { aspect-ratio: 6 / 9; }
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover.has-img { aspect-ratio: auto; container-type: normal; }
.cover.has-img img { height: auto; }
.cover-ph { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 7cqi; color: var(--paper); background: var(--ink); }
.cover-ph h3 { font-size: 9cqi; font-weight: 900; letter-spacing: -0.02em; position: relative; }
.cover-ph small { font-size: max(9px, 3.4cqi); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .85; position: relative; }
.cover-ph.fluffy { background: #1f3ab0; }
.cover-ph.fluffy::after { content: ""; position: absolute; width: 58%; aspect-ratio: 1; right: 20%; bottom: 16%; border: 4.2cqi solid #ef4a5e; border-radius: 46% 46% 50% 50%; }
.cover-ph.innersanities { background: var(--paper); color: var(--ink); align-items: center; text-align: center; box-shadow: inset 0 0 0 1px var(--rule); padding: 5cqi; }
.cover-ph.innersanities .sq { width: 30cqi; aspect-ratio: 1; border: 3cqi solid var(--ink); outline: 1.8cqi solid var(--ink); outline-offset: 2.4cqi; }
.cover-ph.innersanities h3 { font-size: 5cqi; font-weight: 500; letter-spacing: 0; }
.cover-ph.innersanities b { font-size: 4.2cqi; font-weight: 500; letter-spacing: .02em; }
.cover-ph.brainrot::after { content: ""; position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%; right: -18%; bottom: -12%; background: rgb(255 255 255 / .12); }

.samples { display: flex; gap: 10px; flex-wrap: wrap; }
.samples button { padding: 0; border: 1px solid var(--rule); background: var(--paper); cursor: zoom-in; width: 150px; max-width: calc(50% - 5px); }
.samples img { display: block; width: 100%; height: auto; }

/* --- shelf teaser (homepage) ---------------------------------------------- */
.teaser { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; align-items: end; }
.teaser a { display: grid; gap: 14px; text-decoration: none; }
.teaser .cover.has-img { width: fit-content; max-width: 100%; }
.teaser .cover.has-img img { width: auto; max-width: none; height: clamp(200px, 22vw, 280px); }
.teaser .t-name { font-weight: 800; font-size: 17px; display: flex; gap: 10px; align-items: center; }

/* --- zoom lightbox (book samples) ----------------------------------------- */
.lightbox { position: fixed; inset: 0; z-index: 30; background: #0a0a0b; display: none; align-items: center; justify-content: center; touch-action: none; overflow: hidden; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; will-change: transform; user-select: none; -webkit-user-drag: none; touch-action: none; cursor: zoom-in; }
.lightbox img.zoomed { cursor: grab; }
.lightbox img.smooth { transition: transform .18s ease-out; }
.lightbox .lb-close { position: absolute; top: max(12px, env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); width: 44px; height: 44px; border: 0; border-radius: 0; background: var(--paper); color: var(--ink); font: inherit; font-size: 24px; font-weight: 800; line-height: 1; cursor: pointer; z-index: 1; }
.lightbox .lb-hint { position: absolute; bottom: max(14px, env(safe-area-inset-bottom, 0px)); left: 50%; translate: -50% 0; color: #9a9ca3; font-size: 13px; font-weight: 700; pointer-events: none; }
body.lb-open { overflow: hidden; }

@media (max-width: 760px) {
  .shelf { gap: 56px; padding-block: 44px; }
  .book, .book:nth-child(even) { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .book:nth-child(even) .cover { order: 0; }
  .book .cover { width: min(100%, 260px); }
  .teaser { grid-template-columns: minmax(0, 1fr); }
  .teaser .cover { width: min(100%, 220px); }
}
@media (prefers-reduced-motion: reduce) { .lightbox img.smooth { transition: none; } }

/* --- homepage -------------------------------------------------------------- */
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; align-items: end; padding-block: 56px 64px; }
.hero-art { background: var(--ink); padding: 14px; display: block; }
.hero-art img { display: block; width: 100%; height: auto; }
.hero-copy { display: grid; gap: 26px; padding-bottom: 8px; justify-items: start; }
.hero-copy .line { display: flex; align-items: center; gap: 14px; }
.hero-copy h1 { font-size: clamp(42px, 6.4vw, 84px); font-weight: 900; letter-spacing: -0.035em; }
.hero-copy p { font-size: 19px; max-width: 34ch; color: var(--mute); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px 14px; margin-bottom: 32px; flex-wrap: wrap; }
.sec-head h2 { font-size: clamp(28px, 3.4vw, 38px); font-weight: 900; }
.sec-head a { font-weight: 800; text-underline-offset: 4px; }
.welcome { font-size: clamp(20px, 2.4vw, 26px); font-weight: 500; line-height: 1.4; max-width: 40ch; }

/* --- About page ------------------------------------------------------------ */
.about-block { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 32px 56px; }
.about-block h2 { font-size: clamp(26px, 3vw, 34px); font-weight: 900; }
.about-block .prose { font-size: 18px; }

/* --- YouTube facade (nothing loads from YouTube until play) ---------------- */
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; max-width: 100%; background: var(--ink); overflow: hidden; }
.video-frame img.yt-thumb, .video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; display: block; }
.yt-play { position: absolute; inset: 0; width: 100%; height: 100%; display: grid; place-items: center; background: rgb(0 0 0 / .12); border: 0; padding: 0; cursor: pointer; }
.yt-play:hover { background: rgb(0 0 0 / .28); }
.yt-icon { width: 76px; height: 76px; border-radius: 50%; background: var(--red); position: relative; box-shadow: 0 4px 16px rgb(0 0 0 / .4); }
.yt-icon::after { content: ""; position: absolute; left: 31px; top: 23px; border-style: solid; border-width: 15px 0 15px 24px; border-color: transparent transparent transparent var(--paper); }
.yt-escape { position: absolute; right: 8px; bottom: 52px; padding: 6px 10px; background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 700; text-decoration: none; }
.yt-caption { margin-top: 12px; font-size: 14px; color: var(--mute); font-style: italic; }

.site-foot .small { margin-top: 28px; font-size: 13px; color: #9a9ca3; }

@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-block: 28px 44px; }
  .hero-art { width: min(64%, 230px); padding: 8px; }
  .hero { gap: 22px; }
  .hero-copy { gap: 18px; }
  .hero-copy p { font-size: 17px; }
  .about-block { grid-template-columns: minmax(0, 1fr); gap: 18px; }
}

/* --- service advisory tag (reader menu, books) ------------------------------ */
.tag.advisory { background: var(--advisory); box-shadow: none; letter-spacing: .08em; }
