/* Torus Solutions
   Direction A (October 2026). Newsreader for display and reading, Public Sans
   for labels and controls, one brass accent, and a live toroidal field in each
   hero. One left edge: every block sits on the same .wrap, and two-column
   content always splits on the same 5:7 line. */

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

:root {
  /* Ground */
  --bg: #141412;
  --bg-raised: #1B1B18;
  --surface: #1F1F1C;
  --surface-hover: #252520;

  /* Rules. 1px with alpha, so weight is opacity and not sub-pixel width. */
  --rule-hair:   rgba(236, 230, 216, 0.07);
  --rule:        rgba(236, 230, 216, 0.12);
  --rule-strong: rgba(236, 230, 216, 0.22);

  /* Text. Secondary 7.9:1 and muted 5.3:1 against the ground. */
  --text: #ECE6D8;
  --text-secondary: #ABA698;
  --text-muted: #8E897C;

  /* Accent. site.js reads --accent for the field and --accent / --accent-dim
     for the form's sent state, so keep both names. */
  --accent: #CFA96B;
  --accent-bright: #DDBB82;
  --accent-dim: #8E7650;
  --accent-glow: rgba(207, 169, 107, 0.075);
  --accent-band: rgba(207, 169, 107, 0.16);

  /* Type */
  --f-serif: 'Newsreader', Georgia, serif;
  --f-sans: 'Public Sans', system-ui, sans-serif;

  --fs-display:   clamp(42px, 5.8vw, 78px);
  --fs-h2:        clamp(32px, 3.9vw, 50px);
  --fs-statement: clamp(23px, 2.4vw, 30px);
  --fs-quote:     clamp(21px, 2.1vw, 27px);
  --fs-title:     clamp(21px, 1.9vw, 25px);
  --fs-lead:      20px;
  --fs-body:      18px;
  --fs-small:     16px;
  --fs-label:     12px;

  /* Layout */
  --w-wrap: 1120px;
  --gutter: 56px;
  --w-text: 36em;
  --split: 5fr 7fr;
  --split-gap: 72px;
  --space-section: 104px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-serif);
  font-weight: 350;
  font-size: var(--fs-body);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Footer sits at the bottom of short pages instead of floating mid-screen.
   A page that is only a hero lets the hero take up the slack, so there is no
   empty band between it and the footer. */
main { flex: 1 0 auto; display: flex; flex-direction: column; }
main > .hero:only-child { flex: 1 0 auto; border-bottom: 0; }

::selection { background: var(--accent); color: var(--bg); }

.wrap {
  max-width: var(--w-wrap);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* NAV */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.3s;
}

.site-nav.is-scrolled { border-bottom-color: var(--rule-strong); }

.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 28px;
  min-height: 72px;
  padding-block: 12px;
}

.nav-logo {
  font: 500 20px/1 var(--f-serif);
  letter-spacing: 0.005em;
  color: var(--text);
  text-decoration: none;
}

.nav-links { display: flex; flex-wrap: wrap; gap: 0 28px; list-style: none; }

.nav-links a {
  display: inline-block;
  padding-block: 10px;
  font: 500 14px var(--f-sans);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); box-shadow: inset 0 -1px 0 var(--accent); }

/* HERO
   Full bleed, so the glow and the field run to the window edge instead of
   being clipped by the content width. */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: 128px 112px;
  border-bottom: 1px solid var(--rule);
  background: radial-gradient(620px 520px at 76% 50%, var(--accent-glow), transparent 70%);
}

.hero--compact { padding-block: 112px 96px; }

.hero .wrap { position: relative; z-index: 1; }
.hero-text { max-width: 640px; }

.field {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 50%;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 26%);
  mask-image: linear-gradient(to right, transparent, #000 26%);
}

.field canvas { display: block; width: 100%; height: 100%; }

/* site.js sizes the torus from --field-scale: its radius as a share of the
   field's shorter side. Inner pages carry a smaller one, clear of the title. */
.field { --field-scale: 0.42; }
.hero--compact .field { --field-scale: 0.34; width: 44%; }

.motion-toggle {
  position: absolute;
  z-index: 2;
  right: 24px;
  bottom: 20px;
  min-height: 40px;
  padding: 10px 14px;
  font: 500 12px var(--f-sans);
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: rgba(20, 20, 18, 0.6);
  border: 1px solid var(--rule);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.motion-toggle:hover { color: var(--text); border-color: var(--rule-strong); }
.motion-toggle[hidden] { display: none; }

/* TYPE */
.kicker {
  display: block;
  margin-bottom: 24px;
  font: 600 var(--fs-label) var(--f-sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  font: 300 var(--fs-display)/1.03 var(--f-serif);
  font-variation-settings: "opsz" 72;
  letter-spacing: -0.025em;
  color: var(--text);
  text-wrap: balance;
}

h1 em { font-style: italic; font-weight: 300; color: var(--accent); }

h2 {
  font: 300 var(--fs-h2)/1.1 var(--f-serif);
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
}

p { color: var(--text-secondary); max-width: var(--w-text); }
p + p { margin-top: 20px; }

.hero .lead {
  margin-top: 32px;
  max-width: 27em;
  font-size: var(--fs-lead);
  line-height: 1.65;
}

/* A paragraph set large, for a section's opening point. */
.statement {
  font: 300 var(--fs-statement)/1.38 var(--f-serif);
  letter-spacing: -0.01em;
  color: var(--text);
  max-width: 20em;
}

/* BUTTONS AND LINKS */
.hero-cta { margin-top: 44px; display: flex; flex-wrap: wrap; gap: 14px; }
.section-cta { margin-top: 48px; display: flex; flex-wrap: wrap; gap: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 26px;
  font: 600 14px var(--f-sans);
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--rule-strong);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.btn-primary { color: #17140E; background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-bright); border-color: var(--accent-bright); }
.btn-ghost { background: rgba(20, 20, 18, 0.5); }
.btn-ghost:hover { background: var(--surface); border-color: var(--text-muted); }

.text-link {
  display: inline-block;
  padding-bottom: 3px;
  font: 600 14px var(--f-sans);
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-dim);
  transition: border-color 0.2s;
}

.text-link:hover { border-bottom-color: var(--accent); }

/* SECTIONS */
.section { padding-block: var(--space-section); }
.section + .section { border-top: 1px solid var(--rule); }

.section--raised {
  background: var(--bg-raised);
  border-bottom: 1px solid var(--rule);
}

.section--raised + .section { border-top: 0; }

/* The shared two-column line. Left: what it is. Right: what it says. */
.split {
  display: grid;
  grid-template-columns: var(--split);
  gap: var(--split-gap);
  align-items: start;
}

.split > * { min-width: 0; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 40px;
  margin-bottom: 56px;
}

/* HOME: FINDINGS */
.finding-row {
  display: grid;
  grid-template-columns: var(--split);
  gap: var(--split-gap);
  padding-block: 40px;
  border-top: 1px solid var(--rule);
}

.finding-row > * { min-width: 0; }
.finding-row:last-child { padding-bottom: 0; }

.finding-title {
  font: 400 var(--fs-title)/1.3 var(--f-serif);
  color: var(--text);
  margin-bottom: 8px;
}

.finding-meta { font: 500 14px/1.55 var(--f-sans); color: var(--text-muted); max-width: 26em; }
.finding-meta + .finding-meta { margin-top: 6px; }

.quote {
  font: italic 300 var(--fs-quote)/1.45 var(--f-serif);
  color: var(--text);
  max-width: 30em;
  text-wrap: pretty;
}

/* HOME: PRACTICE AREAS */
.areas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px var(--split-gap);
}

.area { padding-top: 28px; border-top: 1px solid var(--rule); }
.area > * { min-width: 0; }

.area h3 {
  font: 400 var(--fs-title)/1.3 var(--f-serif);
  color: var(--text);
  margin-bottom: 10px;
}

.area p { font-size: var(--fs-small); line-height: 1.65; }

/* HOME: HOW WE WORK */
.question {
  font: 300 clamp(26px, 3vw, 38px)/1.28 var(--f-serif);
  letter-spacing: -0.015em;
  color: var(--text);
  max-width: 18em;
}

.question em { color: var(--accent); }

.figure { margin-block: 40px 36px; }

.figure svg { display: block; width: 100%; height: auto; }

.figure figcaption {
  margin-top: 12px;
  font: 400 13px/1.5 var(--f-sans);
  color: var(--text-muted);
}

.fig text { font-family: var(--f-sans); font-size: 13px; fill: var(--text-secondary); }
.fig .fig-key { font-family: var(--f-serif); font-size: 17px; fill: var(--text); }
.fig .fig-track { stroke: var(--rule-strong); stroke-width: 1; }
.fig .fig-band { fill: var(--accent-band); }
.fig .fig-span { stroke: var(--accent); stroke-width: 1.5; fill: none; }
.fig .fig-base { fill: var(--text); }
.fig .fig-stress { fill: var(--bg); stroke: var(--accent); stroke-width: 1.5; }
.fig .fig-legend-stress { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.fig .fig-fail { fill: var(--accent); }

/* ROWS: principles on About, practice areas on Services */
.rows { border-top: 1px solid var(--rule); }
.wrap > .rows:first-child { border-top: 0; }
.wrap > .rows:first-child .row:first-child { padding-top: 0; }

.row {
  display: grid;
  grid-template-columns: var(--split);
  gap: var(--split-gap);
  padding-block: 36px;
  border-bottom: 1px solid var(--rule);
}

.row > * { min-width: 0; }

.row-title {
  font: 400 var(--fs-title)/1.3 var(--f-serif);
  letter-spacing: -0.005em;
  color: var(--text);
}

/* ENGAGEMENTS */
.engagement {
  display: grid;
  grid-template-columns: var(--split);
  gap: var(--split-gap);
  padding-block: 56px;
  border-bottom: 1px solid var(--rule);
}

.engagement:first-child { padding-top: 0; }
.engagement > * { min-width: 0; }

.engagement-region {
  display: block;
  margin-bottom: 12px;
  font: 600 var(--fs-label) var(--f-sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.engagement-sector {
  font: 400 clamp(24px, 2.3vw, 30px)/1.25 var(--f-serif);
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 14px;
}

.engagement-scale {
  font: italic 400 var(--fs-small)/1.6 var(--f-serif);
  color: var(--accent);
  max-width: 24em;
}

.engagement-finding { margin-bottom: 28px; }

.engagement-finding-label {
  display: block;
  margin-bottom: 12px;
  font: 600 var(--fs-label) var(--f-sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.disclosure {
  margin-top: 48px;
  font: 400 15px/1.7 var(--f-sans);
  color: var(--text-muted);
  max-width: 44em;
}

/* CONTACT */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 20px;
}

.form-full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

label {
  font: 600 var(--fs-label) var(--f-sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

input, select, textarea {
  width: 100%;
  padding: 14px 16px;
  font: 350 var(--fs-small) var(--f-serif);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s, background 0.2s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-dim);
  background: var(--surface-hover);
}

select {
  cursor: pointer;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238E897C' stroke-width='1.2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

textarea { resize: vertical; min-height: 140px; line-height: 1.6; }

::placeholder { color: var(--text-muted); opacity: 1; }

.form-actions { margin-top: 28px; }

.form-note {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--rule-hair);
  font: 400 13px/1.65 var(--f-sans);
  color: var(--text-muted);
  max-width: 100%;
}

.form-error { margin-top: 20px; color: var(--accent); font-size: 15px; }
.form-error a { color: var(--accent); }

.hidden-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

button[disabled] { cursor: default; }

/* FOOTER */
.site-footer { border-top: 1px solid var(--rule-strong); }

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 36px;
}

.footer-logo { font: 500 17px var(--f-serif); color: var(--text-secondary); }
.footer-copy { font: 500 13px var(--f-sans); color: var(--text-muted); }

/* ACCESSIBILITY */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 12px 20px;
  font: 600 13px var(--f-sans);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--accent-dim);
  text-decoration: none;
}

.skip-link:focus { left: 16px; top: 16px; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
}

/* RESPONSIVE */
@media (max-width: 960px) {
  :root { --gutter: 40px; --split-gap: 48px; }
  .form-grid { grid-template-columns: 1fr; }
}

/* One column. The field moves above the headline instead of beside it. */
@media (max-width: 760px) {
  :root { --gutter: 24px; --space-section: 72px; }

  .split, .finding-row, .row, .engagement { grid-template-columns: 1fr; gap: 14px; }
  .engagement { gap: 22px; }
  .split { gap: 28px; }
  .areas { grid-template-columns: 1fr; }

  .hero, .hero--compact {
    padding-block: 0 64px;
    background: radial-gradient(360px 300px at 50% 150px, var(--accent-glow), transparent 70%);
  }

  .field {
    position: relative;
    width: 100%;
    height: 320px;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .hero--compact .field { width: 100%; height: 230px; --field-scale: 0.42; }
  .motion-toggle { top: 16px; right: 16px; bottom: auto; }

  .hero .lead { font-size: 18px; }
  .hero-cta { margin-top: 36px; }
  .finding-row { padding-block: 32px; }
  .row { padding-block: 28px; }
  .engagement { padding-block: 44px; }
  .engagement-finding { margin-bottom: 20px; }

  /* The drawing scales down to about two thirds; keep its labels readable. */
  .fig text { font-size: 17px; }
  .fig .fig-key { font-size: 20px; }
}

/* The nav stops sticking on phones, so it never sits over content. */
@media (max-width: 600px) {
  .site-nav { position: static; }
  .site-nav .wrap { min-height: 0; padding-block: 16px 6px; }
  .nav-links { gap: 0 20px; }
  .site-footer .wrap { padding-block: 28px; }
}
