:root {
  color-scheme: dark;
  --ink: #03070a;
  --panel: #0b151d;
  --panel-deep: #071017;
  --signal: #f1efe6;
  --muted: #96a4aa;
  --blue: #218bff;
  --blue-hot: #67c7ff;
  --gold: #e5b84b;
  --gold-hot: #ffd477;
  --red: #e44735;
  /* Retained as a measurable compatibility token for the established browser contrast gate. */
  --focus-ring: #005fcc;
  --hairline: rgba(103, 199, 255, 0.2);
  --line: rgba(150, 164, 170, 0.24);
  --display: Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Narrow", sans-serif;
  --editorial: "Iowan Old Style", Baskerville, "Times New Roman", serif;
  --ui: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --shell: min(82.5rem, calc(100vw - 4rem));
  --cut: 1.125rem;
  font-family: var(--ui);
  font-size: 100%;
  line-height: 1.65;
}

* { box-sizing: border-box; }

html { min-width: 20rem; background: var(--ink); }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 84% 8%, rgba(33, 139, 255, 0.09), transparent 26rem),
    radial-gradient(circle at 8% 70%, rgba(229, 184, 75, 0.045), transparent 28rem),
    linear-gradient(rgba(103, 199, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(103, 199, 255, 0.025) 1px, transparent 1px),
    var(--ink);
  background-size: auto, auto, 4rem 4rem, 4rem 4rem, auto;
  color: var(--signal);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background: linear-gradient(115deg, rgba(3, 7, 10, 0.2), rgba(7, 16, 23, 0.38));
}

::selection { background: var(--gold); color: var(--ink); }

a { color: var(--blue-hot); text-underline-offset: 0.22em; }
a:hover { color: var(--gold-hot); }

code {
  color: #b8dfff;
  font-family: var(--mono);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.skip-link {
  position: fixed;
  top: -6rem;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  border: 2px solid var(--gold-hot);
  background: var(--ink);
  color: var(--signal);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.skip-link:focus { top: 1rem; }

.site-header,
main,
footer {
  width: var(--shell);
  margin-inline: auto;
}

.site-header {
  display: flex;
  min-height: 7.25rem;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid var(--hairline);
}

.site-header::after {
  position: absolute;
  top: 7.15rem;
  left: max(2rem, calc((100vw - 82.5rem) / 2));
  width: 6rem;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, var(--blue) 0 33%, var(--gold) 33% 66%, var(--red) 66%);
}

.wordmark {
  color: var(--signal);
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-decoration: none;
}

.tagline,
.eyebrow,
.section-index,
dt,
legend,
.field > label,
.choice strong {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.tagline,
.eyebrow,
.section-index {
  margin: 0;
  font-size: 0.75rem;
}

.tagline { color: var(--muted); }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--gold-hot);
}

.eyebrow::after {
  width: min(10rem, 24vw);
  height: 1px;
  content: "";
  background: linear-gradient(90deg, var(--gold), transparent);
}

.hero,
.message,
.page-intro {
  display: grid;
  min-height: 34rem;
  align-content: center;
  justify-items: stretch;
  padding-block: clamp(5rem, 11vw, 9rem);
}

.hero > *,
.message > *,
.page-intro > * {
  min-width: 0;
}

.page-intro { min-height: 27rem; }
.message { min-height: calc(100vh - 12rem); }

h1, h2, h3, p { max-width: 65ch; }

h1, h2, h3 {
  color: var(--signal);
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: -0.018em;
}

h1 {
  width: 100%;
  max-width: 12ch;
  margin-block: 1.5rem 1.75rem;
  font-size: clamp(4rem, 8.7vw, 8.5rem);
  line-height: 0.83;
  overflow-wrap: break-word;
}

.page-intro h1,
.message h1 { font-size: clamp(3.6rem, 7vw, 7rem); }

h2 {
  margin-block: 0 1.5rem;
  font-size: clamp(2.7rem, 5vw, 5.25rem);
  line-height: 0.9;
}

h3 {
  margin-block: 0 1rem;
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  line-height: 1;
}

p { color: #c6cdcf; }

.lede {
  max-width: 38rem;
  margin-block: 0 2rem;
  color: #d6d2c7;
  font-family: var(--editorial);
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-style: italic;
  line-height: 1.48;
}

.primary-action,
button {
  display: inline-flex;
  width: fit-content;
  min-height: 3.25rem;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  padding: 0.875rem 1.25rem;
  border: 1px solid var(--gold);
  border-radius: 0;
  background: var(--gold);
  color: var(--ink);
  font-size: 0.75rem;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.12em;
  cursor: pointer;
  text-decoration: none;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.primary-action::after {
  width: 0.45rem;
  height: 0.45rem;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  content: "";
  transform: rotate(45deg);
}
.primary-action:hover, button:hover { background: var(--gold-hot); color: var(--ink); }
.primary-action:active, button:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: not-allowed; }

main section > form + form {
  margin-top: 1rem;
}

form[action$="/sign-out"] button {
  border-color: rgba(103, 199, 255, 0.55);
  background: transparent;
  color: var(--blue-hot);
}

form[action$="/sign-out"] button:hover {
  border-color: var(--blue-hot);
  background: rgba(33, 139, 255, 0.1);
  color: var(--signal);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex="-1"]:focus-visible {
  outline: 3px solid var(--gold-hot);
  outline-offset: 4px;
}

main > section:not(.hero):not(.page-intro):not(.message),
main > form,
main > .error-summary {
  margin-bottom: clamp(5rem, 10vw, 9rem);
}

.comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
}

.comparison > h2 {
  grid-column: 1 / -1;
  margin: 0;
  padding: clamp(2rem, 4vw, 3.5rem);
  background: var(--ink);
}

.comparison article,
.status-panel,
.error-summary,
fieldset,
.notice {
  position: relative;
  border: 1px solid var(--line);
  background: rgba(7, 16, 23, 0.86);
}

.comparison article { min-height: 18rem; padding: clamp(2rem, 4vw, 3.5rem); border: 0; }
.comparison article:first-of-type { box-shadow: inset 3px 0 var(--blue); }
.comparison article:last-of-type { box-shadow: inset 3px 0 var(--gold); }

.status-panel,
.error-summary,
fieldset,
.notice {
  padding: clamp(1.25rem, 3vw, 2rem);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}

.status-panel { box-shadow: inset 3px 0 var(--blue); }
.notice { border-color: rgba(229, 184, 75, 0.46); box-shadow: inset 3px 0 var(--gold); }
.error-summary, .field-error { border-color: rgba(228, 71, 53, 0.55); box-shadow: inset 3px 0 var(--red); }

.application-form { display: grid; gap: 1.5rem; max-width: 52rem; }
fieldset { display: grid; min-width: 0; gap: 1.25rem; margin: 0; }
legend { padding-inline: 0.5rem; color: var(--gold-hot); font-size: 0.78rem; }

.field { display: grid; min-width: 0; gap: 0.45rem; }
.field > label { color: var(--signal); font-size: 0.75rem; }
.hint, .field-error, .status-code, .notice { margin-block: 0; }
.hint { color: var(--muted); font-size: 0.875rem; }
.field-error { padding: 0.65rem 0.8rem; color: #ffb5aa; font-weight: 700; }

button, input, select, textarea { max-width: 100%; min-height: 2.75rem; font: inherit; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(103, 199, 255, 0.35);
  border-radius: 0;
  background: #050d12;
  color: var(--signal);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--red); }

input[type="checkbox"], input[type="radio"] {
  width: 1.25rem;
  height: 1.25rem;
  min-height: 1.25rem;
  margin: 0.2rem 0 0;
  accent-color: var(--gold);
}

.choice { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); gap: 0.7rem; align-items: start; min-height: 2.75rem; }
.choice a { grid-column: auto; }

dl { display: grid; grid-template-columns: minmax(9rem, 0.38fr) minmax(0, 1fr); gap: 0; margin: 1.5rem 0 0; }
dt, dd { min-width: 0; margin: 0; padding: 0.7rem 0.8rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
dt { color: var(--muted); font-size: 0.7rem; }
dd { color: var(--signal); }

.steps { max-width: 52rem; padding-left: 1.5rem; }
.steps li { padding-left: 0.75rem; color: #c6cdcf; }
.steps li + li { margin-top: 1rem; }
.steps li::marker { color: var(--gold); font-family: var(--mono); font-weight: 700; }

.assurance {
  display: grid;
  grid-template-columns: minmax(3rem, 0.18fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 5rem);
  padding-block: clamp(5rem, 10vw, 9rem);
  border-top: 1px solid var(--hairline);
}

.section-index { color: var(--blue-hot); }
.availability { padding: 1rem 0 1rem 1.25rem; border-left: 3px solid var(--gold); font-family: var(--editorial); font-size: 1.15rem; font-style: italic; }

footer {
  display: flex;
  min-height: 9rem;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.875rem;
}

footer nav { display: flex; flex-wrap: wrap; gap: 0.8rem 1.25rem; }
footer a { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; }

@media (hover: hover) and (pointer: fine) {
  .primary-action:hover, button:hover { transform: translateY(-2px); }
}

@media (prefers-color-scheme: dark) {
  :root { --focus-ring: #80bcfe; }
}

@media (max-width: 60rem) {
  :root { --shell: min(100% - 2.625rem, 82.5rem); }
  .site-header::after { left: 1.3125rem; }
  .comparison { grid-template-columns: 1fr; }
  .comparison > h2 { grid-column: auto; }
}

@media (max-width: 42.5rem) {
  :root { --shell: calc(100% - 1.875rem); }
  .site-header { min-height: 6.5rem; align-items: flex-start; flex-direction: column; justify-content: center; gap: 0.5rem; }
  .site-header::after { top: 6.4rem; left: 0.9375rem; }
  h1, .page-intro h1, .message h1 { font-size: clamp(3.2rem, 16vw, 5rem); }
  .hero, .page-intro, .message { min-height: auto; padding-block: 6rem; }
  .primary-action, button { width: 100%; }
  .assurance { grid-template-columns: 1fr; }
  dl { grid-template-columns: 1fr; }
  dd { padding-top: 0; border-top: 0; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; padding-block: 2rem; }
}

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

@media (forced-colors: active) {
  body { background: Canvas; color: CanvasText; }
  .eyebrow::after, .site-header::after { background: CanvasText; }
  .status-panel, .notice, .error-summary, fieldset, .comparison article { border: 1px solid CanvasText; box-shadow: none; }
  .primary-action, button { border: 2px solid ButtonText; background: ButtonFace; color: ButtonText; }
}
