/* Generated by design-system/build.py from components/bundle.css. Do not edit here. */
/* Audrey Fenlow — website components (v2, "Golden hour").
   Loads after tokens.css. Every colour, size, space and radius is a token;
   what tokens cannot say (motion, grain, context colours) is declared once here. */

:root {
  color-scheme: light;

  --ease-out: cubic-bezier(0.16, 0.84, 0.24, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.2, 1);
  --dur-quick: 240ms;
  --dur-reveal: 1100ms;

  /* Context colours. A dark section re-points these; components read only these. */
  --c-ground: var(--af-bg);
  --c-text: var(--af-text);
  --c-muted: var(--af-text-muted);
  --c-accent: var(--af-accent);
  --c-accent-hover: var(--af-accent-deep);
  --c-rule: var(--af-divider);

  /* Paper tooth: specks at a few percent, tiled. Dark specks for light grounds, light for dark. */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .22 0 0 0 0 .17 0 0 0 0 .13 .34 0 0 0 -.12'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .96 0 0 0 0 .9 .3 0 0 0 -.12'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  background-color: var(--af-sky);                    /* what shows when the page is pulled past its top: morning sky */
  scrollbar-width: thin;                              /* the browser's own bar, where it is kept: a thumb and no track */
  scrollbar-color: var(--af-accent) transparent;
}
html[data-end] {                                      /* past the middle of the page: what shows beyond its end is night */
  background-color: var(--af-night-deep);
  scrollbar-color: var(--af-accent-soft) transparent;
}
html.own-scroll { scrollbar-width: none; }            /* a mouse or trackpad: the page draws its own thumb (see Scrollbar) */
html.own-scroll::-webkit-scrollbar { display: none; }

body {
  margin: 0;
  background: var(--af-bg);
  color: var(--af-text);
  font-family: var(--font-serif);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-synthesis: none;
  font-kerning: normal;
  font-variant-numeric: oldstyle-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1, h2, h3, p, ul, ol, blockquote, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
em { font-style: italic; }
::selection { background: var(--af-selection); color: var(--af-text); }

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

.af-skip {
  position: fixed; top: var(--space-3); left: var(--space-3); z-index: 100;
  padding: var(--space-3) var(--space-5);
  background: var(--af-text); color: var(--af-bg);
  font: 700 0.9375rem/1.2 var(--font-sans);
  border-radius: var(--radius-round);
  transform: translateY(-300%);
}
.af-skip:focus { transform: none; }

.af-defs { position: absolute; width: 0; height: 0; }

.af-vh {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ---------- Shell, sections ---------- */

.af-shell {
  width: 100%;
  max-width: calc(var(--shell-max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.af-section {
  position: relative;
  padding-block: var(--section-y);
  background: var(--grain), var(--c-ground);
  color: var(--c-text);
}
.af-section--sand { --c-ground: var(--af-bg-deep); }
.af-section--green,
.af-section--plum,
.af-section--night {
  --c-text: var(--af-on-dark);
  --c-muted: var(--af-on-dark-muted);
  --c-accent: var(--af-accent-soft);
  --c-accent-hover: var(--af-on-dark);
  --c-rule: var(--af-divider-dark);
  background: var(--grain-light), var(--c-ground);
}
.af-section--green { --c-ground: var(--af-section-green); }
.af-section--plum { --c-ground: var(--af-section-dark); }
.af-section--night { --c-ground: var(--af-night); }

/* ---------- Type ---------- */

.af-label {
  display: inline-flex; align-items: center; gap: var(--space-3);
  font: 700 0.75rem/1.5 var(--font-sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-accent);
}
.af-label::before {
  content: ""; flex: none; width: 2rem; height: 1px; background: currentColor; opacity: 0.7;
}
.af-label--plain::before { content: none; }

.af-statement {
  font-size: var(--fs-display);
  line-height: 1.04;
  letter-spacing: -0.022em;
  font-weight: 400;
  text-wrap: balance;
}
.af-h2 {
  font-size: var(--fs-h2);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 400;
  text-wrap: balance;
}
.af-h3 {
  font-size: var(--fs-h3);
  line-height: 1.18;
  letter-spacing: -0.01em;
  font-weight: 400;
  text-wrap: balance;
}
.af-statement em, .af-h2 em { color: var(--c-accent); }

.af-lead {
  font-size: var(--fs-lead);
  line-height: 1.4;
  color: var(--c-muted);
  text-wrap: pretty;
}
.af-caption {
  font: 400 0.875rem/1.5 var(--font-sans);
  color: var(--c-muted);
}

.af-prose { max-width: var(--measure); }
.af-prose p { text-wrap: pretty; }
.af-prose p + p { margin-top: 1.05em; }
.af-prose--dropcap > p:first-child::first-letter {
  float: left;
  font-size: 4.05em;
  line-height: 0.78;
  padding: 0.07em 0.09em 0 0;
  color: var(--c-accent);
}

/* ---------- Buttons, links ---------- */

.af-button {
  display: inline-flex; align-items: center; gap: var(--space-3);
  min-height: 3rem;
  padding: 0 var(--space-6);
  border: 1px solid var(--af-accent);
  border-radius: var(--radius-round);
  background: var(--af-accent);
  color: var(--af-on-accent);
  font: 700 0.9375rem/1.2 var(--font-sans);
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-quick) var(--ease-out), border-color var(--dur-quick) var(--ease-out), scale var(--dur-quick) var(--ease-out);
}
.af-button:hover { background: var(--af-accent-deep); border-color: var(--af-accent-deep); }
.af-button:active { scale: 0.97; }
.af-button svg { width: 1.125rem; height: 1.125rem; transition: transform var(--dur-quick) var(--ease-out); }
.af-button:hover svg { transform: translateY(3px); }
.af-button--paper {
  background: rgba(255, 252, 246, 0.86);
  border-color: rgba(46, 40, 38, 0.1);
  color: var(--af-text);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  box-shadow: var(--shadow-pill);
}
.af-button--paper:hover { background: var(--af-bg-raised); border-color: rgba(46, 40, 38, 0.18); }

.af-link {
  color: var(--c-accent);
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 0.12em;
  transition: background-size 420ms var(--ease-out), color var(--dur-quick) var(--ease-out);
}
.af-link:hover { color: var(--c-accent-hover); background-size: 0 1px; background-position: 100% 100%; }

/* ---------- Progress, masthead ---------- */

.af-progress {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  height: 2px;
  background: var(--af-accent);
  transform-origin: 0 50%;
  transform: scaleX(var(--read, 0));
  pointer-events: none;
}

.af-masthead {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  pointer-events: none;
}
.af-masthead__inner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-5);
  padding-block: clamp(0.75rem, 1.6vw, 1.25rem);
}
.af-pill {
  pointer-events: auto;
  display: inline-flex; align-items: center;
  min-height: 3rem;
  background: rgba(255, 252, 246, 0.84);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  backdrop-filter: blur(14px) saturate(1.25);
  border: 1px solid rgba(46, 40, 38, 0.08);
  border-radius: var(--radius-round);
  box-shadow: var(--shadow-pill);
  color: var(--af-text);
}
.af-wordmark {
  padding: 0 var(--space-5);
  font: italic 400 1.5rem/1 var(--font-serif);
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out), visibility 0s;
}
.af-masthead[data-top] .af-wordmark {
  opacity: 0; visibility: hidden; transform: translateY(-0.5rem);
  transition: opacity 250ms var(--ease-out), transform 250ms var(--ease-out), visibility 0s 250ms;
}
.af-nav { margin-left: auto; padding: 0 0.125rem 0 var(--space-2); }
.af-nav a {
  display: inline-flex; align-items: center;
  min-height: 2.75rem;
  padding: 0 0.875rem;
  border-radius: var(--radius-round);
  font: 400 0.9375rem/1 var(--font-sans);
  letter-spacing: 0.01em;
  color: var(--af-text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur-quick) var(--ease-out), background-color var(--dur-quick) var(--ease-out);
}
.af-nav a:hover, .af-nav a[aria-current] { color: var(--af-text); }
.af-nav a[aria-current] { background: rgba(134, 75, 67, 0.1); }
.af-nav .af-nav__cta {
  margin-left: var(--space-2);
  background: var(--af-accent); color: var(--af-on-accent);
  font-weight: 700;
}
.af-nav .af-nav__cta:hover, .af-nav .af-nav__cta[aria-current] { background: var(--af-accent-deep); color: var(--af-on-accent); }

.af-menu-btn {
  display: none;
  flex: none;
  margin-left: auto;
  padding: 0 var(--space-5);
  gap: 0.625rem;
  font: 700 0.9375rem/1 var(--font-sans);
  letter-spacing: 0.02em;
  cursor: pointer;
}
.af-menu-btn__icon { position: relative; width: 1.125rem; height: 0.625rem; }
.af-menu-btn__icon::before, .af-menu-btn__icon::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor;
  transition: transform 320ms var(--ease-out), top 320ms var(--ease-out);
}
.af-menu-btn__icon::before { top: 0; }
.af-menu-btn__icon::after { top: calc(100% - 1.5px); }
.af-menu-btn[aria-expanded="true"] .af-menu-btn__icon::before { top: calc(50% - 0.75px); transform: rotate(45deg); }
.af-menu-btn[aria-expanded="true"] .af-menu-btn__icon::after { top: calc(50% - 0.75px); transform: rotate(-45deg); }

/* Full-screen menu sheet (phones and small tablets) */
.af-sheet {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 6.5rem var(--gutter) max(2rem, env(safe-area-inset-bottom));
  background: var(--grain), var(--af-bg-raised);
  visibility: hidden; opacity: 0;
  transition: opacity 320ms var(--ease-out), visibility 0s 320ms;
  overflow-y: auto;
}
.af-sheet[data-open] { visibility: visible; opacity: 1; transition: opacity 320ms var(--ease-out), visibility 0s; }
.af-sheet__links { display: grid; gap: 0.25rem; }
.af-sheet__links a {
  display: flex; align-items: baseline; gap: var(--space-4);
  padding: 0.5rem 0;
  font: italic 400 clamp(2.25rem, 10.5vw, 3.5rem)/1.12 var(--font-serif);
  letter-spacing: -0.02em;
  color: var(--af-text);
  text-decoration: none;
  opacity: 0; transform: translateY(1rem);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out), color var(--dur-quick);
  transition-delay: calc(var(--i, 0) * 55ms + 80ms);
}
.af-sheet__links a span { font: 700 0.75rem/1 var(--font-sans); letter-spacing: 0.14em; color: var(--af-accent); }
.af-sheet[data-open] .af-sheet__links a { opacity: 1; transform: none; }
.af-sheet__links a:active { color: var(--af-accent); }
.af-sheet__foot { display: grid; gap: var(--space-2); padding-top: var(--space-6); border-top: 1px solid var(--af-divider); margin-top: var(--space-7); }
.af-sheet__foot a { font-size: 1.25rem; color: var(--af-text); text-decoration: none; }

/* ---------- Hero ---------- */

.af-hero {
  --sky-left: max(66svh, 32.5vw);                     /* where the open sky begins, beside the bakery */
  --name-size: min(calc((100vw - var(--sky-left) - 1.5 * var(--gutter)) / 5.6), 25svh, 13.5rem);
  position: relative;
  height: 100svh; min-height: 34rem; max-height: 75rem;
  overflow: clip;
  isolation: isolate;
  background: var(--af-sky);
}
.af-hero__scene {
  position: absolute; inset: -3%; z-index: -1;
  transform: translate3d(var(--px, 0px), calc(var(--py, 0px) + var(--scroll, 0) * 6%), 0) scale(calc(1 + var(--scroll, 0) * 0.05));
  will-change: transform;
}
.af-hero__scene img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 0% 100%; }
.af-hero__scene::after {                               /* paint tooth over the picture */
  content: ""; position: absolute; inset: 0;
  background: var(--grain);
  mix-blend-mode: multiply; opacity: 0.9;
}
.af-hero__title {
  position: absolute;
  left: var(--sky-left); right: 0;
  top: min(20svh, calc(100svh - 39vw));
  padding-inline: var(--gutter);
  text-align: center;
  transform: translate3d(0, calc(var(--scroll, 0) * -18%), 0);
  opacity: calc(1 - var(--scroll, 0) * 1.5);
}
.af-name {
  font: italic 400 var(--name-size)/0.92 var(--font-serif);
  letter-spacing: -0.02em;
  color: var(--af-olive);
  white-space: nowrap;
}
.af-name span { display: inline-block; }
.af-hero__flourish {
  width: calc(var(--name-size) * 3.1);
  height: auto;
  margin: calc(var(--name-size) * 0.02) auto 0;
  color: var(--af-gold);
  overflow: visible;
}
.af-hero__tagline {
  margin-top: calc(var(--name-size) * 0.12);
  font-size: clamp(1.25rem, calc(var(--name-size) * 0.168), 2rem);
  line-height: 1.25;
  color: var(--af-text);
  text-wrap: balance;
}
.af-hero__cue {
  position: absolute; right: var(--gutter); bottom: clamp(1.25rem, 4svh, 2.5rem);
}

/* ---------- Welcome ---------- */

.af-welcome { padding-bottom: 0; }
.af-welcome__inner { display: grid; justify-items: center; text-align: center; gap: var(--space-6); }
.af-welcome .af-statement { max-width: 15.5em; }
.af-welcome__lead { max-width: 33em; display: grid; gap: 0.6em; }
.af-welcome__lead p:first-child { color: var(--c-text); }

.af-marquee {
  margin-top: var(--section-y);
  padding-block: clamp(1.25rem, 2.6vw, 2rem);
  border-block: 1px solid var(--c-rule);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.af-marquee__track { display: flex; width: max-content; }
.af-marquee__group { display: flex; flex: none; }
.af-marquee__group li {
  display: flex; align-items: center;
  font: italic 400 clamp(1.5rem, 1.1rem + 1.6vw, 2.5rem)/1.2 var(--font-serif);
  letter-spacing: -0.01em;
  color: var(--af-accent);
  white-space: nowrap;
}
.af-marquee__group li::after {
  content: ""; flex: none;
  width: 0.26em; height: 0.26em; margin-inline: 0.9em;
  border-radius: 50%; background: var(--af-coral);
}

/* ---------- Section head ---------- */

.af-head { display: grid; gap: var(--space-5); max-width: 46rem; }
.af-head--split {
  max-width: none;
  grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: var(--space-8);
}
.af-head--split .af-label { grid-column: 1 / -1; justify-self: start; }
.af-hint {
  display: inline-flex; align-items: center; gap: var(--space-3);
  font: 400 0.9375rem/1.4 var(--font-sans);
  color: var(--c-muted);
}
.af-hint svg { width: 1.25rem; height: 1.25rem; color: var(--c-accent); }

/* ---------- Postcards ---------- */

.af-postcards {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1rem, 2.2vw, 2rem);
  margin-top: clamp(3rem, 6vw, 5rem);
}
.af-postcard {
  position: relative;
  perspective: 1400px;
  rotate: var(--tilt, 0deg); translate: 0 var(--drop, 0px);
  transition: rotate 600ms var(--ease-out), translate 600ms var(--ease-out);
}
.af-postcard:nth-child(1) { --tilt: -2.4deg; --drop: 6px; }
.af-postcard:nth-child(2) { --tilt: 1.6deg; --drop: -8px; }
.af-postcard:nth-child(3) { --tilt: -1.2deg; --drop: 10px; }
.af-postcard:nth-child(4) { --tilt: 2.6deg; --drop: -2px; }
.af-postcard:hover, .af-postcard:focus-within, .af-postcard[data-flipped] { rotate: 0deg; translate: 0 -8px; z-index: 2; }

.af-postcard__flip {
  position: relative; display: block; width: 100%;
  aspect-ratio: 4 / 3.5;
  padding: 0; border: 0; background: none;
  text-align: left; cursor: pointer;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(calc(var(--ry, 0deg) + var(--flip, 0deg)));
  transition: transform 900ms var(--ease-in-out);
  border-radius: var(--radius-sm);
}
.af-postcard[data-flipped] .af-postcard__flip { --flip: 180deg; }
html:not(.js) .af-postcard:hover .af-postcard__flip, html:not(.js) .af-postcard:focus-within .af-postcard__flip { --flip: 180deg; }   /* without script the cards still turn */
.af-postcard[data-tilting] .af-postcard__flip { transition-duration: 140ms; transition-timing-function: linear; }
.af-postcard__face {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--grain), var(--af-bg-raised);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  overflow: hidden;
  transition: box-shadow 500ms var(--ease-out);
}
.af-postcard:hover .af-postcard__face, .af-postcard[data-flipped] .af-postcard__face { box-shadow: var(--shadow-lift); }
.af-postcard__front { padding: 0.625rem 0.75rem 0 0.625rem; }
.af-postcard__front img { flex: 1 1 0; min-height: 0; width: 100%; object-fit: cover; border-radius: 1px; }
.af-postcard__title {
  flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  min-height: 3.25rem; padding-left: 0.25rem;
  font: italic 400 clamp(1.125rem, 0.95rem + 0.55vw, 1.4375rem)/1.15 var(--font-serif);
  color: var(--af-text);
}
.af-postcard__title svg { flex: none; width: 1.125rem; height: 1.125rem; color: var(--af-accent); transition: transform 600ms var(--ease-out); }
.af-postcard:hover .af-postcard__title svg { transform: rotate(180deg); }

.af-postcard__back {
  transform: rotateY(180deg);
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  padding: clamp(0.875rem, 1.4vw, 1.25rem);
  gap: clamp(0.75rem, 1.2vw, 1.125rem);
  color: var(--af-text);
}
.af-postcard__note {
  display: flex; flex-direction: column; justify-content: space-between; gap: 0.5rem;
  padding-right: clamp(0.75rem, 1.2vw, 1.125rem);
  border-right: 1px solid var(--af-divider);
  font: italic 400 clamp(0.9375rem, 0.62rem + 0.42vw, 1.0625rem)/1.36 var(--font-serif);
}
.af-postcard__note b { font-weight: 400; color: var(--af-accent); }
.af-postcard__address { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 0.45rem; padding-bottom: 0.25rem; }
.af-postcard__address span {
  display: block; padding-bottom: 0.28rem; border-bottom: 1px solid var(--af-divider);
  font: italic 400 0.8125rem/1.2 var(--font-serif);
  color: var(--af-text-muted);
}
.af-postcard__stamp {
  position: absolute; top: 0; right: 0;
  width: 36%; aspect-ratio: 5 / 6;
  padding: 3px;
  background: var(--af-bg-raised);
  outline: 1px dashed var(--af-gold); outline-offset: -1px;
  box-shadow: 0 1px 2px rgba(46, 40, 38, 0.2);
}
.af-postcard__stamp img { width: 100%; height: 100%; object-fit: cover; }
.af-postcard__postmark {
  position: absolute; top: 2%; right: 22%;
  width: 50%;
  opacity: 0.6;
  transform: rotate(-14deg);
}

/* ---------- Seal / postmark ---------- */

.af-seal { color: var(--af-accent); overflow: visible; }
.af-seal text { font: 700 10.5px/1 var(--font-sans); letter-spacing: 0.2em; fill: currentColor; }
.af-seal .af-seal__mono { font: italic 400 50px/1 var(--font-serif); letter-spacing: -0.04em; }

/* ---------- Story ---------- */

.af-story__grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--space-6);
  align-items: start;
}
.af-story__picture { grid-column: 1 / span 5; position: sticky; top: 7.5rem; }
.af-arch {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 999px 999px var(--radius-md) var(--radius-md);
  overflow: hidden;
  background: var(--af-bg-deep);
}
.af-arch img { width: 100%; height: 100%; object-fit: cover; }
.af-arch::after { content: ""; position: absolute; inset: 0; background: var(--grain); mix-blend-mode: multiply; pointer-events: none; }
.af-story__text { grid-column: 7 / span 6; padding-top: clamp(0rem, 3vw, 3rem); }
.af-story__title {
  margin: var(--space-5) 0 var(--space-7);
  font: italic 400 var(--fs-display)/1 var(--font-serif);
  letter-spacing: -0.022em;
}
.af-story__end { display: flex; align-items: center; gap: var(--space-5); margin-top: var(--space-8); }
.af-ornament { width: 7rem; height: auto; color: var(--c-accent); flex: none; }

/* ---------- Credo ---------- */

.af-writing__grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--space-6);
  align-items: start;
}
.af-writing__head { grid-column: 1 / span 5; position: sticky; top: 7.5rem; display: grid; gap: var(--space-5); }
.af-writing__head .af-label { justify-self: start; }
.af-writing__head .af-lead { max-width: 22em; }
.af-credo { grid-column: 7 / span 6; }
.af-credo__item {
  display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); column-gap: var(--space-5);
  padding-block: clamp(1.75rem, 3vw, 2.5rem);
  border-top: 1px solid var(--c-rule);
  transition: opacity 400ms var(--ease-out);
}
.af-credo__item:last-child { border-bottom: 1px solid var(--c-rule); }
.af-credo__num {
  font: italic 400 clamp(2.5rem, 2rem + 1.6vw, 3.5rem)/0.9 var(--font-serif);
  color: var(--c-accent);
}
.af-credo__item p { margin-top: var(--space-3); color: var(--c-muted); max-width: 30em; }
@media (hover: hover) {
  .af-credo:hover .af-credo__item:not(:hover) { opacity: 0.42; }
}

/* ---------- Lines to keep ---------- */

.af-lines {
  --c-accent: var(--af-accent-deep); --c-muted: var(--af-text);   /* the dusk ground is deeper: 6.2:1 and 9.7:1 at its darkest */
  background: var(--grain), linear-gradient(to bottom, var(--af-bg) 0%, var(--af-sky) 55%, #EDCDBB 100%);
}
.af-lines__list { display: grid; gap: clamp(4.5rem, 10vw, 9rem); margin-top: clamp(3.5rem, 7vw, 6rem); }
.af-line { display: grid; gap: var(--space-5); max-width: min(100%, 56rem); }
.af-line .af-label { justify-self: start; }
.af-line:nth-child(even) { margin-left: auto; }
.af-line blockquote p {
  font: italic 400 var(--fs-quote)/1.1 var(--font-serif);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.af-line mark {
  background: linear-gradient(rgba(212, 115, 92, 0.3), rgba(212, 115, 92, 0.3)) 0 88% / 100% 0.34em no-repeat;
  color: inherit;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.af-share {
  justify-self: start;
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 2.75rem;
  font: 700 0.875rem/1 var(--font-sans); letter-spacing: 0.02em;
  color: var(--c-accent); text-decoration: none;
}
.af-share svg { width: 1rem; height: 1rem; transition: transform var(--dur-quick) var(--ease-out); }
.af-share:hover { color: var(--af-text); }
.af-share:hover svg { transform: translate(2px, -2px); }

/* ---------- Letter ---------- */

.af-letter__grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--space-6);
  align-items: center;
}
.af-letter__portrait { grid-column: 2 / span 4; }
.af-letter__portrait .af-arch { aspect-ratio: 5 / 6.1; }
.af-letter__body { grid-column: 7 / span 6; }
.af-letter__body .af-h2 { margin: var(--space-5) 0 var(--space-6); font-style: italic; }
.af-letter__body .af-prose { font-size: var(--fs-lead); line-height: 1.5; }
.af-signature {
  display: inline-grid; margin-top: var(--space-7);
  font: italic 400 var(--fs-signature)/1 var(--font-serif);
  letter-spacing: -0.02em;
  color: var(--c-text);
}
.af-signature small { font: italic 400 1.1875rem/1.4 var(--font-serif); color: var(--c-muted); margin-bottom: 0.4rem; letter-spacing: 0; }
.af-signature svg { width: 108%; max-width: none; height: auto; margin-top: 0.1em; color: var(--af-accent-soft); overflow: visible; }

/* ---------- Night: contact ---------- */

.af-night {
  --night-h: max(100svh, 46rem);
  --sky-left: max(calc(var(--night-h) * 0.7), 34.5vw);
  position: relative;
  min-height: var(--night-h);
  padding: 0;
  overflow: clip;
  isolation: isolate;
}
.af-night__scene {
  position: absolute; left: 0; bottom: 0; z-index: -1;
  width: max(100%, calc(var(--night-h) * 2.0304));
  aspect-ratio: 1470 / 724;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16%);   /* no hard edge when the words run taller than the picture */
  mask-image: linear-gradient(to bottom, transparent 0, #000 16%);
}
.af-night__scene img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.af-night__scene::after { content: ""; position: absolute; inset: 0; background: var(--grain-light); opacity: 0.8; }
.af-lamp {
  position: absolute; left: 32.65%; top: 47.9%; z-index: 1;
  width: 1px; height: 1px;
}
.af-lamp::before, .af-lamp::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  border-radius: 50%;
  translate: -50% -50%;
}
.af-lamp::before {
  width: clamp(9px, 1vw, 16px); aspect-ratio: 1;
  background: #FFE9B8;
  box-shadow: 0 0 12px 4px rgba(255, 214, 140, 0.9);
}
.af-lamp::after {
  width: clamp(220px, 24vw, 420px); aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(255, 208, 130, 0.42), rgba(255, 196, 120, 0.12) 45%, transparent 70%);
}
.af-night__content {
  position: relative;
  margin-left: var(--sky-left);
  padding: clamp(6.5rem, 15svh, 9.5rem) var(--gutter) var(--space-8);
  max-width: 54rem;
}
.af-night__content { text-shadow: 0 1px 14px rgba(29, 26, 42, 0.55); }   /* keeps the words clear where the lamp's glow passes behind them */
.af-night__content .af-h2 { margin: var(--space-5) 0 var(--space-5); font-size: var(--fs-display); }
.af-night__content .af-lead { max-width: 27em; color: var(--af-on-dark); opacity: 0.88; }

.af-lost { background: var(--af-night-deep); }                    /* the not-found page: one night scene, one way back */
.af-lost__action { margin-top: var(--space-7); }

.af-contact { margin-top: clamp(2rem, 4.5svh, 3.5rem); border-top: 1px solid var(--c-rule); container-type: inline-size; }
.af-contact__row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-4);
  border-bottom: 1px solid var(--c-rule);
}
.af-contact__main {
  display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); align-items: center; column-gap: var(--space-4);
  min-height: 5.25rem;
  padding: var(--space-4) 0;
  color: var(--c-text); text-decoration: none;
  transition: padding var(--dur-quick) var(--ease-out), color var(--dur-quick) var(--ease-out);
}
.af-contact__main .af-label { color: var(--c-muted); }
.af-contact__value {
  font-size: clamp(1.375rem, 0.9rem + 2vw, 2.5rem); line-height: 1.1; letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}
.af-contact__value { white-space: nowrap; }
@container (max-width: 40rem) {                       /* a narrow column: the label sits above the address */
  .af-contact__main { grid-template-columns: minmax(0, 1fr); row-gap: 0.375rem; }
  .af-contact__value { font-size: clamp(1.25rem, 6cqi, 2rem); }
}
@container (max-width: 21.5rem) {                     /* narrower still: the action drops beneath */
  .af-contact__row { grid-template-columns: minmax(0, 1fr); }
  .af-contact__main { min-height: 0; padding-bottom: var(--space-3); }
  .af-contact__action { justify-self: start; margin-bottom: var(--space-5); }
}
.af-contact__main:hover, .af-contact__main:focus-visible { padding-left: var(--space-3); color: var(--c-accent); }
.af-contact__action {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 2.75rem; padding: 0 1.125rem 0 0.875rem;
  border: 1px solid var(--c-rule); border-radius: var(--radius-round);
  background: rgba(29, 26, 42, 0.35);
  color: var(--c-accent);
  font: 700 0.8125rem/1 var(--font-sans); letter-spacing: 0.04em;
  text-decoration: none; cursor: pointer;
  transition: background-color var(--dur-quick) var(--ease-out), border-color var(--dur-quick) var(--ease-out), scale var(--dur-quick) var(--ease-out);
}
.af-contact__action svg { width: 1.125rem; height: 1.125rem; }
.af-contact__action:hover { background: rgba(251, 245, 236, 0.1); border-color: currentColor; }
.af-contact__action:active { scale: 0.95; }
.af-contact__note { margin-top: var(--space-5); color: var(--c-muted); font-size: 1.0625rem; max-width: 32em; }

.af-toast {
  position: fixed; left: 50%; bottom: max(1.5rem, env(safe-area-inset-bottom)); z-index: 70;
  padding: 0.875rem 1.375rem;
  background: var(--af-bg-raised); color: var(--af-text);
  font: 700 0.9375rem/1.2 var(--font-sans);
  border-radius: var(--radius-round);
  box-shadow: var(--shadow-lift);
  transform: translate(-50%, 200%); opacity: 0;
  transition: transform 500ms var(--ease-out), opacity 300ms var(--ease-out);
  pointer-events: none;
}
.af-toast[data-show] { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Footer ---------- */

.af-footer { background: var(--af-night-deep); color: var(--af-on-dark-muted); }
.af-footer__about {                                  /* one plain sentence about the author, for new readers and search engines */
  padding: var(--space-7) max(0px, calc(100% - 44em)) var(--space-6) 0;   /* the rule runs the full width; the sentence keeps a reading measure */
  border-bottom: 1px solid var(--af-divider-dark);
  font-size: 1.0625rem; line-height: 1.55;
  color: var(--af-on-dark-muted);
}
.af-footer__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4) var(--space-6);
  padding-block: var(--space-6);
  font: 400 0.875rem/1.5 var(--font-sans);
}
.af-footer__name { font: italic 400 1.375rem/1 var(--font-serif); color: var(--af-on-dark); }
.af-footer__end { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-2) var(--space-5); }
.af-footer a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 0.35em; min-height: 2.75rem; }
.af-footer a:hover { color: var(--af-on-dark); }
.af-footer :focus-visible, .af-section--green :focus-visible, .af-section--plum :focus-visible, .af-section--night :focus-visible { outline-color: var(--af-accent-soft); }

/* ---------- Scrollbar ---------- */

/* On a mouse or trackpad the page hides the browser's bar and draws this one:
   a thumb with no track, there while the page moves or the pointer is at the
   edge, gone a moment later. Touch screens, keyboards-only, forced colours and
   "more contrast" keep the browser's own. */
.af-scroll {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
  width: 1rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 700ms var(--ease-out) 250ms;
}
.af-scroll[data-show] { opacity: 1; transition: opacity 160ms var(--ease-out); }
.af-scroll[hidden], html[data-menu] .af-scroll { display: none; }
.af-scroll__thumb {
  position: absolute; top: 0; right: 0;
  width: 1rem; height: var(--thumb-h, 4rem);
  transform: translate3d(0, var(--thumb-y, 0px), 0);
  pointer-events: auto; touch-action: none;
  -webkit-user-select: none; user-select: none;
}
.af-scroll__thumb::after {
  content: ""; position: absolute; top: 3px; bottom: 3px; right: 3px;
  width: 5px;
  border-radius: var(--radius-round);
  background: var(--af-accent);
  opacity: 0.62;
  transition: width 220ms var(--ease-out), opacity 220ms var(--ease-out), background-color 500ms var(--ease-out);
}
.af-scroll[data-tone="dark"] .af-scroll__thumb::after { background: var(--af-accent-soft); }
.af-scroll__thumb:hover::after, .af-scroll[data-drag] .af-scroll__thumb::after { width: 9px; opacity: 0.95; }

/* ---------- Pause control ---------- */

.af-motion {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 2.75rem; padding: 0 var(--space-3);
  border: 0; border-radius: var(--radius-round);
  background: none;
  font: 400 0.875rem/1 var(--font-sans); letter-spacing: 0.01em;
  color: var(--c-muted);
  cursor: pointer;
  transition: color var(--dur-quick) var(--ease-out);
}
.af-motion:hover { color: var(--c-text); }
.af-motion svg { width: 1rem; height: 1rem; color: var(--c-accent); }
.af-motion__play, html[data-still] .af-motion__pause { display: none; }
html[data-still] .af-motion__play { display: block; }
html:not(.js) .af-motion { display: none; }
.af-marquee__ctrl { display: flex; justify-content: flex-end; padding-block: var(--space-2) var(--space-4); }
.af-footer .af-motion { color: inherit; }
.af-footer .af-motion:hover { color: var(--af-on-dark); }
.af-footer .af-motion svg { color: var(--af-accent-soft); }

/* ---------- Motion ---------- */

[data-d="1"] { --d: 1; } [data-d="2"] { --d: 2; } [data-d="3"] { --d: 3; } [data-d="4"] { --d: 4; }
.af-sheet__links a:nth-child(2) { --i: 1; } .af-sheet__links a:nth-child(3) { --i: 2; }
.af-sheet__links a:nth-child(4) { --i: 3; } .af-sheet__links a:nth-child(5) { --i: 4; }

@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0; transform: translateY(1.5rem);
    transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out);
    transition-delay: calc(var(--d, 0) * 110ms);
  }
  .js [data-reveal].is-in { opacity: 1; transform: none; }

  .js [data-reveal="frame"] { opacity: 1; transform: none; clip-path: inset(100% 0 0 0 round 999px 999px 14px 14px); transition: clip-path 1500ms var(--ease-in-out); }
  .js [data-reveal="frame"].is-in { clip-path: inset(0 0 0 0 round 999px 999px 14px 14px); }
  .js [data-reveal="frame"] img { transform: scale(1.12); transition: transform 2200ms var(--ease-out); }
  .js [data-reveal="frame"].is-in img { transform: none; }

  .js .af-line mark { background-size: 0% 0.34em; transition: background-size 1100ms var(--ease-in-out) 500ms; }
  .js .af-line.is-in mark { background-size: 100% 0.34em; }

  .js .af-signature path { stroke-dasharray: 300; stroke-dashoffset: 300; transition: stroke-dashoffset 1800ms var(--ease-in-out) 600ms; }
  .js .af-signature.is-in path { stroke-dashoffset: 0; }

  /* The two things that keep moving. They run only where the pause control works, and it stops both. */
  .js .af-marquee__track { animation: af-marquee 46s linear infinite; }
  .js .af-marquee:hover .af-marquee__track, .js .af-marquee:focus-within .af-marquee__track { animation-play-state: paused; }
  .js .af-lamp::after { animation: af-beacon 5.5s ease-in-out infinite; }
  html[data-still] .af-marquee__track, html[data-still] .af-lamp::after { animation-play-state: paused; }

  /* Arrival: the picture is there from the first frame; the name is written across it. */
  .js .af-hero__scene img { animation: af-settle 2600ms var(--ease-out) both; }
  .js .af-name span { animation: af-write 1300ms var(--ease-in-out) both; }
  .js .af-name span + span { animation-delay: 420ms; }
  .js .af-hero__flourish path { stroke-dasharray: 100; stroke-dashoffset: 100; animation: af-draw 1200ms var(--ease-in-out) 1150ms forwards; }
  .js .af-hero__tagline { animation: af-rise 1000ms var(--ease-out) 1250ms both; }
  .js .af-hero__cue { animation: af-fade 900ms var(--ease-out) 1700ms both; }
}

@keyframes af-settle { from { transform: scale(1.07); } to { transform: none; } }
@keyframes af-write { from { clip-path: inset(-30% 105% -30% -10%); opacity: 0.4; } to { clip-path: inset(-30% -10% -30% -10%); opacity: 1; } }
@keyframes af-draw { to { stroke-dashoffset: 0; } }
@keyframes af-rise { from { opacity: 0; transform: translateY(0.75rem); } to { opacity: 1; transform: none; } }
@keyframes af-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes af-marquee { to { transform: translateX(-50%); } }
@keyframes af-beacon { 0%, 100% { opacity: 0.5; scale: 0.86; } 50% { opacity: 1; scale: 1.08; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .af-motion { display: none; }                       /* nothing moves, so there is nothing to pause */
  .af-scroll, .af-scroll[data-show], .af-scroll__thumb::after { transition-duration: 1ms; transition-delay: 0s; }
  .af-postcard__flip { transition: none; }
}

/* ---------- Tablet and below ---------- */

@media (max-width: 1239px) {
  .af-postcards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 2.5rem); max-width: 46rem; margin-inline: auto; }
}

@media (max-width: 899px) {
  .af-nav { display: none; }
  .af-menu-btn { display: inline-flex; }
  .af-head--split { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-4); }
  .af-story__grid, .af-writing__grid, .af-letter__grid { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-8); }
  .af-story__picture, .af-story__text, .af-writing__head, .af-credo, .af-letter__portrait, .af-letter__body { grid-column: 1; }
  .af-story__picture, .af-writing__head { position: static; }
  .af-story__picture .af-arch { aspect-ratio: 1 / 1; max-width: 26rem; margin-inline: auto; }
  .af-letter__portrait .af-arch { max-width: 21rem; margin-inline: auto; }
  .af-credo__item { grid-template-columns: 3.25rem minmax(0, 1fr); }
  .af-line:nth-child(even) { margin-left: 0; }
}
@media (min-width: 900px) {
  .af-sheet { display: none; }
}

/* ---------- Upright screens: the name on open sky, the lake beneath ---------- */

@media (max-aspect-ratio: 1/1), (max-width: 719px) {
  .af-hero {
    --name-size: min(25.5vw, 15svh, 13rem);
    display: flex; flex-direction: column;
    height: 100svh; max-height: none;
  }
  .af-hero__scene {
    position: relative; inset: auto; order: 2;
    flex: 1 1 0; min-height: 44svh;
    margin: -4rem -3% 0;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 30%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 30%);
    transform: translate3d(0, calc(var(--scroll, 0) * 5%), 0) scale(calc(1 + var(--scroll, 0) * 0.05));
  }
  .af-hero__scene img { object-position: 34% 100%; }
  .af-hero__title {
    position: relative; inset: auto; order: 1; z-index: 1;
    padding-top: clamp(5.5rem, 15svh, 9rem);
  }
  .af-name { white-space: normal; line-height: 0.86; }
  .af-name span { display: block; }
  .af-hero__flourish { width: calc(var(--name-size) * 2.3); margin-top: calc(var(--name-size) * 0.1); }
  .af-hero__tagline { max-width: 15em; margin-inline: auto; font-size: clamp(1.1875rem, 5vw, 1.75rem); }
  .af-hero__cue { right: 50%; translate: 50% 0; }

  .af-night { --night-h: auto; min-height: 0; display: flex; flex-direction: column; }
  .af-night__content { order: 1; margin-left: 0; max-width: none; padding-top: var(--section-y); padding-bottom: 0; }
  .af-night__scene {
    order: 2; position: relative; z-index: 0;
    width: 172%; margin: -1.5rem 0 0 -22%;
    aspect-ratio: 1600 / 1228;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 34%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 34%);
  }
  .af-lamp { left: 22.5%; top: 38.6%; }
  .af-lamp::after { width: 46vw; }
}

/* ---------- Phones ---------- */

@media (max-width: 719px) {
  .af-postcards {
    display: flex; gap: 1rem;
    max-width: none; margin-inline: calc(var(--gutter) * -1);
    padding: 1.25rem var(--gutter) 2rem;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .af-postcards::-webkit-scrollbar { display: none; }
  .af-postcard { flex: 0 0 min(80vw, 21rem); scroll-snap-align: center; }
  .af-postcard:nth-child(odd) { --tilt: -1.2deg; --drop: 0px; }
  .af-postcard:nth-child(even) { --tilt: 1.2deg; --drop: 0px; }
  .af-postcard:hover, .af-postcard:focus-within, .af-postcard[data-flipped] { rotate: 0deg; translate: 0 0; }
  .af-footer__inner { justify-content: center; text-align: center; flex-direction: column; }
  .af-footer__about { padding-right: 0; text-align: center; }
}
@media (max-width: 399px) {
  .af-masthead__inner { gap: var(--space-2); }
  .af-wordmark { padding: 0 var(--space-4); font-size: 1.25rem; }
  .af-menu-btn { padding: 0 var(--space-4); }
}

/* ---------- Print ---------- */

@media print {
  .af-masthead, .af-progress, .af-sheet, .af-hero__cue, .af-marquee, .af-marquee__ctrl, .af-motion, .af-scroll, .af-share, .af-toast, .af-hint { display: none !important; }
  .af-hero { height: auto; min-height: 0; }
  .af-section, .af-footer { background: #fff !important; color: #000 !important; --c-text: #000; --c-muted: #333; --c-accent: #000; }
  .af-night__scene { display: none; }
  [data-reveal] { opacity: 1 !important; transform: none !important; clip-path: none !important; }
}
