/* Nowhere Theory — website-specific styles */
@import url('../../colors_and_type.css');

/* Website-scoped surface + text overrides.
   Background shifts from warm paper to a cool off-white (#ededef).
   Body text uses oxblood (#351710) instead of near-black ink. */
:root {
  --surface-0: #ededef;
  --fg-1: #351710;
}

html, body { margin: 0; background: var(--surface-0); }
body { font-family: var(--font-sans); color: var(--fg-1); }

/* ---- Shell ---- */
.nt-shell { max-width: 1280px; margin: 0 auto; padding: 0 48px; }
.nt-rule  { border: 0; border-top: 1px solid var(--stroke-1); margin: 0; }

/* ---- Masthead / site nav ---- */
.nt-mast {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 28px 48px; border-bottom: 1px solid var(--stroke-1);
  max-width: 1280px; margin: 0 auto;
}
.nt-wm { font-family: var(--font-serif); font-size: 22px; letter-spacing: -0.02em; color: var(--fg-1); text-decoration: none; white-space: nowrap; }
.nt-wm em { font-style: italic; font-weight: 300; }
.nt-wm-stop { color: var(--accent-ember); }
.nt-nav-links { display: flex; gap: 32px; align-items: baseline; }
.nt-nav-links a {
  font-family: var(--font-sans); font-size: 13px; color: var(--fg-1);
  text-decoration: none; padding-bottom: 2px; letter-spacing: 0.02em;
}
.nt-nav-links a.on { border-bottom: 1px solid var(--fg-1); }
.nt-nav-links a.muted { color: var(--fg-3); }
.nt-nav-links a:hover:not(.on) { opacity: 0.6; }
.nt-nav-cta {
  font-family: var(--font-sans); font-size: 13px; padding: 8px 16px;
  border: 1px solid var(--nt-ink); border-radius: 4px;
  color: var(--nt-ink); text-decoration: none; transition: all 120ms ease;
  white-space: nowrap;
}
.nt-nav-links a { white-space: nowrap; }
.nt-nav-cta:hover { background: var(--nt-ink); color: var(--nt-bone); }

/* ---- Eyebrow & section marks ---- */
.nt-eyebrow {
  font-family: var(--font-sans); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.18em; color: var(--fg-3);
}
.nt-sect-mark { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); letter-spacing: 0.1em; }

/* ---- Buttons ---- */
.btn {
  font-family: var(--font-sans); font-size: 14px; font-weight: 500;
  padding: 12px 22px; border-radius: 4px; border: 1px solid transparent;
  cursor: pointer; line-height: 1; transition: all 120ms ease;
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
}
.btn-primary { background: var(--nt-navy); color: var(--nt-bone); border-color: var(--nt-navy); }
.btn-primary:hover { background: var(--nt-ink); border-color: var(--nt-ink); }
.btn-secondary { background: var(--nt-bone); color: var(--nt-ink); border-color: var(--nt-ink); }
.btn-secondary:hover { background: var(--nt-powder); }
.btn-ghost { background: transparent; color: var(--nt-ink); border-color: transparent; text-decoration: underline; text-underline-offset: 4px; padding: 12px 4px; }
.btn-ghost:hover { opacity: 0.6; }

/* ---- Inputs ---- */
.nt-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.nt-field label { font-family: var(--font-sans); font-size: 10px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--fg-3); }
.nt-input, .nt-textarea, .nt-select {
  font-family: var(--font-sans); font-size: 15px; padding: 12px 14px;
  background: var(--nt-bone); border: 1px solid var(--nt-line-cool); border-radius: 2px;
  color: var(--fg-1); outline: none; width: 100%;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.nt-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.nt-select { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%231A1410' stroke-width='1.25'%3E%3Cpolyline points='1 1 5 5 9 1'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px;
}
.nt-input:focus, .nt-textarea:focus, .nt-select:focus {
  border-color: var(--nt-navy); box-shadow: 0 0 0 2px var(--nt-paper), 0 0 0 3px var(--nt-navy-40);
}
.nt-hint { font-family: var(--font-sans); font-size: 12px; color: var(--fg-3); margin-top: 4px; }
.nt-hint.err { color: var(--nt-oxblood); }

/* ---- Footer ---- */
.nt-foot {
  max-width: 1280px; margin: 96px auto 0; padding: 36px 48px 36px;
  border-top: 1px solid var(--stroke-1);
  display: flex; gap: 48px; align-items: flex-end; justify-content: space-between;
  font-family: var(--font-sans); font-size: 12px; color: var(--fg-3);
}
.nt-foot b { display: block; color: var(--fg-1); font-weight: 500; text-transform: uppercase; letter-spacing: 0.18em; font-size: 10px; margin-bottom: 8px; }
.nt-foot .col { line-height: 1.75; }
.nt-foot .mark { font-family: var(--font-serif); font-style: italic; color: var(--fg-3); font-size: 13px; }

/* ---- Hand annotation ---- */
.nt-annotation {
  font-family: var(--font-hand); color: var(--accent-ember);
  font-size: 26px; line-height: 1.1; font-weight: 500;
}

/* ---- Page transitions ---- */
.nt-page { animation: pageIn 420ms cubic-bezier(0.22, 0.61, 0.36, 1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============================================================
   THEORIES PAGE — interactive two-type threshold model
   Namespaced .nt-th-* to avoid collisions with other pages
   ============================================================ */

.nt-th-page { padding-bottom: 48px; }

/* ---- Hero --------------------------------------------------- */
.nt-th-hero {
  padding: 96px 0 64px;
  border-bottom: 1px solid var(--stroke-1);
  position: relative;
}
.nt-th-title {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(44px, 6vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.024em;
  max-width: 19ch;
  margin: 24px 0 0;
}
.nt-th-title em {
  font-style: italic;
  color: var(--nt-navy);
  font-weight: 300;
}
.nt-th-lede {
  max-width: 52ch;
  margin-top: 28px;
}
.nt-th-byline {
  margin-top: 36px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-3);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 20px;
}
.nt-th-byline-note {
  font-family: var(--font-hand);
  font-size: 22px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--accent-ember);
  display: inline-block;
  transform: rotate(-3deg);
}

/* ---- Shared two-column block ------------------------------- */
.nt-th-twocol {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 64px;
}
.nt-th-twocol h2 {
  font-size: clamp(28px, 3.2vw, 44px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.012em;
  max-width: 14ch;
}
.nt-th-body {
  font-size: 17px;
  line-height: 1.65;
  color: var(--fg-2);
  max-width: 58ch;
}
.nt-th-body code,
.nt-th-prop code,
.nt-th-section-sub code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--accent-ember);
  background: transparent;
  padding: 0;
  letter-spacing: 0;
}
.nt-th-setup {
  padding: 80px 0;
  border-bottom: 1px solid var(--stroke-1);
}

/* ---- Formal structure disclosure --------------------------- */
.nt-th-math-toggle {
  margin-top: 24px;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--stroke-1);
  padding: 14px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-3);
  cursor: pointer;
  display: block;
  width: 100%;
  text-align: left;
  transition: color 120ms ease;
}
.nt-th-math-toggle:hover { color: var(--accent-ember); }
.nt-th-math {
  margin-top: 18px;
  padding: 22px 24px;
  background: var(--nt-bone);
  border: 1px solid var(--stroke-1);
}
.nt-th-math-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--stroke-1);
  align-items: baseline;
}
.nt-th-math-row:last-child { border-bottom: 0; }
.nt-th-math-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.nt-th-math-eq {
  font-family: var(--font-serif);
  font-size: 18px;
  font-style: italic;
  color: var(--fg-1);
  line-height: 1.4;
}
.nt-th-math-eq sub,
.nt-th-math-eq sup { font-style: normal; font-size: 0.7em; }

/* ---- Model section ----------------------------------------- */
.nt-th-model {
  padding: 80px 0;
  border-bottom: 1px solid var(--stroke-1);
}
.nt-th-modelhead {
  font-size: clamp(32px, 3.8vw, 56px);
  font-weight: 400;
  margin-top: 8px;
  line-height: 1.04;
  letter-spacing: -0.015em;
  font-family: var(--font-serif);
}
.nt-th-modelsub {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--fg-2);
  max-width: 58ch;
  margin-top: 14px;
  margin-bottom: 32px;
}
.nt-th-chartwrap {
  background: var(--nt-bone);
  border: 1px solid var(--stroke-1);
  padding: 24px 18px 14px;
}

/* ---- Regime readout ---------------------------------------- */
.nt-th-readout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  padding: 28px 0 32px;
  border-bottom: 1px solid var(--stroke-1);
}
.nt-th-readout-l {
  border-left: 2px solid var(--accent-ember);
  padding-left: 16px;
}
.nt-th-readout-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  margin-top: 8px;
  color: var(--fg-1);
  line-height: 1.15;
}
.nt-th-readout-r p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--fg-2);
  margin: 0;
  max-width: 64ch;
}

/* ---- Presets ----------------------------------------------- */
.nt-th-presets { padding: 32px 0 12px; }
.nt-th-presetrow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--stroke-1);
}
.nt-th-preset {
  background: transparent;
  border: 0;
  border-right: 1px solid var(--stroke-1);
  padding: 18px 16px;
  text-align: left;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 120ms ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 70px;
}
.nt-th-preset:last-child { border-right: 0; }
.nt-th-preset:hover { background: var(--nt-bone); }
.nt-th-preset .name {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--fg-1);
  font-weight: 500;
  line-height: 1.15;
}
.nt-th-preset .tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  line-height: 1.3;
}

/* ---- Slider controls --------------------------------------- */
.nt-th-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
  padding-top: 32px;
}
.nt-th-slider-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.nt-th-paramname {
  background: none;
  border: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-1);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: color 120ms ease;
}
.nt-th-paramname:hover { color: var(--accent-ember); }
.nt-th-paramname .nt-th-q {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--stroke-1);
  border-radius: 999px;
  font-size: 10px;
  color: var(--fg-3);
  font-family: var(--font-serif);
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
  transition: border-color 120ms ease, color 120ms ease;
}
.nt-th-paramname:hover .nt-th-q {
  border-color: var(--accent-ember);
  color: var(--accent-ember);
}
.nt-th-val {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-ember);
}

/* Range — square thumb, hairline track */
.nt-th-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  background: var(--stroke-1);
  outline: none;
  margin: 0;
  cursor: pointer;
}
.nt-th-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--nt-ink);
  cursor: pointer;
  border-radius: 0;
  border: 0;
  transition: background 120ms ease;
}
.nt-th-slider input[type="range"]::-webkit-slider-thumb:hover {
  background: var(--accent-ember);
}
.nt-th-slider input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--nt-ink);
  cursor: pointer;
  border-radius: 0;
  border: 0;
}
.nt-th-slider input[type="range"]::-moz-range-thumb:hover {
  background: var(--accent-ember);
}
.nt-th-slider input[type="range"]::-moz-range-track {
  height: 2px;
  background: var(--stroke-1);
  border: 0;
}
.nt-th-slider input[type="range"]:focus { outline: none; }
.nt-th-slider input[type="range"]:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px var(--nt-navy-12);
}

/* ---- Parameter disclosure ---------------------------------- */
.nt-th-paramnote {
  margin-top: 32px;
  padding: 26px 28px 24px;
  background: var(--nt-powder);
  position: relative;
  max-width: 720px;
}
.nt-th-paramnote-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  margin: 8px 0 12px;
  color: var(--fg-1);
}
.nt-th-paramnote p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--nt-ink);
  max-width: 56ch;
  margin: 0;
}
.nt-th-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: transparent;
  border: 0;
  font-family: var(--font-sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-3);
  cursor: pointer;
}
.nt-th-close:hover { color: var(--fg-1); }

/* ---- Failure modes ----------------------------------------- */
.nt-th-modes {
  padding: 80px 0;
  border-bottom: 1px solid var(--stroke-1);
}
.nt-th-sectionhead {
  font-family: var(--font-serif);
  font-size: clamp(32px, 3.5vw, 48px);
  font-weight: 400;
  letter-spacing: -0.015em;
  margin-top: 8px;
  line-height: 1.05;
}
.nt-th-section-sub {
  max-width: 58ch;
  color: var(--fg-2);
  margin: 14px 0 32px;
  font-size: 15.5px;
  line-height: 1.65;
}
.nt-th-modegrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--stroke-1);
  border: 1px solid var(--stroke-1);
}
.nt-th-mode {
  background: var(--nt-bone);
  padding: 28px 28px 32px;
  border-top: 2px solid var(--accent-ember);
}
.nt-th-mode-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: 0;
  padding: 0;
  width: 100%;
  cursor: pointer;
}
.nt-th-mode-head .l {
  display: flex;
  gap: 16px;
  align-items: baseline;
}
.nt-th-mode-type {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-ember);
}
.nt-th-mode-head .r {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--fg-3);
  line-height: 1;
  transition: color 120ms ease;
}
.nt-th-mode-head:hover .r { color: var(--accent-ember); }
.nt-th-mode-name {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  margin: 14px 0 6px;
  line-height: 1.1;
  color: var(--fg-1);
}
.nt-th-mode-anchor {
  font-style: italic;
  color: var(--fg-3);
  font-size: 14px;
  margin-bottom: 14px;
  font-family: var(--font-serif);
}
.nt-th-mode-brief {
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg-2);
}
.nt-th-mode-detail {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--fg-2);
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--stroke-1);
  max-width: none;
}

/* ---- Cases accordion --------------------------------------- */
.nt-th-cases {
  padding: 80px 0;
  border-bottom: 1px solid var(--stroke-1);
}
.nt-th-caselist {
  border-top: 1px solid var(--stroke-1);
}
.nt-th-case {
  border-bottom: 1px solid var(--stroke-1);
}
.nt-th-case-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.nt-th-case-head:hover .name { color: var(--accent-ember); }
.nt-th-case-head:hover .r { color: var(--accent-ember); }
.nt-th-case-head .name {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  color: var(--fg-1);
  margin-bottom: 6px;
  transition: color 120ms ease;
  line-height: 1.15;
}
.nt-th-case-head .tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.nt-th-case-head .r {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--fg-3);
  line-height: 1;
  transition: color 120ms ease;
  padding-left: 24px;
}
.nt-th-case .body {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--fg-2);
  padding: 0 0 26px;
  max-width: 72ch;
}

/* ---- Notes / propositions ---------------------------------- */
.nt-th-end { padding: 80px 0 96px; }
.nt-th-endhead {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.012em;
  max-width: 14ch;
}
.nt-th-prop {
  font-size: 16px;
  line-height: 1.65;
  color: var(--fg-2);
  margin-bottom: 16px;
  max-width: 64ch;
}
.nt-th-prop strong {
  color: var(--fg-1);
  font-weight: 500;
}
.nt-th-fineprint {
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg-3);
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--stroke-1);
  max-width: 64ch;
}

/* ---- Mobile ------------------------------------------------ */
@media (max-width: 880px) {
  .nt-th-page { padding: 0 24px !important; }
  .nt-th-hero { padding: 56px 0 40px; }
  .nt-th-title { font-size: clamp(36px, 9vw, 56px); }
  .nt-th-byline { gap: 12px; }
  .nt-th-byline-note { font-size: 18px; }
  .nt-th-setup,
  .nt-th-model,
  .nt-th-modes,
  .nt-th-cases,
  .nt-th-end { padding: 56px 0; }
  .nt-th-twocol { grid-template-columns: 1fr; gap: 20px; }
  .nt-th-twocol h2 { max-width: none; }
  .nt-th-math-row { grid-template-columns: 1fr; gap: 4px; }
  .nt-th-readout { grid-template-columns: 1fr; gap: 16px; padding: 22px 0 26px; }
  .nt-th-readout-l {
    border-left: 0;
    border-top: 2px solid var(--accent-ember);
    padding: 14px 0 0;
  }
  .nt-th-presetrow { grid-template-columns: 1fr 1fr; }
  .nt-th-preset { border-right: 0; border-bottom: 1px solid var(--stroke-1); }
  .nt-th-preset:nth-child(odd) { border-right: 1px solid var(--stroke-1); }
  .nt-th-preset:nth-last-child(-n+2) { border-bottom: 0; }
  .nt-th-controls { grid-template-columns: 1fr; gap: 28px; }
  .nt-th-modegrid { grid-template-columns: 1fr; }
  .nt-th-mode-name { font-size: 24px; }
  .nt-th-case-head .name { font-size: 20px; }
  .nt-th-endhead { max-width: none; }
}

/* ---- Slider sublabel (added for translated parameter descriptions) ---- */
.nt-th-slider-sub {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--fg-3);
  letter-spacing: 0.02em;
  margin-bottom: 8px;
  margin-top: 2px;
}
