/* Moorline | utxo.yachts
   Nautical-chart treatment: hairline rules, sounding numerals, one blue family.
   Six colors, all defined as custom properties on :root. */

:root {
  color-scheme: light;
  --paper: #f1f4f9;
  --tint: #dee5f2;
  --ink: #0f1b2e;
  --slate: #3e4e6a;
  --sea: #234d95;
  --rule: #63789c;
  --font: -apple-system, "Helvetica Neue", Arial, sans-serif;
  --measure: 38rem;
  --gutter: 16px;
  --leading: 1.8;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 0;
  font-family: var(--font);
  font-size: clamp(1.0625rem, 0.98rem + 0.35vw, 1.2rem);
  line-height: var(--leading);
  color: var(--ink);
  background-color: var(--paper);
  overflow-wrap: break-word;
}

svg {
  max-width: 100%;
}

a {
  color: var(--sea);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--sea);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background-color: var(--paper);
  color: var(--ink);
  border: 2px solid var(--sea);
  font-weight: 700;
  text-decoration: none;
}

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

/* Type */

h1,
h2,
h3 {
  font-family: var(--font);
  color: var(--ink);
}

h1 {
  font-size: clamp(2rem, 1.2rem + 3.2vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 1.5rem;
}

h2 {
  font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.95rem);
  line-height: 1.2;
  font-weight: 700;
  margin: 0 0 1rem;
}

h3 {
  font-size: clamp(1.08rem, 1rem + 0.4vw, 1.25rem);
  line-height: 1.3;
  font-weight: 700;
  margin: 1.75rem 0 0.5rem;
}

p {
  margin: 0 0 1.2em;
}

ul,
ol {
  margin: 0 0 1.2em;
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.4em;
}

/* Layout */

.wrap {
  width: 100%;
  max-width: 64rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

@media (min-width: 48rem) {
  .wrap {
    padding-inline: 2rem;
  }
}

.column {
  max-width: var(--measure);
  min-width: 0;
}

.section-grid {
  display: grid;
  gap: 0.5rem;
}

.sounding {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
  color: var(--slate);
}

@media (min-width: 52rem) {
  .section-grid {
    grid-template-columns: 7rem minmax(0, var(--measure));
    column-gap: 3rem;
    justify-content: center;
  }

  .sounding {
    padding-top: 0.55rem;
    text-align: right;
  }
}

/* Header and navigation */

.site-header {
  border-bottom: 1px solid var(--rule);
  padding-block: 1.25rem;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem 1.5rem;
}

.brand {
  color: var(--ink);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
  line-height: 1.1;
  text-decoration: none;
}

.brand-sub {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--slate);
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list li + li {
  margin-top: 0;
}

.nav-list a {
  display: inline-block;
  padding-block: 0.2rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.nav-list a:hover {
  border-bottom-color: var(--rule);
}

.nav-list a[aria-current="page"] {
  color: var(--sea);
  font-weight: 700;
  border-bottom-color: var(--sea);
}

/* Hero */

.hero {
  padding-block: clamp(3rem, 8vw, 6rem) clamp(2.5rem, 6vw, 4.5rem);
}

.kicker {
  margin: 0 0 1.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--slate);
}

.lede {
  font-size: clamp(1.08rem, 1rem + 0.5vw, 1.3rem);
  line-height: 1.75;
  color: var(--slate);
}

.moorings {
  display: block;
  width: 100%;
  height: auto;
  margin: 2.5rem 0 2.25rem;
}

.sea-line {
  stroke: var(--sea);
  stroke-width: 3;
}

.water {
  fill: none;
  stroke: var(--rule);
  stroke-width: 2;
  stroke-dasharray: 14 10;
}

.rope {
  stroke: var(--rule);
  stroke-width: 2;
}

.ring-full {
  fill: var(--sea);
  stroke: var(--sea);
  stroke-width: 3;
}

.ring-empty {
  fill: var(--paper);
  stroke: var(--sea);
  stroke-width: 3;
}

/* Buttons */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.25rem;
  border: 2px solid var(--sea);
  background-color: var(--paper);
  color: var(--sea);
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.btn:hover {
  background-color: var(--tint);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.btn-solid {
  background-color: var(--sea);
  color: var(--paper);
}

.btn-solid:hover {
  background-color: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* Sections and content */

.section {
  border-top: 1px solid var(--rule);
  padding-block: clamp(2.75rem, 7vw, 4.75rem);
}

.marks {
  list-style: none;
  padding-left: 0;
}

.marks li {
  position: relative;
  padding-left: 1.75rem;
}

.marks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.9em;
  width: 1rem;
  height: 2px;
  background-color: var(--sea);
}

.note {
  margin: 2.5rem 0 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--sea);
  background-color: var(--tint);
  font-size: 0.97em;
}

.note p:last-child {
  margin-bottom: 0;
}

.next-steps {
  list-style: none;
  padding-left: 0;
}

.next-steps a {
  font-weight: 700;
}

/* Diagrams */

.figure {
  margin: 2rem 0;
}

.figure svg {
  display: block;
  width: 100%;
  max-width: 24rem;
  height: auto;
}

.figure figcaption {
  margin-top: 0.75rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--slate);
}

.diagram-box {
  fill: var(--tint);
  stroke: var(--sea);
  stroke-width: 2;
}

.diagram-box-out {
  fill: var(--paper);
  stroke: var(--sea);
  stroke-width: 2;
}

.diagram-core {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 2;
}

.diagram-line {
  fill: none;
  stroke: var(--sea);
  stroke-width: 2;
}

.diagram-arrow {
  fill: var(--sea);
}

.diagram-text {
  fill: var(--ink);
  font-family: var(--font);
  font-size: 16px;
}

.diagram-title {
  font-weight: 700;
}

/* Dial (enhanced only) */

.dial-enhanced {
  display: none;
}

.js .dial-enhanced {
  display: block;
}

.no-js-note {
  display: block;
  padding: 0.9rem 1rem;
  border-left: 4px solid var(--rule);
  background-color: var(--tint);
}

.js .no-js-note {
  display: none;
}

.dial-panel {
  display: grid;
  justify-items: center;
  gap: 1rem;
  margin: 2rem 0 1.5rem;
  padding: 1.5rem 1rem 1.25rem;
  border: 2px solid var(--rule);
  background-color: var(--tint);
  text-align: center;
}

.field-label {
  margin: 0;
  font-weight: 700;
}

.dial-readout {
  margin: 0;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 1.9rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hint {
  margin: 0;
  max-width: 30rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--slate);
}

.dial {
  display: block;
  width: min(17.5rem, 100%);
  height: auto;
  margin: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.dial:active {
  cursor: grabbing;
}

.dial:focus-visible {
  outline: 3px solid var(--sea);
  outline-offset: 6px;
  border-radius: 50%;
}

.dial-face {
  fill: var(--paper);
  stroke: var(--rule);
  stroke-width: 2;
}

.tick {
  stroke: var(--slate);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.dial-label {
  fill: var(--slate);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
}

.knob-body {
  fill: var(--tint);
  stroke: var(--rule);
  stroke-width: 3;
}

.knob-pointer {
  stroke: var(--sea);
  stroke-width: 5;
  stroke-linecap: round;
}

.knob-cap {
  fill: var(--sea);
}

.dial-value {
  fill: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
}

.result {
  margin: 0 0 1.25rem;
  padding-left: 1rem;
  border-left: 4px solid var(--sea);
  color: var(--ink);
}

.berths {
  display: grid;
  gap: 0.6rem;
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.berths li + li {
  margin-top: 0;
}

.berth {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 1rem;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--rule);
  background-color: var(--paper);
  transition: border-color 200ms ease, background-color 200ms ease;
}

.berth[hidden] {
  display: none;
}

.berth.is-spent {
  border: 2px solid var(--sea);
  background-color: var(--tint);
}

.berth-change {
  border-style: dashed;
}

.berth-name {
  font-weight: 700;
}

.berth-value {
  font-variant-numeric: tabular-nums;
}

.berth-state {
  margin-left: auto;
  font-size: 0.92rem;
  color: var(--slate);
  text-align: right;
}

.berth.is-spent .berth-state {
  color: var(--sea);
  font-weight: 700;
}

/* Reference table */

.ref-table {
  width: 100%;
  margin: 1.5rem 0 2rem;
  border-collapse: collapse;
  font-size: 0.97rem;
}

.ref-table caption {
  padding-bottom: 0.6rem;
  text-align: left;
  font-size: 0.95rem;
  color: var(--slate);
}

.ref-table th,
.ref-table td {
  padding: 0.7rem 0.6rem 0.7rem 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.ref-table thead th {
  border-bottom: 2px solid var(--sea);
  font-weight: 700;
}

.ref-table tbody th {
  font-weight: 700;
}

/* Glossary */

.glossary {
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

.glossary > div {
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--rule);
}

.glossary dt {
  font-weight: 700;
  color: var(--ink);
}

.glossary dd {
  margin: 0.2rem 0 0;
  color: var(--ink);
}

/* Contact */

.mail-link {
  font-size: 1.15rem;
  font-weight: 700;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 2.25rem 2.75rem;
  font-size: 0.95rem;
  color: var(--slate);
}

.site-footer p {
  max-width: var(--measure);
  margin: 0 0 0.6rem;
}

.site-footer a {
  color: var(--sea);
}

/* Reduced motion: every transition gets a static version */

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

  .btn,
  .btn:hover,
  .btn-solid:hover,
  .nav-list a,
  .berth {
    transition: none;
  }
}
