@font-face {
  font-family: "Archivo AllowanceOS";
  src: url("/fonts/archivo-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f2f0e9;
  --panel: #f8f7f2;
  --ink: #10253c;
  --blue: #164e78;
  --blue-deep: #0c354f;
  --slate: #52616d;
  --line: #b8b9b2;
  --fine: #d8d8d1;
  --orange: #d45b21;
  --green: #19704b;
  --display: "Archivo AllowanceOS", "Arial Narrow", sans-serif;
  --body: "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { width: 100%; min-width: 320px; min-height: 100%; }

html { background: var(--ink); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  overflow: hidden;
}

button, a { -webkit-tap-highlight-color: transparent; }

button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(22, 78, 120, 0.3);
  outline-offset: 3px;
}

.landing-shell {
  display: grid;
  grid-template-rows: 76px minmax(0, 1fr);
  width: min(100%, 1800px);
  height: 100dvh;
  min-height: 620px;
  margin: 0 auto;
  border-inline: 1px solid var(--line);
  background: var(--paper);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 4vw, 68px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font: 680 20px/1 var(--display);
  letter-spacing: -0.025em;
  text-decoration: none;
}

.brand > span > span { color: var(--blue); font-weight: 520; }

.brand-mark {
  width: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
}

.site-nav { display: flex; align-items: center; gap: 8px; }

.site-nav a, .login-button {
  min-height: 42px;
  padding: 0 17px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 610 12px/1 var(--display);
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.site-nav a:hover { color: var(--blue); }

.login-button {
  min-width: 82px;
  border: 1px solid var(--ink);
  transition: background-color 180ms ease-out, color 180ms ease-out;
}

.login-button:hover { background: var(--ink); color: #fff; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(250px, 0.65fr);
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
}

.aperture {
  position: relative;
  grid-column: 1 / -1;
  min-height: 0;
  margin: clamp(24px, 3.7vh, 50px) clamp(24px, 4vw, 68px) clamp(20px, 3vh, 38px);
}

.control-field { width: 100%; height: 100%; overflow: visible; }

.field-outer, .field-inner, .center-line {
  fill: none;
  stroke: var(--blue);
  vector-effect: non-scaling-stroke;
}

.field-outer { stroke-width: 1.4; }
.field-inner { stroke-width: 1; opacity: 0.72; }
.center-line { stroke-width: 0.7; stroke-dasharray: 3 8; opacity: 0.28; }

.filter-layer rect {
  fill: var(--paper);
  opacity: 0.72;
}

.filter-layer path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  opacity: 0.72;
}

.filter-layer text {
  fill: var(--slate);
  font: 580 9px var(--display);
  letter-spacing: 0.12em;
}

.filter-layer text { opacity: 0.78; }
.stage-signal { fill: var(--blue); opacity: 0.34; transition: fill 120ms ease-out, opacity 120ms ease-out; }
.filter-layer.rejecting .stage-signal { fill: var(--orange); opacity: 1; }
.filter-layer.rejecting path { stroke: var(--orange); opacity: 1; }
.filter-layer.rejecting rect { fill: #f3e5dc; opacity: 0.9; }
.filter-layer.rejecting text { fill: var(--orange); opacity: 1; }

.particle-flow { fill: var(--blue); opacity: 0.5; }
.particle-flow.passed { fill: var(--green); opacity: 0.82; }
.particle-flow.blocked { fill: var(--orange); opacity: 1; }
.particle-ring { fill: none; stroke: var(--orange); stroke-width: 1; vector-effect: non-scaling-stroke; opacity: 0; }
.particle-ring.visible { opacity: 0.62; }

.aperture-label {
  position: absolute;
  z-index: 2;
  top: 50%;
  color: var(--slate);
  font: 580 10px/1 var(--display);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}

.label-input { left: -4px; transform: translate(-100%, -50%) rotate(180deg); }
.label-output { right: -4px; transform: translate(100%, -50%); }

.boundary-readout {
  position: absolute;
  left: 50%;
  bottom: 7%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--slate);
  font: 560 9px/1 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.boundary-readout span + span::before { content: "/"; color: var(--line); margin-right: 11px; }
.boundary-readout .readout-signal::before { content: none; }
.readout-signal { width: 6px; height: 6px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 3px rgba(25, 112, 75, 0.12); }

.hero-copy, .hero-actions {
  border-top: 1px solid var(--line);
  min-height: clamp(180px, 25vh, 250px);
  padding: clamp(26px, 4vh, 48px) clamp(24px, 4vw, 68px);
}

.hero-copy { border-right: 1px solid var(--line); }

.hero-copy h1 {
  max-width: 900px;
  margin: 0 0 18px;
  font: 620 clamp(42px, 5.2vw, 78px)/0.95 var(--display);
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero-copy p {
  max-width: 70ch;
  margin: 0;
  color: var(--slate);
  font-size: clamp(14px, 1.1vw, 19px);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  width: min(100%, 230px);
  min-height: 50px;
  padding: 0 18px;
  background: var(--blue);
  color: #fff;
  font: 630 12px/1 var(--display);
  text-decoration: none;
  transition: background-color 180ms ease-out;
}

.primary-action:hover { background: var(--blue-deep); }
.primary-action svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; }

.hero-actions p {
  margin: 0;
  color: var(--slate);
  font: 540 11px/1.45 var(--display);
  letter-spacing: 0.04em;
  text-align: right;
  text-transform: uppercase;
}

.notice {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 13px 18px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  box-shadow: 0 10px 32px rgba(16, 37, 60, 0.22);
  transition: opacity 180ms ease-out, transform 260ms cubic-bezier(.16, 1, .3, 1);
}

.notice.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 760px) {
  .landing-shell { grid-template-rows: 64px minmax(0, 1fr); min-height: 560px; border: 0; }
  .site-header { padding-inline: 18px; }
  .brand { font-size: 19px; }
  .brand-mark { width: 24px; }
  .site-nav { gap: 0; }
  .site-nav a, .login-button { padding-inline: 12px; min-height: 40px; }
  .login-button { min-width: 70px; }
  .hero { grid-template-columns: 1fr; grid-template-rows: minmax(220px, 1fr) auto auto; }
  .aperture { grid-column: 1; margin: 18px 18px 12px; overflow: hidden; }
  .control-field { width: 160%; max-width: none; transform: translateX(-18.75%); }
  .aperture-label, .boundary-readout { display: none; }
  .filter-layer text { font-size: 8px; letter-spacing: .07em; }
  .hero-copy, .hero-actions { min-height: 0; padding: 22px 20px; }
  .hero-copy { border-right: 0; }
  .hero-copy h1 { margin-bottom: 12px; font-size: clamp(48px, 11.8vw, 50px); }
  .hero-copy p { font-size: 14px; line-height: 1.48; }
  .hero-actions { flex-direction: row; align-items: center; gap: 18px; padding-block: 16px; }
  .primary-action { width: auto; min-width: 172px; min-height: 46px; }
  .hero-actions p { font-size: 11px; }
  .notice { right: 16px; bottom: 16px; left: 16px; text-align: center; }
}

@media (max-width: 390px), (max-height: 680px) {
  .hero-copy { padding-block: 18px; }
  .hero-copy h1 { font-size: 48px; }
  .hero-copy p { font-size: 14px; }
  .hero-actions p { display: none; }
  .primary-action { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
