@font-face { font-family: "RT Display"; src: url("../../assets/bahnschrift.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "RT Sans"; src: url("../../assets/segoeui.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "RT Sans"; src: url("../../assets/segoeuib.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "RT Mono"; src: url("../../assets/consola.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "RT Mono"; src: url("../../assets/consolab.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --navy: #082744;
  --blue: #155eef;
  --green: #0b6e4f;
  --mint: #baff90;
  --yellow: #ffd21a;
  --red: #ff3b30;
  --paper: #f6f8f5;
  --fog: #dfe7e2;
  --line: #b8c7be;
  --white: #fff;
  --error: #b42318;
  --success: #08633f;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--fog); color: var(--navy); font-family: "RT Sans", Arial, sans-serif; line-height: 1.55; }
button, input, select { font: inherit; }
a { color: inherit; }

.skip-link { position: fixed; top: 10px; left: 10px; z-index: 200; transform: translateY(-180%); padding: 10px 14px; background: var(--yellow); color: var(--navy); font-weight: 700; }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 4px solid var(--yellow); outline-offset: 3px; }

.site-header { min-height: 86px; display: flex; align-items: center; gap: 28px; padding: 14px clamp(22px, 5vw, 76px); background: var(--navy); color: var(--white); border-bottom: 5px solid var(--yellow); }
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 226px; text-decoration: none; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; background: var(--yellow); color: var(--navy); font: 800 17px "RT Display"; transform: rotate(-3deg); }
.brand b { display: block; font: 760 18px "RT Display"; letter-spacing: .04em; }
.brand small { display: block; color: #b8cad7; font: 700 8px "RT Mono"; letter-spacing: .15em; }
.site-header > nav { display: flex; gap: clamp(16px, 2.3vw, 34px); align-items: center; margin-left: auto; }
.site-header > nav a { color: #dbe7ef; font-size: 13px; font-weight: 700; text-decoration: none; }
.site-header > nav a:hover, .site-header > nav a.active { color: var(--yellow); }
.mobile-tools { display: none; color: var(--yellow); font-weight: 700; text-decoration: none; }
.header-cta, .primary-button, .tool-action, .secondary-button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; padding: 10px 20px; border: 3px solid var(--navy); border-radius: 0; font-weight: 700; text-decoration: none; cursor: pointer; box-shadow: 5px 5px 0 var(--navy); transition: transform 140ms ease, box-shadow 140ms ease; }
.header-cta, .primary-button, .tool-action { background: var(--yellow); color: var(--navy); }
.header-cta { border-color: var(--yellow); box-shadow: none; white-space: nowrap; }
.header-cta:hover, .primary-button:hover, .tool-action:hover, .secondary-button:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--navy); }

.tools-hero { min-height: 650px; display: grid; grid-template-columns: minmax(0, .95fr) minmax(430px, 1.05fr); background: var(--blue); color: var(--white); overflow: hidden; }
.hero-copy { align-self: center; padding: clamp(65px, 9vw, 120px) clamp(24px, 6vw, 90px); }
.kicker { margin: 0 0 18px; color: var(--green); font: 700 14px "RT Mono"; }
.hero-copy .kicker { display: inline-block; padding: 6px 9px; background: var(--yellow); color: var(--navy); transform: rotate(-1deg); }
h1, h2, h3 { margin-top: 0; font-family: "RT Display", sans-serif; font-weight: 760; letter-spacing: -.025em; line-height: 1.02; }
.hero-copy h1 { max-width: 720px; margin-bottom: 24px; font-size: clamp(50px, 6vw, 84px); }
.hero-copy > p:not(.kicker) { max-width: 590px; margin: 0 0 32px; color: #dce6ff; font-size: clamp(18px, 1.6vw, 23px); }
.hero-art { position: relative; min-height: 620px; background: var(--navy); box-shadow: inset 7px 0 0 var(--yellow); }
.hero-route { position: absolute; left: 8%; right: 8%; top: 46%; display: grid; grid-template-columns: 1fr 52px 1.2fr 52px 1fr; align-items: center; transform: rotate(-4deg); }
.hero-route span { display: grid; min-height: 112px; place-items: center; padding: 15px; border: 4px solid var(--white); background: var(--blue); font: 760 20px "RT Display"; text-align: center; }
.hero-route span:last-child { background: var(--green); }
.hero-route i { height: 7px; background: var(--yellow); }
.hero-note { position: absolute; padding: 15px 18px; background: var(--white); color: var(--navy); font: 700 17px "RT Mono"; box-shadow: 9px 9px 0 var(--red); }
.note-one { top: 15%; left: 12%; transform: rotate(5deg); }
.note-two { right: 11%; bottom: 13%; transform: rotate(-5deg); background: var(--yellow); box-shadow: 9px 9px 0 var(--blue); }

.tools-shell { max-width: 1480px; display: grid; grid-template-columns: minmax(280px, .32fr) minmax(0, .68fr); gap: clamp(28px, 4vw, 64px); margin: 0 auto; padding: clamp(68px, 8vw, 120px) clamp(22px, 5vw, 76px); }
.tool-index { align-self: start; position: sticky; top: 24px; }
.index-heading h2 { margin-bottom: 16px; font-size: clamp(42px, 4.7vw, 66px); }
.index-heading > p:last-child { max-width: 35ch; color: #476276; }
.search-label, .field-label { display: block; margin: 28px 0 8px; color: var(--navy); font-weight: 700; }
.search-input, .tool-form input, .tool-form select { width: 100%; min-height: 52px; padding: 11px 13px; border: 3px solid var(--navy); border-radius: 0; background: var(--white); color: var(--navy); box-shadow: 4px 4px 0 var(--green); }
.tool-nav { margin-top: 22px; box-shadow: inset 0 3px 0 var(--navy); padding-top: 3px; }
.tool-nav button { width: 100%; display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; padding: 15px 4px; border: 0; border-bottom: 2px solid var(--line); background: transparent; color: var(--navy); text-align: left; cursor: pointer; }
.tool-nav button:hover, .tool-nav button[aria-current="true"] { padding-left: 12px; background: var(--yellow); }
.tool-nav .nav-code { font: 700 15px "RT Mono"; color: var(--green); }

.tool-workspace { min-height: 720px; overflow: hidden; border: 4px solid var(--navy); border-radius: 0; background: var(--white); box-shadow: 14px 14px 0 var(--green); }
.workspace-home { padding: clamp(30px, 5vw, 70px); }
.workspace-home > h2, .tool-head h2 { margin-bottom: 17px; font-size: clamp(40px, 4.3vw, 64px); }
.workspace-home > p, .tool-head > p { max-width: 63ch; color: #566b7b; }
.tool-grid { margin-top: 42px; border-top: 4px solid var(--navy); }
.tool-card { display: grid; grid-template-columns: 66px 1fr auto; gap: 20px; align-items: center; padding: 26px 0; border-bottom: 2px solid var(--line); }
.tool-card-code { font: 700 16px "RT Mono"; color: var(--green); }
.tool-card h3 { margin: 0 0 5px; font-size: 25px; }
.tool-card p { margin: 0; color: #5d7180; }
.tool-card button, .tool-card a { border: 0; border-bottom: 3px solid var(--blue); background: transparent; color: var(--blue); font-weight: 700; text-decoration: none; cursor: pointer; }

.tool-view { min-height: 720px; }
.tool-head { padding: clamp(34px, 5vw, 70px); background: var(--navy); color: var(--white); border-bottom: 7px solid var(--yellow); }
.tool-head h2 { color: var(--white); }
.tool-head > p { color: #c9d8e3; }
.tool-meta { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 24px; }
.tool-meta span { padding: 5px 9px; border: 2px solid #8fa7b8; color: #dce7ef; font: 700 12px "RT Mono"; }
.tool-body { display: grid; grid-template-columns: minmax(0, .95fr) minmax(310px, 1.05fr); gap: 36px; padding: clamp(30px, 5vw, 68px); }
.tool-form fieldset { margin: 0 0 24px; padding: 0; border: 0; }
.tool-form legend { margin-bottom: 14px; font: 760 21px "RT Display"; }
.tool-form .field-label { margin-top: 18px; }
.field-help { display: block; margin-top: 8px; color: #5d7180; font-size: 13px; }
.range-row { display: grid; grid-template-columns: 1fr 54px; gap: 12px; align-items: center; }
.range-row output { display: grid; width: 50px; height: 46px; place-items: center; background: var(--navy); color: var(--yellow); font-weight: 700; }
.choice-list { display: grid; gap: 9px; }
.choice-list label { display: flex; gap: 11px; align-items: flex-start; padding: 12px; border: 2px solid var(--line); background: var(--paper); cursor: pointer; }
.choice-list label:hover { border-color: var(--blue); }
.choice-list input { width: auto; min-height: auto; margin-top: 5px; box-shadow: none; }
.form-actions { display: flex; gap: 13px; margin-top: 28px; }
.secondary-button { background: var(--white); color: var(--navy); }

.result-panel { align-self: start; min-height: 320px; padding: 30px; border: 4px solid var(--navy); border-radius: 0; background: #e5ffd2; box-shadow: 9px 9px 0 var(--yellow); }
.result-panel h3 { font-size: 31px; }
.result-panel p { max-width: 52ch; }
.result-panel ul { padding-left: 20px; }
.result-panel li + li { margin-top: 8px; }
.result-number { display: block; margin: 13px 0 20px; color: var(--green); font: 800 clamp(48px, 6vw, 78px)/1 "RT Display"; }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 21px 0; }
.result-stat { padding: 15px; border-top: 5px solid var(--green); background: var(--white); }
.result-stat b { display: block; color: var(--navy); font-size: 24px; }
.result-stat span { color: #5d7180; font-size: 13px; }
.notice { margin-top: 20px; padding: 15px 16px; border: 3px solid var(--navy); background: var(--white); font-size: 14px; }
.error-message { color: var(--error); font-weight: 700; }
.success-message { color: var(--success); font-weight: 700; }

.site-footer { display: flex; justify-content: space-between; gap: 28px; padding: 44px clamp(22px, 5vw, 76px); background: var(--navy); color: #b8cad7; border-top: 7px solid var(--yellow); }
.site-footer p { margin: 0; }
.site-footer b { color: var(--white); }
.site-footer nav { display: flex; gap: 24px; }

@media (max-width: 1100px) {
  .site-header > nav { display: none; }
  .mobile-tools { display: inline-flex; margin-left: auto; }
  .header-cta { margin-left: auto; }
  .tools-hero { grid-template-columns: 1fr .85fr; }
  .hero-route { grid-template-columns: 1fr; gap: 10px; top: 24%; }
  .hero-route i { width: 7px; height: 35px; justify-self: center; }
  .tools-shell { grid-template-columns: 1fr; }
  .tool-index { position: static; }
  .tool-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-nav button:nth-child(odd) { border-right: 2px solid var(--line); }
}

@media (max-width: 760px) {
  .site-header { min-height: 76px; padding: 12px 18px; }
  .brand { min-width: 0; }
  .brand small { display: none; }
  .header-cta { margin-left: 0; padding-inline: 14px; }
  .tools-hero { display: block; min-height: 0; }
  .hero-copy { padding: 68px 22px 58px; }
  .hero-copy h1 { font-size: clamp(44px, 13vw, 62px); }
  .hero-art { min-height: 430px; box-shadow: inset 0 7px 0 var(--yellow); }
  .hero-route { left: 12%; right: 12%; }
  .tools-shell { padding: 66px 17px; }
  .tool-nav { grid-template-columns: 1fr; }
  .tool-nav button:nth-child(odd) { border-right: 0; }
  .workspace-home, .tool-head, .tool-body { padding: 28px 21px; }
  .tool-card { grid-template-columns: 48px 1fr; }
  .tool-card > :last-child { grid-column: 2; justify-self: start; }
  .tool-body { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .001ms !important; }
}
