:root {
  --bg: #edf0f3;
  --panel: #ffffff;
  --ink: #0f1720;
  --soft: #4f5b67;
  --line: #cdd4db;
  --signal: #2448ff;   /* the lit route */
  --packet: #ffae00;   /* the packet travelling it */
  --sans: 'Geist', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.6 var(--sans); }
a { color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -.03em; line-height: 1.05; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: #fff; padding: .5rem 1rem; z-index: 10; }

.top {
  display: flex; align-items: center; max-width: var(--max); margin: 0 auto;
  padding: 1.25rem var(--gutter);
}
.brand { font-weight: 700; text-decoration: none; letter-spacing: -.02em; }
.top__nav { margin-left: auto; display: flex; gap: 1.5rem; }
.top__nav a { text-decoration: none; color: var(--soft); font-weight: 500; }
.top__nav a:hover { color: var(--ink); }

.hero { max-width: var(--max); margin: 0 auto; padding: clamp(3rem, 9vw, 7rem) var(--gutter) clamp(2rem, 5vw, 3.5rem); }
.hero h1 { font-size: clamp(2.6rem, 6.4vw, 5.6rem); font-weight: 800; max-width: 15ch; margin-bottom: 1.5rem; }
.lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--soft); max-width: 50ch; margin: 0; }

/* the route */
.route {
  max-width: var(--max); margin: 0 auto; padding: clamp(1.5rem, 3vw, 2.5rem);
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  width: calc(100% - 2 * var(--gutter));
}
.route__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2.5rem; }
.route__head h2 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); font-weight: 700; }
.route__again {
  font: 500 .95rem var(--sans); color: var(--signal); background: none; cursor: pointer;
  border: 1px solid currentColor; border-radius: 999px; padding: .5rem 1rem;
}
.route__again:hover { background: var(--signal); color: #fff; }
.route__again:disabled { opacity: .45; cursor: default; background: none; color: var(--signal); }

.track { position: relative; }
.track__line { position: absolute; left: 12px; right: 12px; top: 0; width: calc(100% - 24px); height: 24px; overflow: visible; }
.track__line line { stroke: var(--line); stroke-width: 2; vector-effect: non-scaling-stroke; }
.track__line .track__lit { stroke: var(--signal); stroke-dasharray: 1000; stroke-dashoffset: 1000; }
.packet {
  position: absolute; top: 12px; left: 12px; width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%; background: var(--packet); box-shadow: 0 0 0 5px rgba(255, 174, 0, .25);
  opacity: 0;
}
.hops { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.hop { display: flex; flex-direction: column; gap: .2rem; }
/* four stops evenly spaced: the last two share the third column */
.hop:nth-child(3), .hop:last-child { grid-row: 1; grid-column: 3; justify-self: start; }
.hop:last-child { justify-self: end; align-items: flex-end; text-align: right; }
.hop__dot {
  width: 24px; height: 24px; border-radius: 50%; background: var(--panel);
  border: 2px solid var(--line); margin-bottom: .9rem; position: relative; z-index: 1;
  transition: border-color .2s, background .2s;
}
.hop.is-hit .hop__dot { border-color: var(--signal); background: var(--signal); box-shadow: inset 0 0 0 5px var(--panel); }
.hop__name { font-weight: 700; }
.hop__val { font: 400 .95rem var(--mono); color: var(--soft); }

.stats {
  margin: 2.75rem 0 0; display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}
.stats div { padding: 1.1rem 0 0; }
.stats dt { color: var(--soft); font-size: .95rem; }
.stats dd { margin: .15rem 0 0; font: 500 clamp(1.5rem, 3vw, 2.2rem)/1.1 var(--mono); letter-spacing: -.03em; }
.route__note { margin: 1.5rem 0 0; color: var(--soft); font-size: .95rem; }

/* sections */
.do, .work, .contact { max-width: var(--max); margin: 0 auto; padding: clamp(4rem, 9vw, 7rem) var(--gutter) 0; }
section h2 { font-size: clamp(2rem, 4.2vw, 3.2rem); font-weight: 800; margin-bottom: 2rem; }

.do__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
.do__list li { border-top: 2px solid var(--ink); padding-top: 1.1rem; }
.do__list h3 { font-size: 1.35rem; font-weight: 700; margin-bottom: .5rem; }
.do__list p { margin: 0; color: var(--soft); }

.work__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.work__item {
  display: grid; grid-template-columns: 16rem 1fr auto; gap: 1rem 2rem; align-items: baseline;
  padding: 1.4rem 0; border-bottom: 1px solid var(--line); text-decoration: none;
}
.work__name { font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; }
.work__what { color: var(--soft); }
.work__tag { font: 500 .85rem var(--mono); color: var(--signal); }
.work__item:hover .work__name { color: var(--signal); }

.contact { padding-bottom: clamp(5rem, 10vw, 8rem); }
.contact h2 { max-width: 18ch; }
.btn {
  display: inline-flex; align-items: center; min-height: 3.5rem; padding: 0 1.6rem;
  background: var(--ink); color: #fff; border-radius: 999px; text-decoration: none;
  font: 500 1.1rem var(--mono);
}
.btn:hover { background: var(--signal); }

.foot {
  max-width: var(--max); margin: 0 auto; padding: 1.75rem var(--gutter) 2.5rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem;
  border-top: 1px solid var(--line); color: var(--soft); font-size: .95rem;
}
.foot p { margin: 0; }

@media (max-width: 760px) {
  .hops { grid-template-columns: 1fr; gap: 1.4rem; padding-left: 0; }
  .hop, .hop:nth-child(2), .hop:nth-child(3), .hop:last-child {
    grid-row: auto; grid-column: auto; justify-self: stretch;
    display: grid; grid-template-columns: 24px 1fr; column-gap: 1rem; align-items: center; text-align: left;
  }
  .hop__dot { grid-row: span 2; margin: 0; }
  .track__line { left: 0; top: 12px; width: 24px; height: calc(100% - 24px); }
  .track__line line { display: none; }
  .packet { left: 12px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .do__list { grid-template-columns: 1fr; }
  .work__item { grid-template-columns: 1fr auto; }
  .work__what { grid-column: 1 / -1; grid-row: 2; }
}
