/* matthewvisher.com — implements DESIGN.md (Apple web system, getdesign.md analysis) */

/* ---------- Tokens ---------- */
:root {
  /* Brand & accent — one accent, no second color. Lemon (Apple systemYellow);
     yellow can't carry white text, so filled pills use ink and links use the dark variant */
  --primary: #FFD60A;
  --primary-focus: #B89A00;
  --primary-on-dark: #FFD60A;
  --on-primary: #1d1d1f;
  --primary-deep: #756200;
  --primary-border: #B89A00;

  /* Surface */
  --canvas: #ffffff;
  --canvas-parchment: #f5f5f7;
  --surface-pearl: #fafafc;
  --surface-tile-1: #272729;
  --surface-tile-2: #2a2a2c;
  --surface-tile-3: #252527;
  --surface-black: #000000;
  --surface-chip-translucent: rgba(210, 210, 215, 0.64);

  /* Text */
  --ink: #1d1d1f;
  --body-on-dark: #ffffff;
  --body-muted: #cccccc;
  --ink-muted-80: #333333;
  --ink-muted-48: #7a7a7a;

  /* Hairlines */
  --divider-soft: #f0f0f0;
  --hairline: #e0e0e0;

  /* Spacing */
  --xxs: 4px; --xs: 8px; --sm: 12px; --md: 17px;
  --lg: 24px; --xl: 32px; --xxl: 48px; --section: 80px;

  /* Radius */
  --r-none: 0px; --r-xs: 5px; --r-sm: 8px; --r-md: 11px; --r-lg: 18px; --r-pill: 9999px;

  /* The one shadow — photography only */
  --shadow-product: rgba(0, 0, 0, 0.22) 3px 5px 30px 0;

  --font-display: "SF Pro Display", system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  --font-text: "SF Pro Text", system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; margin: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-text);
  background: var(--canvas);
  color: var(--ink);
  /* body: 17 / 400 / 1.47 / -0.374px — not 16px */
  font-size: 17px;
  font-weight: 400;
  line-height: 1.47;
  letter-spacing: -0.374px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--canvas); color: var(--primary-deep); padding: var(--sm) var(--lg);
}
.skip-link:focus { left: 0; }

/* ---------- Type utilities ---------- */
.t-hero    { font-family: var(--font-display); font-size: 56px; font-weight: 600; line-height: 1.07; letter-spacing: -0.28px; }
.t-display { font-family: var(--font-display); font-size: 40px; font-weight: 600; line-height: 1.10; letter-spacing: 0; }
.t-section { font-family: var(--font-display); font-size: 34px; font-weight: 600; line-height: 1.47; letter-spacing: -0.374px; }
.t-lead    { font-size: 28px; font-weight: 400; line-height: 1.14; letter-spacing: 0.196px; }
.t-airy    { font-size: 24px; font-weight: 300; line-height: 1.5; letter-spacing: 0; }
.t-tagline { font-size: 21px; font-weight: 600; line-height: 1.19; letter-spacing: 0.231px; }
.t-strong  { font-size: 17px; font-weight: 600; line-height: 1.24; letter-spacing: -0.374px; }
.t-caption { font-size: 14px; font-weight: 400; line-height: 1.43; letter-spacing: -0.224px; }
.t-caption-strong { font-size: 14px; font-weight: 600; line-height: 1.29; letter-spacing: -0.224px; }
.t-fine    { font-size: 12px; font-weight: 400; line-height: 1.4; letter-spacing: -0.12px; }

/* ---------- Global nav — 44px, true black ---------- */
.global-nav {
  background: var(--surface-black);
  height: 44px;
  position: sticky; top: 0; z-index: 50;
}
.global-nav__inner {
  max-width: 1440px; margin: 0 auto; height: 100%;
  padding: 0 var(--lg);
  display: flex; align-items: center; gap: 20px;
}
.global-nav a {
  color: var(--body-on-dark);
  font-size: 12px; font-weight: 400; line-height: 1; letter-spacing: -0.12px;
  text-decoration: none; opacity: 0.88;
}
.global-nav a:hover { opacity: 1; }
.global-nav__brand { font-weight: 600; }
.global-nav__spacer { margin-left: auto; }

/* ---------- Sub-nav — frosted parchment ---------- */
.sub-nav {
  position: sticky; top: 44px; z-index: 49;
  height: 52px;
  background: rgba(245, 245, 247, 0.8);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.sub-nav__inner {
  max-width: 1440px; margin: 0 auto; height: 100%;
  padding: 0 var(--lg);
  display: flex; align-items: center; gap: var(--lg);
}
.sub-nav__name {
  display: flex; align-items: center; gap: 10px;
  font-family: "Saira", var(--font-display); font-style: italic;
  font-size: 21px; font-weight: 700; line-height: 1.19; letter-spacing: 0;
  text-decoration: none; color: var(--ink);
}
.sub-nav__name .mark { flex: none; }
.sub-nav__links { margin-left: auto; display: flex; align-items: center; gap: var(--lg); }
.sub-nav__links a {
  font-size: 14px; font-weight: 400; line-height: 1.29; letter-spacing: -0.224px;
  text-decoration: none; color: var(--ink); opacity: 0.85;
}
.sub-nav__links a:hover { opacity: 1; }
.sub-nav__links a[aria-current="page"] { opacity: 1; font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; text-decoration: none; text-align: center;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.1s ease;
}
.btn:active { transform: scale(0.95); }
.btn:focus-visible { outline: 2px solid var(--primary-focus); outline-offset: 2px; }

.btn--primary {
  background: var(--primary); color: var(--on-primary);
  font-size: 17px; font-weight: 400; line-height: 1.47; letter-spacing: -0.374px;
  border-radius: var(--r-pill); padding: 11px 22px;
}
.btn--secondary {
  background: transparent; color: var(--primary-deep); border-color: var(--primary-border);
  font-size: 17px; font-weight: 400; line-height: 1.47; letter-spacing: -0.374px;
  border-radius: var(--r-pill); padding: 11px 22px;
}
.btn--secondary-on-dark {
  background: transparent; color: var(--primary-on-dark); border-color: var(--primary-on-dark);
  font-size: 17px; font-weight: 400; line-height: 1.47; letter-spacing: -0.374px;
  border-radius: var(--r-pill); padding: 11px 22px;
}
.btn--large {
  background: var(--primary); color: var(--on-primary);
  font-size: 18px; font-weight: 300; line-height: 1; letter-spacing: 0;
  border-radius: var(--r-pill); padding: 14px 28px;
}
.btn--dark-utility {
  background: var(--ink); color: var(--body-on-dark);
  font-size: 14px; font-weight: 400; line-height: 1.29; letter-spacing: -0.224px;
  border-radius: var(--r-sm); padding: 8px 15px;
}
.btn--pearl {
  background: var(--surface-pearl); color: var(--ink-muted-80);
  font-size: 14px; font-weight: 400; line-height: 1.43; letter-spacing: -0.224px;
  border: 3px solid var(--divider-soft);
  border-radius: var(--r-md); padding: 8px 14px;
}
.btn--nav {
  background: var(--primary); color: var(--on-primary);
  font-size: 14px; font-weight: 400; line-height: 1.29; letter-spacing: -0.224px;
  border-radius: var(--r-pill); padding: 6px 16px;
}

/* Links */
.link { color: var(--primary-deep); text-decoration: none; }
.link:hover { text-decoration: underline; }
.link-on-dark { color: var(--primary-on-dark); text-decoration: none; }
.link-on-dark:hover { text-decoration: underline; }

/* ---------- Tiles — full bleed, radius 0, color change is the divider ---------- */
.tile { padding: var(--section) var(--lg); border-radius: var(--r-none); }
.tile__inner { max-width: 1440px; margin: 0 auto; text-align: center; }
.tile__inner--prose { max-width: 980px; text-align: left; }

.tile--light { background: var(--canvas); color: var(--ink); }
.tile--parchment { background: var(--canvas-parchment); color: var(--ink); }
.tile--dark { background: var(--surface-tile-1); color: var(--body-on-dark); }
.tile--dark-2 { background: var(--surface-tile-2); color: var(--body-on-dark); }
.tile--dark-3 { background: var(--surface-tile-3); color: var(--body-on-dark); }

.tile--dark .t-lead,
.tile--dark-2 .t-lead,
.tile--dark-3 .t-lead { color: var(--body-muted); }

/* Centered stack rhythm: headline → tagline → CTAs */
.tile__inner > .t-hero,
.tile__inner > .t-display { margin-bottom: var(--md); }
.stack-lead { max-width: 26ch; margin: 0 auto var(--xl); }
.tile__inner--prose .stack-lead { margin-left: 0; max-width: 46ch; }
.actions { display: flex; gap: var(--lg); justify-content: center; flex-wrap: wrap; }
.tile__inner--prose .actions { justify-content: flex-start; }

/* ---------- Portrait — the only shadow in the system ---------- */
.portrait { margin: var(--xxl) auto 0; max-width: 720px; }
.portrait img { box-shadow: var(--shadow-product); border-radius: var(--r-none); }
.portrait--inline { margin: 0 0 var(--xl); max-width: 560px; }
.portrait--inline img { border-radius: var(--r-lg); }


/* ---------- Photo band — large centered portrait dissolving into the tiles ---------- */
.photo-band {
  margin: 0;
  width: 100%;
  display: flex; justify-content: center;
  /* ground matches the white tile above and the parchment tile below,
     so the masked portrait dissolves into both */
  background: linear-gradient(to bottom,
    var(--canvas) 0%,
    var(--canvas) 22%,
    var(--canvas-parchment) 80%,
    var(--canvas-parchment) 100%);
}
.photo-band img {
  width: 100%;
  max-width: 1120px;
  height: auto;
  border-radius: var(--r-none);
  box-shadow: none;
  /* dissolve on every edge — top and bottom into the tiles, sides into the page */
  -webkit-mask-image:
    linear-gradient(to bottom, transparent 0%, #000 26%, #000 62%, transparent 99%),
    linear-gradient(to right, transparent 0%, #000 22%, #000 78%, transparent 100%);
  mask-image:
    linear-gradient(to bottom, transparent 0%, #000 26%, #000 62%, transparent 99%),
    linear-gradient(to right, transparent 0%, #000 22%, #000 78%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
/* the mask already supplies the air — don't double it with tile padding */
.photo-band + .tile { padding-top: var(--xs); }

/* ---------- Proof row — quiet caption band ---------- */
.proof {
  list-style: none; padding: 0;
  margin: var(--xl) auto 0;
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: var(--xs) var(--lg);
  font-size: 14px; font-weight: 400; line-height: 1.43; letter-spacing: -0.224px;
  color: var(--ink-muted-48);
}
.tile--dark .proof, .tile--dark-2 .proof, .tile--dark-3 .proof { color: var(--body-muted); }

/* ---------- Utility card grid ---------- */
.grid {
  list-style: none; padding: 0;
  margin: var(--xxl) auto 0;
  display: grid; gap: var(--lg);
  text-align: left;
}
@media (min-width: 835px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1069px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--lg);
  /* no shadow — shadow belongs to photography */
}
.card__meta {
  display: flex; flex-wrap: wrap; gap: var(--xxs) var(--sm);
  font-size: 12px; font-weight: 400; line-height: 1.4; letter-spacing: -0.12px;
  color: var(--ink-muted-48);
  margin-bottom: var(--sm);
}
.card__meta .status { color: var(--primary-deep); font-weight: 600; }
.card h3 { font-size: 21px; font-weight: 600; line-height: 1.19; letter-spacing: 0.231px; margin-bottom: var(--xs); }
.card h3 a { text-decoration: none; }
.card h3 a:hover { color: var(--primary-deep); }
.card p { margin-top: var(--xs); }
.card .aud { color: var(--ink-muted-48); font-size: 14px; line-height: 1.43; letter-spacing: -0.224px; }
.card .ev { margin-top: var(--md); font-size: 14px; line-height: 1.43; letter-spacing: -0.224px; }

/* ---------- Prose ---------- */
.prose { max-width: 62ch; }
.prose p { margin-top: var(--md); }
.prose h2 { font-family: var(--font-display); font-size: 34px; font-weight: 600; line-height: 1.47; letter-spacing: -0.374px; margin-top: var(--xxl); }
.prose ul { margin-top: var(--md); padding-left: var(--lg); }
.prose li { margin-top: var(--xs); }
.prose--centered {
  margin-left: auto; margin-right: auto;
  text-align: center;
  max-width: 58ch;
}
/* markers read badly on centred text — drop them and let the spacing carry the list */
.prose--centered ul { list-style: none; padding-left: 0; }
.prose--centered li { margin-top: var(--md); }

.fine { font-size: 12px; line-height: 1.4; letter-spacing: -0.12px; color: var(--ink-muted-48); }

/* ---------- Definition rows ---------- */
.rows { margin-top: var(--lg); max-width: 780px; }
.rows > div {
  display: flex; gap: var(--lg);
  padding: var(--md) 0;
  border-bottom: 1px solid var(--hairline);
}
.rows dt {
  font-size: 14px; font-weight: 600; line-height: 1.29; letter-spacing: -0.224px;
  color: var(--ink-muted-48);
  width: 150px; flex-shrink: 0;
}
.rows dd { margin: 0; }

/* ---------- Footer — parchment, deliberately dense ---------- */
.footer {
  background: var(--canvas-parchment);
  color: var(--ink-muted-80);
  padding: 64px var(--lg);
}
.footer__inner { max-width: 1440px; margin: 0 auto; }
.footer__cols { display: grid; gap: var(--xl); }
@media (min-width: 735px) { .footer__cols { grid-template-columns: repeat(3, 1fr); } }
.footer h4 {
  font-size: 14px; font-weight: 600; line-height: 1.29; letter-spacing: -0.224px;
  color: var(--ink); margin-bottom: var(--xxs);
}
.footer ul { list-style: none; padding: 0; }
.footer li a {
  /* dense-link: 17 / 400 / 2.41 — the relaxed leading is what makes dense columns scannable */
  font-size: 17px; font-weight: 400; line-height: 2.41; letter-spacing: 0;
  text-decoration: none; color: var(--ink-muted-80);
}
.footer li a:hover { color: var(--primary-deep); }
.footer__legal {
  margin-top: var(--xl); padding-top: var(--lg);
  border-top: 1px solid var(--hairline);
  font-size: 12px; font-weight: 400; line-height: 1.4; letter-spacing: -0.12px;
  color: var(--ink-muted-48);
}

/* ---------- Responsive — hero ladder 56 → 40 → 34 → 28 ---------- */
@media (max-width: 1068px) {
  .t-hero { font-size: 40px; }
  .t-display { font-size: 34px; }
}
@media (max-width: 833px) {
  .sub-nav__links { gap: var(--md); }
}
@media (max-width: 640px) {
  .t-hero { font-size: 34px; }
  .t-display { font-size: 28px; }
  .t-lead { font-size: 21px; }
  .tile { padding: var(--xxl) var(--md); }
  .global-nav__inner, .sub-nav__inner { padding: 0 var(--md); }
  .sub-nav__links a:not(.btn) { display: none; }
}
@media (max-width: 419px) {
  .t-hero { font-size: 28px; }
}

/* ---------- Motion: Single Frame hero + Receipt Reveal (reduced-motion off = static) ---------- */
.hero { position: relative; overflow: hidden; }
.hero-shutter { display: none; }
.hero-frame {
  position: absolute; inset: 28px; border: 1.5px solid rgba(29, 29, 31, 0.3);
  border-radius: 14px; pointer-events: none;
}
.hero-frame i {
  position: absolute; top: 14px; right: 16px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--primary);
}
.card .status .tick {
  display: inline-block; width: 13px; height: 13px; border-radius: 50%;
  background: var(--primary); position: relative; vertical-align: -2px; margin-right: 5px;
}
.card .status .tick::after {
  content: ""; position: absolute; left: 4px; top: 2.5px; width: 3.5px; height: 6.5px;
  border: solid var(--ink); border-width: 0 1.6px 1.6px 0; transform: rotate(40deg);
}
@media (prefers-reduced-motion: no-preference) {
  html.js .hero-shutter {
    display: block; position: absolute; inset: 0; z-index: 5;
    background: var(--ink); transform-origin: top;
    animation: mv-shutter 0.7s cubic-bezier(0.7, 0, 0.2, 1) forwards 0.15s;
  }
  html.js .hero-frame { animation: mv-framedrift 9s ease-in-out infinite alternate; }
  html.js .hero-frame i { animation: mv-recpulse 2.4s ease-in-out infinite; }
  html.js .reveal { opacity: 0; transform: translateY(36px); }
  html.js .reveal.in { animation: mv-rise 0.65s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; animation-delay: calc(var(--i, 0) * 0.12s); }
  html.js .card .status .tick { transform: scale(0); }
  html.js .reveal.in .status .tick { animation: mv-tickpop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; animation-delay: calc(0.6s + var(--i, 0) * 0.12s); }
}
@keyframes mv-shutter { to { transform: scaleY(0); visibility: hidden; } }
@keyframes mv-framedrift { from { transform: scale(1); } to { transform: scale(1.02) translateY(-4px); } }
@keyframes mv-recpulse { 0%, 100% { opacity: 0.9; } 50% { opacity: 0.25; } }
@keyframes mv-rise { to { opacity: 1; transform: none; } }
@keyframes mv-tickpop { 60% { transform: scale(1.3); } 100% { transform: scale(1); } }
