/* Pawberry — sections: the paper sheet, latest stories, wallpapers, footer.
   Owned by the sections agent. Tokens come from base.css. Mobile first. */

/* ------------------------------------------------------------------
   1. Sheet: the paper page that rises over the hero
   ------------------------------------------------------------------ */
.sheet {
  position: relative;
  z-index: 2;
  background: var(--paper);
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  margin-top: calc(-1 * var(--radius-sheet));   /* rounded top edge overlaps the hero */
  padding-top: var(--space-8);                  /* 64 */
  /* bottom: section spacing (64) + 32 that tucks under the footer's rounded top (see §5) */
  padding-bottom: calc(var(--space-8) + var(--radius-panel));
}
.stories,
.wallpapers {
  width: min(var(--content-max), 100% - 2 * var(--gutter));
  margin-inline: auto;
}
@media (min-width: 600px) {
  .sheet { padding-top: 80px; }
}
@media (min-width: 900px) {
  .sheet {
    padding-top: var(--space-9);                /* 96 */
    padding-bottom: calc(var(--space-9) + var(--radius-panel));
  }
}

/* ------------------------------------------------------------------
   2. Section head: title left, link right
   ------------------------------------------------------------------ */
.section-head {
  display: flex;
  flex-wrap: wrap;                 /* link drops below the title cleanly if it cannot fit */
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-5);   /* 24 phone */
}
.section-head h2 {
  font: 600 28px/32px var(--font-display);
  letter-spacing: -0.035em;
  color: var(--ink);
}
.section-head p {
  max-width: 40ch;
  margin-top: var(--space-2);
  font: 400 17px/26px var(--font-body);
  color: var(--ink-muted);
}
.section-head .text-link { white-space: nowrap; }
@media (min-width: 600px) {
  .section-head { margin-bottom: var(--space-6); }   /* 32 */
  .section-head h2 { font-size: 36px; line-height: 40px; }
}

/* ------------------------------------------------------------------
   3. Latest stories
   ------------------------------------------------------------------ */
.story-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);   /* stacked: phones and tablets */
  gap: var(--space-6);
  align-items: start;
}
@media (min-width: 900px) {
  .story-layout {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: var(--space-7);                    /* 48 */
  }
}

/* Lead story: the whole card is one link */
.story-lead a {
  display: grid;
  gap: var(--space-2);
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--radius-card);
}
.story-lead .placeholder,
.wallpaper-grid img {
  transition: transform var(--dur-ui) var(--ease-out), box-shadow var(--dur-ui) var(--ease-out);
}
.story-lead .placeholder { margin-bottom: var(--space-2); }
.story-lead h3 {
  font: 600 20px/24px var(--font-display);
  letter-spacing: -0.02em;
}
.story-lead .summary {
  max-width: 52ch;
  font: 400 15px/23px var(--font-body);
  color: var(--ink-muted);
}
@media (min-width: 600px) {
  .story-lead h3 { font-size: 24px; line-height: 28px; }
}
.story-lead a:hover .placeholder {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

/* Story list: quiet, scannable, no summaries */
.story-list li:last-child { border-bottom: 1px solid var(--line); }
.story-list li a {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4) 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  border-radius: 0;
}
.story-list li a .placeholder { border-radius: 10px; font-size: 10px; }
.story-list h3 {
  margin-top: var(--space-1);
  font: 600 18px/23px var(--font-display);
  letter-spacing: -0.01em;
}
@media (min-width: 600px) {
  .story-list li a { grid-template-columns: 96px minmax(0, 1fr); }
}
.story-lead a:hover h3,
.story-list li a:hover h3 {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

/* Focus: strawberry ring, 4px off the card */
.story-lead a:focus-visible,
.story-list li a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
  border-radius: var(--radius-card);
}

/* ------------------------------------------------------------------
   4. Wallpapers: compact, photographic
   ------------------------------------------------------------------ */
.wallpapers { margin-top: var(--space-8); }      /* 64 phone */
@media (min-width: 900px) {
  .wallpapers { margin-top: var(--space-9); }    /* 96 desktop */
}
.wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));   /* 3 small portrait tiles, even on a phone */
  gap: 10px;
  max-width: 720px;                                   /* left-aligned, never dominant */
}
@media (min-width: 600px) {
  .wallpaper-grid { gap: var(--space-4); }
}
.wallpaper-grid li { min-width: 0; }
.wallpaper-grid a {
  display: grid;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font: 560 14px/18px var(--font-display);
  overflow-wrap: anywhere;
  border-radius: var(--radius-card);
}
@media (min-width: 600px) {
  .wallpaper-grid a { font-size: 15px; line-height: 20px; }
}
.wallpaper-grid img {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: var(--radius-card);
  background: var(--oat);
}
.wallpaper-grid a:hover img {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}
.wallpaper-grid a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
}

/* ------------------------------------------------------------------
   5. Footer: an oat sheet with rounded top, resting on the paper
   Technique: the footer pulls up by --radius-panel (negative margin) and sits above
   the paper sheet (z-index 3 > 2). The sheet reserves exactly that much extra bottom
   padding, so paper, not the dark body, shows behind the footer's rounded corners.
   The footer is the last element, so nothing dark appears below it.
   ------------------------------------------------------------------ */
/* Liquid Glass footer: a large frosted sheet over a faint colour field painted on the page
   canvas behind it (body background, anchored to the bottom of the document), so it reads as glass. */
body {
  background:
    radial-gradient(640px 460px at 10% 96%, rgba(244, 150, 172, 0.48), transparent 72%),
    radial-gradient(560px 420px at 40% 104%, rgba(212, 190, 238, 0.40), transparent 72%),
    radial-gradient(640px 460px at 68% 98%, rgba(250, 206, 142, 0.55), transparent 72%),
    radial-gradient(560px 420px at 98% 90%, rgba(166, 198, 148, 0.48), transparent 72%),
    var(--paper);
  background-repeat: no-repeat;
}
.site-footer {
  position: relative;
  isolation: isolate;
  z-index: 3;
  margin-top: 0;   /* the stories/wallpapers sheet above was removed; the footer now follows the hero */
  background:
    var(--lg-sheen),
    linear-gradient(180deg, rgba(255, 255, 255, 0.30), rgba(255, 244, 240, 0.12)),
    rgba(255, 252, 248, 0.44);
  -webkit-backdrop-filter: var(--lg-filter);
          backdrop-filter: var(--lg-filter);
  box-shadow: 0 0 0 0.5px var(--lg-edge), inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 -14px 40px -16px rgba(128, 28, 54, 0.16);
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  color: var(--ink);
  overflow: hidden; overflow: clip;   /* the oversized moving gradient must never create horizontal scroll */
}
/* slowly drifting multi-colour field inside the glass (pink, honey/peach, leaf, lilac, cream), kept soft and
   under a light frosted veil so footer text stays >= 4.5:1. Oversized layer, moved with transform only. */
.site-footer::after {
  content: ""; position: absolute; inset: -30% -25%; z-index: -1; pointer-events: none;
  background:
    linear-gradient(rgba(255, 252, 248, 0.32), rgba(255, 252, 248, 0.32)),                   /* frosted veil */
    radial-gradient(34% 46% at 12% 22%, rgba(244, 150, 172, 0.46), transparent 72%),         /* strawberry pink */
    radial-gradient(34% 46% at 42% 78%, rgba(250, 206, 142, 0.58), transparent 72%),         /* honey / peach */
    radial-gradient(34% 46% at 70% 24%, rgba(166, 198, 148, 0.50), transparent 72%),         /* leaf */
    radial-gradient(34% 46% at 90% 76%, rgba(212, 190, 238, 0.50), transparent 72%),         /* lilac */
    radial-gradient(40% 50% at 56% 50%, rgba(255, 244, 225, 0.70), transparent 72%);         /* cream */
  animation: footer-drift 22s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes footer-drift {
  from { transform: translate3d(-5%, -4%, 0) scale(1) rotate(0deg); }
  to   { transform: translate3d(5%, 4%, 0) scale(1.08) rotate(3deg); }
}
.site-footer::before {   /* specular rim, brightest top-left */
  content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; padding: 1px; pointer-events: none;
  background: var(--lg-rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-footer { background: var(--oat); }
}
@media (prefers-reduced-transparency: reduce) {
  .site-footer { background: var(--oat); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.footer-inner,
.footer-bottom {
  width: min(var(--content-max), 100% - 2 * var(--gutter));
  margin-inline: auto;
}
.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
  padding: var(--space-8) 0 var(--space-7);
}
.footer-brand img { height: 40px; width: auto; }
.footer-brand p {
  max-width: 24ch;
  margin-top: 14px;
  font: 400 14px/21px var(--font-body);
  color: var(--ink-muted);
}
.footer-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));   /* phones: 2 columns, third wraps */
  gap: var(--space-6) var(--space-5);
}
.footer-groups h2 {
  margin-bottom: var(--space-3);
  font: 600 12px/16px var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.footer-groups a {
  display: block;
  padding: 6px 0;
  font: 500 15px/20px var(--font-display);
  color: var(--ink);
  text-decoration: none;
  transition: color var(--dur-ui) var(--ease-out);
}
.footer-groups a:hover { color: var(--strawberry); }
@media (min-width: 600px) {
  .footer-groups { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-5); }
}
@media (min-width: 900px) {
  .footer-inner {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 3.4fr);
    gap: var(--space-7);
    align-items: start;
  }
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding: 20px 0 28px;
  border-top: 1px solid rgba(46, 35, 34, 0.12);
  font: 400 13px/18px var(--font-body);
  color: var(--ink-muted);
}
.footer-bottom a {
  color: var(--ink-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-bottom a:hover { color: var(--strawberry); }

/* ------------------------------------------------------------------
   6. Reduced motion: no lifts, no transitions
   ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .site-footer::after { animation: none; will-change: auto; transform: none; }
  .story-lead .placeholder,
  .wallpaper-grid img,
  .footer-groups a { transition: none; }
  .story-lead a:hover .placeholder,
  .wallpaper-grid a:hover img { transform: none; }
}

/* ================= NEWSLETTER (shared: home + articles) =================
   The card is .gcard on the home page and .glass on article pages. */
.letter > .sec-wrap { position: relative; max-width: calc(var(--content-max) + 2 * var(--gutter)); margin: 0 auto; padding-inline: var(--gutter); }
.letter { position: relative; isolation: isolate; overflow: hidden; overflow: clip; padding: 40px 0 72px; }
.letter::before {   /* colour field behind the glass card */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(26% 46% at 22% 52%, rgba(244, 150, 172, .42), transparent 72%),
    radial-gradient(24% 44% at 70% 40%, rgba(250, 206, 142, .44), transparent 72%),
    radial-gradient(22% 40% at 90% 70%, rgba(212, 190, 238, .34), transparent 72%);
  -webkit-mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent);
          mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent);
}
.letter-card {
  border-radius: 26px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  max-width: 880px; margin-inline: auto; padding: clamp(40px, 6vw, 72px) clamp(22px, 5vw, 64px);
}
.letter-card h2 { font: 600 clamp(32px, 4.2vw, 52px) / 1.04 var(--font-display); letter-spacing: -.035em; color: var(--ink); text-wrap: balance; }
.letter-sub { margin-top: 14px; max-width: 50ch; font-size: clamp(17px, 1.5vw, 19px); line-height: 1.45; color: var(--ink-muted); text-wrap: balance; }
.letter-form { width: min(100%, 460px); margin-top: 30px; }
.letter-field {
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 20px; border-radius: 999px;
  background: rgba(255, 255, 255, .82); box-shadow: inset 0 0 0 1px rgba(46, 35, 34, .12), inset 0 1px 2px rgba(46, 35, 34, .06), 0 1px 0 #fff, 0 10px 24px -14px rgba(128, 28, 54, .35);
  transition: box-shadow .2s ease;
}
.letter-field:focus-within { box-shadow: inset 0 0 0 2px var(--strawberry), 0 0 0 4px rgba(181, 31, 66, .14), 0 10px 24px -14px rgba(128, 28, 54, .35); }
.letter-field input {
  flex: 1; min-width: 0; height: 46px; padding: 0; border: 0; background: none; outline: none;
  font: 500 16px/1 var(--font-body, inherit); color: var(--ink);
}
.letter-field input::placeholder { color: rgba(46, 35, 34, .5); }
.letter-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; border-radius: 999px; color: var(--paper); cursor: pointer;
  font: 600 15px/1 var(--font-display); background: linear-gradient(180deg, #c22648, #ab1c3d);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 6px 14px -6px rgba(181, 31, 66, .55);
  transition: background .2s ease, transform .25s var(--ease-out-soft);
  padding: 0 24px; border: 0; flex: none; font-size: 15px; }
.letter-btn:hover { background: linear-gradient(180deg, #a21f3f, var(--jam)); }
.letter-btn:active { transform: scale(.97); }
.letter-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.letter-note { margin-top: 12px; font-size: 13.5px; line-height: 1.4; color: var(--ink-muted); }
.letter-note.is-error { color: #a3172f; }
.letter-note.is-ok { color: #2f6b3a; }

@media (max-width: 420px) {
  .letter-field { flex-wrap: wrap; border-radius: 24px; padding: 6px 6px 6px 18px; }
  .letter-field input { flex-basis: 100%; }
  .letter-btn { flex-basis: 100%; justify-content: center; }
}
