/* =====================================================================
   FIELD — shared foundation (v3)
   Base: microsoft.ai recreation (cream / warm ink / peach→terracotta,
   Bradford LL + Red Hat Mono). Extended with a few warm pastel accents
   and a wavy / scalloped "sticker" language.
   ===================================================================== */

@import url('../assets/fonts/fonts.css');

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul[role='list'], ol[role='list'] { list-style: none; padding: 0; }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
button { background: none; border: none; cursor: pointer; padding: 0; }
[hidden] { display: none !important; }

:root {
  /* type */
  --font-serif: 'Bradford LL', 'Iowan Old Style', Georgia, serif;
  --font-mono: 'Red Hat Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* base palette (from the microsoft.ai recreation) */
  --ink: #5d524b;
  --ink-2: #3f3631;          /* deeper ink for small text contrast */
  --ink-soft: #857a6e;
  --cream: #fef9ed;
  --paper: #f7ecd9;
  --paper-2: #f2e5cd;
  --line: rgba(93, 82, 75, 0.16);
  --hero-1: #fde3d1;
  --hero-2: #fbd3be;
  --hero-3: #f0b494;
  --hero-4: #dc8f6c;
  --hero-5: #b8694a;
  --rust: #a67c52;

  /* field accents — warm pastels in the spirit of the wavy-blob board */
  --butter: #f5d77c;
  --butter-2: #f9e9a8;
  --sage: #b8c79a;
  --sage-2: #dfe6c8;
  --rose: #ecbcb2;
  --rose-2: #f6dcd4;
  --tomato: #e3624a;
  --berry: #a8456b;
  --dusk: #b9c6d6;
  --dusk-2: #dfe5ec;
  --night: #2f2a33;

  /* layout */
  --edge: clamp(1rem, 3vw, 2.25rem);
  --max: 1440px;
  --header-h: 64px;
  --r-sm: 12px;
  --r: 20px;
  --r-lg: 32px;
  --r-full: 999px;
  --shadow: 0 4px 80px rgba(93, 82, 75, 0.22);
  --shadow-sm: 0 6px 24px rgba(93, 82, 75, 0.14);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html { background: var(--cream); }
body {
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

::selection { background: var(--hero-3); color: var(--cream); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--tomato);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 1rem; top: -4rem; z-index: 2000;
  background: var(--ink); color: var(--cream); padding: .6rem 1rem; border-radius: var(--r-full);
  font-size: 12px; transition: top .25s var(--ease-quart);
}
.skip-link:focus-visible { top: 1rem; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--edge); }

/* ---------- type ---------- */
.display {
  font-family: var(--font-serif);
  font-weight: 450;
  line-height: .95;
  letter-spacing: -0.015em;
}
.display em, .serif em { font-style: italic; }
.h-xl { font-family: var(--font-serif); font-weight: 450; font-size: clamp(2.6rem, 7.4vw, 7.2rem); line-height: .94; letter-spacing: -.02em; }
.h-lg { font-family: var(--font-serif); font-weight: 450; font-size: clamp(2.1rem, 5vw, 4.6rem); line-height: 1; letter-spacing: -.015em; }
.h-md { font-family: var(--font-serif); font-weight: 450; font-size: clamp(1.6rem, 3vw, 2.6rem); line-height: 1.08; letter-spacing: -.01em; }
.h-sm { font-family: var(--font-serif); font-weight: 450; font-size: clamp(1.25rem, 1.8vw, 1.6rem); line-height: 1.2; }
.lede { font-family: var(--font-serif); font-size: clamp(1.15rem, 1.7vw, 1.5rem); line-height: 1.4; color: var(--ink); }
.mono { font-family: var(--font-mono); }
.small { font-size: 12px; letter-spacing: .02em; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .55em;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .08em;
  text-transform: uppercase; color: var(--rust);
}
.eyebrow::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor;
}
.muted { color: var(--ink-soft); }

/* ---------- header ---------- */
.site-header {
  position: fixed; z-index: 900;
  top: 20px; left: var(--edge); right: var(--edge);
  max-width: calc(var(--max) - 2 * var(--edge)); margin-inline: auto;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 10px 0 20px;
  background: var(--cream);
  border-radius: var(--r);
  filter: drop-shadow(0 4px 60px rgba(93, 82, 75, .25));
  transition: transform .6s var(--ease-out), opacity .4s;
}
.site-header.is-hidden { transform: translateY(calc(-100% - 30px)); }
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--font-serif); font-size: 1.3rem; color: var(--ink); white-space: nowrap;
}
.brand__mark {
  width: 30px; height: 30px; flex: none; position: relative; display: grid; place-items: center;
  color: var(--cream); font-family: var(--font-serif); font-style: italic; font-size: 1rem;
}
.brand__mark::before {
  content: ''; position: absolute; inset: 0; background: var(--hero-4);
  -webkit-mask: url('../assets/shapes/scallop-12.svg') center / contain no-repeat;
  mask: url('../assets/shapes/scallop-12.svg') center / contain no-repeat;
  transition: transform .8s var(--ease-spring);
}
.brand:hover .brand__mark::before { transform: rotate(60deg) scale(1.08); }
.brand__mark span { position: relative; transform: translateY(-1px); }
.site-nav { display: flex; align-items: center; gap: clamp(1rem, 2.6vw, 2.4rem); }
.site-nav a {
  font-size: 12px; font-weight: 500; color: var(--ink-soft); letter-spacing: .02em; position: relative; padding: .4rem 0;
  transition: color .25s;
}
.site-nav a:hover, .site-nav a[aria-current='page'] { color: var(--ink); }
.site-nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 6'%3E%3Cpath d='M0 3 Q5 0 10 3 T20 3 T30 3 T40 3' fill='none' stroke='%23dc8f6c' stroke-width='1.6'/%3E%3C/svg%3E") repeat-x 0 0 / 20px 6px;
  transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease-out);
}
.site-nav a:hover::after { transform: scaleX(1); }
.header-right { display: flex; align-items: center; gap: .75rem; }
.clock {
  display: inline-flex; align-items: center; gap: .5rem; font-size: 11px; color: var(--ink-soft); white-space: nowrap;
}
.clock__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 3px rgba(184, 199, 154, .35); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(184, 199, 154, 0); } }

@media (max-width: 760px) {
  .site-header { top: 12px; height: 56px; padding-left: 14px; }
  .site-nav { display: none; }
  .clock { display: none; }
  .brand { font-size: 1.1rem; }
}

/* ---------- buttons ---------- */
.pill {
  --bg: var(--paper); --fg: var(--ink);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  height: 44px; padding: 0 1.4rem;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .03em;
  color: var(--fg); background: var(--bg); border-radius: var(--r-full);
  transition: transform .5s var(--ease-spring), box-shadow .3s, background .25s, color .25s;
  white-space: nowrap; isolation: isolate;
}
.pill:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 10px 26px rgba(93, 82, 75, .18); }
.pill:active { transform: translateY(0) scale(.97); }
.pill--dark { --bg: var(--ink); --fg: var(--cream); }
.pill--cream { --bg: var(--cream); --fg: var(--ink); }
.pill--tomato { --bg: var(--tomato); --fg: var(--cream); }
.pill--ghost { --bg: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.pill--sm { height: 34px; padding: 0 1rem; font-size: 11px; }
.pill svg { width: 14px; height: 14px; flex: none; transition: transform .4s var(--ease-out); }
.pill:hover svg { transform: translate(2px, -2px); }
.pill[disabled] { opacity: .5; pointer-events: none; }

/* ---------- stickers & wavy shapes ---------- */
/* .sticker = scalloped badge. Shape in ::before via mask so content stays crisp. */
.sticker {
  --s-bg: var(--butter); --s-fg: var(--ink-2); --s-shape: url('../assets/shapes/scallop-12.svg');
  position: relative; display: inline-grid; place-items: center; text-align: center;
  width: var(--s-size, 120px); height: var(--s-size, 120px); padding: calc(var(--s-size, 120px) * .16);
  color: var(--s-fg); font-family: var(--font-mono); font-size: 11px; font-weight: 500; line-height: 1.25;
  letter-spacing: .03em; text-transform: uppercase; isolation: isolate;
  transition: transform .7s var(--ease-spring);
}
.sticker::before {
  content: ''; position: absolute; inset: 0; z-index: -1; background: var(--s-bg);
  -webkit-mask: var(--s-shape) center / contain no-repeat; mask: var(--s-shape) center / contain no-repeat;
  filter: drop-shadow(0 6px 10px rgba(93, 82, 75, .12));
}
.sticker:hover { transform: rotate(-8deg) scale(1.06); }
.sticker--flower { --s-shape: url('../assets/shapes/flower-8.svg'); }
.sticker--sun { --s-shape: url('../assets/shapes/sun-24.svg'); }
.sticker--16 { --s-shape: url('../assets/shapes/scallop-16.svg'); }
.sticker--wobble { --s-shape: url('../assets/shapes/wobble.svg'); }
.sticker .serif { font-family: var(--font-serif); text-transform: none; letter-spacing: 0; font-size: 1.6em; line-height: 1; display: block; }

/* tag = small pill sticker with a slight tilt */
.tag {
  display: inline-flex; align-items: center; gap: .45em; height: 28px; padding: 0 .85rem;
  border-radius: var(--r-full); background: var(--paper); color: var(--ink);
  font-size: 11px; font-weight: 500; letter-spacing: .03em; white-space: nowrap;
}
.tag--line { background: transparent; box-shadow: inset 0 0 0 1px currentColor; }
.tag--dark { background: var(--ink); color: var(--cream); }

/* wavy band (sine edges top & bottom) */
.wavy-band { position: relative; isolation: isolate; }
.wavy-band::before {
  content: ''; position: absolute; inset: 0; z-index: -1; background: var(--band-bg, var(--butter-2));
  -webkit-mask: url('../assets/shapes/sine-band.svg') 0 0 / 100% 100% no-repeat;
  mask: url('../assets/shapes/sine-band.svg') 0 0 / 100% 100% no-repeat;
}

/* squiggle connectors drawn on scroll: <svg class="squiggle"><path data-draw .../></svg> */
.squiggle { position: absolute; pointer-events: none; overflow: visible; }
.squiggle path { fill: none; stroke: var(--squiggle, var(--hero-4)); stroke-width: 1.6; stroke-linecap: round; }

/* "this is a simulation" badge */
.sim-badge {
  display: inline-flex; align-items: center; gap: .5em;
  height: 26px; padding: 0 .8rem; border-radius: var(--r-full);
  background: var(--ink); color: var(--cream); font-size: 10.5px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
}
.sim-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--butter); animation: pulse 2s infinite; }

/* placeholder marker for swap-later media */
.ph-note {
  position: absolute; z-index: 3; left: 10px; bottom: 10px;
  font-size: 10px; letter-spacing: .05em; text-transform: uppercase;
  padding: .25rem .55rem; border-radius: var(--r-full); background: rgba(254, 249, 237, .85); color: var(--ink);
  pointer-events: none;
}

/* ---------- reveal ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(26px); }
.js [data-reveal].is-in { opacity: 1; transform: none; transition: opacity .9s var(--ease-quart), transform 1s var(--ease-out); transition-delay: var(--d, 0s); }

/* ---------- custom cursor (fine pointers only) ---------- */
.cursor { position: fixed; left: 0; top: 0; z-index: 1500; pointer-events: none; display: none; }
@media (hover: hover) and (pointer: fine) { .has-cursor .cursor { display: block; } }
.cursor__dot {
  position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--ink);
  transition: opacity .2s, transform .3s var(--ease-out);
}
.cursor__blob {
  position: absolute; width: 84px; height: 84px; margin: -42px 0 0 -42px; display: grid; place-items: center;
  color: var(--ink-2); font-size: 10.5px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
  transform: scale(0); transition: transform .5s var(--ease-spring);
}
.cursor__blob::before {
  content: ''; position: absolute; inset: 0; background: var(--cursor-bg, var(--butter));
  -webkit-mask: url('../assets/shapes/scallop-12.svg') center / contain no-repeat; mask: url('../assets/shapes/scallop-12.svg') center / contain no-repeat;
  animation: spin 9s linear infinite;
}
.cursor__blob span { position: relative; }
.cursor.is-active .cursor__blob { transform: scale(1); }
.cursor.is-active .cursor__dot { opacity: 0; }
.cursor.is-down .cursor__blob { transform: scale(.85); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- page transition (scalloped wipe) ---------- */
.pt {
  position: fixed; inset: 0; z-index: 1800; pointer-events: none; display: grid; place-items: center; overflow: hidden;
}
.pt__blob {
  width: 30vmax; height: 30vmax; flex: none; background: var(--pt-bg, var(--hero-4));
  -webkit-mask: url('../assets/shapes/scallop-16.svg') center / contain no-repeat; mask: url('../assets/shapes/scallop-16.svg') center / contain no-repeat;
  transform: scale(0);
}
.pt__label {
  position: absolute; font-family: var(--font-serif); font-style: italic; font-size: clamp(2rem, 6vw, 5rem); color: var(--cream); opacity: 0;
}

/* ---------- footer ---------- */
.site-footer {
  position: relative; background: var(--ink); color: var(--paper); overflow: hidden;
  padding: clamp(4rem, 9vw, 7rem) 0 2rem; margin-top: -1px;
}
.site-footer a:not(.pill) { color: var(--cream); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; align-items: start; }
.footer-grid h3 { font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--hero-3); margin-bottom: 1rem; }
.footer-grid ul { list-style: none; padding: 0; display: grid; gap: .45rem; font-size: 13px; }
.footer-grid ul a { opacity: .85; transition: opacity .2s; }
.footer-grid ul a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.footer-word {
  font-family: var(--font-serif); font-style: italic; font-size: clamp(5rem, 22vw, 21rem); line-height: .8; letter-spacing: -.04em;
  color: var(--hero-2); margin-top: clamp(2.5rem, 6vw, 5rem); white-space: nowrap; user-select: none;
}
.footer-word span { display: inline-block; transition: transform .6s var(--ease-spring), color .3s; }
.footer-word span:hover { transform: translateY(-.08em) rotate(-4deg); color: var(--butter); }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: 11px; color: rgba(247, 236, 217, .65); margin-top: 1.5rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- next project (shared component, styled per page via --np-bg) ---------- */
.next-project {
  position: relative; display: block; overflow: hidden; isolation: isolate;
  padding: clamp(5rem, 12vw, 10rem) 0; background: var(--np-bg, var(--paper)); color: var(--np-fg, var(--ink));
  text-align: center;
}
.next-project__label, .next-project__title, .next-project__tagline { display: block; }
.next-project__label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.next-project__title { font-family: var(--font-serif); font-size: clamp(3rem, 11vw, 10rem); line-height: .9; letter-spacing: -.03em; margin-top: 1rem; }
.next-project__title em { font-style: italic; }
.next-project__tagline { max-width: 40ch; margin: 1.25rem auto 0; font-family: var(--font-serif); font-size: clamp(1rem, 1.5vw, 1.25rem); opacity: .85; }
.next-project__blob {
  position: absolute; z-index: -1; left: 50%; top: 50%; width: min(70vw, 760px); aspect-ratio: 1; translate: -50% -50%;
  background: var(--np-blob, var(--hero-2));
  -webkit-mask: url('../assets/shapes/scallop-16.svg') center / contain no-repeat; mask: url('../assets/shapes/scallop-16.svg') center / contain no-repeat;
  transition: transform 1.2s var(--ease-out); animation: spin 60s linear infinite;
}
.next-project:hover .next-project__blob { transform: scale(1.12); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
