/* Cambrian Ops site. Tokens come from the Brand Identity Guidelines (10.26).
   Change a brand color once, here. */
:root {
  --dark: #0F1720;      /* Deep Earth */
  --stone: #EAE7DD;     /* Stone */
  --paper: #F4F4F5;     /* Graphite */
  --blue: #2E7D8F;      /* Cambrian Blue */
  --green: #2F966B;     /* Evolution Green */
  --gold: #D4B483;      /* Sediment Gold */

  --bg: var(--stone);
  --surface: var(--paper);
  --text: #0F1720;
  --muted: #3F5049;
  --rule: #C6C1B1;
  --link: #1F6A7A;
  --callout: #C9DAD6;
  --band: var(--dark);
  --band-text: #EAE7DD;
  --band-muted: #B7C3BD;
  --art: #EAE7DD;

  --font: "Prompt", system-ui, -apple-system, "Segoe UI", Arial, Helvetica, sans-serif;
  --measure: 68ch;
  --gutter: clamp(20px, 4vw, 48px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1219;
    --surface: #111C26;
    --text: #EAE7DD;
    --muted: #B4BFB9;
    --rule: #27333F;
    --link: #7EC0CF;
    --callout: #12303A;
    --band: #080D13;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1219;
  --surface: #111C26;
  --text: #EAE7DD;
  --muted: #B4BFB9;
  --rule: #27333F;
  --link: #7EC0CF;
  --callout: #12303A;
  --band: #080D13;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(88px + env(safe-area-inset-top, 0px)); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.62;
  font-weight: 400;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
img, svg { max-width: 100%; display: block; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--gold); color: var(--dark); padding: .6rem 1rem; z-index: 100; font-weight: 600; }
.skip:focus { left: 8px; }

/* Type */
h1, h2, h3 { font-weight: 500; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(2.4rem, 5.6vw, 4.6rem); line-height: 1.04; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.7rem, 3.1vw, 2.6rem); line-height: 1.14; }
h3 { font-size: 1.25rem; line-height: 1.3; font-weight: 600; letter-spacing: -0.005em; }
p { margin: 0 0 1em; max-width: var(--measure); }
.lede { font-size: clamp(1.15rem, 1.7vw, 1.4rem); line-height: 1.5; color: var(--band-muted); max-width: 46ch; font-weight: 300; }
.small { font-size: .9rem; color: var(--muted); }
strong, b { font-weight: 600; }

/* Header */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: var(--band); color: var(--band-text); border-bottom: 1px solid rgba(234,231,221,.12); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--band); z-index: 60; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--band-text); text-decoration: none; }
.brand-mark { width: 42px; height: 42px; flex: none; }
.brand-logo { height: 46px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.wordmark { font-size: 1.15rem; letter-spacing: .16em; font-weight: 400; text-transform: uppercase; }
.wordmark b { color: var(--green); font-weight: 600; }
.tagline { font-size: .66rem; letter-spacing: .06em; color: var(--band-muted); margin-top: 3px; }
.nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 32px); }
.nav a:not(.btn) { color: var(--band-text); text-decoration: none; font-size: .98rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:not(.btn):hover { border-bottom-color: var(--gold); }
.nav a[aria-current="page"] { border-bottom-color: var(--green); }
.nav-toggle { display: none; background: none; border: 1px solid rgba(234,231,221,.4); color: var(--band-text); font: inherit; font-size: .95rem; padding: .45rem .9rem; border-radius: 3px; cursor: pointer; }

/* Buttons */
.btn { display: inline-block; background: var(--green); color: #0F1720; font-weight: 600; text-decoration: none; padding: .9rem 1.5rem; border-radius: 3px; border: 0; font-family: inherit; font-size: 1rem; cursor: pointer; line-height: 1.2; }
.btn:hover { background: #3AA878; text-decoration: none; }
.btn-sm { padding: .6rem 1.05rem; font-size: .95rem; }
.btn-line { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--text); }
.btn-line:hover { background: var(--text); color: var(--bg); }

/* Hero + page heads */
.band { background: var(--band); color: var(--band-text); }
.hero { position: relative; overflow: hidden; padding: clamp(64px, 11vw, 140px) 0 clamp(72px, 12vw, 150px); }
.hero .wrap { position: relative; z-index: 2; }
.hero h1 { max-width: 12ch; margin-bottom: 28px; }
.hero .lede { margin-bottom: 36px; }
.hero .fine { margin: 22px 0 0; font-size: .95rem; color: var(--band-muted); max-width: none; }
.hero-art { position: absolute; z-index: 1; right: -14%; top: 50%; width: min(72vw, 860px); transform: translateY(-50%); pointer-events: none; opacity: .95; }
.hero-art { opacity: 0; animation: art-in 1.6s ease-out .1s forwards; }
@keyframes art-in { to { opacity: .95; } }
@media (prefers-reduced-motion: reduce) {
  .hero-art { animation: none; opacity: .95; }
  html { scroll-behavior: auto; }
}
.page-head { padding: clamp(48px, 8vw, 96px) 0 clamp(44px, 7vw, 84px); }
.page-head h1 { font-size: clamp(2.2rem, 4.6vw, 3.8rem); max-width: 18ch; margin-bottom: 20px; }

/* Sections */
section { padding: clamp(56px, 8vw, 104px) 0; }
.section-head { margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2 { max-width: 20ch; margin-bottom: 14px; }
.section-head p { color: var(--muted); }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.rows { border-top: 1px solid var(--rule); margin: 0; padding: 0; list-style: none; }
.rows > li, .rows > .row { border-bottom: 1px solid var(--rule); padding: 20px 0; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 5fr); gap: 8px 32px; }
.rows h3 { font-size: 1.1rem; }
.rows p { margin: 0; color: var(--muted); }
.rows .meta { color: var(--text); font-weight: 500; }
.cred { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 28px; margin: 0; padding: 0; list-style: none; }
.cred li { border-top: 3px solid var(--gold); padding-top: 18px; }
.cred h3 { font-size: 1.05rem; margin-bottom: 8px; }
.cred p { font-size: .95rem; color: var(--muted); margin: 0; }
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.steps li { counter-increment: step; border-top: 1px solid var(--rule); padding-top: 18px; }
.steps li::before { content: counter(step); display: block; font-size: 2.4rem; font-weight: 300; color: var(--green); line-height: 1; margin-bottom: 14px; }
.steps p { margin: 0; }
.steps.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split.rev { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; }
.cta-band { text-align: left; }
.cta-band h2 { max-width: 16ch; margin-bottom: 20px; }
.cta-band p { color: var(--band-muted); }
.sig { margin-top: 28px; font-size: .95rem; color: var(--band-muted); }
.sig b { color: var(--band-text); }

/* Process chevrons */
.chevrons { display: flex; list-style: none; margin: 28px 0; padding: 0; }
.chevrons li { flex: 1 1 0; background: var(--band); color: var(--band-text); padding: .95rem 1rem .95rem 1.9rem; font-weight: 500; font-size: .95rem; text-align: center; margin-left: -12px; clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%, 16px 50%); }
.chevrons li:first-child { margin-left: 0; clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%); padding-left: 1.2rem; }
.chevrons li:last-child { background: var(--green); color: #0F1720; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 24px 0 32px; }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: .98rem; }
th, td { text-align: left; padding: 14px 16px; vertical-align: top; border-bottom: 1px solid var(--rule); }
thead th { background: var(--band); color: var(--band-text); font-weight: 500; border-bottom: 0; }
tbody th { font-weight: 600; width: 22%; }
tbody tr:nth-child(even) td, tbody tr:nth-child(even) th { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.callout { background: var(--callout); border-left: 4px solid var(--blue); padding: 18px 22px; margin: 28px 0; max-width: 78ch; }
.callout p { margin: 0; max-width: none; }

/* Services blocks */
.offer { border-top: 1px solid var(--rule); }
.offer + .offer { margin-top: 0; }
.offer h2 { margin-bottom: 12px; max-width: 22ch; }
.offer .tag { font-weight: 500; color: var(--link); margin: 0 0 20px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); }
.checks { list-style: none; margin: 0 0 1em; padding: 0; }
.checks li { padding: 8px 0 8px 26px; border-bottom: 1px solid var(--rule); position: relative; }
.checks li::before { content: ""; position: absolute; left: 0; top: 17px; width: 11px; height: 11px; border: 2px solid var(--green); border-radius: 50%; }
details { border-bottom: 1px solid var(--rule); }
details:first-of-type { border-top: 1px solid var(--rule); }
summary { cursor: pointer; padding: 18px 36px 18px 0; font-weight: 600; list-style: none; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font-size: 1.5rem; font-weight: 300; color: var(--green); }
details[open] summary::after { content: "\2212"; }
details p { padding: 0 0 18px; margin: 0; color: var(--muted); }
.detail-body { padding: 0 0 26px; }
.detail-body .tag { color: var(--link); font-weight: 500; }
.detail-body h3 { font-size: 1.05rem; }

/* Selected work */
.work { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 32px; }
.work > li { border-top: 3px solid var(--gold); padding-top: 18px; display: flex; flex-direction: column; }
.work .client { color: var(--link); font-weight: 500; font-size: .95rem; margin: 0 0 6px; }
.work h3 { margin-bottom: 10px; }
.work > li > p:not(.client) { color: var(--muted); font-size: .98rem; margin-bottom: 14px; }
.work .chips { margin-top: auto; }
.chips a { color: inherit; text-decoration: none; }
.chips a:hover { text-decoration: underline; }

/* Screenshot */
.shot { margin: 40px 0 0; }
.shot img { width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--rule); box-shadow: 0 12px 32px rgba(15,23,32,.12); }
.shot figcaption { font-size: .9rem; color: var(--muted); margin-top: 10px; }

/* Team */
.people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(28px, 5vw, 72px); }
.person { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 20px; padding: 28px 0; border-top: 1px solid var(--rule); }
.mono { width: 64px; height: 64px; border-radius: 50%; background: var(--dark); color: var(--stone); display: grid; place-items: center; font-weight: 500; font-size: 1.15rem; letter-spacing: .04em; box-shadow: inset 0 0 0 2px var(--green); }
.person h3 { margin-bottom: 2px; }
.person .role { color: var(--link); font-weight: 500; margin: 0 0 10px; font-size: .98rem; }
.person p { color: var(--muted); font-size: .98rem; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.chips li { background: var(--callout); color: var(--text); font-size: .82rem; padding: 3px 10px; border-radius: 2px; }

/* Forms */
.form { max-width: 560px; }
.field { margin-bottom: 20px; }
label { display: block; font-weight: 500; margin-bottom: 6px; }
label .opt { font-weight: 400; color: var(--muted); }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid #8D998F; border-radius: 3px; padding: .75rem .9rem; }
textarea { min-height: 120px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.hp { position: absolute; left: -9999px; }
.status { margin-top: 14px; min-height: 1.5em; font-weight: 500; }
.status.ok { color: var(--link); }
.status.err { color: #B3261E; }
.mini-form { display: flex; gap: 10px; flex-wrap: wrap; }
.mini-form input { flex: 1 1 200px; width: auto; background: rgba(234,231,221,.08); border-color: rgba(234,231,221,.4); color: var(--band-text); }
.mini-form input::placeholder { color: var(--band-muted); }
.mini-form.light input { background: var(--surface); border-color: #8D998F; color: var(--text); }
.mini-form.light input::placeholder { color: var(--muted); }

/* Footer */
.site-footer { background: var(--band); color: var(--band-text); padding: clamp(48px, 7vw, 88px) 0 32px; }
.site-footer a { color: var(--band-text); }
.foot { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr 1.4fr; gap: 36px; margin-bottom: 40px; }
.foot h2 { font-size: 1rem; font-weight: 600; margin-bottom: 14px; letter-spacing: 0; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 8px; }
.foot p { color: var(--band-muted); font-size: .95rem; max-width: 36ch; }
.legal { border-top: 1px solid rgba(234,231,221,.16); padding-top: 22px; color: var(--band-muted); font-size: .86rem; }
.legal p { max-width: 90ch; margin-bottom: 8px; }

/* Preview routing */
[data-view] { display: none; }
[data-view].on { display: block; }

@media (max-width: 960px) {
  .cred { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot { grid-template-columns: 1fr 1fr; }
  .split, .split.rev, .two, .people, .cols { grid-template-columns: 1fr; }
  .steps, .steps.four { grid-template-columns: 1fr; }
  .rows > li, .rows > .row { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--band); flex-direction: column; align-items: flex-start; padding: 18px var(--gutter) 26px; gap: 16px; border-bottom: 1px solid rgba(234,231,221,.12); }
  .nav.open { display: flex; }
  .site-header { position: sticky; }
  .hero-art { right: -40%; top: 34%; width: 130vw; animation-name: art-in-m; }
  @keyframes art-in-m { to { opacity: .28; } }
  .chevrons { flex-direction: column; }
  .chevrons li { clip-path: none !important; margin: 0 0 2px; text-align: left; padding: .8rem 1rem; }
  .cred { grid-template-columns: 1fr; }
  .work { grid-template-columns: 1fr; }
  .foot { grid-template-columns: 1fr; }
  .tagline { display: none; }
  .brand-logo { height: 40px; }
}

/* Six nav links plus the button need room; switch to the menu button below 1040px */
@media (max-width: 1040px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--band); flex-direction: column; align-items: flex-start; padding: 18px var(--gutter) 26px; gap: 16px; border-bottom: 1px solid rgba(234,231,221,.12); }
  .nav.open { display: flex; }
}
