/* ==========================================================================
   HUD components — the Anduril/Atlas register.
   Chamfered frames, corner registration marks, bracketed technical codes,
   plain outlined buttons, and the spec-block hero footer.
   ========================================================================== */

/* --- Chamfered frame with corner registration marks ---------------------- */

.hud {
  --cut: 22px;                    /* size of the clipped corner */
  --hud-line: var(--line);
  --hud-bg: var(--paper);
  --hud-tick: var(--brass);
  position: relative;
  isolation: isolate;
}

/* Border and fill are two stacked clipped layers — a plain border can't
   follow a chamfer. */
.hud::before,
.hud::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.hud::before {
  inset: 0;
  background: var(--hud-line);
  clip-path: polygon(
    0 0, 100% 0,
    100% calc(100% - var(--cut)),
    calc(100% - var(--cut)) 100%,
    0 100%);
}

.hud::after {
  inset: 1px;
  background: var(--hud-bg);
  clip-path: polygon(
    0 0, 100% 0,
    100% calc(100% - var(--cut) + 1.5px),
    calc(100% - var(--cut) + 1.5px) 100%,
    0 100%);
}

.hud > * { position: relative; }

/* Registration marks sit just outside the four corners. Drawn as background
   gradients so no extra markup is needed. */
.hud--marks {
  background-image:
    linear-gradient(var(--hud-tick), var(--hud-tick)),
    linear-gradient(var(--hud-tick), var(--hud-tick)),
    linear-gradient(var(--hud-tick), var(--hud-tick)),
    linear-gradient(var(--hud-tick), var(--hud-tick));
  background-size: 6px 6px;
  background-repeat: no-repeat;
  background-position:
    -3px -3px,
    calc(100% + 3px) -3px,
    -3px calc(100% + 3px),
    calc(100% + 3px) calc(100% + 3px);
}

.hud--ink { --hud-line: rgba(255, 255, 255, .3); --hud-bg: var(--ink); --hud-tick: var(--brass-lite); }
.hud--sand { --hud-bg: var(--sand); }
.hud--tight { --cut: 14px; }
.hud--wide  { --cut: 34px; }

.hud__body { padding: clamp(1.4rem, 2.4vw, 2rem); }

/* Optional readout in the bottom-left, like a load percentage. */
.hud__readout {
  position: absolute;
  left: clamp(1.4rem, 2.4vw, 2rem);
  bottom: clamp(1rem, 1.8vw, 1.4rem);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  color: var(--muted);
}

/* --- Bracketed technical code -------------------------------------------- */

.code {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.code::before { content: "["; margin-right: .25em; opacity: .55; }
.code::after  { content: "]"; margin-left: .25em; opacity: .55; }

.code--brass { color: var(--brass); }
.section--ink .code { color: rgba(255, 255, 255, .55); }

/* Spec label: bold uppercase line with the code beneath it. */
.spec { display: grid; gap: .7rem; }

.spec__name {
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--ink);
  max-width: 30ch;
}

.section--ink .spec__name { color: #fff; }

/* --- Plain outlined button ------------------------------------------------ */

.btn--line {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-bd: var(--ink);
  --btn-sweep: var(--ink);
  --btn-fg-hover: #fff;
  --btn-glow: rgba(10, 26, 40, .3);
  padding: .8em 1.6em;
  gap: 0;
}

.btn--line-light {
  --btn-bg: transparent;
  --btn-fg: #fff;
  --btn-bd: #fff;
  --btn-sweep: #fff;
  --btn-fg-hover: #0A1A28;
  --btn-glow: rgba(255, 255, 255, .24);
  padding: .8em 1.6em;
  gap: 0;
}

/* --- Hero spec footer ----------------------------------------------------- */

.hero__spec {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) auto;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
  padding-block: clamp(1.6rem, 3vw, 2.4rem);
  border-top: 1px solid rgba(255, 255, 255, .22);
  margin-bottom: clamp(1.4rem, 3vw, 2.2rem);
}

.hero__creed {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .08em;
  line-height: 1.5;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
  margin: 0;
  max-width: 26ch;
}

.hero__brief {
  font-family: var(--font-body);
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.45;
  text-transform: uppercase;
  color: #fff;
  margin: 0;
  max-width: 52ch;
}

.hero__reg {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  color: rgba(255, 255, 255, .55);
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .hero__spec { grid-template-columns: 1fr; gap: 1.2rem; }
  .hero__reg { text-align: left; }
}

/* --- Scanline / grid tick detail ------------------------------------------ */

.ticks-rule {
  height: 10px;
  border-top: 1px solid var(--line);
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: 44px 5px;
  background-repeat: repeat-x;
  background-position: top left;
}

.section--ink .ticks-rule {
  border-color: rgba(255, 255, 255, .18);
  background-image: linear-gradient(to right, rgba(255, 255, 255, .18) 1px, transparent 1px);
}

/* --- Transit log ---------------------------------------------------------- */

.log { border-top: 1px solid var(--line); }

.log__row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1.5fr) minmax(0, 1fr) 92px 96px;
  gap: clamp(.75rem, 2vw, 1.75rem);
  align-items: center;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
  transition: background .25s var(--ease);
}

/* The section behind this log is already --sand, so hovering to --sand
   repainted the row in the surrounding colour and swallowed the rule.
   Highlight to paper, and mark the active row on the left. */
.log__row:hover {
  background: var(--paper);
  box-shadow: inset 2px 0 0 var(--brass), inset 0 -1px 0 var(--line);
}

.log__head {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted-soft);
  padding-block: .8rem;
}

.log__head:hover { background: none; }

.log__ref {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--brass);
}

.log__route {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-weight: 600;
  font-size: .98rem;
  flex-wrap: wrap;
}

.log__route svg { width: 11px; height: 11px; fill: var(--muted-soft); flex: none; }

.log__vessel { font-size: .92rem; color: var(--muted); }

.log__num {
  font-family: var(--font-mono);
  font-size: .88rem;
  color: var(--ink);
  white-space: nowrap;
}

@media (max-width: 860px) {
  .log__row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .3rem .9rem;
    padding: 1.1rem 0;
  }
  .log__head { display: none; }
  .log__ref { grid-column: 1 / -1; }
  .log__route { grid-column: 1 / -1; }
  .log__vessel { grid-column: 1; }
  .log__num { text-align: right; }
  .log__num + .log__num { grid-column: 2; }
}
