/* ==========================================================================
   jorgemartin.design — shared styles
   Sections: 1 Fonts · 2 Tokens · 3 Base · 4 Layout · 5 Header · 6 Footer
             7 Components · 8 Home · 9 Latest work · 10 About · 11 Blog
             12 Contact · 13 Case studies & articles · 14 Responsive
   ========================================================================== */

/* 1. Fonts --------------------------------------------------------------- */
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/Inter-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/Inter-Variable-Italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../assets/fonts/InstrumentSerif-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Fragment Mono";
  src: url("../assets/fonts/FragmentMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* 2. Tokens -------------------------------------------------------------- */
:root {
  --bg: #000;
  --surface: #04070d;
  --card: #1c1c1e;
  --text: #fff;
  --text-2: rgba(255, 255, 255, 0.65);
  --text-3: rgba(255, 255, 255, 0.25);
  --heading: #d5dbe6;
  --line: rgba(255, 255, 255, 0.25);
  --line-soft: rgba(255, 255, 255, 0.1);
  --border-card: rgba(216, 231, 242, 0.07);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-mono: "Fragment Mono", ui-monospace, Menlo, monospace;

  --content: 1200px;
  --gutter: 120px;
  --section-gap: 220px;
  --header-h: 84px;
}

/* 3. Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: -0.4px;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 4px; }
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; }
.muted { color: var(--text-2); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* 4. Layout -------------------------------------------------------------- */
.page {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
  width: min(var(--content), 100% - 2 * var(--gutter));
  margin: 0 auto;
  padding-top: 92px;
}
.full-bleed { width: 100vw; margin-left: calc(50% - 50vw); }

.page-title {
  position: relative;
  font-size: clamp(56px, 7.2vw, 104px);
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: -0.04em;
}
/* small "aim" ornament: a ring sitting on a short line, right edge */
.aim { position: relative; }
.aim::before, .aim::after { content: ""; position: absolute; pointer-events: none; }
.aim::before {
  right: -36px; bottom: 0; width: 72px; height: 1px;
  background: var(--line);
}
.aim::after {
  right: -12px; bottom: -12px; width: 24px; height: 24px;
  border: 1px solid var(--line); border-radius: 50%;
}

/* label + hairline used above sections ("Stack ———") */
.tagline {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; line-height: 1.4; font-weight: 300; letter-spacing: 0;
  color: var(--accent, var(--text-2));
}
.tagline::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: 0.4; }
.tagline--reverse::after { order: -1; }

/* 5. Header -------------------------------------------------------------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  background: rgba(10, 12, 18, 0.35);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  backdrop-filter: blur(14px) saturate(180%);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 36px;
  width: min(var(--content), 100% - 2 * var(--gutter));
  height: 100%;
  margin: 0 auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}
/* scroll progress, driven by js/main.js */
.site-header__progress {
  position: absolute; left: 0; bottom: -1px; height: 1px; width: 100%;
  background: #fff; transform-origin: left; transform: scaleX(0);
}
.brand { display: flex; align-items: center; gap: 16px; font-size: 18px; line-height: 1.75; }
.brand img { width: 35px; height: 35px; }
.nav { display: flex; align-items: center; gap: 48px; }
.nav a { color: var(--text-2); transition: color 0.2s; }
.nav a:hover, .nav a[aria-current="page"] { color: #fff; }
.nav-toggle { display: none; }

/* 6. Footer -------------------------------------------------------------- */
.site-footer {
  width: min(var(--content), 100% - 2 * var(--gutter));
  margin: var(--section-gap) auto 0;
  padding: 120px 0;
}
.site-footer__row {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
}
.site-footer .nav { gap: 36px; }
.socials { display: flex; justify-content: flex-end; gap: 24px; }
.icon {
  display: block; width: 24px; height: 24px;
  background: var(--text-3);
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
  transition: background 0.2s;
}
a:hover > .icon { background: #fff; }
.icon--linkedin { --icon: url("../assets/icons/linkedin.svg"); }
.icon--dribbble { --icon: url("../assets/icons/dribbble.svg"); }
.icon--medium { --icon: url("../assets/icons/medium.svg"); }
.icon--vimeo { --icon: url("../assets/icons/vimeo.svg"); }
.site-footer__legal {
  margin-top: 48px; padding: 8px;
  border-top: 1px solid var(--text-2);
  display: flex; flex-direction: column; gap: 12px;
  text-align: right; font-size: 12px; line-height: 1.4; font-weight: 300; letter-spacing: 0;
  color: var(--text-2);
}

/* 7. Components ---------------------------------------------------------- */
/* Button */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 300px; max-width: 100%; height: 60px; padding: 16px 24px 16px 36px;
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 8px;
  background: var(--surface);
  color: #fff; font-size: 16px; line-height: 28px;
  transition: border-color 0.2s;
}
.btn::before { /* glow along the bottom edge */
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(41% 25% at 50% 100%, #fff 0%, rgba(255, 255, 255, 0) 100%);
  opacity: 0.22; transition: opacity 0.3s;
}
.btn:hover::before, .btn:focus-visible::before, .btn:active::before { opacity: 1; }
.btn:hover, .btn:focus-visible, .btn:active { border-color: #fff; }
.btn > * { position: relative; }
.btn svg {
  width: 22px; height: 22px; fill: currentColor;
  opacity: 0; transform: translateX(-4px);
  transition: opacity 0.2s, transform 0.2s;
}
.btn:hover svg, .btn:focus-visible svg, .btn:active svg { opacity: 1; transform: none; }
.btn--block { width: 100%; }

/* Call to action block (bottom of every page) */
.cta { position: relative; display: flex; flex-direction: column; align-items: center; gap: 94px; text-align: center; }
.cta::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: 50%;
  width: 885px; max-width: 100vw; height: 665px; transform: translate(-50%, -50%);
  background: radial-gradient(50% 50%, rgba(213, 219, 230, 0.7) 0%, rgba(4, 7, 13, 0) 100%);
  opacity: 0.1; pointer-events: none;
}
.cta h2, .display {
  font-size: clamp(30px, 3.1vw, 44px); line-height: 1.2; font-weight: 500; letter-spacing: 0;
}
.cta__tag { margin-top: 16px; font-style: italic; color: var(--text-2); }
.cta__action { position: relative; width: 100%; display: flex; justify-content: center; }

/* Project card (home = large, latest work = compact) */
.project-card {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 1200 / 720; border-radius: 8px;
  background: var(--card);
  box-shadow: 0 -48px 66px rgba(0, 0, 0, 0.25);
}
.project-card__media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.project-card:hover .project-card__media { transform: scale(1.02); }
.project-card__tag {
  position: absolute; top: 24px; right: 24px;
  padding: 2px 12px; border-radius: 20px; background: rgba(0, 0, 0, 0.25);
  font-size: 14px; line-height: 1.4; font-weight: 300; letter-spacing: 0;
}
.project-card__body {
  position: absolute; inset: auto 0 0 0;
  padding: 40px 24px 24px;
  background: linear-gradient(rgba(30, 30, 30, 0) 0%, rgb(20, 20, 20) 39%);
}
.project-card__head { display: flex; align-items: center; gap: 16px; }
.project-card__text { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.project-card__title { font-size: 30px; line-height: 1.05; font-weight: 700; letter-spacing: -0.9px; }
.project-card__subtitle { font-size: 18px; line-height: 1.25; font-weight: 500; letter-spacing: -0.36px; }
.project-card__desc { font-size: 15px; line-height: 1.4; letter-spacing: -0.3px; color: var(--text-2); }
.project-card__arrow { width: 44px; height: 44px; fill: #fff; flex: none; transition: transform 0.3s; }
.project-card:hover .project-card__arrow { transform: translateX(6px); }
.project-card__stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  margin-top: 12px; padding-top: 22px; border-top: 1px solid var(--line-soft);
}
.stat { display: flex; align-items: baseline; gap: 12px; }
.stat__value { font-size: 17px; line-height: 1.1; font-weight: 700; letter-spacing: -0.34px; color: var(--accent, #fff); }
.stat__label { font-size: 14px; line-height: 1.2; font-weight: 500; letter-spacing: -0.28px; }

.project-card--compact { aspect-ratio: 381 / 540; }
.project-card--compact .project-card__title { font-size: 20px; line-height: 1.4; letter-spacing: 0; }
.project-card--compact .project-card__arrow { width: 32px; height: 32px; }

/* 8. Home ---------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  min-height: min(100vh, 900px); height: 100vh; max-height: 1100px;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 44px;
  padding: 160px 40px 40px;
  margin-top: -92px; /* sits under the fixed header */
  isolation: isolate;
}
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.35) 40%, rgba(0, 0, 0, 0) 70%); }
.hero__video { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.hero h1 {
  max-width: 1224px; text-align: center;
  font-size: clamp(30px, 3.1vw, 44px); line-height: 1.2; font-weight: 500; letter-spacing: 0;
  color: #fff;
}
.hero__scroll { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 7px; font-size: 16px; line-height: 1.6; letter-spacing: -0.32px; }
.hero__scroll svg { width: 25px; height: 25px; fill: var(--text-2); animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(5px); } }

.project-stack { display: flex; flex-direction: column; gap: 240px; }
.project-stack > li { position: sticky; top: calc(var(--header-h) + 24px); }

.intro { display: flex; flex-direction: column; align-items: center; gap: 44px; text-align: center; scroll-margin-top: 140px; }

.reviews { display: flex; flex-direction: column; align-items: center; gap: 94px; }
.reviews__head { max-width: 640px; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.reviews__head p { color: var(--text-2); }
.reviews__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; width: 100%; }
.review {
  position: relative; overflow: hidden;
  border: 1px solid var(--border-card); border-radius: 16px; background: var(--surface);
}
.review::before { /* soft light from the top-right corner */
  content: ""; position: absolute; top: 0; right: 0; width: 437px; height: 306px;
  background: radial-gradient(50% 50% at 93.7% 8.1%, rgba(184, 199, 217, 0.5) 0%, rgba(4, 7, 13, 0) 100%);
  opacity: 0.1; pointer-events: none;
}
.review__who { display: flex; align-items: center; gap: 15px; padding: 15px; }
.review__avatar {
  flex: none; width: 50px; height: 50px; margin: 4px; border-radius: 8px; object-fit: cover;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.12) 0 6px, rgba(255,255,255,.04) 6px 12px);
}
.review__name { line-height: 28px; }
.review__role { font-size: 12px; line-height: 1.3; letter-spacing: 0; color: var(--text-2); }
.review__quote { padding: 24px; }

.clients { width: min(1100px, 100%); overflow: hidden; padding: 10px;
  -webkit-mask: linear-gradient(90deg, transparent, #000 12.5%, #000 87.5%, transparent);
  mask: linear-gradient(90deg, transparent, #000 12.5%, #000 87.5%, transparent); }
.clients__track { display: flex; width: max-content; gap: 160px; padding-right: 160px; align-items: center; animation: marquee 30s linear infinite; }
.clients__track img { height: 40px; width: auto; }
.clients:hover .clients__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* 9. Latest work ---------------------------------------------------------- */
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 44px; }

/* 10. About --------------------------------------------------------------- */
.lead {
  font-size: clamp(30px, 3.1vw, 44px); line-height: 1.2; font-weight: 500; letter-spacing: 0;
  text-align: center; color: #e4e9f2;
}
/* Content pages (non-case-study): tighter above-the-fold */
main.page:has(.lead),
main.page:has(.contact-grid),
main.page:has(.work-grid),
main.page:has(.post-feature) { padding-top: 128px; gap: 96px; }

main.page:has(.lead) .page-title,
main.page:has(.contact-grid) .page-title,
main.page:has(.work-grid) .page-title,
main.page:has(.post-feature) .page-title { font-size: clamp(44px, 5vw, 72px); }
.prose-block { display: flex; flex-direction: column; gap: 24px; }
.prose-block p { font-size: 18px; line-height: 1.75; }
.about-image img { width: 100%; height: auto; }

.stack { display: flex; flex-direction: column; gap: 80px; }
.stack__grid { display: grid; grid-template-columns: repeat(3, 300px); justify-content: space-between; gap: 80px 0; }
.tool { display: flex; flex-direction: column; gap: 28px; padding-bottom: 0; }
.tool img { width: 75px; height: 75px; object-fit: cover; border-radius: 4px; opacity: 0.5; }
.tool__name { font-size: 18px; line-height: 1.75; }
.tool__kind { font-size: 14px; line-height: 1.4; font-weight: 300; letter-spacing: 0; color: var(--text-2); }

.list-section { display: flex; flex-direction: column; gap: 44px; }
.award, .cert {
  display: grid; align-items: start; column-gap: 0;
  padding-bottom: 36px; border-bottom: 1px solid var(--line);
}
.award { grid-template-columns: 450px 450px 1fr; }
.award h3 { font-size: 32px; line-height: 1.75; font-weight: 400; letter-spacing: -0.3px; }
.award__title { max-width: 300px; }
.award p, .cert p { color: var(--text-2); }
.cert { grid-template-columns: 257px 600px 1fr; padding-bottom: 44px; }
.cert h3 { font-size: 22px; line-height: 1.4; font-weight: 400; letter-spacing: 0; }

/* 11. Blog ---------------------------------------------------------------- */
.post-feature { display: grid; grid-template-columns: 3fr 1fr; gap: 16px 0; }
.post-feature img { width: 100%; aspect-ratio: 900 / 595; object-fit: cover; border-radius: 2px; }
.post-feature .tagline { align-self: start; padding-left: 16px; }
.post-feature__text { grid-column: 1 / -1; }
.post-title { font-size: 32px; line-height: 1.75; font-weight: 400; letter-spacing: -0.3px; color: var(--text-2); transition: color 0.2s; }
a:hover .post-title { color: #fff; }
.post-date { color: var(--text-3); }
.post-row { display: grid; grid-template-columns: 450px 1fr; gap: 0 150px; }
.post-row img { width: 100%; aspect-ratio: 450 / 333; object-fit: cover; border-radius: 2px; }
.post-list { display: flex; flex-direction: column; gap: 60px; }

/* 12. Contact ------------------------------------------------------------- */
.contact-intro { max-width: 900px; margin: 0 auto; font-size: clamp(22px, 2.3vw, 32px); line-height: 1.75; font-weight: 400; letter-spacing: -0.3px; }
.contact-grid { display: flex; justify-content: space-between; align-items: flex-start; gap: 60px; }
.form-card {
  position: relative; overflow: hidden;
  flex: 0 1 632px; display: flex; flex-direction: column; gap: 20px; padding: 32px;
  border: 1px solid var(--border-card); border-radius: 16px; background: var(--surface);
}
.form-card::before {
  content: ""; position: absolute; top: 0; right: 0; width: 437px; height: 306px;
  background: radial-gradient(50% 50% at 93.7% 8.1%, rgba(184, 199, 217, 0.5) 0%, rgba(4, 7, 13, 0) 100%);
  opacity: 0.1; pointer-events: none;
}
.field { position: relative; display: flex; flex-direction: column; gap: 4px; }
.field span { font-size: 14px; line-height: 22px; font-weight: 500; letter-spacing: -0.14px; }
.field input, .field textarea {
  width: 100%; padding: 12px; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 8px;
  background: rgba(0, 0, 0, 0.5); color: rgba(255, 255, 255, 0.92);
  font: 14px/24px var(--font-sans);
}
.field textarea { min-height: 100px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: rgba(255, 255, 255, 0.45); }
.field input:focus, .field textarea:focus { outline: none; border-color: #fff; box-shadow: inset 0 0 0 1px #fff; }
.form-status { font-size: 14px; line-height: 22px; text-align: center; color: var(--text-2); }
.form-status[data-state="success"] { color: #53caf5; }
.form-status[data-state="error"] { color: #ff7a93; }
.form-card button[disabled] { opacity: 0.6; cursor: progress; }
.social-list { flex: 0 0 379px; display: flex; flex-direction: column; gap: 48px; }
.social-item { display: flex; align-items: center; gap: 24px; }
.social-item__icon { flex: none; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 4px; background: var(--surface); border: 1px solid var(--border-card); }
.social-item__icon .icon { width: 36px; height: 36px; background: var(--text-2); }
.social-item__name { font-size: 18px; line-height: 1.75; color: var(--text-2); transition: color 0.2s; }
.social-item:hover .social-item__name { color: #fff; }
.social-item:hover .icon { background: #fff; }
.social-item__handle { font-size: 14px; line-height: 1.4; font-weight: 300; letter-spacing: 0; color: var(--text-3); }

/* Contact-specific: even tighter since it's only 3 blocks */
main.page:has(.contact-grid) { gap: 40px; }
main.page:has(.contact-grid) .contact-intro { max-width: 632px; margin: 0; text-align: left; font-size: clamp(18px, 1.8vw, 24px); line-height: 1.5; }
main.page:has(.contact-grid) .social-list { flex: 0 0 auto; gap: 36px; }

/* 13. Case studies & articles ---------------------------------------------- */
/* Two columns: long-form text plus a sticky list of facts. Add --flip to put the facts on the left. */
.case-section { display: grid; grid-template-columns: minmax(0, 720px) minmax(0, 360px); justify-content: space-between; align-items: start; gap: 48px; }
.case-section--flip { grid-template-columns: minmax(0, 360px) minmax(0, 720px); }
.case-section--flip .facts { order: -1; }

.facts { position: sticky; top: calc(var(--header-h) + 40px); display: flex; flex-direction: column; gap: 36px; color: var(--accent, var(--text-2)); }
.facts dt { display: flex; align-items: center; gap: 10px; font-size: 14px; line-height: 1.4; font-weight: 300; letter-spacing: 0; }
.facts dt::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: 0.25; }
.facts dd { margin: 10px 0 0; font-size: 18px; line-height: 1.75; }

.prose > * { margin-top: 20px; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: clamp(38px, 4.5vw, 64px); line-height: 1.35; font-weight: 500; letter-spacing: -0.042em; }
.prose h3 { margin-top: 48px; font-size: clamp(24px, 2.3vw, 32px); line-height: 1.75; font-weight: 400; letter-spacing: -0.3px; }
.prose h5 { margin-top: 40px; font-size: 22px; line-height: 1.4; font-weight: 400; letter-spacing: 0; }
.prose h6 { margin-top: 40px; font-size: 18px; line-height: 1.4; font-weight: 600; letter-spacing: -0.36px; }
.prose * + h2 { margin-top: 32px; }
.prose p, .prose li { font-size: 18px; line-height: 1.75; color: var(--text-2); }
.prose strong { color: #fff; font-weight: 600; }
.prose a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { margin-top: 48px; padding-left: 23px; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li::marker { color: var(--text-2); }
.prose ul + p, .prose ol + p { margin-top: 20px; }
.prose blockquote { padding-left: 22px; }
.prose blockquote p { font-size: 16px; line-height: 1.8; font-style: italic; color: #999; }
.prose figure, .gallery figure { margin-top: 48px; }
.prose figure img, .prose figure video, .gallery img { width: 100%; height: auto; }
figcaption { margin-top: 8px; font-size: 13px; line-height: 1.2; font-style: italic; letter-spacing: 0; color: #aaa; }
.prose pre.flow {
  margin-top: 48px; padding: 30px 24px; overflow-x: auto;
  border-radius: 15px; background: #161820;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.6; letter-spacing: 0; color: var(--heading);
}
.table-wrap { margin-top: 48px; overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.6; letter-spacing: 0; color: var(--text-2); }
.prose th, .prose td { padding: 10px; border: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.prose th { background: rgba(153, 153, 153, 0.1); color: #fff; font-weight: 700; }

/* Live embed (iframe) */
.embed { aspect-ratio: 1200 / 682; overflow: hidden; border-radius: 12px; border: 1px solid var(--border-card); background: var(--surface); }
.embed iframe { width: 100%; height: 100%; border: 0; }

/* Numbered full-width images */
.gallery { display: flex; flex-direction: column; gap: 180px; margin-inline: -60px; }
.gallery figure { margin: 0; }
.gallery__num { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 14px; line-height: 1.4; font-weight: 300; letter-spacing: 0; color: var(--tile, var(--text-2)); }
.gallery__num::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: 0.5; }
.gallery figcaption { font-size: 14px; line-height: 1.4; font-weight: 300; font-style: normal; color: var(--text-2); }

.device-video { display: flex; flex-direction: column; align-items: center; gap: 18px; margin: 0; }
.device-video video { width: 360px; max-width: 100%; height: auto; border-radius: 12px; }
.device-video figcaption { margin: 0; font-size: 16px; color: #fff; }

/* "see also" links */
.see-also { display: flex; flex-direction: column; gap: 24px; }
.see-also__item { display: flex; align-items: center; min-height: 100px; border-radius: 2px; background: var(--tile, #111112); transition: filter 0.2s; }
.see-also__item:hover { filter: brightness(1.15); }
.see-also__thumb { flex: none; width: 300px; height: 100px; padding: 8px; }
.see-also__thumb > * { width: 100%; height: 100%; object-fit: cover; }
.see-also__text { flex: 1; padding: 16px; }
.see-also__tag { font-size: 14px; line-height: 1.4; font-weight: 300; letter-spacing: 0; }
.see-also__title { font-size: 32px; line-height: 1.75; font-weight: 400; letter-spacing: -0.3px; }
.see-also__arrow { flex: none; width: 48px; height: 48px; margin-right: 0; fill: #fff; }

/* Blog article */
.post-hero img { width: 100%; aspect-ratio: 1200 / 675; object-fit: cover; border-radius: 2px; }
.article { display: grid; grid-template-columns: minmax(0, 750px) minmax(0, 300px); justify-content: space-between; align-items: start; gap: 48px; }
.post-next { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.post-next .post-title { max-width: 600px; }
.post-next svg { flex: none; width: 48px; height: 48px; fill: var(--text-2); }

/* Reveal on scroll (only active when js/main.js has run) */
.has-reveal [data-reveal] { opacity: 0; transform: translateY(40px); transition: opacity 0.7s ease, transform 0.7s ease; }
.has-reveal [data-reveal].is-visible { opacity: 1; transform: none; }

/* 14. Responsive ---------------------------------------------------------- */
/* Tablet */
@media (max-width: 1199px) {
  :root { --gutter: 40px; --section-gap: 140px; }
  .aim::before { right: -20px; width: 56px; }
  .aim::after { right: 4px; }
  .reviews__grid { grid-template-columns: repeat(2, 1fr); }
  .work-grid { gap: 24px; }
  .stack__grid { grid-template-columns: repeat(3, 1fr); gap: 64px 24px; }
  .award { grid-template-columns: 1fr 2fr 1fr; }
  .cert { grid-template-columns: 1fr 2.4fr 1fr; column-gap: 24px; }
  .post-row { gap: 0 48px; grid-template-columns: 2fr 3fr; }
  .gallery { margin-inline: -20px; gap: 120px; }
  .see-also__title { font-size: 26px; }
  .contact-grid { gap: 40px; }
  .social-list { flex-basis: 280px; }
  .project-stack { gap: 120px; }

  /* Content pages: scale trimmed above-the-fold down for tablet */
  main.page:has(.lead),
  main.page:has(.contact-grid),
  main.page:has(.work-grid),
  main.page:has(.post-feature) { padding-top: 96px; gap: 72px; }
  main.page:has(.contact-grid) { gap: 32px; }
}

/* Phone */
@media (max-width: 809px) {
  :root { --gutter: 20px; --section-gap: 100px; --header-h: 64px; }
  body { font-size: 15px; }
  .page { padding-top: 88px; }
  .aim::before, .aim::after { display: none; }

  /* Floating glass pill (top, iOS-style) */
  .site-header {
    inset: calc(env(safe-area-inset-top, 0px) + 10px) 12px auto 12px;
    height: auto;
    border-radius: 999px;
    background: rgba(20, 22, 30, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.18);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    backdrop-filter: blur(24px) saturate(200%);
    box-shadow:
      0 8px 24px rgba(0, 0, 0, 0.55),
      0 2px 6px rgba(0, 0, 0, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.4),
      inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    overflow: hidden;
  }
  .site-header::before {
    content: "";
    position: absolute; inset: 0 0 auto 0; height: 60%;
    border-radius: 999px 999px 0 0;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0));
    pointer-events: none;
  }
  .site-header__inner {
    width: 100%; padding: 6px; gap: 4px;
    border-bottom: none;
    position: relative; z-index: 1;
  }
  .site-header__progress { display: none; }
  .brand {
    padding: 12px; border-radius: 14px;
    transition: background 0.2s;
  }
  .brand span { display: none; }
  .brand img { width: 22px; height: 22px; }
  .nav-toggle { display: none; }
  .site-header .nav {
    display: flex; flex-direction: row; align-items: center; gap: 4px;
  }
  .site-header .nav a {
    font-size: 0; padding: 12px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-2); transition: color 0.2s, background 0.2s;
  }
  .site-header .nav a::before {
    content: ""; display: block; width: 22px; height: 22px;
    background: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
  }
  .site-header .nav a[href*="latest-work"] { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16'/><rect width='20' height='14' x='2' y='6' rx='2'/></svg>"); }
  .site-header .nav a[href*="about"]       { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2'/><circle cx='12' cy='7' r='4'/></svg>"); }
  .site-header .nav a[href*="blog"]        { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 7v14'/><path d='M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z'/></svg>"); }
  .site-header .nav a[href*="contact"]     { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect width='20' height='16' x='2' y='4' rx='2'/><path d='m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7'/></svg>"); }
  .site-header .nav a[aria-current="page"] { background: rgba(255, 255, 255, 0.14); color: #fff; }

  .hero { margin-top: 0; padding: 48px 20px 48px; }
  .project-stack { gap: 40px; }
  .project-stack > li { position: static; }
  .project-card { aspect-ratio: 3 / 4; }
  .project-card__title { font-size: 24px; }
  .project-card__subtitle { font-size: 16px; }
  .project-card__arrow { width: 32px; height: 32px; }
  .project-card__stats { grid-template-columns: 1fr; gap: 10px; }
  .project-card--compact { aspect-ratio: 4 / 5; }

  .cta { gap: 56px; }
  .reviews { gap: 56px; }
  .reviews__grid, .work-grid { grid-template-columns: 1fr; }
  .clients__track { gap: 72px; padding-right: 72px; }
  .clients__track img { height: 30px; }

  .prose-block p { font-size: 16px; }
  .stack { gap: 48px; }
  .stack__grid { grid-template-columns: repeat(2, 1fr); gap: 48px 16px; }
  .tool { gap: 16px; }
  .tool img { width: 56px; height: 56px; }
  .award, .cert { grid-template-columns: 1fr; row-gap: 4px; padding-bottom: 24px; }
  .award h3 { font-size: 24px; }
  .cert h3 { font-size: 18px; }

  .post-feature { grid-template-columns: 1fr; }
  .post-feature .tagline { padding-left: 0; order: -1; }
  .post-row { grid-template-columns: 1fr; gap: 16px; }
  .post-title { font-size: 24px; line-height: 1.4; }

  .case-section, .case-section--flip, .article { grid-template-columns: minmax(0, 1fr); gap: 56px; }
  .facts { position: static; gap: 24px; }
  .case-section--flip .facts { order: 0; }
  .prose p, .prose li { font-size: 16px; }
  .gallery { margin-inline: 0; gap: 72px; }
  .see-also__thumb { width: 110px; height: 84px; }
  .see-also__title { font-size: 22px; line-height: 1.4; }
  .see-also__arrow { width: 32px; height: 32px; margin-right: 8px; }
  .post-next svg { width: 32px; height: 32px; }

  .contact-grid { flex-direction: column; }
  .form-card { flex: none; width: 100%; padding: 20px; }
  .social-list { flex: none; gap: 28px; }

  /* Content pages: scale trimmed above-the-fold down for phone */
  main.page:has(.lead),
  main.page:has(.contact-grid),
  main.page:has(.work-grid),
  main.page:has(.post-feature) { padding-top: 80px; gap: 56px; }
  main.page:has(.contact-grid) { gap: 32px; }
  main.page:has(.contact-grid) .contact-intro { max-width: 100%; }

  .site-footer { padding: 72px 0 48px; }
  .site-footer__row { grid-template-columns: 1fr; gap: 28px; }
  .site-footer .nav { flex-wrap: wrap; gap: 20px 28px; }
  .socials { justify-content: flex-start; }
  .site-footer__legal { text-align: left; padding: 12px 0 0; }
}

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