/* =========================================================
   Makenna Lewison — Digital Design Portfolio
   Shared design system. Every page links this one file.
   ========================================================= */

/* ---------- Fonts (self-hosted, OFL licensed, Latin subset) ---------- */
@font-face {
  font-family: "Archivo"; src: url("../fonts/archivo-expanded.woff?v=9") format("woff");
  font-weight: 700 800; font-stretch: 125%; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Public Sans"; src: url("../fonts/public-sans.woff?v=9") format("woff");
  font-weight: 400 600; font-style: normal; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --black: #080605;
  --espresso: #221a14;
  --espresso-2: #2e241c;
  --cream: #f1eee3;
  --white: #ffffff;
  --gold: #b69a58;
  --gold-light: #fbe7b2;
  --gold-deep: #86713f;

  --text: var(--cream);
  --text-dim: rgba(241, 238, 227, 0.66);
  --text-faint: rgba(241, 238, 227, 0.42);
  --line: rgba(241, 238, 227, 0.12);
  --line-strong: rgba(241, 238, 227, 0.24);
  --glass: rgba(34, 26, 20, 0.52);
  --glass-edge: rgba(251, 231, 178, 0.14);

  --font-display: "Archivo", "Arial Black", system-ui, sans-serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* fluid side gutter: 16px on phones → ~4.5vw on large screens */
  --gutter: clamp(16px, 4.5vw, 96px);
  --section-y: clamp(88px, 12vw, 200px);
  --radius-lg: clamp(18px, 2vw, 32px);
  --radius-md: 14px;
  --radius-pill: 999px;

  /* type scale (fluid) */
  --step--1: clamp(0.8rem, 0.78rem + 0.1vw, 0.875rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.5rem);
  --step-2: clamp(1.5rem, 1.25rem + 1.1vw, 2.25rem);
  --step-3: clamp(2rem, 1.5rem + 2.4vw, 3.75rem);
  --step-4: clamp(2.6rem, 1.6rem + 4.6vw, 6.5rem);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  color-scheme: dark;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--black);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--gold); color: var(--black); }

:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 4px;
  border-radius: 6px;
}

.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 200;
  padding: 12px 18px; border-radius: var(--radius-pill);
  background: var(--gold-light); color: var(--black); font-weight: 600;
  transition: top .2s;
}
.skip-link:focus { top: 16px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* film grain over everything — tiny inline SVG, GPU-cheap */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 150;
  opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); position: relative; }

.display {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 800;
  line-height: .9;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.outline-type {
  color: transparent;
  -webkit-text-stroke: max(1px, 0.012em) var(--cream);
}

.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px 48px;
  align-items: end;
  margin-bottom: clamp(40px, 6vw, 88px);
}
.section-head h2 { font-size: var(--step-4); }
.section-head p { color: var(--text-dim); max-width: 46ch; }
@media (min-width: 900px) {
  .section-head { grid-template-columns: 1fr auto; }
  .section-head p { text-align: right; }
}

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--cream); --fg: var(--black);
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 52px; padding: 0 28px;
  border-radius: var(--radius-pill);
  background: var(--bg); color: var(--fg);
  font-weight: 600; font-size: var(--step-0); letter-spacing: .005em;
  transition: transform .4s var(--ease-out), color .3s;
  white-space: nowrap;
}
/* gold fill sweeps up from where the pointer enters */
.btn::before {
  content: ""; position: absolute; z-index: -1;
  left: var(--mx, 50%); top: var(--my, 50%);
  width: 0; height: 0; border-radius: 50%;
  background: var(--gold-light);
  transform: translate(-50%, -50%);
  transition: width .5s var(--ease-out), height .5s var(--ease-out);
}
.btn:hover::before, .btn:focus-visible::before { width: 260%; height: 600%; }
.btn:active { transform: scale(.97); }
.btn--ghost {
  --bg: rgba(241, 238, 227, .06); --fg: var(--cream);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.btn--ghost:hover, .btn--ghost:focus-visible { color: var(--black); }
.btn svg { width: 1.05em; height: 1.05em; flex: none; }

.text-link {
  position: relative; display: inline-flex; align-items: center; gap: .5em;
  font-weight: 600; color: var(--cream);
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .45s var(--ease-out), color .3s;
  padding-bottom: 2px;
}
.text-link:hover, .text-link:focus-visible { background-size: 100% 1px; color: var(--gold-light); }

/* ---------- Header (glass pill) ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  padding: clamp(10px, 1.4vw, 20px) var(--gutter);
  pointer-events: none;
  transition: transform .5s var(--ease-out);
}
.site-header.is-hidden { transform: translateY(-120%); }
.nav-bar {
  pointer-events: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 8px 8px 8px 16px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: 1px solid transparent;
  transition: background .4s, border-color .4s, backdrop-filter .4s;
}
.site-header.is-scrolled .nav-bar {
  background: var(--glass);
  border-color: var(--glass-edge);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 20px 50px -20px rgba(0,0,0,.6);
}
.brand { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; }
.brand-mark { width: 22px; height: 40px; flex: none; }
.brand-name { font-family: var(--font-display); font-stretch: 125%; font-weight: 700; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; line-height: 1.1; }
.nav-links { display: none; align-items: center; gap: 4px; }
.nav-links a {
  position: relative; padding: 10px 16px; border-radius: var(--radius-pill);
  font-size: .95rem; color: var(--text-dim); transition: color .25s, background .25s;
}
.nav-links a:hover, .nav-links a:focus-visible { color: var(--cream); background: rgba(241,238,227,.07); }
.nav-links a[aria-current="page"] { color: var(--cream); }
.nav-links a[aria-current="page"]::after {
  content: ""; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px;
  border-radius: 50%; background: var(--gold-light); transform: translateX(-50%);
}
.nav-cta { display: none; }
.nav-cta.btn { min-height: 44px; padding: 0 20px; font-size: .92rem; }
.menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(241,238,227,.08); border: 1px solid var(--line);
}
.menu-toggle span, .menu-toggle span::before {
  display: block; width: 18px; height: 1.5px; background: var(--cream); position: relative;
  transition: transform .4s var(--ease-out);
}
.menu-toggle span::before { content: ""; position: absolute; top: 6px; }
.menu-toggle span { transform: translateY(-3px); }
.menu-open .menu-toggle span { transform: translateY(0) rotate(45deg); }
.menu-open .menu-toggle span::before { transform: translateY(-6px) rotate(-90deg); }

@media (min-width: 860px) {
  .nav-links { display: flex; }
  .nav-cta { display: inline-flex; }
  .menu-toggle { display: none; }
}

/* mobile menu sheet */
.mobile-menu {
  position: fixed; inset: 0; z-index: 90;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 32px;
  padding: 120px var(--gutter) 40px;
  background: rgba(8,6,5,.86);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  opacity: 0; visibility: hidden;
  transition: opacity .4s var(--ease-out), visibility 0s .4s;
}
.menu-open .mobile-menu { opacity: 1; visibility: visible; transition: opacity .4s var(--ease-out); }
.mobile-menu ul { display: grid; gap: 4px; }
.mobile-menu a.mm-link {
  display: block; font-family: var(--font-display); font-stretch: 125%; font-weight: 800;
  font-size: clamp(2.6rem, 13vw, 5rem); line-height: 1; text-transform: uppercase;
  transform: translateY(30px); opacity: 0;
  transition: transform .6s var(--ease-out), opacity .6s var(--ease-out), color .25s;
}
.mobile-menu a.mm-link:hover { color: var(--gold-light); }
.menu-open .mobile-menu a.mm-link { transform: none; opacity: 1; }
.menu-open .mobile-menu li:nth-child(2) a { transition-delay: .05s; }
.menu-open .mobile-menu li:nth-child(3) a { transition-delay: .1s; }
.menu-open .mobile-menu li:nth-child(4) a { transition-delay: .15s; }
.mobile-menu .mm-foot { display: flex; flex-wrap: wrap; gap: 12px; }
@media (min-width: 860px) { .mobile-menu { display: none; } }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px var(--gutter) 32px;
  display: grid; gap: 24px;
  color: var(--text-faint); font-size: var(--step--1);
}
.site-footer nav ul { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { color: var(--text-dim); transition: color .2s; }
.site-footer a:hover { color: var(--cream); }
@media (min-width: 760px) {
  .site-footer { grid-template-columns: 1fr auto auto; align-items: center; gap: 40px; }
}

/* ---------- Scroll reveal (one quiet pattern, used sparingly) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

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

/* elements sized by JS fit-text measure their natural width */
[data-fit] { width: max-content; max-width: none; margin-inline: auto; }

/* very large displays: scale the whole rem-based system up so text keeps its presence */
@media (min-width: 1920px) {
  html { font-size: calc(100% + (100vw - 1920px) * 0.006); }
}

/* status pill used on work cards everywhere */
.work-tag {
  display: inline-block; margin-right: 8px; padding: 2px 10px;
  border-radius: var(--radius-pill); border: 1px solid var(--line-strong);
  color: var(--gold-light); font-size: .74rem; vertical-align: 1px;
}

/* long single-word display headings never overflow tiny phones */
.section-head h2 { overflow-wrap: anywhere; }
@media (max-width: 380px) { .section-head h2 { font-size: 11vw; } }
.mobile-menu a.mm-link[aria-current="page"] { color: var(--gold-light); }

/* =========================================================
   v5 additions
   ========================================================= */
/* status pills: Live / Pending live */
.status {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  padding: 3px 11px 3px 9px; border-radius: var(--radius-pill);
  font-size: .74rem; font-weight: 600; white-space: nowrap; line-height: 1.4;
  border: 1px solid var(--line-strong); color: var(--cream); background: rgba(8,6,5,.45);
}
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-light); position: relative; }
.status--live { border-color: rgba(251,231,178,.45); color: var(--gold-light); }
.status--live i::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--gold-light);
  animation: ping 2s var(--ease-out) infinite;
}
.status--soon i { background: transparent; border: 1px solid var(--gold-light); }
@keyframes ping { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }

/* gold hairline that draws itself under a section heading */
.gold-rule {
  display: block; height: 1px; margin: calc(clamp(40px, 6vw, 88px) * -0.55) 0 clamp(28px, 3.4vw, 52px);
  background: linear-gradient(90deg, var(--gold-light), var(--gold) 40%, transparent);
  transform-origin: left; transform: scaleX(0); transition: transform 1.6s var(--ease-out);
}
.gold-rule.is-drawn, .no-js .gold-rule { transform: none; }
@media (prefers-reduced-motion: reduce) { .gold-rule { transform: none; } }
