/* ==========================================================================
   rebeccaaaa.com
   Tokens first. Colors, type and spacing all live here.
   ========================================================================== */

:root {
  /* Color: warm paper, olive-black ink, mint accent with a forest shade */
  --paper: #faf8f1;
  --ink: #26281f;
  --muted: #74756a;
  --line: #dcd9cc;
  --well: #eeebdf;
  --accent: #e0ffb5;         /* green */
  --accent-soft: #f1ffdc;
  --secondary: #8cf5a6;      /* mint: not used yet, kept as a secondary color */
  --secondary-soft: #d5f7dd;
  --accent-deep: #1f4a31;    /* forest */
  --glass: rgb(250 248 241 / 0.62);

  /* Type */
  --serif: "Cormorant Garamond", "Cormorant", Georgia, serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --text-xs: 0.6875rem;      /* 11px small caps labels */
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: clamp(1rem, 1.3vw, 1.125rem);
  --text-title: clamp(1.5rem, 2.4vw, 2.125rem);     /* 24–34px: card names, case study labels, quotes */
  --text-h: clamp(1.75rem, 3.4vw, 2.75rem);         /* 28–44px: section headers, Next link */
  --text-display: clamp(2.5rem, 6.5vw, 6.5rem);     /* 40–104px: hero statement, footer heading, case study titles, stats */

  /* Space: an 8px scale for fixed gaps, and fluid steps (min–max, growing with the
     screen) for the larger rhythm between blocks and sections */
  --space-xs: 4px;
  --space-s: 8px;
  --space-m: 12px;
  --space-base: 16px;
  --space-l: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --flow-m: clamp(24px, 3vw, 40px);
  --flow-l: clamp(32px, 4vw, 56px);
  --flow-xl: clamp(48px, 6vw, 88px);
  --flow-2xl: clamp(56px, 7vw, 96px);
  --section: clamp(96px, 12vw, 176px);
  --gutter: var(--space-base);            /* page margins */
  --col-gap: clamp(12px, 1.6vw, 24px);    /* between columns */
  --nav-h: 66px;                /* email pill (34px) + 16px above and below, matching the 16px side padding */
}

/* Base ---------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + var(--space-2xl)); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
.card .thumb img, .reel img, .strip img { outline: 1px solid var(--line); outline-offset: -1px; }   /* hairline so white UI doesn't melt into the paper */
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; }

.u { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
.u:hover, .ext:hover .u { text-decoration-color: transparent; }   /* ↗ links: hovering the arrow counts too */
.ext { white-space: nowrap; }   /* external links: words + ↗ wrap as one piece */
.nowrap { white-space: nowrap; }

:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

.wrap { padding-inline: var(--gutter); }
.caps { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; }
.muted { color: var(--muted); }

/* Nav: flush to the margins at load, becomes a blurred bar on scroll -------- */
.nav {
  position: fixed;
  z-index: 10;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  height: var(--nav-h);
  display: grid;
  grid-template-columns: 1fr auto;               /* wordmark left, email right */
  align-items: center;
  gap: var(--space-base);
  padding: var(--space-base) var(--gutter);      /* items sit 16px from the top and sides */
  background: transparent;
  transition: top 0.35s ease, left 0.35s ease, right 0.35s ease, background-color 0.3s ease, backdrop-filter 0.3s ease;
}
.nav.is-scrolled {                               /* the bar insets 16px all around */
  top: calc(var(--space-base) + env(safe-area-inset-top, 0px));
  left: var(--gutter);
  right: var(--gutter);
  padding-inline: var(--space-base);
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  backdrop-filter: blur(22px) saturate(1.4);
}
/* Wordmark: REBECCA + italic AAA ("Rebecca, plus three more A's") */
.nav .home {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  justify-self: start;
}
.nav .home em {
  font-style: italic;
  font-weight: 500;           /* same weight as the upright letters */
  margin-left: 0.04em;        /* evens out the wedge where upright meets italic */
}
.nav .status {                 /* email button */
  justify-self: end;
  background: var(--accent);
  color: var(--accent-deep);
  border-radius: 99px;
  padding: 7px 14px;
  font-size: var(--text-sm);
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.nav .status:hover { background: var(--accent-deep); color: var(--paper); }
.nav .status .short { display: none; }

/* Section heads mix sans + serif italic in one line -------------------------- */
.section { padding-top: var(--section); }
/* Links to a section (#work, #about) land on its heading, just under the nav,
   not at the top of the section's spacing */
.section[id] { scroll-margin-top: calc(-1 * var(--section)); }
.head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-base);
  margin-bottom: var(--flow-l);
}
.head h2 { font-size: var(--text-h); font-weight: 400; line-height: 1.1; letter-spacing: -0.01em; }
.head h2 em { font-size: 1.12em; }

/* Line-item list (label + value rows) --------------------------------------- */
.rows { border-top: 1px solid var(--line); }
.rows > div {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);   /* label column just fits the longest label */
  gap: var(--space-s) var(--col-gap);
  padding-block: var(--space-m);
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.rows dt { color: var(--muted); }
.rows dd { font-size: var(--text-lg); }

/* Cover ---------------------------------------------------------------------- */
/* Mint glow: a soft blob that slowly drifts and changes shape.
   Used at the top (cover) and bottom (contact) as bookends. */
.glow-top { position: relative; isolation: isolate; overflow: clip; }
.glow-top::before, .glow-layer::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(760px, 115vw);
  aspect-ratio: 1.1;
  background: radial-gradient(circle, var(--accent) 0%, var(--accent) 30%, var(--accent-soft) 70%, transparent 100%);
  filter: blur(28px);
  opacity: 0.8;
  border-radius: 38% 62% 63% 37% / 41% 44% 56% 59%;
  animation: blob 9s ease-in-out infinite;
  pointer-events: none;
}
.glow-top::before {             /* the glow spans the cover and shows between the carousel images */
  left: calc(min(760px, 115vw) * -0.2);
  top: calc(min(760px, 115vw) * -0.3);
}
.glow-bottom { position: relative; }
/* The bottom glow sits in its own layer that reaches well above the contact
   section, so it fades up behind the About table with no hard line, while the
   layer still clips the blob at the page's right and bottom edges (anchored in
   the corner, no extra scroll). It sits behind all page content. */
.glow-layer {
  position: absolute;
  inset: -560px 0 0 0;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}
.glow-layer::before {
  right: calc(min(760px, 115vw) * -0.22);
  bottom: calc(min(760px, 115vw) * -0.3);
  animation-delay: -4.5s;
}
/* Loops back to its starting shape, like the LottieFiles blob reference */
@keyframes blob {
  0%   { border-radius: 38% 62% 63% 37% / 41% 44% 56% 59%; transform: scale(1) rotate(0deg); }
  25%  { border-radius: 64% 36% 30% 70% / 62% 30% 70% 38%; transform: scale(1.1) rotate(18deg); }
  50%  { border-radius: 30% 70% 58% 42% / 34% 66% 34% 66%; transform: scale(0.92) rotate(-6deg); }
  75%  { border-radius: 70% 30% 44% 56% / 48% 68% 32% 52%; transform: scale(1.06) rotate(12deg); }
  100% { border-radius: 38% 62% 63% 37% / 41% 44% 56% 59%; transform: scale(1) rotate(0deg); }
}
.cover-top {
  /* 80% of the screen tall, never shorter than 520px; text centered vertically
     in the space below the nav */
  min-height: max(80svh, 520px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: calc(var(--nav-h) + var(--space-2xl));
  padding-bottom: var(--space-2xl);
}
.cover-meta {
  margin-top: var(--flow-m);
}

/* The statement is the cover; the wordmark lives in the nav */
.statement-hero {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--text-display);
  line-height: 1.02;
  letter-spacing: -0.015em;
  max-width: 21ch;
  text-wrap: balance;
}
.statement-hero .keep { white-space: nowrap; }   /* "Product & UX design" stays on one line */

/* Carousel: each image's width comes from its type (desktop, tablet, mobile, photo),
   heights vary, and everything sits on one baseline so the labels line up. Very tall
   images are capped and cropped from the top. It drifts on its own (see the script in
   index.html) and can also be scrolled by hand. Built by tools/build-carousel.py. */
.reel {
  margin-top: var(--flow-xl);
  overflow-x: auto;
  scrollbar-width: none;
}
.reel::-webkit-scrollbar { display: none; }
.reel-track { display: flex; align-items: flex-end; gap: var(--col-gap); width: max-content; padding-inline: var(--gutter); }
.reel figure { position: relative; flex: none; }
.reel figure[data-kind="photo"] { --size: .85; }   /* photos sit a little smaller than screens */
.reel img { width: 100%; height: auto; max-height: 480px; object-fit: cover; object-position: top; }
/* Phone screens all share one shape (9:16), cropped from the top, so they line up */
.reel figure[data-kind="mobile"] img { aspect-ratio: 9 / 16; object-fit: cover; object-position: top; }
.reel .cutout img { outline: none; object-fit: contain; object-position: bottom; }   /* background knocked out */
/* Real-world scale: each image is tagged desktop / tablet / mobile / photo (data-kind),
   so a desktop screen reads bigger than a phone. Heights still vary. */
.reel { --s: 1; }
.reel figure[data-kind="desktop"] { width: calc(520px * var(--s) * var(--size, 1)); }
.reel figure[data-kind="tablet"]  { width: calc(400px * var(--s) * var(--size, 1)); }
.reel figure[data-kind="mobile"]  { width: calc(200px * var(--s) * var(--size, 1)); }
.reel figure[data-kind="photo"]   { width: calc(320px * var(--s) * var(--size, 1)); }

/* Text notch set into an image (bottom-left) -------------------------------- */
.notch {
  position: absolute;
  left: 0;
  bottom: 0;
  background: var(--paper);
  padding: var(--space-s);              /* 8px on every side of the trimmed text */
  display: flex;
  gap: var(--space-s);
  align-items: baseline;
  line-height: 1;
}
/* Crop each line to cap height + baseline (like Figma's vertical trim), so the 8px
   padding is measured from the letters, not the line box. Values come from the
   fonts' metrics: Cormorant caps are 0.625em tall, Helvetica's 0.714em. */
.notch .caps { margin-block: -0.156em -0.13em; }
.reel .notch { padding: calc(var(--space-s) - 0.156em) var(--space-s) calc(var(--space-s) - 0.13em); }   /* text sits directly in the notch */

/* Placeholder until real images go in */
.ph { width: 100%; height: 100%; background: var(--well); }

/* Work grid (uniform) -------------------------------------------------------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--flow-2xl) var(--col-gap);
}
.card { position: relative; }
.card .thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; margin-bottom: var(--space-base); }
/* Each card image sets its own crop: --focus is the point to center on (x% y%),
   --zoom how far to push in. Edit them in the style="" on each card's <img>. */
.card .thumb img, .card .thumb .ph {
  width: 100%; height: 100%; object-fit: cover;
  object-position: var(--focus, 50% 50%);
  transform-origin: var(--focus, 50% 50%);
  transform: scale(var(--zoom, 1));
  transition: transform 0.8s ease;
}
.card:has(a.card-link):hover .thumb img, .card:has(a.card-link):hover .thumb .ph { transform: scale(calc(var(--zoom, 1) * 1.015)); }
.card .notch h3 { font-family: var(--serif); font-weight: 500; font-size: var(--text-title); margin-block: -0.19em -0.185em; }   /* trimmed to cap height, see .notch */
.card-link { display: block; color: inherit; }   /* the whole card is one link (a plain block in the one-pager build) */
.card .outcome { font-size: var(--text-lg); margin-bottom: var(--space-s); text-wrap: pretty; }   /* fills the tile; no lone last words */
a.card-link:hover .notch h3, a.card-link:focus-visible .notch h3 { font-style: italic; }   /* matches the Next link */
.card .proj { color: var(--ink); margin-right: var(--space-s); }   /* project name before the year: SITE REDESIGN 2026 */
.card .thumb .redacted { position: absolute; inset: 0; display: grid; place-items: center; background: var(--ink); color: var(--paper); font-size: var(--text-lg); }   /* NDA card: a black box instead of a screenshot */
.card .censor { display: inline-block; width: 6em; height: 1em; vertical-align: -0.12em; background: var(--ink); }   /* black bar in place of the project name */
.work-note { margin-top: clamp(var(--space-2xl), 6vw, 80px); }   /* 48px on phones, up to 80px: a little closer to the cards than --flow-xl */

/* About ---------------------------------------------------------------------- */
.about { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--space-xl) var(--col-gap); }
.about .rows { grid-column: 4 / 13; }

/* Contact -------------------------------------------------------------------- */
.contact {
  position: relative;
  margin-top: var(--section);
  padding-block: var(--section) var(--flow-xl);
}

.contact h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--text-display);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin-bottom: var(--space-xl);
}
.contact-links { display: grid; gap: var(--space-xs); font-size: var(--text-lg); }   /* email + links, body size */
.fine-print { margin-top: var(--flow-2xl); }

/* ==========================================================================
   Case study
   ========================================================================== */
.cs-title { padding-top: calc(var(--nav-h) + var(--flow-xl)); }
.cs-title h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--text-display);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin-bottom: var(--space-l);
}
.cs-title .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-base);
  padding-bottom: var(--space-base);
  border-bottom: 1px solid var(--line);
}

.cs-section {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  gap: var(--space-l) var(--col-gap);
  padding-block: var(--flow-xl);
  border-bottom: 1px solid var(--line);
}
.cs-section > h2 { font-family: var(--serif); font-weight: 500; font-size: var(--text-title); line-height: 1.1; }
.cs-section > h2 .caps { display: block; font-family: var(--sans); font-weight: 400; color: var(--muted); margin-top: var(--space-s); }
.cs-body { min-width: 0; }

.prose { font-size: var(--text-lg); line-height: 1.55; max-width: 62ch; }
.prose p + p { margin-top: 0.9em; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-l) var(--col-gap); margin-top: var(--space-2xl); }
.stat { border-top: 1px solid var(--ink); padding-top: var(--space-m); }
.stat .value { font-family: var(--serif); font-size: var(--text-display); line-height: 1; letter-spacing: -0.015em; }
.stat .what { color: var(--muted); margin-top: var(--space-s); }

.cs-body .rows { margin-top: var(--space-xl); }

.strip {
  --h: clamp(280px, 34vw, 480px);
  display: flex;
  gap: var(--space-base);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: var(--space-base);
  margin-top: var(--space-xl);
  margin-right: calc(-1 * var(--gutter));
  padding-right: var(--gutter);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.strip figure { flex: none; scroll-snap-align: start; }
.strip img, .strip .ph { height: var(--h); width: auto; }
.strip .ph { background: #fff; box-shadow: 0 0 0 1px var(--line); }
.strip .mobile  { aspect-ratio: 9 / 19; }
.strip .desktop { aspect-ratio: 16 / 10; }
.strip figcaption { margin-top: var(--space-s); color: var(--muted); }
.strip img { aspect-ratio: auto; }               /* screenshots keep their own shape */
.strip img.flow { height: min(var(--h), 375px); }     /* wide strip of screens: don't upscale */
/* Full-length pages: a fixed window you scroll inside */
.strip .page-scroll {
  height: var(--h);
  width: calc(var(--h) * 0.72);
  overflow-y: auto;
  overscroll-behavior: contain;
  outline: 1px solid var(--line);
  outline-offset: -1px;
  background: #fff;
  scrollbar-width: thin;
}
.strip .page-scroll img { display: block; width: 100%; height: auto; outline: 0; }
.strip .page-scroll--mobile { width: calc(var(--h) * 0.46); }

.nda { padding-block: var(--flow-l); }

/* Bottom of each case study: previous project (or All work) and the next one */
.pager {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-base);
  padding-block: var(--flow-xl);
}
.pager strong { font-family: var(--serif); font-weight: 400; font-size: var(--text-h); line-height: 1; }   /* previous and next match */
.pager a:hover .name { font-style: italic; }   /* only the name; the arrow stays put */
/* This font draws arrows high; nudge them down to sit centered on mixed-case names.
   They stay upright when the name turns italic. */
.pager .arr { position: relative; top: 0.1em; font-style: normal; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
  .about .rows { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  :root { --nav-h: 64px; }      /* mobile pill is 32px tall */
  .nav .status { padding: 6px 12px; }
  .nav .status .long { display: none; }
  .nav .status .short { display: inline; }
  .rows > div { grid-template-columns: 1fr; gap: var(--space-xs); }
  .work-grid { grid-template-columns: 1fr; }
  .cs-section { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .reel img { max-height: 360px; }
  .reel { --s: .7; }
}

/* Case study extras ---------------------------------------------------------- */
/* Stack: short, wide pieces (content modules, banners) shown at their own size */
.stack { display: grid; gap: var(--space-l); margin-top: var(--space-xl); justify-items: start; }
.stack img { max-width: 100%; height: auto; outline: 1px solid var(--line); outline-offset: -1px; }
.stack figcaption { margin-top: var(--space-s); color: var(--muted); }
/* Pull quotes from clients and users */
.quotes { display: grid; gap: var(--space-l); margin-top: var(--space-xl); }
.quotes blockquote { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: var(--text-title); line-height: 1.2; max-width: 36ch; }
.quotes cite { display: block; margin-top: var(--space-s); font-family: var(--sans); font-style: normal; font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* 404 ------------------------------------------------------------------------ */
.lost { min-height: 100svh; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: center; gap: var(--space-xl) var(--col-gap); padding-top: var(--nav-h); }
.lost-text { grid-column: 1 / 6; }
.lost h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(6rem, 18vw, 16rem); line-height: 0.85; letter-spacing: -0.02em; }
.lost-line { font-size: var(--text-h); margin-block: var(--space-m) var(--space-l); }
.lost-photo { grid-column: 6 / 13; margin-right: calc(-1 * var(--gutter)); }
.lost-photo img { width: 100%; height: auto; }
@media (max-width: 700px) {
  .lost-text, .lost-photo { grid-column: 1 / -1; }
  .lost-photo { margin-inline: calc(-1 * var(--gutter)); }
}

/* Names that turn italic on hover keep their width: invisible upright and italic
   copies (from data-text) hold space for whichever is wider, so nothing shifts */
.card .notch h3, .pager .name { display: inline-grid; }
.card .notch h3::before, .card .notch h3::after,
.pager .name::before, .pager .name::after {
  content: attr(data-text);
  visibility: hidden;
  height: 0;
  overflow: hidden;
}
.card .notch h3::before, .pager .name::before { font-style: normal; order: 1; }   /* after the visible name, so its baseline leads */
.card .notch h3::after, .pager .name::after { font-style: italic; }

/* Case studies: hovering the wordmark swaps it for "← All work" in the same spot.
   Both sit in one grid cell, so the swap never shifts anything. */
.home--back { display: inline-grid; }
.home--back > span { grid-area: 1 / 1; transition: opacity 0.2s ease; }
.home--back .back { opacity: 0; white-space: nowrap; }
.home--back:hover .wm, .home--back:focus-visible .wm { opacity: 0; }
.home--back:hover .back, .home--back:focus-visible .back { opacity: 1; }
.home--back .arr { position: relative; top: 0.1em; }

/* Client hover images. Names with an image get a dotted underline; the preview follows
   the pointer. Off on touch screens (the script only runs where hover exists). */
.peek {
  display: block; position: fixed; top: 0; left: 0; z-index: 40; pointer-events: none;
  width: auto; height: auto; max-width: 280px; max-height: 360px;
  outline: 1px solid var(--line); outline-offset: -1px;
  opacity: 0; transition: opacity .15s;
}
.peek.on { opacity: 1; }
.peek-name { white-space: nowrap; text-decoration: underline dotted var(--muted); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.peek-name:hover { text-decoration-color: var(--ink); }
@media (max-width: 380px) {
  .card .notch h3 { font-size: 1.3rem; }   /* keeps "Daily Harvest · Design system 2026" on one line on the smallest phones */
  .statement-hero { font-size: min(var(--text-display), calc((100vw - 2 * var(--gutter)) * .122)); }   /* "Product & UX design" always fits its line */
}
