:root {
  color-scheme: light;
  --ink: #0f172a;
  --muted: #526078;
  --line: #d9e2ef;
  --line-strong: #bac8da;
  --paper: #ffffff;
  --surface: #f6f8fc;
  --surface-blue: #eef6ff;
  --navy: #0b1424;
  --blue: #1d4ed8;
  --blue-hover: #173faa;
  --cyan: #0e7490;
  --green: #137052;
  --green-soft: #ecfdf5;
  --amber: #92400e;
  --amber-soft: #fffbeb;
  --red: #b42318;
  --red-soft: #fff1f0;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(14, 116, 144, 0.1), transparent 28rem),
    linear-gradient(180deg, #f9fbff 0, #fff 28rem);
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: var(--blue);
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button,
input,
select,
textarea,
a {
  outline-offset: 3px;
}

:focus-visible {
  outline: 3px solid #f59e0b;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  padding: 10px 14px;
  color: white;
  background: var(--navy);
  border-radius: 8px;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  min-height: 76px;
  padding: 14px clamp(20px, 4vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: white;
  background: var(--navy);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: white;
  text-decoration: none;
}

.brand:hover {
  color: white;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: #0b3750;
  background: linear-gradient(145deg, white, #dff7ff);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(14, 116, 144, 0.25);
  font: 900 15px/1 Consolas, monospace;
}

.brand-mark span:nth-child(2) {
  color: var(--cyan);
}

.brand-copy {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-copy strong {
  font-size: 20px;
}

.brand-copy small {
  letter-spacing: 0.18em;
  color: #bdc9d9;
  font-size: 10px;
}

.back-link {
  padding: 9px 13px;
  color: #dce9f8;
  border: 1px solid #3b4d66;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

.back-link:hover {
  color: white;
  border-color: #8aa7ca;
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  padding: clamp(56px, 8vw, 100px) 0 44px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: clamp(30px, 5vw, 72px);
  align-items: center;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(42px, 6.5vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(27px, 4vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

h3 {
  margin-bottom: 9px;
  font-size: 21px;
  line-height: 1.2;
}

.hero-lede {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
}

.authorization-notice {
  display: flex;
  gap: 16px;
  padding: 24px;
  background: var(--green-soft);
  border: 1px solid #a7e6cf;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.authorization-notice h2 {
  margin-bottom: 6px;
  font-size: 21px;
  letter-spacing: 0;
}

.authorization-notice p {
  margin-bottom: 0;
  color: #235b48;
}

.notice-icon {
  flex: 0 0 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--green);
  border-radius: 50%;
  font-weight: 900;
}

.quick-start {
  padding: clamp(28px, 4vw, 42px);
  display: grid;
  grid-template-columns: minmax(230px, 0.7fr) minmax(0, 1.3fr);
  gap: 28px;
  background: var(--navy);
  border-radius: var(--radius-lg);
  color: white;
}

.quick-start .section-kicker {
  color: #67e8f9;
}

.quick-start ol {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  list-style: none;
}

.quick-start li {
  padding: 14px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
}

.quick-start li > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--navy);
  background: #67e8f9;
  border-radius: 50%;
  font-weight: 900;
}

.quick-start li p {
  margin: 2px 0 0;
  color: #d8e2ef;
}

.lab-shell {
  margin: 56px 0;
}

.section-heading {
  max-width: 790px;
  margin-bottom: 26px;
}

.section-heading > p:last-child {
  color: var(--muted);
}

.control-group {
  min-width: 0;
  margin: 0 0 22px;
  padding: clamp(18px, 3vw, 30px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.06);
}

.control-group > legend {
  padding: 0 10px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
}

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

.field-card {
  min-width: 0;
  padding: 19px;
  background: var(--surface);
  border: 1px solid #e4e9f2;
  border-radius: var(--radius-md);
}

.field-card-wide {
  grid-column: 1 / -1;
}

.field-card > label,
.field-card > legend,
.option-row label {
  display: block;
  margin-bottom: 7px;
  color: #17243b;
  font-weight: 750;
}

.field-card > legend {
  padding: 0 4px;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="file"],
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

textarea {
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #7892b4;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

input[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.1);
}

.field-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.field-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.field-meta output {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.locator-hint {
  margin: 14px 0 0;
  padding-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  border-top: 1px dashed #c6d2e1;
  color: var(--muted);
  font-size: 12px;
}

.locator-hint span {
  margin-right: 2px;
  font-weight: 750;
}

code {
  padding: 2px 5px;
  color: #174c6b;
  background: #eaf5fb;
  border-radius: 5px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.option-card {
  position: relative;
}

.option-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
}

.option-row input,
.radio-list input {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--blue);
}

.option-row label {
  margin-bottom: 0;
}

.radio-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.radio-list label {
  padding: 9px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.range-row,
.color-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.range-row input {
  min-width: 0;
  flex: 1;
  accent-color: var(--blue);
}

.range-row output,
.color-row output {
  min-width: 54px;
  padding: 5px 8px;
  text-align: center;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: Consolas, monospace;
  font-size: 14px;
}

.color-row input {
  width: 70px;
  height: 46px;
  padding: 4px;
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
}

.file-name {
  margin-top: 10px;
  display: block;
  color: #23456a;
  font-weight: 700;
}

.form-actions {
  margin: 28px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.action-locator-hint {
  flex-basis: 100%;
  margin-top: 2px;
}

.button {
  min-height: 46px;
  padding: 11px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.button-primary {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}

.button-primary:hover {
  color: white;
  background: var(--blue-hover);
  border-color: var(--blue-hover);
}

.button-primary:disabled {
  color: #dbe5f4;
  background: #58709b;
  border-color: #58709b;
  cursor: wait;
}

.button-secondary {
  color: var(--ink);
  background: white;
  border-color: var(--line-strong);
}

.button-secondary:hover {
  color: var(--ink);
  background: #eef2f8;
}

.result-panel {
  padding: clamp(22px, 3vw, 32px);
  background: var(--surface-blue);
  border: 1px solid #b8d8f7;
  border-left: 6px solid var(--blue);
  border-radius: var(--radius-md);
}

.result-panel[data-state="success"] {
  background: var(--green-soft);
  border-color: #9adfc6;
  border-left-color: var(--green);
}

.result-panel[data-state="error"] {
  background: var(--red-soft);
  border-color: #f3b8b3;
  border-left-color: var(--red);
}

.result-heading h2 {
  margin-bottom: 8px;
  font-size: 26px;
}

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

.result-values div {
  padding: 8px 0;
  display: grid;
  grid-template-columns: minmax(100px, 0.45fr) 1fr;
  gap: 10px;
  border-bottom: 1px solid rgba(19, 112, 82, 0.2);
}

.result-values dt {
  color: var(--muted);
  font-weight: 700;
}

.result-values dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.behavior-grid {
  margin: 68px 0 40px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.behavior-heading {
  grid-column: 1 / -1;
}

.behavior-card {
  position: relative;
  padding: 24px;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.behavior-card > p:not(.locator-hint):not(.state-status) {
  color: var(--muted);
}

.card-number {
  position: absolute;
  top: 10px;
  right: 16px;
  color: #e1e9f4;
  font-size: 48px;
  font-weight: 900;
  line-height: 1;
}

.state-status {
  margin: 14px 0 0;
  padding: 10px 12px;
  color: #334155;
  background: #eef2f7;
  border-radius: 8px;
  font-weight: 750;
}

.state-status[data-state="waiting"] {
  color: var(--amber);
  background: var(--amber-soft);
}

.state-status[data-state="ready"] {
  color: var(--green);
  background: var(--green-soft);
}

.scroll-runway {
  min-height: 48vh;
  display: grid;
  grid-template-rows: auto 1fr;
  justify-items: center;
  color: #7b8ba1;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 11px;
  font-weight: 800;
}

.scroll-runway span:last-child {
  width: 1px;
  margin-top: 12px;
  background: linear-gradient(#9fb1c8, transparent);
}

.scroll-target,
.second-tab-destination {
  margin: 30px 0;
  padding: clamp(28px, 5vw, 52px);
  border-radius: var(--radius-lg);
}

.scroll-target {
  color: white;
  background: linear-gradient(135deg, #0f3f64, #0e7490);
  box-shadow: var(--shadow);
}

.scroll-target .section-kicker {
  color: #a5f3fc;
}

.scroll-target a {
  color: white;
  font-weight: 800;
}

.second-tab-destination {
  margin-bottom: 70px;
  background: white;
  border: 1px solid var(--line);
}

.second-tab-destination[data-context="second-tab"] {
  background: var(--green-soft);
  border-color: #81d9b8;
  box-shadow: var(--shadow);
}

footer {
  padding: 30px 20px;
  display: flex;
  justify-content: center;
  gap: 24px;
  color: #b8c5d6;
  background: var(--navy);
  text-align: center;
}

footer p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .hero,
  .quick-start {
    grid-template-columns: 1fr;
  }

  .behavior-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  main {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    padding-inline: 14px;
  }

  .brand-copy small {
    display: none;
  }

  .back-link {
    padding: 8px 10px;
    font-size: 13px;
  }

  .quick-start ol,
  .field-grid,
  .result-values {
    grid-template-columns: 1fr;
  }

  .field-card-wide {
    grid-column: auto;
  }

  .field-meta,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-actions .button,
  .behavior-card .button {
    width: 100%;
  }
}

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

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