/* clintgrounds.com — Direction C (Bento). Tokens mirror the Figma "Color" variables. */
@font-face { font-family: "DM Sans"; src: url("/assets/fonts/dm-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/assets/fonts/dm-sans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/assets/fonts/dm-sans-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg-page: #ffffff;
  --bg-subtle: #f4f4f1;
  --bg-muted: #e9e9e4;
  --bg-inverse: #0b0b0b;
  --text-primary: #0b0b0b;
  --text-secondary: #56565a;
  --text-inverse: #ffffff;
  --text-inverse-secondary: #b4b4b8;
  --border-default: #dcdcd6;
  --border-strong: #0b0b0b;
  --action-primary: #2340e8;
  --action-primary-hover: #1a2fb8;
  --action-tint: #e9edff;
  --action-on-inverse: #9caeff;
  --focus-ring: #2340e8;

  --page-pad: 24px;
  --gap: 16px;
  --card-pad: 36px;
  --card-radius: 24px;
  --sub-radius: 18px;
  --max: 1200px;

  --fs-display: clamp(2rem, 1.4rem + 2.1vw, 3.25rem);    /* 32 → 52 */
  --fs-h1: clamp(1.875rem, 1.35rem + 2vw, 3rem);         /* 30 → 48 */
  --fs-h2: clamp(1.625rem, 1.4rem + 0.7vw, 2rem);        /* 26 → 32 */
  --fs-h3: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem);    /* 18 → 20 */
  --fs-stat: clamp(1.875rem, 1.6rem + 0.9vw, 2.5rem);    /* 30 → 40 */
  --fs-lead: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);    /* 16 → 18 */
  --fs-body: 1rem;                                       /* 16 */
  --fs-small: 0.9375rem;                                 /* 15 */
  --fs-eyebrow: 0.8125rem;                               /* 13 */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 100px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg-subtle); color: var(--text-primary);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--fs-body); line-height: 1.55; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

a { color: var(--action-primary); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--action-primary-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 6px; }
.on-dark :focus-visible, .on-dark:focus-visible { outline-color: var(--action-on-inverse); }

.skip-link { position: absolute; left: 12px; top: -100px; z-index: 100; background: var(--bg-inverse); color: var(--text-inverse);
  padding: 12px 18px; border-radius: 999px; font-weight: 500; }
.skip-link:focus { top: 12px; color: var(--text-inverse); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Layout */
.page { max-width: var(--max); margin: 0 auto; padding: var(--page-pad); display: grid; gap: var(--gap); }
.card { background: var(--bg-page); border-radius: var(--card-radius); padding: var(--card-pad); }
.card--inverse { background: var(--bg-inverse); color: var(--text-inverse); }
.card--tint { background: var(--action-tint); }
.card--subtle { background: var(--bg-subtle); }
.card--sm { padding: 26px; border-radius: var(--sub-radius); }
.card--outline { background: var(--bg-page); border: 1px solid var(--border-default); }
.stack > * + * { margin-top: var(--stack, 24px); }
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 40px; align-items: start; }
.glance { display: grid; grid-template-columns: minmax(0, 400px) repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.article { padding-inline: max(var(--card-pad), calc((100% - 740px) / 2)); }
.measure { max-width: 60ch; }

/* Type */
.eyebrow { font-size: var(--fs-eyebrow); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.card--inverse .eyebrow { color: var(--text-inverse-secondary); }
.display { font-size: var(--fs-display); font-weight: 500; line-height: 1; letter-spacing: -0.04em; }
.h1 { font-size: var(--fs-h1); font-weight: 500; line-height: 1.02; letter-spacing: -0.04em; max-width: 18ch; }
.h2 { font-size: var(--fs-h2); font-weight: 500; line-height: 1.12; letter-spacing: -0.025em; max-width: 24ch; }
.h3 { font-size: var(--fs-h3); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }
.lead { font-size: var(--fs-lead); color: var(--text-secondary); line-height: 1.4; max-width: 46ch; }
.muted { color: var(--text-secondary); }
.card--inverse .muted { color: var(--text-inverse-secondary); }
.small { font-size: var(--fs-small); }
.stat { font-size: var(--fs-stat); font-weight: 500; line-height: 1; letter-spacing: -0.03em; }
.quote { font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.625rem); font-weight: 500; line-height: 1.3; letter-spacing: -0.01em; }
blockquote { margin: 0; }
.pullquote { border-left: 3px solid var(--border-strong); padding: 4px 0 4px 24px; }

/* Buttons & chips */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px;
  border-radius: 999px; font: inherit; font-size: 0.9375rem; font-weight: 500; line-height: 1.3; text-decoration: none; border: 0; cursor: pointer; }
.btn--primary { background: var(--action-primary); color: var(--text-inverse); }
.btn--primary:hover { background: var(--action-primary-hover); color: var(--text-inverse); }
.btn--secondary { background: var(--bg-subtle); color: var(--text-primary); }
.btn--secondary:hover { background: var(--bg-muted); color: var(--text-primary); }
.btn--inverse { background: var(--bg-page); color: var(--text-primary); }
.btn--inverse:hover { background: var(--bg-muted); color: var(--text-primary); }
.btn--ghost-inverse { background: transparent; color: var(--text-inverse); box-shadow: inset 0 0 0 1px var(--text-inverse-secondary); }
.btn--ghost-inverse:hover { color: var(--text-inverse); background: #222; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.text-link { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; font-weight: 500; font-size: 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--bg-subtle); font-size: 0.875rem; font-weight: 500; }
.chip--outline-inverse { background: transparent; box-shadow: inset 0 0 0 1px var(--text-inverse-secondary); color: var(--text-inverse); }
.chip--tint { background: var(--action-tint); }
.badge-num { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--bg-inverse); color: var(--text-inverse); font-weight: 700; font-size: 0.875rem; }
.lock { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9375rem; color: var(--text-secondary); }
.lock svg { flex: none; }

/* Header */
.header-wrap { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; padding-top: 12px; padding-bottom: 0; background: linear-gradient(var(--bg-subtle) 70%, transparent); }
.nav { box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 6px 20px -12px rgba(0,0,0,.25); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--bg-page);
  border-radius: 999px; padding: 10px 10px 10px 28px; box-shadow: 0 1px 0 rgba(0,0,0,.04); }
.wordmark { font-weight: 700; font-size: 1.1875rem; letter-spacing: -0.02em; color: var(--text-primary); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.wordmark:hover { color: var(--text-primary); }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a:not(.btn) { color: var(--text-primary); text-decoration: none; font-weight: 500; font-size: 0.9375rem; padding: 12px 14px; border-radius: 999px; }
.nav-links a:not(.btn):hover { background: var(--bg-subtle); }
.nav-links a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
.menu-toggle { display: none; }
.nav-drawer { display: contents; }
.drawer-head, .nav-backdrop { display: none; }

/* Projects */
.proj-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.project-card { position: relative; }
.project-card--grid { display: flex; flex-direction: column; padding: 14px; }
.project-card__body { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; padding: 24px 14px 14px; }
.proj-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.proj-logo { height: 28px; width: auto; max-width: 132px; object-fit: contain; }
.proj-lock { display: inline-flex; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 500; }
.proj-title { font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem); line-height: 1.2; letter-spacing: -0.015em; }
.proj-title--lg { font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem); }
.card-link { color: var(--text-primary); text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--card-radius); }
.card-link:hover { color: var(--text-primary); text-decoration: underline; text-decoration-thickness: 2px; }
.card-link:focus-visible { outline: none; }
.project-card:has(.card-link:focus-visible) { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.project-card:hover .proj-cta { text-decoration: underline; }
.proj-cta { display: inline-flex; align-items: center; gap: 8px; color: var(--action-primary); font-weight: 500; }
.proj-media img { object-position: top center; }
.media.proj-confidential { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  background: var(--bg-inverse); color: var(--text-inverse); padding: 24px; }
.proj-confidential svg { width: 24px; height: 28px; }
.proj-confidential p { font-weight: 500; }
.proj-confidential .small { color: var(--text-inverse-secondary); font-weight: 400; }

/* Media */
.media { background: var(--bg-muted); border-radius: var(--sub-radius); overflow: hidden; }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media--contain img { object-fit: contain; background: var(--bg-page); }
.media figcaption { padding: 12px 4px 0; font-size: 0.9375rem; color: var(--text-secondary); background: var(--bg-page); }
figure { margin: 0; }
.client-logo { height: 56px; width: auto; max-width: 220px; object-fit: contain; }
.hero-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }

/* Home */
.home-hero { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--gap); }
.home-hero__intro { display: flex; flex-direction: column; justify-content: space-between; gap: 28px; }
.home-hero__side { display: grid; gap: var(--gap); grid-template-rows: auto 1fr; }
.portrait { border-radius: var(--card-radius); overflow: hidden; aspect-ratio: 440 / 340; background: var(--bg-muted); }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.credential { display: flex; align-items: center; gap: 20px; }
.credential img { width: 64px; height: 64px; flex: none; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.stats .card { padding: 24px; }
.logos { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px 22px; }
.logos li { display: grid; place-items: center; height: 68px; border: 1px solid var(--border-default); border-radius: var(--sub-radius); padding: 12px 20px; }
.logos img { max-height: 38px; max-width: 100%; width: auto; object-fit: contain; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 32px 16px 0; }
.case-card { display: grid; grid-template-columns: minmax(0, 500px) minmax(0, 1fr); gap: 0; padding: 14px; }
.case-card__body { padding: 26px 32px 26px 26px; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; }
.case-card .media { align-self: center; width: 100%; }
.split--quote { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; }
.split--wide { grid-template-columns: minmax(0, 760px) minmax(0, 1fr); align-items: center; }
.a11y-bento { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: var(--gap); }
.a11y-bento__main { display: flex; flex-direction: column; justify-content: space-between; gap: 28px; }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border-default); padding-top: 32px; margin-top: 40px; font-size: 0.875rem; color: var(--text-secondary); }
.footer-bottom a { color: var(--text-primary); }

/* Case study */
.breadcrumb { padding: 12px 16px 0; font-size: 1rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; color: var(--text-secondary); }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; }
.meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 0; }
.meta div { border-top: 1px solid var(--border-default); padding-top: 20px; }
.meta dt { margin-bottom: 6px; }
.meta dd { margin: 0; font-size: 0.9375rem; }
.hero-media { aspect-ratio: 1280 / 620; max-height: 56vh; width: 100%; }
.hero-media img { object-position: top center; }
.stat-card { display: flex; flex-direction: column; gap: 8px; }
.dark-stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.dark-stats .card { padding: 20px; border-radius: var(--sub-radius); }
.dark-stats .stat { font-size: 1.875rem; }
.next { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--gap); }
.next .card { padding: 32px; }
.card > .stack, .card.stack { --stack: 20px; }
.section-title { display: grid; gap: 12px; }
.divider-top { border-top: 1px solid var(--border-default); padding-top: 24px; }
.rule-top { border-top: 2px solid var(--border-strong); padding-top: 20px; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; align-items: stretch; }
.dots { display: flex; gap: 6px; }
.dots span { width: 20px; height: 20px; border-radius: 50%; background: var(--bg-inverse); }

.placeholder { background: var(--bg-muted); border-radius: var(--sub-radius); width: 100%; }

/* Password page (StatiCrypt template) */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate .card { width: min(100%, 520px); }
.field { display: grid; gap: 8px; }
.field label { font-weight: 500; }
.field input[type="password"], .field input[type="text"] { font: inherit; font-size: 1.125rem; min-height: 52px; padding: 10px 16px; border: 1.5px solid var(--text-secondary); border-radius: 14px; width: 100%; }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--action-primary); }
.error { color: #b00020; font-weight: 500; }

/* Responsive */
@media (max-width: 1100px) {
  :root { --card-pad: 40px; }
  .home-hero { grid-template-columns: minmax(0, 1fr) 340px; }
  .stats, .grid-4, .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .logos { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .glance { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .glance > :first-child { grid-column: 1 / -1; }
  .split, .split--wide, .split--quote, .case-card, .a11y-bento, .next { grid-template-columns: minmax(0, 1fr); }
  .case-card__body { padding: 24px 24px 32px; }
  .article { padding-inline: var(--card-pad); }
}
@media (max-width: 760px) {
  :root { --page-pad: 12px; --gap: 12px; --card-pad: 24px; --card-radius: 24px; }
  body { font-size: 1.0625rem; }
  .card { padding-block: 40px; }
  .card--sm, .stats .card { padding: 24px; }
  .home-hero, .grid-2, .grid-3, .steps { grid-template-columns: minmax(0, 1fr); }
  .glance { grid-template-columns: minmax(0, 1fr); }
  .logos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta { grid-template-columns: minmax(0, 1fr); }
  .dark-stats { grid-template-columns: minmax(0, 1fr); }
  .section-head { padding: 32px 8px 0; }
  .nav { padding: 8px 8px 8px 20px; border-radius: 28px; }
  .menu-toggle { display: inline-flex; background: var(--bg-inverse); color: var(--text-inverse); }
  .menu-toggle:hover { background: #222; color: var(--text-inverse); }
  .proj-grid { grid-template-columns: minmax(0, 1fr); }
  .project-card--grid { padding: 12px; }
  .project-card__body { padding: 20px 8px 8px; }
  /* Side drawer */
  .nav-drawer { display: flex; flex-direction: column; position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
    width: min(360px, 88vw); height: 100dvh; background: var(--bg-page); padding: 16px 20px 24px;
    box-shadow: -12px 0 40px rgba(0,0,0,.18); overflow-y: auto;
    transform: translateX(100%); visibility: hidden; transition: transform .28s ease, visibility 0s linear .28s; }
  .nav-drawer.is-open { transform: translateX(0); visibility: visible; transition: transform .28s ease, visibility 0s; }
  .drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border-default); }
  .drawer-close { background: var(--bg-subtle); color: var(--text-primary); }
  .drawer-close:hover { background: var(--bg-muted); color: var(--text-primary); }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; padding-top: 12px; flex: 1; }
  .nav-links li { border-bottom: 1px solid var(--border-default); }
  .nav-links li.nav-cta { border: 0; margin-top: auto; padding-top: 24px; }
  .nav-links a:not(.btn) { display: flex; align-items: center; min-height: 64px; font-size: 1.375rem; padding: 12px 8px; border-radius: 12px; }
  .nav-links .btn { width: 100%; min-height: 56px; font-size: 1.0625rem; }
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(11,11,11,.5); }
  .nav-backdrop[hidden] { display: none; }
  body.menu-open { overflow: hidden; }
  .credential img { width: 72px; height: 72px; }
  .breadcrumb li:not(:first-child) { display: none; }
  .client-logo { height: 44px; }
}
/* Stats: light reveal on scroll (only when JS is running; see main.js) */
.js .reveal { opacity: 0; transform: translateY(10px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1); transition-delay: var(--reveal-delay, 0ms); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
@media (prefers-reduced-motion: reduce) { .nav-drawer, .nav-drawer.is-open { transition: none; } }
@media (forced-colors: active) {
  .nav-drawer { border-left: 1px solid CanvasText; }
  .btn, .chip, .nav, .card { border: 1px solid CanvasText; }
}
