.tool {
  --tool-soot: #0f0f0f;
  --tool-panel: #181917;
  --tool-ink: #f5f4ed;
  --tool-muted: #c5c5ba;
  --tool-lime: #dafa9c;
  --tool-copper: #ffa379;
  --tool-paper: #eeede4;
  --tool-display: "Funnel Display", var(--sans);
  background: var(--tool-paper);
  color: #191b15;
}

.tool-intro {
  background: var(--tool-soot);
  color: var(--tool-ink);
}

.tool-intro-grid {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  min-height: max(35rem, calc(100svh - 76px));
  align-items: center;
  gap: clamp(1.5rem, 4vw, 5rem);
  padding-block: clamp(2.25rem, 6vw, 6rem);
}

.tool-intro h1 {
  color: inherit;
  font: 500 clamp(3.2rem, 7.1vw, 7.8rem)/.91 var(--tool-display);
  letter-spacing: -.075em;
  text-wrap: balance;
}

.tool-intro .end-stop { color: var(--tool-lime); }
.tool-intro-copy p { max-width: 35ch; margin-top: 1.4rem; color: var(--tool-muted); font-size: clamp(1rem, 1.65vw, 1.25rem); line-height: 1.55; }
.tool-intro-copy code { color: var(--tool-lime); font-size: .84em; }

.tool .tool-cta {
  display: inline-flex;
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding-inline: 1rem;
  min-height: 3.15rem;
  border-radius: 0;
  color: var(--tool-soot);
  background: var(--tool-lime);
}

.tool .tool-cta:hover { background: #efffd0; color: var(--tool-soot); }
.tool-intro :focus-visible, .tool-output :focus-visible { outline-color: var(--tool-lime); }

.tool-visual {
  position: relative;
  display: grid;
  min-height: clamp(16rem, 39vw, 30rem);
  align-items: center;
  isolation: isolate;
  overflow: clip;
  color: var(--tool-ink);
  background: var(--tool-panel);
}

.traffic-visual {
  background: #140e0a;
  align-items: end;
}

.traffic-visual::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: url("/optical-fibers.webp") center / cover no-repeat;
  filter: sepia(.88) saturate(1.7) contrast(1.23);
  opacity: .8;
}

.traffic-visual ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--tool-soot);
}

.traffic-visual li {
  padding: .85rem .6rem .9rem;
  border-top: 4px solid var(--series);
  font-size: clamp(.775rem, 1.2vw, .95rem);
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
}

.traffic-visual li:nth-child(1), .series-hybrid { --series: #dafa9c; }
.traffic-visual li:nth-child(2), .series-classical { --series: #ffa379; }
.traffic-visual li:nth-child(3), .series-postQuantum { --series: #f4edbd; }
.traffic-visual li:nth-child(4), .series-unknown { --series: #99998c; }

.traffic-tool .tool-intro {
  background: var(--tool-lime);
  color: var(--tool-soot);
}

.traffic-tool .tool-intro-grid {
  grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr);
  align-content: center;
  align-items: end;
  row-gap: clamp(1rem, 4vw, 4rem);
}

.traffic-tool .tool-intro h1 {
  grid-column: 1 / -1;
  font-size: clamp(4.1rem, 14.35vw, 12.5rem);
  letter-spacing: -.085em;
}

.traffic-tool .end-stop { color: #6f5225; }
.traffic-tool .tool-intro-copy { align-self: end; padding-block: 0 clamp(0rem, 2vw, 2rem); }
.traffic-tool .tool-intro-copy p { margin-top: 0; color: #242b15; }
.traffic-tool .tool-cta { color: var(--tool-lime); background: var(--tool-soot); }
.traffic-tool .tool-cta:hover { color: var(--tool-lime); background: #363b2e; }
.traffic-tool .tool-intro :focus-visible { outline-color: var(--tool-soot); }
.traffic-tool .traffic-visual { min-height: clamp(13.5rem, 28vw, 24rem); }

.watch-visual {
  align-content: end;
  background-color: #21120e;
  background-image: url("/handshake.webp");
  background-position: 66% 44%;
  background-size: cover;
}

.watch-visual > p {
  width: fit-content;
  margin: 0 1.1rem .55rem;
  padding: .3rem .5rem;
  background: var(--tool-soot);
  font-weight: 550;
}

.watch-visual ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--tool-lime);
  color: var(--tool-soot);
}

.watch-visual li {
  padding: .9rem .55rem;
  border-inline-start: 1px solid #98ad6f;
  text-align: center;
  line-height: 1.15;
}

.watch-visual li:first-child { border-inline-start: 0; }
.watch-visual strong { display: block; font: 500 clamp(2rem, 4.2vw, 4.8rem)/.95 var(--tool-display); letter-spacing: -.07em; font-variant-numeric: tabular-nums; }
.watch-visual span { display: block; margin-top: .4rem; font-size: .875rem; }

.guide-tool .tool-intro {
  --tool-sheet: #f6f0de;
  background: var(--tool-sheet);
  color: var(--tool-soot);
}

.guide-tool .tool-intro-grid {
  grid-template-columns: minmax(0, 1.16fr) minmax(0, .84fr);
}

.guide-tool .tool-intro h1 {
  font-size: clamp(3.15rem, 6.4vw, 7rem);
  text-wrap: initial;
}

.guide-title-end { display: block; color: #8a3e22; }
.guide-tool .tool-intro .end-stop,
.guide-tool .tool-intro-copy code { color: #8a3e22; }
.guide-tool .tool-intro-copy p { color: #413d31; }
.guide-tool .tool-cta { color: var(--tool-ink); background: var(--tool-soot); }
.guide-tool .tool-cta:hover { color: var(--tool-ink); background: #433a2f; }
.guide-tool .tool-intro :focus-visible { outline-color: #8a3e22; }

.guide-visual {
  --guide-line: #574a36;
  padding: clamp(.85rem, 4vw, 3rem);
  align-content: center;
  border: 1px solid #a29a86;
  background: #e6dfcc;
  color: #211b14;
}

.guide-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(.55rem, 2vw, 1.4rem);
}

.guide-inputs > div, .guide-combined {
  position: relative;
  padding: clamp(.65rem, 2.6vw, 2rem);
  background: #f8f4e8;
}

.guide-inputs > div { container-type: inline-size; border-top: 4px solid #943b21; }
.guide-inputs > div + div { border-color: #5c711e; }
.guide-visual strong { display: block; font: 500 clamp(.9rem, 2.25vw, 2.15rem)/1.1 var(--tool-display); letter-spacing: -.035em; }
.guide-inputs strong { font-size: clamp(.82rem, 16.5cqw, 1.75rem); white-space: nowrap; }
.guide-visual span { display: block; font-size: clamp(.8rem, 1.2vw, 1rem); margin-top: .35rem; }
.guide-combined { background: var(--tool-soot); color: var(--tool-lime); text-align: center; }
.guide-join {
  height: clamp(2rem, 6vw, 4rem);
  margin-inline: 25%;
  background: linear-gradient(var(--guide-line) 0 0) center bottom / 2px 50% no-repeat,
    linear-gradient(var(--guide-line) 0 0) center / 100% 2px no-repeat,
    linear-gradient(var(--guide-line) 0 0) left top / 2px 50% no-repeat,
    linear-gradient(var(--guide-line) 0 0) right top / 2px 50% no-repeat;
}

.tool-body { padding-block: clamp(2.25rem, 6vw, 5.5rem); }
.tool h2 { font: 500 clamp(1.8rem, 4vw, 4rem)/1.02 var(--tool-display); letter-spacing: -.055em; text-wrap: balance; }
.tool h3 { font: 650 1.25rem/1.2 var(--tool-display); letter-spacing: -.025em; margin-top: 1.5rem; }
.tool-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1px; background: #d0cec3; }
.tool-grid > section { min-width: 0; padding: clamp(1.15rem, 3.1vw, 3.35rem); background: #fdfcf6; }
.tool-grid > .tool-output { background: var(--tool-panel); color: var(--tool-ink); }
.tool-output { --line: #53534a; }

.tool label { margin: 1rem 0 .3rem; }
.tool input, .tool select, .tool textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  padding: .62rem;
  border: 1px solid #79776c;
  border-radius: 0;
  color: #191b15;
  background: white;
}

.tool input[type="file"] { padding: .35rem; }
.tool input[type="file"]::file-selector-button {
  min-height: 2rem;
  padding-inline: .7rem;
  margin-inline-end: .65rem;
  border: 0;
  font: inherit;
  color: #191b15;
  background: var(--tool-paper);
  cursor: pointer;
}

.tool textarea { font-family: var(--mono); font-size: .9rem; }
.tool .fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: .9rem; }
.tool .actions { margin-top: 1rem; }
.tool .button { border-radius: 0; }
.tool .button-primary:not(:disabled) { border-color: var(--tool-soot); background: var(--tool-soot); color: var(--tool-lime); }
.tool .button-primary:hover:not(:disabled) { background: #34382b; }
.tool .button-secondary:not(:disabled) { border-color: #53534a; color: inherit; background: transparent; }
.tool .button-secondary:hover:not(:disabled) { border-color: currentColor; }
.tool .tool-output a, .tool .tool-output .button-quiet, .tool .tool-output summary { color: var(--tool-lime); }
.tool .tool-output .button-primary:not(:disabled) { background: var(--tool-lime); border-color: var(--tool-lime); color: var(--tool-soot); }
.tool .tool-output .button-primary:hover:not(:disabled) { background: #efffd0; }
.tool #open-watch { margin-top: 1rem; }
.tool-output p, .tool-output details, .tool form p, .tool summary + p { margin-top: .7rem; }
.tool .metric { color: var(--tool-lime); font: 500 clamp(3.5rem, 10vw, 9rem)/.87 var(--tool-display); letter-spacing: -.09em; }
.tool table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: 1rem; }
.tool th, .tool td { border-bottom: 1px solid var(--line); padding: .48rem .25rem; text-align: left; overflow-wrap: anywhere; }
.tool td.num, .tool th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tool summary { min-height: 2.75rem; cursor: pointer; font-weight: 650; padding-block: .5rem; }
.tool p[role="alert"]:not(:empty) { color: #ac2734; font-weight: 650; }
.tool .tool-output p[role="alert"]:not(:empty) { color: #ff9da6; }
.tool-notes { margin-top: clamp(1.5rem, 4vw, 3rem); padding: clamp(1.15rem, 3.1vw, 3.35rem); background: #fdfcf6; border-top: 3px solid #252720; }
.tool-notes p { max-width: 65ch; margin-top: .85rem; }
.tool-notes a, .tool form a { color: #70402b; }
.tool-notes a:hover, .tool form a:hover { color: #381806; }
.tool-notes h2 { margin-bottom: 1rem; }
.tool code, .tool dd, .tool-output p { overflow-wrap: anywhere; }
.tool dl { margin: .6rem 0; }
.tool dt { font-weight: 650; margin-top: .45rem; }
.tool dd { margin: 0; }
.tool output { display: block; }
.tool .watch-events li { padding: .45rem 0; }

.watch-tool .watch-block { border-top: 1px solid var(--line); margin-top: 1.5rem; padding-top: 1rem; }
.watch-tool .watch-block h3 { margin-top: 0; }
.watch-tool .watch-block p { margin-block: .65rem; max-width: 52ch; }
.watch-tool .watch-schedule-fields { align-items: start; }
.watch-tool #watch-summary h3 { overflow-wrap: anywhere; }
.watch-tool .watch-events { padding-inline-start: 1.25rem; }
.watch-tool .watch-events li + li { border-top: 1px solid var(--line); }
.watch-tool .watch-events li > p, .watch-tool .watch-events li > details { margin-top: .25rem; }
.watch-tool .watch-events details dd { font: .875rem/1.55 var(--mono); }

.traffic-bars {
  display: grid;
  gap: .24rem;
  margin-block: 1.6rem;
}

.traffic-bars progress { appearance: none; width: 100%; height: .55rem; border: 0; background: #43443c; color: var(--series); }
.traffic-bars progress::-webkit-progress-bar { background: #43443c; }
.traffic-bars progress::-webkit-progress-value { background: var(--series); }
.traffic-bars progress::-moz-progress-bar { background: var(--series); }
.traffic-bars > div { display: grid; grid-template-columns: minmax(0, 9.2rem) minmax(0, 1fr); gap: .5rem; align-items: center; font-size: .875rem; }
.traffic-bars span { color: var(--tool-muted); }

.tool .daily-traffic :is(th, td) { overflow-wrap: normal; }
.daily-traffic td:first-child { white-space: nowrap; }

.tool .benchmark {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  gap: clamp(1rem, 6vw, 6rem);
  align-items: center;
  border: 0;
  background: var(--tool-lime);
}
.benchmark strong { display: block; font: 500 clamp(3.8rem, 10vw, 9rem)/.95 var(--tool-display); letter-spacing: -.09em; }
.benchmark span { display: block; margin-top: .6rem; }

.guide-chapters .tool-notes {
  display: grid;
  grid-template-columns: minmax(12rem, .82fr) minmax(0, 1.18fr);
  gap: .85rem clamp(1rem, 4vw, 5rem);
}

.guide-chapters .tool-notes > * { margin: 0; }
.guide-chapters .tool-notes > :not(h2) { grid-column: 2; }
.guide-chapters .tool-notes:first-child { margin-top: 0; }
.guide-chapters .tool-notes dl { padding: 1rem; color: var(--tool-ink); background: var(--tool-soot); }
.guide-chapters .tool-notes dl dt { color: var(--tool-muted); }
.guide-chapters .tool-notes dl dd:last-child { color: var(--tool-lime); }
.guide-chapters .tool-notes:last-child ul { padding-inline-start: 1.25rem; }

@media (prefers-reduced-motion: no-preference) {
  .tool-intro[data-enter] .tool-visual { animation: tool-entrance 650ms cubic-bezier(.2, .8, .3, 1) both; }
  .tool .button, .tool .tool-cta { transition: background-color 180ms ease, transform 180ms ease, border-color 180ms ease; }
  .tool .button:hover:not(:disabled) { transform: translateY(-2px); }
  .tool .button:active:not(:disabled) { transform: translateY(1px); }
  @keyframes tool-entrance {
    from { opacity: .45; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (max-width: 50rem) {
  .tool-intro-grid, .traffic-tool .tool-intro-grid, .guide-tool .tool-intro-grid {
    min-height: 0;
    grid-template-columns: 1fr;
    align-content: start;
  }

  .tool-intro h1 { max-width: 15ch; }
  .tool-visual { min-height: clamp(14rem, 43vw, 22rem); }
  .tool-grid { grid-template-columns: minmax(0,1fr); }
  .tool-grid > .tool-output { border-top: 1px solid var(--line); }
}

@media (max-width: 36rem) {
  .tool .fields, .guide-chapters .tool-notes, .tool .benchmark { grid-template-columns: minmax(0,1fr); }
  .guide-chapters .tool-notes > :not(h2) { grid-column: 1; }
  .tool .tool-cta { justify-content: space-between; width: 100%; }
  .tool-intro-copy p { margin-top: 1rem; }
  .tool-intro-grid { padding-block: 2rem; }
  .tool .daily-traffic { font-size: .8125rem; }
}

@media print {
  .tool-visual, .tool .tool-cta, .tool .actions { display: none; }
  .tool, .tool .tool-intro, .tool-grid, .tool-grid > section, .guide-chapters .tool-notes dl, .tool-notes { background: white; color: black; }
  .tool-intro-grid { display: block; min-height: 0; padding: 0; }
  .tool-intro-copy :is(p, code), .tool .metric, .tool-intro .end-stop, .tool .tool-output summary,
  .tool .traffic-bars span, .guide-chapters .tool-notes dl :is(dt, dd:last-child) { color: black; }
  .tool .tool-grid, .guide-chapters .tool-notes { display: block; }
  .tool .tool-grid > section, .tool-notes { padding-inline: 0; }
}
