/* =============================================================================
   Yofetch · placeholder landing page
   Mirrors The Stacks visual vocabulary (assets_new/css/design-system.css +
   experiments/library/v4/css/library.css). Tokens and treatments are inlined
   here so this placeholder deploys independently of the sandbox rebuild.
   ============================================================================= */

/* ---------------------------------------------------------------------------
   Tokens (light only; placeholder doesn't need dark-mode just yet)
   --------------------------------------------------------------------------- */
:root {
  --paper:        #F1E8D5;
  --card-bg:      #FDFBF3;
  --card-bg-2:    #FBF6E5;
  --ink:          #1F2430;
  --ink-soft:     #3A4050;
  --muted:        #6B6357;
  --ink-whisper:  #958F86;
  --pin:          #E86A5A;
  --pin-shaft:    #D4D4D4;
  --accent:       #FF8A3D;
  --accent-soft:  #FFA464;
  --on-accent:    #1F2430;
  --border:       color-mix(in srgb, var(--ink) 55%, transparent);
  --shadow-soft:  1px 1px 0 var(--muted);
  --shadow-mid:   1.5px 1.5px 0 var(--muted);
  --shadow-deep:  2px 2px 0 var(--ink);
  --border-thin:  1.5px solid var(--border);
  --border-thick: 2px solid var(--border);
  --ff-head:      'Fraunces', Georgia, serif;
  --ff-hand:      'Caveat', 'Segoe Script', cursive;
  --ff-body:      'DM Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  min-height: 100dvh;
  font-family: var(--ff-body);
  color: var(--ink);
  background: var(--paper);
  /* Stacks paper-grain treatment: two soft radial washes + a procedural
     SVG noise overlay. Gives the cream paper a warm, lived-in quality
     without using a heavy texture image. */
  background-image:
    radial-gradient(ellipse 900px 500px at 12% -10%, rgba(255, 206, 140, 0.35), transparent 60%),
    radial-gradient(ellipse 900px 500px at 90% 110%, rgba(200, 180, 140, 0.30), transparent 60%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.12  0 0 0 0 0.10  0 0 0 0 0.07  0 0 0 0.14 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------------------------------------------------------------------------
   Page shell
   --------------------------------------------------------------------------- */
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 22px 20px;
  position: relative;
}
.page__inner { width: 100%; }
.page__inner--focused {
  max-width: 760px;
  margin: 0 auto;
}

/* ---------------------------------------------------------------------------
   Strip-bar (page chrome)
   --------------------------------------------------------------------------- */
.strip-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  background: var(--card-bg);
  border: var(--border-thick);
  border-radius: 14px;
  box-shadow: var(--shadow-mid);
  transform: rotate(-0.5deg);
  position: relative;
  z-index: 10;
}
/* When the viewport narrows to the point that the strip-bar would be
   the same width as the focused content column below it (~804px and
   under, since the focused column maxes at 760px + 44px page padding),
   the bar goes full-bleed across the viewport. Becomes a header band
   rather than a card aligned with the content. */
@media (max-width: 804px) {
  .strip-bar {
    margin-top: -14px;           /* absorb .page padding-top so the bar hugs the viewport top edge */
    margin-left: -22px;
    margin-right: -22px;
    border-top: 0;
    border-left: 0;
    border-right: 0;
    border-bottom-width: 1.5px;  /* lighter bottom edge in the full-bleed state */
    border-radius: 0;
    box-shadow: none;            /* the flat-offset shadow was stacking a grey hairline under the border — drop it */
    transform: none;
  }
}
.strip-bar__home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.strip-bar__home-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--card-bg);
  border: var(--border-thick);
  border-radius: 50%;
  padding: 4px;
  box-shadow: var(--shadow-deep);
  color: var(--ink);
}
.strip-bar__home-mark svg { width: 100%; height: 100%; }
.strip-bar__home-name {
  font-family: var(--ff-head);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.015em;
  color: var(--ink);
}

/* ---------------------------------------------------------------------------
   Intro (kicker + h1 + hint on the left, Yo speech bubble on the right)
   Same structure as the library welcome page.
   --------------------------------------------------------------------------- */
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 36px 0 32px;
}
.intro__copy { min-width: 0; flex: 1; }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--ff-body);
  font-weight: 700;
  font-size: 12px;
  line-height: 1;            /* tighten the label's line-box to its glyphs so it visually centers with the icon */
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.kicker__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--accent-soft);
  color: var(--on-accent);
  border: 2px solid var(--on-accent);
  border-radius: 6px;
  box-shadow: var(--shadow-deep);
  transform: rotate(-3deg);
}
.kicker__icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transform: rotate(-30deg);
}
.kicker__label { color: var(--ink); }

.intro__h1 {
  font-family: var(--ff-head);
  font-size: clamp(38px, 3.4vw, 44px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--ink);
}
.intro__hint {
  font-family: var(--ff-body);
  font-size: 19px;
  color: var(--muted);
  margin: 10px 0 0;
  max-width: 580px;
  line-height: 1.5;
}

/* ---------------------------------------------------------------------------
   Yo's speech bubble — mascot + bubble with tail pointing left, pin at top.
   --------------------------------------------------------------------------- */
.yo-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.intro .yo-tip { transform: translateX(-10px); }

.yo-tip__mascot {
  width: 110px;
  height: 110px;
  flex-shrink: 0;
  transform: rotate(6deg);
  animation: introBob 4s ease-in-out infinite;
  object-fit: contain;
  display: block;
  margin-top: 18px;
}
@keyframes introBob {
  0%, 100% { transform: rotate(6deg) translateY(0); }
  50%      { transform: rotate(5deg) translateY(-5px); }
}

.yo-tip__bubble {
  position: relative;
  background: var(--card-bg);
  border: var(--border-thick);
  border-radius: 14px;
  padding: 12px 16px 14px;
  box-shadow: var(--shadow-mid);
  max-width: 320px;
  min-width: 140px;
}
.yo-tip__label {
  display: block;
  font-family: var(--ff-hand);
  font-size: 18px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}
.yo-tip__text {
  display: block;
  font-family: var(--ff-hand);
  font-size: 22px;
  color: var(--ink);
  margin: 0;
  line-height: 1.25;
}
.yo-tip__tail {
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 14px;
  height: 14px;
  background: var(--card-bg);
  border-bottom: var(--border-thick);
  border-left: var(--border-thick);
}
/* ---------------------------------------------------------------------------
   Modes — "things you'll do here" stack of crooked panel rows.
   Mirrors the .book-row pattern from The Stacks browse-page listing mode:
   small visual glyph on the left, title + body on the right, slight tilts
   alternating row-to-row, flat-offset shadows.
   --------------------------------------------------------------------------- */
.modes,
.channels {
  margin: 36px 0 28px;
}
.modes__title,
.channels__title {
  font-family: var(--ff-head);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  color: var(--ink);
}
.modes__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mode-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
  align-items: start;
  background: var(--card-bg);
  border: var(--border-thin);
  border-radius: 10px;
  padding: 16px 18px 16px 16px;
  box-shadow: var(--shadow-mid);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

/* Subtle alternating tilts — same idea as listings__list book-row but
   scoped to 8 rows so each one gets a unique angle. Magnitudes are small
   (0.3°–0.6°) because wide rows stacked vertically need restraint. */
.mode-row:nth-child(1) { transform: rotate(-0.5deg); }
.mode-row:nth-child(2) { transform: rotate( 0.4deg); }
.mode-row:nth-child(3) { transform: rotate(-0.3deg); }
.mode-row:nth-child(4) { transform: rotate( 0.6deg); }
.mode-row:nth-child(5) { transform: rotate(-0.4deg); }
.mode-row:nth-child(6) { transform: rotate( 0.5deg); }
.mode-row:nth-child(7) { transform: rotate(-0.6deg); }
.mode-row:nth-child(8) { transform: rotate( 0.3deg); }

/* Polaroid framing — each glyph sits in a small white photo card with
   a generous bottom caption-margin (the classic Polaroid silhouette)
   and a soft blurred shadow suggesting it's been stuck to the page.
   ::before paints the "photo" area (a paper-tone inset with a faint
   border) so the icon reads as the printed image. Per-row rotation
   on the polaroid itself gives the wall-of-snapshots feel. */
/* Polaroid frame + photo area. Outer width matches the channel
   polaroids (84px); height is shorter because the mode polaroid's
   empty caption space below the photo is half the size — modes have
   the mode title in the row text to the right, so they don't need
   the full caption-area silhouette the channel polaroids carry. */
.mode-row__glyph {
  position: relative;
  width: 84px;
  height: 83px;
  margin-top: 3px;
  background: #ffffff;
  padding: 5px 5px 16px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    1px 2px 0 var(--muted),
    0 5px 14px rgba(0, 0, 0, 0.10);
}
.mode-row__glyph::before {
  content: '';
  position: absolute;
  inset: 5px 5px 16px 5px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  pointer-events: none;
  z-index: 0;
}
.mode-row__glyph svg {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 42px;
  color: var(--ink);
}

/* Each polaroid stuck-to-the-page at a slightly different angle. */
.mode-row:nth-child(1) .mode-row__glyph { transform: rotate(-4deg); }
.mode-row:nth-child(2) .mode-row__glyph { transform: rotate( 3deg); }
.mode-row:nth-child(3) .mode-row__glyph { transform: rotate(-2deg); }
.mode-row:nth-child(4) .mode-row__glyph { transform: rotate( 5deg); }
.mode-row:nth-child(5) .mode-row__glyph { transform: rotate(-5deg); }
.mode-row:nth-child(6) .mode-row__glyph { transform: rotate( 2deg); }
.mode-row:nth-child(7) .mode-row__glyph { transform: rotate(-3deg); }
.mode-row:nth-child(8) .mode-row__glyph { transform: rotate( 4deg); }

.mode-row__info { min-width: 0; }

.mode-row__title {
  font-family: var(--ff-head);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 5px;
  color: var(--ink);
}

.mode-row__copy {
  font-family: var(--ff-body);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
}

/* ---------------------------------------------------------------------------
   Yo's takes — handwritten dog-voiced footnote that always appears under
   each panel's default copy. Each take is preceded by a dotted separator
   that visually marks the boundary between editorial copy above and
   Yo's commentary below.
   --------------------------------------------------------------------------- */
.yo-take {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px dashed color-mix(in srgb, var(--ink) 35%, transparent);
  font-family: var(--ff-hand);
  line-height: 1.3;
}
/* The channels take sits between the hint paragraph and the channels
   card; it needs bottom breathing room so the card isn't kissing it. */
.channels > .yo-take {
  margin-bottom: 14px;
}
.yo-take__label {
  display: inline;
  font-weight: 600;
  font-size: 19px;
  color: var(--accent);
  margin-right: 7px;
}
.yo-take__text {
  display: inline;
  font-weight: 500;
  font-size: 20px;
  color: var(--ink);
}

/* ---------------------------------------------------------------------------
   Channels — "things you'll see here" panel. Single outer card styled like
   a .mode-row, containing a horizontal row of 8 mini-polaroid channel cards.
   The section breaks out of the 760px focused column to ~920px so all 8
   fit comfortably side-by-side on wide displays. On narrow viewports the
   row becomes horizontally scrollable (overflow-x: auto) with a fade-to-
   right gradient as scroll affordance — ties back to the Swipe mode above.
   --------------------------------------------------------------------------- */
.channels__hint {
  font-family: var(--ff-body);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 16px;
  max-width: 560px;
}

/* Card stays aligned with the rest of the focused 760px column. All 8
   polaroids fit in a row at full focused-column width; narrower viewports
   trigger horizontal scroll with a right-edge fade affordance. */
.channels__card {
  position: relative;
  background: var(--card-bg);
  border: var(--border-thin);
  border-radius: 10px;
  padding: 8px 18px;         /* top/bottom — .channel items carry their own margin-bottom for scrollbar clearance */
  box-shadow: var(--shadow-mid);
  transform: rotate(0.6deg);
}

/* Right-edge fade gradient — visible when the row overflows on narrow
   viewports. Hides when the focused column is wide enough for all 8. */
.channels__card::after {
  content: '';
  position: absolute;
  top: 1px;
  bottom: 1px;
  right: 1px;
  width: 50px;
  background: linear-gradient(to right, transparent, var(--card-bg) 70%);
  pointer-events: none;
  border-radius: 0 9px 9px 0;
}
@media (min-width: 800px) {  /* viewport ≥ 800px → focused column ≥ 756px → all 8 polaroids fit */
  .channels__card::after { display: none; }
}

/* Flex row + overflow-x. At ≥920px viewport all 8 polaroids fit. Below
   that, the row scrolls horizontally. */
.channel-grid {
  list-style: none;
  margin: 0;
  padding: 4px 0 0; /* small top room for polaroid tilts; bottom space comes from each .channel's margin-bottom (cleaner separation from scrollbar) */
  display: flex;
  gap: 6px;         /* a touch more breathing room than the original 4, with no risk of triggering the scrollbar at full width */
  overflow-x: auto;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.channel-grid::-webkit-scrollbar { height: 6px; }
.channel-grid::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ink) 22%, transparent);
  border-radius: 3px;
}

.channel {
  flex: 0 0 auto;
  width: 84px;
  margin-bottom: 8px;        /* pushes polaroids up away from the scrollbar when overflow shows */
  display: flex;
  justify-content: center;
  scroll-snap-align: start;
}
.channel__polaroid {
  width: 84px;
  background: #ffffff;
  padding: 5px;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow:
    1px 1px 0 var(--muted),
    0 3px 8px rgba(0, 0, 0, 0.08);
}
.channel__photo {
  background: var(--accent-soft);  /* orange — same as the mode polaroids */
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.channel__photo svg {
  width: 34px;
  height: 34px;
  color: var(--ink);
}
.channel__caption {
  font-family: var(--ff-hand);
  font-weight: 600;
  font-size: 18px;
  line-height: 1;
  text-align: center;
  padding: 2px 0 5px;
  color: var(--ink);
}
/* Per-channel polaroid rotation — scrapbook-stuck variance. */
.channel:nth-child(1) .channel__polaroid { transform: rotate(-3deg); }
.channel:nth-child(2) .channel__polaroid { transform: rotate( 2deg); }
.channel:nth-child(3) .channel__polaroid { transform: rotate(-1.5deg); }
.channel:nth-child(4) .channel__polaroid { transform: rotate( 3.5deg); }
.channel:nth-child(5) .channel__polaroid { transform: rotate(-4deg); }
.channel:nth-child(6) .channel__polaroid { transform: rotate( 1deg); }
.channel:nth-child(7) .channel__polaroid { transform: rotate(-2deg); }
.channel:nth-child(8) .channel__polaroid { transform: rotate( 3deg); }

/* ---------------------------------------------------------------------------
   Page foot
   --------------------------------------------------------------------------- */
.pagefoot {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
  padding: 8px 0;
  color: var(--ink);
  font-size: 13px;
}
.pagefoot__paw {
  width: 18px;
  height: 18px;
  color: var(--ink);
  opacity: 0.8;
  flex-shrink: 0;
}
.pagefoot__paw--flip { transform: scaleX(-1); }
.pagefoot p { margin: 0; }

/* ---------------------------------------------------------------------------
   Phones
   --------------------------------------------------------------------------- */
@media (max-width: 760px) {
  .intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    margin: 24px 0 24px;
  }
  /* When wrapped, Yo aligns to the left edge of the column (no longer
     centered) and pulls 15px further left so the mascot's body sits
     visually flush with the headline above. */
  .intro .yo-tip { transform: translateX(-19px); align-self: flex-start; margin-top: 4px; }
  .yo-tip__mascot { width: 90px; height: 90px; margin-top: 12px; }
  .yo-tip__bubble { max-width: 240px; }
  /* Switch the row from a grid (96px col + 1fr col) to a block with the
     polaroid floated left. On narrow viewports the right-column text was
     getting trapped in a thin strip — title and body copy stretched 6-8
     lines deep while the polaroid sat short next to it, leaving a tall
     empty gutter below the polaroid. Floating the polaroid lets the body
     text wrap *under* it once the text passes the polaroid's bottom edge,
     using the full row width. The .yo-take clears the float so its dotted
     separator always starts at the left edge of the row, not next to the
     polaroid. */
  .mode-row {
    display: block;
    padding: 14px 16px;
  }
  .mode-row::after {
    content: '';
    display: block;
    clear: both;
  }
  .mode-row__glyph {
    float: left;
    margin: 3px 14px 6px 0;
  }
  .mode-row__info .yo-take {
    clear: left;
  }
  .mode-row__title { font-size: 19px; }
  .mode-row__copy { font-size: 15.5px; }

  /* Channels: keep desktop top/bottom tight on phone too; only the
     side padding shrinks slightly. Horizontal scroll handled by the
     base flex+overflow rules. */
  .channels__card { padding: 8px 16px; }
}
