/* ==========================================================================
   Avuren — coming soon
   A wayfinding system: sign plates, timetable rows, sodium-lamp night palette.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Ground & structure */
  --ink:        #0C0E13;
  --ink-raise:  #13161D;
  --line:       #262B36;
  --line-soft:  #1B1F28;

  /* Type */
  --bone:       #ECE7DE;
  --mist:       #8A91A0;
  --mist-dim:   #5F6675;

  /* Accent — sodium vapour */
  --amber:      #E9B04A;
  --amber-deep: #C4802A;

  /* Type roles */
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Rhythm */
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  font-variation-settings: "wdth" 100;
  font-size: clamp(0.95rem, 0.9rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Tread texture — chevron hatching, barely there */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background:
    repeating-linear-gradient(115deg, rgba(236, 231, 222, 0.028) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(65deg,  rgba(236, 231, 222, 0.02)  0 1px, transparent 1px 14px),
    radial-gradient(120% 75% at 50% -10%, rgba(233, 176, 74, 0.09), transparent 62%);
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.32;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

main, .topbar, .footer { position: relative; z-index: 2; }

a { color: inherit; }

::selection { background: var(--amber); color: #14100A; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 1px;
}

/* --------------------------------------------------------------- top bar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(1.1rem, 3vw, 1.9rem) var(--gutter);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.mark__glyph {
  width: 20px; height: 20px;
  fill: none;
  stroke: var(--amber);
  stroke-width: 1.6;
  stroke-linecap: square;
}

.mark__word {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  padding-left: 0.1em;
}

.topbar__meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mist);
}

.topbar__sep {
  width: 30px;
  height: 1px;
  background: var(--line);
}

.status { display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap; }

/* Everything still fits on a phone once the tracking comes in; only the
   dividing rule has to go. */
@media (max-width: 620px) {
  .topbar__sep { display: none; }

  .topbar__meta {
    gap: 0.7rem;
    font-size: 0.62rem;
    letter-spacing: 0.13em;
  }

  .mark__word {
    font-size: 0.7rem;
    letter-spacing: 0.24em;
  }

  .mark { gap: 0.45rem; }
  .mark__glyph { width: 17px; height: 17px; }
}

.status i {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 0 rgba(233, 176, 74, 0.55);
  animation: ping 2.6s var(--ease) infinite;
}

@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(233, 176, 74, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(233, 176, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(233, 176, 74, 0); }
}

/* ------------------------------------------------------------------ hero */

.hero {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(2.5rem, 9vw, 6rem) var(--gutter) clamp(1.75rem, 5vw, 3rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 3vw, 2rem);
}

.eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--amber);
}

.plate { display: flex; flex-direction: column; gap: clamp(0.5rem, 1.4vw, 0.9rem); }

.plate__rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.plate__rule > span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), var(--line-soft));
  transform-origin: left;
  animation: rule-in 1.1s var(--ease) both;
}

.plate__rule--btm > span {
  background: linear-gradient(90deg, var(--line-soft), var(--line));
  animation-delay: 0.15s;
}

.plate__rule em {
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--mist-dim);
  white-space: nowrap;
}

@keyframes rule-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Base size is a safe fallback; app.js fits the word to the plate exactly. */
.wordmark {
  margin: 0;
  display: flex;
  justify-content: space-between;
  font-size: clamp(2.4rem, 12vw, 8rem);
  font-weight: 600;
  font-variation-settings: "wdth" 125, "wght" 600;
  line-height: 0.86;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.wordmark span {
  display: inline-block;
  animation: letter-in 0.9s var(--ease) both;
  animation-delay: calc(220ms + var(--i) * 65ms);
}

@keyframes letter-in {
  from { opacity: 0; transform: translateY(0.34em); clip-path: inset(0 0 100% 0); }
  to   { opacity: 1; transform: none; clip-path: inset(0 0 -15% 0); }
}

.statement {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(1.05rem, 0.95rem + 0.75vw, 1.55rem);
  line-height: 1.45;
  color: var(--bone);
  text-wrap: pretty;
}

.reveal { animation: fade-up 1s var(--ease) both; animation-delay: var(--d, 0ms); }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ----------------------------------------------------------- route strip */

.strip {
  position: relative;
  width: 100%;
  height: clamp(150px, 26vh, 240px);
  margin-block: clamp(0.5rem, 2vw, 1.25rem);
  border-block: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(19, 22, 29, 0.55), rgba(12, 14, 19, 0));
  overflow: hidden;
}

.strip__canvas { display: block; width: 100%; height: 100%; }

.strip__edge {
  position: absolute;
  top: 0; bottom: 0;
  width: clamp(40px, 9vw, 130px);
  pointer-events: none;
}
.strip__edge--l { left: 0;  background: linear-gradient(90deg, var(--ink), transparent); }
.strip__edge--r { right: 0; background: linear-gradient(270deg, var(--ink), transparent); }

/* -------------------------------------------------------------- timetable */

.log {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(2.25rem, 6vw, 4rem) var(--gutter) clamp(2.5rem, 7vw, 4.5rem);
}

.log__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-bottom: clamp(0.9rem, 2vw, 1.4rem);
}

.section-title {
  margin: 0;
  font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.15rem);
  font-weight: 500;
  font-variation-settings: "wdth" 112, "wght" 500;
  letter-spacing: 0.02em;
}

.section-note {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mist-dim);
}

.board {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-soft);
}

.row {
  position: relative;
  display: grid;
  grid-template-columns: max-content 26px minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(0.75rem, 2.5vw, 2rem);
  padding: clamp(0.85rem, 2.2vw, 1.25rem) clamp(0.4rem, 1.2vw, 0.9rem);
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease);
}

/* Active marker rail */
.row::before {
  content: "";
  position: absolute;
  left: 0; top: -1px; bottom: -1px;
  width: 2px;
  background: var(--amber);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.55s var(--ease);
}

.row__time {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--mist);
  transition: color 0.45s var(--ease);
}

.row__glyph { display: block; width: 24px; height: 24px; color: var(--mist-dim); transition: color 0.45s var(--ease), transform 0.6s var(--ease); }

.row__glyph svg {
  width: 100%; height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.row__label {
  font-size: clamp(1.05rem, 0.95rem + 0.85vw, 1.6rem);
  font-weight: 500;
  font-variation-settings: "wdth" 118, "wght" 500;
  letter-spacing: 0.005em;
  color: var(--bone);
}

.row__note {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--mist);
  text-wrap: pretty;
}

.row.is-active {
  background: linear-gradient(90deg, rgba(233, 176, 74, 0.075), rgba(233, 176, 74, 0));
  border-bottom-color: var(--line);
}
.row.is-active::before { transform: scaleY(1); }
.row.is-active .row__time { color: var(--amber); }
.row.is-active .row__glyph { color: var(--amber); transform: translateX(2px); }

@media (max-width: 760px) {
  .row {
    grid-template-columns: max-content 22px minmax(0, 1fr);
    row-gap: 0.3rem;
  }
  .row__note { grid-column: 3 / -1; }
  .row__glyph { width: 22px; height: 22px; }
}

/* ----------------------------------------------------------------- footer */

.footer {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(1.5rem, 4vw, 2.5rem) var(--gutter) clamp(2rem, 5vw, 3rem);
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem clamp(1.5rem, 5vw, 3.5rem);
}

.footer__fine {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--mist-dim);
}

/* ------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0.001ms !important;
  }
}
