/* ==========================================================================
   Himan & — shared design system
   Used by every page. Page-specific layouts live in home.css / projects.css.
   ========================================================================== */

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-wght-italic.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --paper:      #F4F2EC;
  --paper-2:    #ECE9E1;
  --card:       #FBFAF7;
  --ink:        #17191A;
  --ink-2:      #3D423F;
  --ink-3:      #5C625E;
  --line:       #D9D5CA;
  --line-2:     #C9C4B7;
  --sage:       #526B56;
  --sage-deep:  #3F5543;
  --sage-soft:  #DCE4D8;
  --sage-light: #A9BFA5;
  --night:      #141815;
  --night-2:    #1C211D;
  --night-3:    #232A25;
  --night-line: #323A34;
  --on-night:   #EDEBE4;
  --on-night-2: #B4BAB3;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --max: 1240px;
  --gutter: clamp(20px, 4.5vw, 48px);
  --radius: 20px;
  --radius-sm: 12px;
  --section-y: clamp(80px, 11vw, 144px);
  --header-h: 76px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
[id] { scroll-margin-top: calc(var(--header-h) + 12px); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--sage-soft); color: var(--ink); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { top: 16px; }
:focus-visible { outline: 2px solid var(--sage); outline-offset: 3px; border-radius: 6px; }
.on-dark :focus-visible, .section-dark :focus-visible { outline-color: var(--sage-light); }

/* ---------- Layout helpers ---------- */
.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--section-y) 0; }
.section-tint { background: var(--paper-2); }
.section-dark { background: var(--night); color: var(--on-night); }

/* ---------- Type ---------- */
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: .02em; }
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--sage); margin-bottom: 20px;
}
.kicker::before { content: ""; width: 22px; height: 1px; background: currentColor; }
.section-dark .kicker { color: var(--sage-light); }
.display {
  font-family: var(--serif); font-weight: 380;
  font-size: clamp(50px, 8vw, 112px); line-height: .96; letter-spacing: -.035em;
}
.display em, .title em { font-style: italic; color: var(--sage); font-weight: 360; }
.section-dark .display em, .section-dark .title em { color: var(--sage-light); }
.title {
  font-family: var(--serif); font-weight: 380;
  font-size: clamp(38px, 5.4vw, 70px); line-height: 1.02; letter-spacing: -.03em;
}
.lede { font-size: clamp(18px, 1.55vw, 21px); line-height: 1.6; color: var(--ink-2); }
.section-dark .lede { color: var(--on-night-2); }
.section-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px 64px; align-items: end; margin-bottom: clamp(48px, 6vw, 80px); }
.section-head .lede { max-width: 520px; }
.section-head-stack { display: block; max-width: 820px; }
.section-head-stack .lede { margin-top: 24px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 14px 26px; border-radius: 999px;
  font-weight: 500; font-size: 16px; line-height: 1.2; text-decoration: none; white-space: nowrap;
  border: 1.5px solid transparent; cursor: pointer;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.btn .arrow { display: inline-block; transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn-sm { min-height: 44px; padding: 10px 20px; font-size: 15px; }
.btn-lg { min-height: 58px; padding: 16px 32px; font-size: 17px; }
.btn-primary { background: var(--sage); color: #fff; }
.btn-primary:hover { background: var(--sage-deep); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: var(--sage-deep); }
.btn-outline { border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn-light { background: var(--on-night); color: var(--night); }
.btn-light:hover { background: var(--sage-light); }
.btn-outline-light { border-color: rgba(237, 235, 228, .5); color: var(--on-night); }
.btn-outline-light:hover { border-color: var(--on-night); background: var(--on-night); color: var(--night); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.text-link {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 500; text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px;
  background-position: 0 100%; background-repeat: no-repeat; padding-bottom: 2px;
  transition: background-size .3s var(--ease);
}
.text-link:hover { background-size: 100% 1px; }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px;
  font-size: 13.5px; line-height: 1.4; color: var(--ink-2); background: var(--card);
}
.chips-dark li, .section-dark .chips li { border-color: var(--night-line); background: var(--night-2); color: var(--on-night); }
.chips-sage li { background: var(--sage-soft); border-color: transparent; color: var(--sage-deep); font-family: var(--mono); font-size: 12.5px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  background: rgba(244, 242, 236, .86);
  backdrop-filter: saturate(150%) blur(12px); -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .3s, background-color .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.wordmark {
  font-family: var(--serif); font-size: 27px; font-weight: 450; letter-spacing: -.02em;
  text-decoration: none; white-space: nowrap; line-height: 1;
}
.wordmark .amp { font-style: italic; color: var(--sage); font-weight: 380; }

.site-nav { display: flex; align-items: center; gap: 30px; font-size: 15px; }
.site-nav .nav-link {
  position: relative; text-decoration: none; color: var(--ink-2); padding: 8px 0;
  transition: color .2s;
}
.site-nav .nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1.5px;
  background: var(--sage); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.site-nav .nav-link:hover, .site-nav .nav-link.is-active, .site-nav .nav-link[aria-current="page"] { color: var(--ink); }
.site-nav .nav-link:hover::after, .site-nav .nav-link.is-active::after, .site-nav .nav-link[aria-current="page"]::after { transform: scaleX(1); }
.nav-cta { margin-left: 6px; }

.nav-toggle {
  display: none; width: 48px; height: 48px; margin-right: -10px; border: 0; background: transparent;
  cursor: pointer; padding: 0; flex-direction: column; justify-content: center; align-items: center; gap: 7px;
}
.nav-toggle-bar { display: block; width: 24px; height: 1.5px; background: var(--ink); transition: transform .3s var(--ease); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:first-child { transform: translateY(4.25px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { transform: translateY(-4.25px) rotate(-45deg); }

/* (Ticker styles live in home.css, the only page that uses it.) */

/* ---------- Shared CTA band ---------- */
.cta {
  position: relative; overflow: hidden; background: var(--night); color: var(--on-night);
  padding: clamp(96px, 12vw, 168px) 0;
}
.cta::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(169, 191, 165, .14) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 70%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 70%);
}
.cta-inner { position: relative; text-align: center; max-width: 1080px; }
.cta .kicker { color: var(--sage-light); justify-content: center; }
.cta-title { font-family: var(--serif); font-weight: 380; font-size: clamp(42px, 5.8vw, 86px); line-height: .98; letter-spacing: -.035em; }
.cta-title em { font-style: italic; color: var(--sage-light); font-weight: 360; }
.cta-lede { margin: 28px auto 0; max-width: 580px; font-size: clamp(17px, 1.5vw, 20px); color: var(--on-night-2); }
.cta .btn-row { justify-content: center; margin-top: 44px; }
.cta-email { margin-top: 26px; font-family: var(--mono); font-size: 14px; }
.cta-email a { color: var(--on-night-2); text-underline-offset: 4px; }
.cta-email a:hover { color: var(--on-night); }

/* ---------- Footer (all pages) ---------- */
.site-footer { background: var(--night); color: var(--on-night-2); border-top: 1px solid var(--night-line); }
.studio-footer { padding-top: clamp(64px, 8vw, 104px); }
.sf-grid {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .75fr) minmax(0, .75fr) minmax(0, 1.1fr);
  gap: 40px clamp(32px, 4vw, 64px); padding-bottom: clamp(48px, 6vw, 72px);
}
.sf-brand .wordmark { color: var(--on-night); font-size: 32px; }
.sf-brand .wordmark .amp { color: var(--sage-light); }
.sf-tagline { margin-top: 20px; font-family: var(--serif); font-size: 24px; line-height: 1.25; letter-spacing: -.01em; color: var(--on-night); }
.sf-tagline em { font-style: italic; color: var(--sage-light); }
.sf-desc { margin-top: 12px; max-width: 340px; font-size: 15px; line-height: 1.6; color: var(--on-night-2); }
.sf-heading {
  font-family: var(--mono); font-size: 11.5px; font-weight: 400; letter-spacing: .08em; text-transform: uppercase;
  color: var(--sage-light); padding-bottom: 14px; margin-bottom: 6px; border-bottom: 1px solid var(--night-line);
}
.sf-col ul { display: flex; flex-direction: column; }
.sf-col a:not(.btn) {
  display: inline-flex; align-items: center; min-height: 40px; color: var(--on-night-2);
  text-decoration: none; font-size: 15.5px; transition: color .2s;
}
.sf-col a:not(.btn):hover { color: var(--on-night); }
.sf-start p { margin: 10px 0 18px; font-size: 15px; line-height: 1.6; color: var(--on-night-2); }
.sf-start .sf-email { margin: 14px 0 0; font-family: var(--mono); font-size: 13.5px; }
.sf-start .sf-email a { min-height: 0; text-decoration: underline; text-underline-offset: 4px; }
.sf-mark {
  font-family: var(--serif); font-weight: 360; font-size: clamp(72px, 16vw, 236px); line-height: .82;
  letter-spacing: -.055em; white-space: nowrap; overflow: hidden; color: var(--night-3); user-select: none;
  padding-top: 8px; padding-bottom: 8px;
}
.sf-mark em { font-style: italic; color: #2A332C; }
.sf-bottom {
  position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  padding-top: 22px; padding-bottom: 30px; font-size: 13.5px; color: var(--on-night-2);
}
.sf-bottom::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); height: 1px; background: var(--night-line); }
.sf-top { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--on-night-2); text-decoration: none; }
.sf-top:hover { color: var(--on-night); }

/* ---------- Reveal on scroll (enabled by JS) ---------- */
.js-reveal .reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js-reveal .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js-reveal .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .btn .arrow, .text-link { transition: none; }
}

/* ==========================================================================
   Responsive (shared parts)
   ========================================================================== */
@media (max-width: 1080px) {
  .site-nav { gap: 22px; }
}

@media (max-width: 960px) {
  :root { --header-h: 68px; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); padding: 16px var(--gutter) 40px; overflow-y: auto;
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
  }
  .site-nav.is-open { visibility: visible; opacity: 1; transform: none; }
  .site-nav .nav-link {
    font-family: var(--serif); font-size: 34px; letter-spacing: -.02em; color: var(--ink);
    padding: 14px 0; border-bottom: 1px solid var(--line);
  }
  .site-nav .nav-link::after { display: none; }
  .site-nav .nav-link[aria-current="page"], .site-nav .nav-link.is-active { color: var(--sage); font-style: italic; }
  .nav-cta { margin: 28px 0 0; min-height: 56px; font-size: 17px; }
  .nav-open { overflow: hidden; }

  .no-js .nav-toggle { display: none; }
  .no-js .site-header { height: auto; position: static; }
  .no-js .header-inner { flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
  .no-js .site-nav { position: static; visibility: visible; opacity: 1; transform: none; flex-direction: row; flex-wrap: wrap; gap: 4px 18px; padding: 0; background: none; }
  .no-js .site-nav .nav-link { font-family: var(--sans); font-size: 15px; border: 0; padding: 6px 0; }
  .no-js .nav-cta { margin: 0; }

  .section-head { grid-template-columns: minmax(0, 1fr); }
  .sf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sf-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .btn-row .btn { flex: 1 1 100%; }
  .cta .btn-row .btn { flex: 1 1 100%; }
  .sf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 24px; }
  .sf-start { grid-column: 1 / -1; }
  .sf-start .btn { width: 100%; }
  .sf-col a:not(.btn) { min-height: 44px; }
  .sf-bottom { flex-direction: column; align-items: flex-start; gap: 0; }
}

/* ---------- 404 page ---------- */
.notfound-lede { margin-top: 28px; }
.notfound-ctas { margin-top: 40px; }
