:root {
  color-scheme: dark;
  --ink: #f7eee2;
  --muted: #c6b7a7;
  --dim: #9b8a7c;
  --paper: #f0e5d4;
  --paper-deep: #ddcdb8;
  --night: #161212;
  --panel: #201a1a;
  --panel-raised: #2a2020;
  --line: rgba(240, 229, 212, 0.18);
  --line-dark: rgba(44, 32, 27, 0.2);
  --red: #df4b3e;
  --red-bright: #fa6e54;
  --red-deep: #762a27;
  --amber: #f0b66b;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.3);
  font-family: "Avenir Next", "Hiragino Sans", "Yu Gothic", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--night);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 77% 0%, rgba(148, 51, 45, 0.22), transparent 30rem),
    var(--night);
  color: var(--ink);
  line-height: 1.6;
  letter-spacing: 0.01em;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input {
  min-height: 44px;
}

button {
  border: 0;
  cursor: pointer;
}

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

img,
svg {
  display: block;
  max-width: 100%;
}

.site-header,
.site-footer,
.page-shell {
  width: min(1240px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-decoration: none;
}

.wordmark-mark {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--red-bright);
  border-radius: 50%;
  color: var(--red-bright);
  font-size: 0.8rem;
}

.header-note,
.site-footer {
  color: var(--dim);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
}

.page-shell {
  padding-block: 34px 84px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: clamp(24px, 6vw, 88px);
  align-items: end;
  padding-block: 34px 70px;
}

.hero-copy {
  max-width: 660px;
}

.eyebrow,
.condition-kicker {
  margin: 0 0 12px;
  color: var(--red-bright);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

h1,
h2,
h3,
h4,
p,
figure,
dl {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  line-height: 1.16;
}

h1 {
  max-width: 680px;
  margin-bottom: 22px;
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  font-weight: 500;
  letter-spacing: -0.06em;
}

h1 em {
  color: var(--red-bright);
  font-style: normal;
}

.hero-lede {
  max-width: 560px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.22rem);
}

.hero-caption {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--dim);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.article-directory-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 18px;
  color: var(--paper);
  text-decoration-color: var(--red-bright);
  text-underline-offset: 0.2em;
}

.signal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red-bright);
  box-shadow: 0 0 0 5px rgba(223, 75, 62, 0.12);
}

.hero-image {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 12px;
  background: linear-gradient(135deg, rgba(223, 75, 62, 0.4), transparent 33%), var(--panel);
  box-shadow: var(--shadow);
  transform: rotate(1.5deg);
}

.hero-image img {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.08);
}

.hero-image figcaption {
  padding: 11px 3px 0;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

.tool-panel,
.diagram-section {
  margin-top: 14px;
  padding: clamp(20px, 4vw, 42px);
  border: 1px solid var(--line);
  background: rgba(32, 26, 26, 0.9);
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.65rem, 3vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.section-explainer {
  max-width: 360px;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.action-spacer {
  flex: 1 1 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.button-primary {
  background: var(--red);
  color: #fff7ef;
}

.button-primary:hover {
  background: var(--red-bright);
}

.button-secondary {
  border-color: rgba(240, 229, 212, 0.28);
  background: transparent;
  color: var(--ink);
}

.button-secondary:hover {
  border-color: var(--red-bright);
  color: var(--red-bright);
}

.status {
  min-height: 1.6em;
  margin: 0 0 20px;
  color: var(--amber);
  font-size: 0.82rem;
}

.status.status-error {
  color: #ff9d86;
}

.conditions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.condition-card {
  min-width: 0;
  padding: clamp(17px, 3vw, 28px);
  border: 1px solid var(--line);
  background: var(--panel-raised);
}

.condition-a {
  border-top: 3px solid var(--red);
}

.condition-b {
  border-top: 3px solid var(--amber);
}

.condition-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.condition-kicker {
  margin-bottom: 6px;
  color: var(--dim);
  font-size: 0.62rem;
}

.condition-b .condition-kicker {
  color: var(--amber);
}

.condition-card h3 {
  margin-bottom: 0;
  font-size: 1.3rem;
  font-weight: 500;
}

.condition-badge {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--red);
  border-radius: 50%;
  color: var(--red-bright);
  font-size: 0.85rem;
  font-weight: 700;
}

.condition-b .condition-badge {
  border-color: var(--amber);
  color: var(--amber);
}

.preset-row {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.preset-row label,
.field-group label {
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 700;
}

select,
input {
  width: 100%;
  border: 1px solid rgba(240, 229, 212, 0.25);
  border-radius: 3px;
  background: #181414;
  color: var(--ink);
}

select {
  padding: 8px 10px;
  font-size: 1rem;
}

input {
  padding: 8px 10px;
  font-size: 1rem;
}

select:hover,
input:hover {
  border-color: rgba(240, 229, 212, 0.5);
}

input[aria-invalid="true"] {
  border-color: var(--red-bright);
  box-shadow: 0 0 0 2px rgba(223, 75, 62, 0.14);
}

.condition-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 12px;
}

.field-group {
  min-width: 0;
}

.field-group label {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  margin-bottom: 5px;
}

.unit {
  color: var(--dim);
  font-weight: 400;
}

.field-error {
  min-height: 1.25em;
  margin: 4px 0 0;
  color: #ff9d86;
  font-size: 0.68rem;
  line-height: 1.35;
}

.result-block {
  margin-top: 19px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}

.result-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.result-heading h4 {
  margin: 0;
  color: var(--paper);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.result-rule {
  height: 1px;
  flex: 1;
  background: var(--line);
}

.result-list,
.fov-list {
  margin-bottom: 0;
}

.result-list > div,
.fov-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(240, 229, 212, 0.08);
}

dt {
  color: var(--muted);
  font-size: 0.78rem;
}

dd {
  margin: 0;
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}

.result-list dd {
  font-size: 1rem;
  font-weight: 700;
}

.fov-panel {
  margin-top: 15px;
  padding: 12px 14px;
  background: rgba(22, 18, 18, 0.66);
}

.fov-panel > p {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
  color: var(--red-bright);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.fov-panel > p span {
  color: var(--dim);
  font-size: 0.64rem;
  font-weight: 400;
}

.fov-list > div {
  padding: 4px 0;
  border-bottom: 0;
}

.fov-list dd {
  color: var(--paper);
  font-size: 0.85rem;
}

.diagram-section {
  background: var(--paper);
  color: #302421;
}

.diagram-section .eyebrow {
  color: var(--red-deep);
}

.diagram-section .section-heading h2 {
  color: #302421;
}

.diagram-section .section-explainer {
  color: #69584c;
}

.depth-figure {
  margin: 0;
}

#depth-diagram {
  width: 100%;
  min-height: 220px;
  overflow: visible;
}

.diagram-paper {
  fill: rgba(255, 250, 240, 0.45);
}

.diagram-axis,
.range-track {
  stroke: rgba(48, 36, 33, 0.28);
  stroke-width: 1;
}

.range-track {
  stroke-width: 8;
  stroke-linecap: round;
}

.diagram-ticks line {
  stroke: rgba(48, 36, 33, 0.45);
  stroke-width: 1;
}

.axis-label,
.row-label,
.range-label {
  fill: #69584c;
  font-family: "Avenir Next", "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 12px;
}

.row-label {
  fill: #302421;
  font-size: 16px;
  font-weight: 700;
}

.axis-start {
  text-anchor: start;
}

.axis-end {
  text-anchor: end;
}

.depth-band {
  opacity: 0.9;
}

.band-a {
  fill: var(--red);
}

.band-b {
  fill: #b47b2f;
}

.focus-marker {
  stroke: #302421;
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
}

.focus-dot {
  stroke: #fffaf0;
  stroke-width: 3;
}

.dot-a {
  fill: var(--red);
}

.dot-b {
  fill: #b47b2f;
}

.range-label {
  fill: #302421;
  font-size: 11px;
}

.depth-figure figcaption {
  margin-top: 11px;
  color: #69584c;
  font-size: 0.75rem;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.note-card {
  padding: 25px 28px;
  border: 1px solid var(--line);
  background: rgba(32, 26, 26, 0.66);
}

.note-card h2 {
  margin-bottom: 14px;
  font-size: 1.35rem;
  font-weight: 500;
}

.note-card p {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.note-card .formula-line {
  margin-block: 20px;
  padding: 11px 13px;
  border-left: 3px solid var(--red);
  background: rgba(118, 42, 39, 0.18);
  color: var(--paper);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
}

.small-print {
  color: var(--dim) !important;
  font-size: 0.72rem !important;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-block: 22px 34px;
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    padding-bottom: 45px;
  }

  .hero-image {
    width: min(620px, 100%);
    margin-inline: auto;
  }

  .conditions-grid,
  .notes-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .site-header,
  .site-footer,
  .page-shell {
    width: min(100% - 24px, 1240px);
  }

  .site-header {
    min-height: 64px;
  }

  .header-note {
    display: none;
  }

  .page-shell {
    padding-top: 16px;
  }

  .hero {
    gap: 28px;
    padding-block: 25px 34px;
  }

  h1 {
    font-size: clamp(2.35rem, 13vw, 3.6rem);
  }

  .section-heading {
    display: block;
  }

  .section-heading h2 {
    margin-bottom: 13px;
  }

  .section-explainer {
    margin-bottom: 0;
  }

  .action-spacer {
    display: none;
  }

  .button {
    flex: 1 1 calc(50% - 10px);
    padding-inline: 8px;
  }

  .condition-form {
    grid-template-columns: 1fr;
  }

  .tool-panel,
  .diagram-section {
    padding: 17px 13px;
  }

  .condition-card {
    padding: 17px 13px;
  }

  .note-card {
    padding: 20px 17px;
  }

  .site-footer {
    display: block;
  }

  .site-footer span {
    display: block;
    margin-bottom: 4px;
  }
}

@media (max-width: 340px) {
  .wordmark {
    font-size: 0.75rem;
  }

  .button {
    flex-basis: 100%;
  }

  #depth-diagram {
    min-height: 180px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  :root {
    color-scheme: light;
  }

  html,
  body,
  .page-shell,
  .diagram-section {
    background: #fff;
    color: #111;
  }

  .site-header,
  .site-footer,
  .hero-image,
  .action-bar,
  .status,
  .notes-grid {
    display: none;
  }

  .page-shell,
  .tool-panel,
  .diagram-section {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  body,
  .tool-panel,
  .condition-card,
  .result-block,
  .fov-panel,
  input,
  select {
    background: #fff;
    color: #222;
  }

  .hero {
    display: block;
    padding: 0 0 20px;
  }

  h1 {
    margin-bottom: 0;
    color: #111;
    font-size: 26pt;
  }

  .hero-lede,
  .hero-caption,
  .eyebrow,
  .diagram-section .section-explainer,
  .depth-figure figcaption {
    color: #444;
  }

  .conditions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .condition-card,
  .note-card {
    border: 1px solid #aaa;
    background: #fff;
    color: #111;
  }

  input,
  select {
    border-color: #aaa;
    color: #111;
  }

  h1,
  h2,
  h3,
  h4,
  label,
  dt,
  dd,
  .unit,
  .preset-row label,
  .field-group label {
    color: #222;
  }

  .section-explainer,
  .condition-kicker,
  .fov-panel > p,
  .fov-panel > p span {
    color: #444;
  }

  .result-block {
    border-top-color: #bbb;
  }

  .result-rule {
    background: #bbb;
  }

  .result-list dd,
  .fov-list dd,
  .condition-card h3,
  .result-heading h4,
  .diagram-section .section-heading h2 {
    color: #111;
  }
}


/* SOU100 Stage A batch-06 */
.hero-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; margin: .75rem 0 .65rem; padding-left: 1.25rem; }
.hero-steps li { min-width: 0; padding-left: .08rem; font-size: .82rem; line-height: 1.45; overflow-wrap: anywhere; }
.hero-cta { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; margin: .1rem 0 .5rem; padding: .55rem .9rem; border: 1px solid var(--red-bright); border-radius: 999px; color: var(--ink); background: rgba(250, 110, 84, .16); font-weight: 800; text-decoration: none; }
.hero-cta:focus-visible { outline: 3px solid var(--red-bright); outline-offset: 3px; }
.hero-cta span { font-size: 1.05rem; line-height: 1; }
.hero { padding-block: 24px 28px; gap: clamp(20px, 4vw, 56px); }
.hero h1 { margin-bottom: .65rem; font-size: clamp(2.2rem, 4.6vw, 4.25rem); word-break: auto-phrase; }
.hero-lede { margin-bottom: .65rem; font-size: 1rem; }
@media (max-width: 640px) {
  .hero { gap: 0; padding-block: 16px 20px; }
  .hero-image { display: none; }
  .hero h1 { margin-bottom: .45rem; font-size: clamp(2rem, 9vw, 3.2rem); }
  .hero-lede { margin: .35rem 0 .55rem; font-size: .94rem; line-height: 1.55; }
  .hero-steps { gap: .25rem; margin: .55rem 0; }
  .hero-steps li { font-size: .74rem; }
  .hero-caption { margin-top: .15rem; font-size: .68rem; }
  .article-directory-link { margin-top: .25rem; }
  .tool-panel .section-heading .eyebrow { display: none; }
  .tool-panel .section-heading { gap: .45rem; margin-bottom: .65rem; }
  .tool-panel .section-heading h2 { margin-bottom: .35rem; font-size: 1.35rem; }
}
