/* ==========================================================================
   Bevelstone — site.css
   Tokens are ported verbatim from the Bevelstone design system ("BlueSite").
   Theme: `.light` / `.dark` on <html>; otherwise follows the OS.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --font-sans: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --surface-0: #f5f7f9;
  --surface-1: #fff;
  --surface-sunken: #edf1f4;
  --ink: #101c28;
  --ink-2: #3d4b59;
  --ink-3: #5d6b79;
  --ink-faint: #8593a0;
  --border: #dce2e8;
  --border-strong: #c2ccd6;
  --divider: #e9edf1;
  --brand: #135f79;
  --brand-strong: #0f4f65;
  --brand-soft: #e1eef3;
  --brand-soft-border: #b9d8e4;
  --on-brand: #fff;
  --link: var(--brand);
  --link-hover: var(--brand-strong);
  --focus-ring: #1d7a99;
}

:root.dark {
  color-scheme: dark;
  --surface-0: #0d141b;
  --surface-1: #151e27;
  --surface-sunken: #0a1016;
  --ink: #e4eaef;
  --ink-2: #c3cdd6;
  --ink-3: #92a0ad;
  --ink-faint: #5f6e7c;
  --border: #2a3641;
  --border-strong: #3a4855;
  --divider: #223040;
  --brand: #74bcd6;
  --brand-strong: #8fcbe0;
  --brand-soft: #74bcd624;
  --brand-soft-border: #74bcd661;
  --on-brand: #08222d;
  --focus-ring: #86cbe3;
}

@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    color-scheme: dark;
    --surface-0: #0d141b;
    --surface-1: #151e27;
    --surface-sunken: #0a1016;
    --ink: #e4eaef;
    --ink-2: #c3cdd6;
    --ink-3: #92a0ad;
    --ink-faint: #5f6e7c;
    --border: #2a3641;
    --border-strong: #3a4855;
    --divider: #223040;
    --brand: #74bcd6;
    --brand-strong: #8fcbe0;
    --brand-soft: #74bcd624;
    --brand-soft-border: #74bcd661;
    --on-brand: #08222d;
    --focus-ring: #86cbe3;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--surface-0);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
html.rm { scroll-behavior: auto; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--surface-0);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p, dl, dt, dd { margin: 0; }
a { color: var(--link); text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
::selection { background: var(--brand); color: var(--on-brand); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { display: block; }

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

/* Page enter */
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.page { animation: pageIn .5s ease both; }
@media (prefers-reduced-motion: reduce) { .page { animation: none; } }
html.rm .page { animation: none; }

/* ---------- Primitives ---------- */

/* Beveled frame: 1px "border" made from a clipped wrapper + clipped inner.
   Set --b (outer bevel size) on .bevel; inner bevel is --b minus 1px. */
.bevel {
  --b: 16px;
  --bi: calc(var(--b) - 1px);
  display: flex;
  background: var(--brand-soft-border);
  padding: 1px;
  clip-path: polygon(var(--b) 0, calc(100% - var(--b)) 0, 100% var(--b), 100% calc(100% - var(--b)),
                     calc(100% - var(--b)) 100%, var(--b) 100%, 0 calc(100% - var(--b)), 0 var(--b));
}
.bevel > .bevel-in {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--surface-1);
  clip-path: polygon(var(--bi) 0, calc(100% - var(--bi)) 0, 100% var(--bi), 100% calc(100% - var(--bi)),
                     calc(100% - var(--bi)) 100%, var(--bi) 100%, 0 calc(100% - var(--bi)), 0 var(--bi));
}

/* Beveled tag: single layer, soft background */
.tag {
  --b: 9px;
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .32em;
  line-height: 2.1;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 10px 16px 10px 20px;
  max-width: 100%;
  clip-path: polygon(var(--b) 0, calc(100% - var(--b)) 0, 100% var(--b), 100% calc(100% - var(--b)),
                     calc(100% - var(--b)) 100%, var(--b) 100%, 0 calc(100% - var(--b)), 0 var(--b));
}

/* Mono labels */
.mono { font-family: var(--font-mono); }
.label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .34em; color: var(--brand); }

/* Section kicker: rule + label */
.kicker { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.kicker::before { content: ""; width: 44px; height: 1px; background: var(--brand); flex: none; }
.kicker--center { justify-content: center; }
.kicker--center::after { content: ""; width: 44px; height: 1px; background: var(--brand); flex: none; }

/* Headings */
.h-display { font-family: var(--font-sans); font-weight: 700; line-height: 1.08; letter-spacing: -.02em; }
.h2 { font-size: clamp(32px, 4.2vw, 42px); }
.h2--band { font-size: clamp(28px, 3.6vw, 34px); line-height: 1.1; }

/* Character reveal (JS splits headings into .reveal > .w > span) */
.reveal .w { display: inline-block; white-space: nowrap; }
.reveal .w > span {
  display: inline-block;
  opacity: .001;
  transform: translateY(-9px) scale(1.04);
  transition: transform .55s cubic-bezier(.22, .61, .36, 1) var(--d, 0ms), opacity .45s ease var(--d, 0ms);
}
.is-on .reveal .w > span { opacity: 1; transform: none; }
html.rm .reveal .w > span { opacity: 1; transform: none; transition: none; }

/* Layout */
.section { max-width: 1280px; margin: 0 auto; padding: 8% 6% 7%; box-sizing: content-box; scroll-margin-top: 8px; }
.section--work { padding: 8% 6% 7%; }
.section--principles { padding: 6% 6% 8%; }
.section--company { padding: 8% 6%; }
.section--contact { max-width: 1000px; padding: 6% 6% 9%; text-align: center; }
.band-inner { max-width: 1280px; margin: 0 auto; padding: 64px 6% 72px; box-sizing: content-box; }

/* ---------- Brand mark ---------- */
/* The <symbol id="mark"> reads these custom properties through <use>. */
.mark { --mark-sw: 2.5; --mark-frame: var(--brand); --mark-fill: var(--ink); }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  --b: 8px;
  display: inline-flex;
  align-items: stretch;
  height: 32px;
  background: var(--brand-soft-border);
  padding: 1px;
  clip-path: polygon(var(--b) 0, calc(100% - var(--b)) 0, 100% var(--b), 100% calc(100% - var(--b)),
                     calc(100% - var(--b)) 100%, var(--b) 100%, 0 calc(100% - var(--b)), 0 var(--b));
}
.theme-toggle__in {
  --bi: 7px;
  display: inline-flex;
  background: var(--surface-1);
  clip-path: polygon(var(--bi) 0, calc(100% - var(--bi)) 0, 100% var(--bi), 100% calc(100% - var(--bi)),
                     calc(100% - var(--bi)) 100%, var(--bi) 100%, 0 calc(100% - var(--bi)), 0 var(--bi));
}
.theme-toggle button {
  width: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  transition: color .2s ease, background-color .2s ease;
}
.theme-toggle button:hover { color: var(--ink); }
.theme-toggle button.is-on { color: var(--brand); background: var(--brand-soft); }
.theme-toggle button:focus-visible { outline-offset: -2px; }
.theme-toggle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle--mobile { display: none; position: fixed; right: 14px; bottom: 14px; z-index: 70; height: 36px; }
.theme-toggle--mobile button { width: 34px; }

/* ---------- Nav ---------- */
.nav {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  padding: 20px 6%;
  display: flex; justify-content: space-between; align-items: center;
}
.nav--static { position: static; }
.nav__brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.nav__brand .mark { width: 22px; height: 22px; }
.nav__word { font-family: var(--font-mono); font-size: 12px; letter-spacing: .34em; color: var(--ink); }
.nav__links { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.nav__links a { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-decoration: none; color: var(--ink); }
.nav__links a:hover { color: var(--brand); }

/* Floating chip nav (appears after scrolling past the hero) */
.chip {
  --b: 11px;
  position: fixed; top: 14px; left: 50%; z-index: 60;
  transform: translateX(-50%) translateY(-140%);
  opacity: 0; pointer-events: none;
  transition: transform .45s ease, opacity .45s ease;
  max-width: calc(100vw - 28px);
}
.chip.is-on { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }
.chip .bevel-in { --bi: 10px; padding: 10px 20px; display: flex; align-items: center; gap: 16px; }
.chip .mark { width: 15px; height: 15px; --mark-sw: 3; flex: none; }
.chip a { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-decoration: none; color: var(--ink); white-space: nowrap; }
.chip a:hover { color: var(--brand); }
html.rm .chip { transition: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(180deg, var(--brand-soft), transparent 55%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 36px;
  padding: 112px 6% 56px;
  min-height: 100vh;
  min-height: 100svh;
}
.hero__plate { width: 100%; max-width: 1240px; }
.hero__plate svg { width: 100%; height: auto; }
.plate-frame { fill: none; stroke: var(--brand-soft-border); stroke-width: 1.5; }
.plate-frame--inner { stroke-width: .75; }
.plate-light { fill: none; stroke: var(--brand); stroke-width: 2; }
.plate-word { font-family: var(--font-sans); font-size: 132px; font-weight: 700; letter-spacing: 2px; fill: var(--ink); }
.plate-meta { font-family: var(--font-mono); font-size: 12px; letter-spacing: 4px; fill: var(--brand); }
.hero__title { font-size: clamp(34px, 5.2vw, 50px); line-height: 1.1; letter-spacing: -.02em; font-weight: 700; }
.hero__lead { max-width: 700px; font-size: 17px; line-height: 1.75; color: var(--ink-2); text-wrap: pretty; }
.scroll-cue { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 6px; }
.scroll-cue::before { content: ""; display: block; width: 1px; height: 52px; background: var(--brand-soft-border); }
.scroll-cue span { font-family: var(--font-mono); font-size: 10px; letter-spacing: .42em; color: var(--brand); }

/* ---------- What we build ---------- */
.section__intro { margin: 0 0 40px; font-size: 17px; color: var(--ink-2); max-width: 720px; }
.section--work .h2 { margin-bottom: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 22px; }
.tilt { display: flex; transition: transform .25s ease; will-change: transform; }
.tilt .bevel { flex: 1 1 auto; }
.card-in {
  padding: 30px 28px 34px;
  min-height: 280px;
  display: flex; flex-direction: column; gap: 14px;
  background:
    linear-gradient(105deg, transparent 42%, var(--brand-soft) 50%, transparent 58%) no-repeat -140% 0 / 240% 100%,
    var(--surface-1);
  transition: background-position .45s ease;
}
.tilt:hover .card-in { background-position: 140% 0; }
html.rm .tilt, html.rm .card-in { transition: none; }
.card-num {
  --b: 7px;
  align-self: flex-start;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .3em; color: var(--brand);
  background: var(--brand-soft); padding: 6px 9px 6px 13px;
  clip-path: polygon(var(--b) 0, calc(100% - var(--b)) 0, 100% var(--b), 100% calc(100% - var(--b)),
                     calc(100% - var(--b)) 100%, var(--b) 100%, 0 calc(100% - var(--b)), 0 var(--b));
}
.card-in h3 { font-size: 23px; line-height: 1.2; letter-spacing: -.01em; font-weight: 700; }
.card-in p { font-size: 15.5px; line-height: 1.7; color: var(--ink-2); text-wrap: pretty; }

/* ---------- How we work ---------- */
.section--principles .h2 { margin-bottom: 44px; }
.principles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 44px 56px; }
.principle { border-top: 1px solid var(--brand-soft-border); padding-top: 20px; }
.principle__num { font-family: var(--font-mono); font-size: 11px; letter-spacing: .3em; color: var(--brand); margin-bottom: 10px; }
.principle h3 { font-size: 21px; font-weight: 700; margin-bottom: 8px; }
.principle p { font-size: 15.5px; line-height: 1.7; color: var(--ink-2); text-wrap: pretty; }

/* ---------- Custom work band ---------- */
.band { background: var(--brand-soft); border-top: 1px solid var(--brand-soft-border); border-bottom: 1px solid var(--brand-soft-border); scroll-margin-top: 8px; }
.band .h2--band { margin-bottom: 16px; }
.band p { max-width: 760px; font-size: 17px; line-height: 1.75; color: var(--ink-2); text-wrap: pretty; }

/* ---------- Company ---------- */
.section--company .h2 { margin-bottom: 36px; }
.company { display: flex; flex-wrap: wrap; gap: 44px; align-items: flex-start; }
.company__text { flex: 1 1 400px; min-width: min(400px, 100%); }
.company__text p { font-size: 17px; line-height: 1.8; color: var(--ink-2); text-wrap: pretty; }
.company__text p + p { margin-top: 18px; }
.company__facts { flex: 0 1 380px; min-width: min(340px, 100%); }
.company__facts .bevel { --b: 14px; }
.facts { padding: 26px 26px 28px; display: flex; flex-direction: column; }
.facts__row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--divider); }
.facts__row:last-child { border-bottom: 0; padding-bottom: 2px; }
.facts__k { font-family: var(--font-mono); font-size: 10px; letter-spacing: .26em; color: var(--brand); flex: none; padding-top: 2px; }
.facts__v { font-family: var(--font-mono); font-size: 12px; color: var(--ink); text-align: right; }
a.facts__v { color: var(--ink); }

/* ---------- Contact ---------- */
.section--contact .h2 { margin-bottom: 26px; }
.contact__lead { margin: 0 auto; max-width: 780px; font-weight: 500; font-size: clamp(21px, 2.6vw, 26px); line-height: 1.55; letter-spacing: -.01em; text-wrap: pretty; }
.contact__lead a { font-weight: 700; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 26px 6% 34px;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 8px 12px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .06em; color: var(--ink-3);
}
.footer .dot { color: var(--brand); }
.footer a { color: inherit; }
.footer a:hover { color: var(--ink); }

/* ---------- Specimen plate ---------- */
.specimen { background: var(--surface-sunken); border-top: 1px solid var(--border); }
.specimen[hidden] { display: none; }
.specimen .band-inner { padding: 56px 6% 72px; }
.specimen__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 30px; flex-wrap: wrap; }
.specimen__head a { font-family: var(--font-mono); font-size: 11px; letter-spacing: .22em; color: var(--ink); }
.specimen__row { display: flex; flex-wrap: wrap; gap: 26px; align-items: stretch; }
.specimen__marks { flex: 0 1 300px; min-width: min(280px, 100%); --b: 14px; }
.specimen__marks .bevel-in { padding: 30px 26px; display: flex; flex-direction: column; gap: 22px; align-items: center; justify-content: center; }
.specimen__marks-row { display: flex; align-items: flex-end; gap: 26px; }
.specimen__marks .mark-lg { width: 96px; height: 96px; --mark-sw: 1.5; }
.specimen__marks .mark-sm { width: 32px; height: 32px; --mark-sw: 2.5; }
.specimen__caption { font-family: var(--font-mono); font-size: 10px; letter-spacing: .26em; color: var(--ink-3); text-align: center; }
.specimen__social { flex: 1 1 520px; min-width: min(320px, 100%); display: flex; flex-direction: column; gap: 12px; }
.specimen__social svg { width: 100%; height: auto; }
.specimen__social .specimen__caption { text-align: left; }
.og-bg { fill: var(--surface-0); }
.og-frame { fill: none; stroke: var(--brand-soft-border); stroke-width: 2; }
.og-frame--inner { stroke-width: 1; }
.og-kicker { font-family: var(--font-mono); font-size: 15px; letter-spacing: 7px; fill: var(--brand); }
.og-word { font-family: var(--font-sans); font-size: 96px; font-weight: 700; fill: var(--ink); }
.og-tag { font-family: var(--font-sans); font-size: 32px; font-weight: 500; fill: var(--ink-2); }
.og-rule { stroke: var(--brand-soft-border); stroke-width: 1; }
.og-url { font-family: var(--font-mono); font-size: 15px; letter-spacing: 3px; fill: var(--ink); }
.og-meta { font-family: var(--font-mono); font-size: 15px; letter-spacing: 3px; fill: var(--brand); }

/* ---------- Legal pages ---------- */
.legal { max-width: 800px; margin: 0 auto; padding: 6% 6% 8%; box-sizing: content-box; }
.legal h1 { font-size: clamp(36px, 4.6vw, 46px); line-height: 1.05; letter-spacing: -.02em; font-weight: 700; margin-bottom: 14px; }
.legal__meta { font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em; color: var(--brand); margin-bottom: 44px; }
.legal__sec { border-top: 1px solid var(--border); padding: 26px 0; }
.legal__sec:last-child { padding-bottom: 0; }
.legal__sec h3 { font-size: 21px; font-weight: 700; margin-bottom: 10px; }
.legal__sec p { font-size: 15.5px; line-height: 1.8; color: var(--ink-2); }
.legal__sec p + p { margin-top: 12px; }

/* ---------- 404 ---------- */
.notfound {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: 24px; padding: 14% 6% 12%;
  min-height: 100vh; min-height: 100svh;
}
.notfound__plate { width: 150px; height: 92px; }
.notfound__plate .f { fill: none; stroke: var(--brand-soft-border); stroke-width: 1.5; }
.notfound__plate .c { fill: none; stroke: var(--brand); stroke-width: 2; }
.notfound__plate text { font-family: var(--font-mono); font-size: 20px; letter-spacing: 8px; fill: var(--brand); }
.notfound h1 { font-size: clamp(34px, 5vw, 48px); line-height: 1.08; letter-spacing: -.02em; font-weight: 700; }
.notfound p { font-size: 17.5px; color: var(--ink-2); }
.notfound a { font-weight: 600; font-size: 19px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav__word { display: none; }
  .theme-toggle--desktop { display: none; }
  .theme-toggle--mobile { display: inline-flex; }
  .nav--static .nav__word { display: inline; }
  .hero { min-height: auto; padding-top: 96px; gap: 28px; }
  .tag { letter-spacing: .22em; padding: 8px 12px 8px 16px; }
  .plate-word { letter-spacing: 0; }
  .section, .band-inner, .legal { padding-left: 6%; padding-right: 6%; }
  .chip .bevel-in { gap: 12px; padding: 10px 14px; }
  .notfound { min-height: 70vh; }
}
@media (max-width: 480px) {
  .nav { padding-top: 16px; }
  .nav__links { gap: 10px 14px; }
  .nav__links a { letter-spacing: .12em; }
}
@media (max-width: 380px) {
  .chip .bevel-in { gap: 10px; padding: 9px 12px; }
  .chip a { letter-spacing: .08em; }
}
