/* ThetaSquared, LLC — site styles
   Tokens are defined light-first on bare :root, then overridden for dark. */

:root {
  --bg:        #fbfaf7;
  --surface:   #ffffff;
  --surface-2: #f4f2ec;
  --ink:       #16211d;
  --ink-2:     #33423c;
  --muted:     #5f6d67;
  --line:      #e0e4e0;
  --line-2:    #cdd4cf;
  --green:     #1f5c3d;
  --green-2:   #2d7a52;
  --teal:      #1d6f83;
  --on-green:  #f4f8f5;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --wrap: 1120px;
  --gut: clamp(1.25rem, 4vw, 3rem);
  --radius: 4px;
  --shadow: 0 1px 2px rgba(22,33,29,.05), 0 8px 24px -12px rgba(22,33,29,.14);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #101614;
    --surface:   #171f1c;
    --surface-2: #1d2723;
    --ink:       #eef2ef;
    --ink-2:     #ccd6d1;
    --muted:     #94a29c;
    --line:      #27332e;
    --line-2:    #33423c;
    --green:     #6fbf90;
    --green-2:   #8fd3a9;
    --teal:      #6bb6c9;
    --on-green:  #0d1512;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6);
  }
}

:root[data-theme="dark"] {
  --bg:#101614; --surface:#171f1c; --surface-2:#1d2723;
  --ink:#eef2ef; --ink-2:#ccd6d1; --muted:#94a29c;
  --line:#27332e; --line-2:#33423c;
  --green:#6fbf90; --green-2:#8fd3a9; --teal:#6bb6c9; --on-green:#0d1512;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2.5rem, 6.5vw, 4.25rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h3 { font-size: 1.28rem; line-height: 1.3; }

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green-2); }

img, svg { max-width: 100%; height: auto; }
ul { margin: 0 0 1em; padding-left: 1.15em; }
li { margin-bottom: .4em; }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 2px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--green); color: var(--on-green); padding: .75rem 1.25rem;
}
.skip:focus { left: .5rem; top: .5rem; }

.eyebrow {
  font-family: var(--sans);
  font-size: .72rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 1rem;
}

.lede {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  line-height: 1.55; color: var(--ink-2); max-width: 62ch;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 1rem; min-height: 68px; }

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand img { width: 42px; height: 42px; flex: none; }
.brand b { font-family: var(--serif); font-size: 1.18rem; font-weight: 600; letter-spacing: -.01em; }
.brand span { display: block; font-size: .66rem; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); font-weight: 500; }

.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: .93rem; font-weight: 500; }
.nav a:hover { color: var(--green); }
/* Specificity must beat `.nav a`, or the CTA inherits body-text colour on green. */
.nav a.btn { color: var(--on-green); font-size: .88rem; }
.nav a.btn:hover { color: var(--on-green); }
.nav-toggle { display: none; }

@media (max-width: 880px) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: .5rem;
    background: none; border: 1px solid var(--line-2); border-radius: var(--radius);
    color: var(--ink); font: inherit; font-size: .85rem; padding: .5rem .8rem; cursor: pointer;
  }
  .nav {
    position: fixed; inset: 68px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: .5rem var(--gut) 1.25rem; box-shadow: var(--shadow);
  }
  .nav[hidden] { display: none; }
  .nav a { padding: .85rem 0; border-bottom: 1px solid var(--line); }
  .nav .btn { margin-top: 1rem; justify-content: center; border-bottom: 0; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--green); color: var(--on-green);
  padding: .8rem 1.4rem; border-radius: var(--radius);
  font-weight: 600; font-size: .95rem; text-decoration: none;
  border: 1px solid var(--green); cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--green-2); border-color: var(--green-2); color: var(--on-green); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--muted); }

/* ---------- sections ---------- */
section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
section + section { border-top: 1px solid var(--line); }
.section-head { max-width: 58ch; margin-bottom: clamp(2rem, 4vw, 3rem); }

/* ---------- hero ---------- */
.hero { padding-block: clamp(3.5rem, 9vw, 7rem); border-top: 0; }
.hero .wrap { display: grid; grid-template-columns: 1.35fr .65fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { margin-bottom: .35em; }
.hero h1 em { font-style: normal; color: var(--green); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
/* The seal is a raster asset recovered from the original site at 103px native.
   Cap display size so it never upscales past ~1.5x and go soft. */
.hero-seal img { width: 160px; height: 160px; margin-inline: auto; display: block; }

@media (max-width: 800px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-seal { order: -1; }
  .hero-seal img { width: 116px; height: 116px; margin-inline: 0; }
}

/* ---------- cards ---------- */
.grid {
  display: grid; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.card { background: var(--surface); padding: clamp(1.5rem, 3vw, 2rem); }
.card h3 { margin-bottom: .5rem; }
.card p { font-size: .97rem; color: var(--muted); }
.card .num {
  font-family: var(--serif); font-size: .8rem; color: var(--green);
  display: block; margin-bottom: .75rem; letter-spacing: .08em;
}

@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
@media (max-width: 880px) { .about-grid { grid-template-columns: 1fr; } }

.creds { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.creds li { margin: 0; padding: .95rem 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.creds strong { display: block; color: var(--ink); font-weight: 600; }
.creds span { color: var(--muted); font-size: .9rem; }

/* ---------- experience ---------- */
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.facts li { margin: 0; background: var(--bg); padding: 1.15rem 0 1.15rem 2.1rem; position: relative; font-size: 1rem; }
.facts li::before {
  content: ""; position: absolute; left: .45rem; top: 1.6rem;
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
}

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: .95fr 1.05fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 880px) { .contact-grid { grid-template-columns: 1fr; } }

.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink); margin-bottom: .4rem; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: .98rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius); padding: .7rem .85rem;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--green); }
.hp { position: absolute; left: -9999px; }
.form-note { font-size: .85rem; color: var(--muted); margin-top: .9rem; }

.contact-detail { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.contact-detail li { display: flex; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--line); font-size: .97rem; margin: 0; }
.contact-detail dfn {
  font-style: normal; color: var(--muted); min-width: 5.5rem;
  font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; padding-top: .2rem;
}

/* ---------- callout ---------- */
.callout {
  background: var(--surface-2); border-left: 3px solid var(--green);
  padding: 1.25rem 1.5rem; border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .92rem; color: var(--muted);
}
.callout strong { color: var(--ink); }

/* ---------- pull quote ---------- */
.pull { border-left: 3px solid var(--green); padding-left: 1.5rem; margin: 0; max-width: 60ch; }
.pull p { font-family: var(--serif); font-size: clamp(1.25rem, 2.6vw, 1.6rem); line-height: 1.4; color: var(--ink); }
.pull footer { font-size: .9rem; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 3rem 2.5rem; font-size: .9rem; color: var(--muted); }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; }
@media (max-width: 700px) { .site-footer .wrap { grid-template-columns: 1fr; } }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--green); }

.foot-legal {
  border-top: 1px solid var(--line); margin-top: 2.5rem; padding-top: 1.5rem;
  display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; justify-content: space-between; font-size: .82rem;
}

/* ---------- inner pages ---------- */
.prose { max-width: 68ch; }
.prose h2 { font-size: 1.5rem; margin-top: 2.5rem; }
.prose h2:first-of-type { margin-top: 1.5rem; }

/* ---------- content + sidebar pages ---------- */
.aside-grid { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(0,.8fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
@media (max-width: 880px) { .aside-grid { grid-template-columns: 1fr; } }

.aside { font-size: .96rem; }
.aside h3 { font-size: 1.1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.aside p { color: var(--muted); }

/* ---------- service blocks ---------- */
.svc { padding-block: 1.75rem; border-top: 1px solid var(--line); }
.svc:first-of-type { border-top: 0; padding-top: .5rem; }
.svc h3 { margin-bottom: .35rem; }
.svc h3 a { text-decoration: none; color: var(--ink); }
.svc h3 a:hover { color: var(--green); text-decoration: underline; }
.svc-tag { font-family: var(--serif); font-size: 1.1rem; line-height: 1.45; color: var(--green); margin-bottom: .75rem; }
.svc-more { font-size: .9rem; margin-bottom: 0; }
.svc-img { display: block; width: 100%; max-width: 424px; height: auto; border-radius: var(--radius); margin: 0 0 1.5rem; }

.svc-other { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.svc-other h3 { font-size: 1.05rem; }
.svc-other ul { list-style: none; padding: 0; margin: 0; }
.svc-other li { margin: 0; border-bottom: 1px solid var(--line); }
.svc-other a { display: block; padding: .7rem 0; text-decoration: none; font-size: .95rem; }
.svc-other a:hover { text-decoration: underline; }

/* ---------- links directory ---------- */
.link-cats { list-style: none; padding: 0; margin: 2rem 0; }
.link-cats > li { margin: 0; padding: 1.5rem 0; border-top: 1px solid var(--line); }
.link-cats h3 { margin-bottom: .4rem; }
.empty-note { font-size: .9rem; color: var(--muted); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; background: var(--surface-2); padding: .12em .4em; border-radius: 3px; }

/* current page in nav */
.nav a[aria-current="page"] { color: var(--green); text-decoration: underline; text-underline-offset: 5px; }

/* the contact page reuses form styles inside a prose column */
.aside-grid form { margin-top: 1.5rem; max-width: 34rem; }
.aside-grid .contact-detail { max-width: 34rem; }

/* Interior pages carry their main heading as h1 but at h2's visual weight —
   the hero h1 on the home page is the only display-scale heading on the site. */
h1.page-title { font-size: clamp(1.9rem, 4vw, 2.6rem); }

/* ============================================================
   Personal-site rebuild (2026). Sections below supersede the
   ThetaSquared-branded header and card styles above.
   ============================================================ */

/* ---------- wordmark header ---------- */
.brand { display: block; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand-name {
  display: block; font-family: var(--serif); font-size: 1.06rem;
  font-weight: 500; letter-spacing: .01em; line-height: 1.1;
}
.brand-sub {
  display: block; font-size: .64rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted); font-weight: 500; margin-top: .18rem;
}
.nav { gap: 1.15rem; }
.nav a { font-size: .88rem; }

/* ---------- home: one screen ---------- */
.opening {
  min-height: calc(100svh - 68px);
  display: flex; align-items: center;
  padding-block: clamp(2.5rem, 6vw, 4rem);
  border: 0;
}
.opening .wrap { display: block; width: 100%; }
.opening h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.4rem);
  margin-bottom: .55em; max-width: 20ch;
}
.proposition {
  font-family: var(--serif); font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  line-height: 1.45; color: var(--ink-2); max-width: 46ch; margin-bottom: clamp(2rem, 5vw, 3.25rem);
}
.proposition em { font-style: normal; color: var(--green); }

.doors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.door {
  background: var(--bg); padding: 1.5rem 1.25rem 1.5rem 0; text-decoration: none;
  display: block; transition: background .15s ease;
}
.door:not(:first-child) { padding-left: 1.25rem; }
.door:hover { background: var(--surface-2); }
.door .k { display: block; font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: .5rem; }
.door .t { display: block; font-family: var(--serif); font-size: 1.22rem; color: var(--ink); line-height: 1.25; }
.door .a { display: block; font-size: .85rem; color: var(--green); margin-top: .7rem; }
@media (max-width: 760px) {
  .opening { min-height: 0; }
  .doors { grid-template-columns: 1fr; }
  .door, .door:not(:first-child) { padding: 1.25rem 0; }
}

/* ---------- page head ---------- */
.page-head { max-width: 60ch; margin-bottom: clamp(2.25rem, 5vw, 3.5rem); }
.page-head .lede { margin-top: .75rem; }

/* ---------- case files ---------- */
.band { margin-top: clamp(2.5rem, 5vw, 4rem); }
.band > h2 {
  font-size: 1.05rem; font-family: var(--sans); font-weight: 600;
  letter-spacing: .15em; text-transform: uppercase; color: var(--muted);
  padding-bottom: .6rem; border-bottom: 2px solid var(--green); margin-bottom: 0;
}
.band > .band-note { font-size: .92rem; color: var(--muted); margin: .9rem 0 0; max-width: 62ch; }

.cf { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,15rem); gap: clamp(1.5rem,4vw,3rem); padding-block: clamp(2rem,4vw,2.75rem); border-bottom: 1px solid var(--line); }
@media (max-width: 880px) { .cf { grid-template-columns: 1fr; } }
.cf-id { font-family: var(--serif); font-size: .82rem; letter-spacing: .1em; color: var(--green); display: block; margin-bottom: .4rem; }
.cf h3 { font-size: 1.42rem; margin-bottom: .2rem; }
.cf .years { font-size: .85rem; color: var(--muted); margin-bottom: 1.1rem; }
.cf dl { margin: 0; }
.cf dt {
  font-size: .68rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-top: 1.1rem;
}
.cf dt:first-child { margin-top: 0; }
.cf dd { margin: .35rem 0 0; }

/* margin testimonial, beside the project it describes */
.cf-aside { align-self: start; }
.cf-quote {
  margin: 0; padding: 1rem 0 0; border-top: 2px solid var(--green);
  font-size: .93rem;
}
.cf-quote p { font-family: var(--serif); font-size: 1.02rem; line-height: 1.45; color: var(--ink); }
.cf-quote footer { font-size: .82rem; color: var(--muted); line-height: 1.45; }
.cf-quote footer b { display: block; color: var(--ink-2); font-weight: 600; }
@media (max-width: 880px) { .cf-quote { border-top-width: 1px; margin-top: .5rem; } }

/* ---------- defined units (advisory / neutral) ---------- */
.unit { padding-block: 1.6rem; border-top: 1px solid var(--line); }
.unit:first-of-type { border-top: 2px solid var(--green); }
.unit h3 { font-size: 1.18rem; margin-bottom: .5rem; }
.unit .ask { font-family: var(--serif); font-size: 1.06rem; color: var(--green); margin-bottom: .6rem; }
.unit-meta { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .8rem 2rem; margin-top: .9rem; }
@media (max-width: 620px) { .unit-meta { grid-template-columns: 1fr; } }
.unit-meta div { font-size: .92rem; }
.unit-meta dt, .unit-meta .lbl {
  font-size: .66rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; display: block; margin-bottom: .25rem;
}

/* ---------- factor list (method) ---------- */
.factors { list-style: none; padding: 0; margin: 1.5rem 0 0; counter-reset: factor; }
.factors > li { margin: 0; padding: 1.35rem 0; border-top: 1px solid var(--line); counter-increment: factor; }
.factors > li::before {
  content: counter(factor, decimal-leading-zero);
  font-family: var(--serif); font-size: .8rem; color: var(--green);
  display: block; margin-bottom: .35rem; letter-spacing: .08em;
}
.factors h4 { font-size: 1.1rem; margin-bottom: .35rem; }
.factors .q { color: var(--muted); font-size: .95rem; margin: 0; }
.factors .ai {
  margin: .7rem 0 0; padding-left: .9rem; border-left: 2px solid var(--green);
  font-size: .93rem;
}
.factors .ai b { color: var(--ink); font-weight: 600; }

/* ---------- reference list ---------- */
.refs { list-style: none; padding: 0; margin: 1.25rem 0 0; }
.refs li { padding: .7rem 0; border-top: 1px solid var(--line); font-size: .93rem; margin: 0; }
.refs .yr { color: var(--green); font-family: var(--serif); margin-right: .5rem; }
.refs cite { font-style: italic; }

/* ---------- dated CV rows ---------- */
.rows { list-style: none; padding: 0; margin: 0 0 1.5rem; border-top: 1px solid var(--line); }
.rows li { display: grid; grid-template-columns: 8.5rem minmax(0,1fr); gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); margin: 0; font-size: .95rem; }
@media (max-width: 620px) { .rows li { grid-template-columns: 1fr; gap: .15rem; } }
.rows .when { color: var(--muted); font-size: .85rem; padding-top: .12rem; }
.rows b { display: block; color: var(--ink); font-weight: 600; }
.rows span.det { color: var(--muted); font-size: .9rem; }

/* ---------- editorial placeholder ---------- */
.todo {
  border: 1px dashed var(--green); border-left-width: 3px; border-left-style: solid;
  background: var(--surface-2); padding: 1rem 1.2rem; margin: 1.25rem 0;
  font-size: .92rem; color: var(--ink-2);
}
.todo b {
  display: block; color: var(--green); font-size: .68rem; letter-spacing: .15em;
  text-transform: uppercase; margin-bottom: .4rem;
}

/* ---------- disclosure block (neutral page) ---------- */
.disclosure { border: 1px solid var(--line-2); padding: clamp(1.25rem,3vw,1.75rem); margin-top: 1.5rem; }
.disclosure h3 { font-size: 1.05rem; }
.disclosure ul { font-size: .93rem; color: var(--ink-2); }

/* ---------- footer ---------- */
.foot-entity { display: flex; gap: 1rem; align-items: flex-start; }
.foot-entity img { width: 52px; height: 52px; flex: none; }
.foot-notice {
  font-size: .8rem; color: var(--muted); line-height: 1.6;
  border-top: 1px solid var(--line); padding-top: 1.5rem; margin: 2.5rem 0 0; max-width: 78ch;
}
.foot-legal { border-top: 0; margin-top: 1.25rem; padding-top: 0; }
