/* The night train window background: the hero of a night train booking app on a deep night blue. The canvas fills
   the stage and draws the city out of focus (bokeh discs, the haze over the horizon, the poles that pass); a glass
   layer adds the window's reflection, a grain layer smooths the gradients; the words sit on top. */
:root {
  --page: #06070c;          /* the night */
  --sky: #0b1020;           /* the sky just above the horizon */
  --ink: #f4f1ec;           /* the heading and the button */
  --muted: #a3a2ab;         /* the small words */
  --lede: #c3c0bb;          /* the line under the heading */
  --line: rgba(255, 255, 255, 0.1); /* thin edges */
  --sodium: #ffa552;        /* the street lamps: sodium amber */
  --warm: #ffe2bd;          /* the windows: warm white */
  --ice: #8ec5ff;           /* the LED lights: ice blue */
  --signal: #ff5a4a;        /* a few signal lights: red */
  --button-ink: #0a0b10;    /* the words on the button */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stage {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 320px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  isolation: isolate;
  background: radial-gradient(120% 70% at 50% 72%, var(--sky), var(--page) 70%);
}

.city {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  opacity: 0;
}

/* the window: a soft diagonal reflection, a darker frame toward the corners and a scrim behind the words */
.glass {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(60% 46% at 50% 47%, rgba(6, 7, 12, 0.5), rgba(6, 7, 12, 0) 72%),
    linear-gradient(112deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.035) 42%, rgba(255, 255, 255, 0) 47%, rgba(255, 255, 255, 0) 60%, rgba(255, 255, 255, 0.02) 64%, rgba(255, 255, 255, 0) 67%),
    radial-gradient(140% 120% at 50% 50%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.55) 100%);
  background-size: 100% 100%, 160% 100%, 100% 100%;
  background-position: 0 0, var(--sheen, 50%) 0, 0 0;
}

.grain {
  position: absolute;
  inset: -64px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-size: 128px 128px;
}

.bar,
.hero,
.hint {
  position: relative;
  z-index: 2;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(12px, 3vh, 22px) clamp(16px, 4vw, 40px) 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 620;
  font-variation-settings: 'wdth' 104;
  letter-spacing: -0.005em;
}

.brand__mark {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bar__link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: color 0.3s, box-shadow 0.3s, background-color 0.3s;
}

@media (hover: hover) {
  .bar__link:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  }
}

.hero {
  align-self: center;
  justify-self: center;
  width: min(100%, 760px);
  padding: 0 clamp(16px, 5vw, 40px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* tonight's train, on a strip of frosted glass */
.ticket {
  display: inline-flex;
  align-items: center;
  gap: clamp(6px, 1.6vw, 10px);
  max-width: 100%;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 24px -12px rgba(0, 0, 0, 0.8);
  transition: color 0.3s, box-shadow 0.3s;
}

.ticket__when {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 620;
  letter-spacing: 0.02em;
  color: #1a1206;
  background: linear-gradient(180deg, color-mix(in srgb, var(--sodium) 70%, #fff), var(--sodium));
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15), 0 0 16px -2px color-mix(in srgb, var(--sodium) 55%, transparent);
}

.ticket__leg b {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.ticket__arrow {
  width: 20px;
  height: 10px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (hover: hover) {
  .ticket:hover {
    color: var(--ink);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 8px 24px -12px rgba(0, 0, 0, 0.8);
  }
  .ticket:hover .ticket__arrow {
    transform: translateX(3px);
  }
}

.title {
  margin: clamp(12px, 3vh, 22px) 0 0;
  font-size: clamp(27px, min(8.2vw, 8.6vh), 74px);
  line-height: 1.02;
  font-weight: 540;
  font-variation-settings: 'wdth' 100;
  letter-spacing: -0.035em;
  text-wrap: balance;
  text-shadow: 0 2px 30px rgba(6, 7, 12, 0.6);
}

.title__line {
  display: inline-block;
}

.lede {
  margin: clamp(10px, 2.4vh, 18px) 0 0;
  max-width: 44ch;
  font-size: clamp(13px, min(3.6vw, 2.2vh), 16.5px);
  line-height: 1.5;
  color: var(--lede);
  text-shadow: 0 1px 14px rgba(6, 7, 12, 0.7);
}

.actions {
  margin-top: clamp(14px, 3.6vh, 28px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  position: relative;
  height: clamp(40px, 6.2vh, 46px);
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--button-ink);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn__face {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  padding: 0 clamp(16px, 4vw, 21px);
  border-radius: inherit;
  background: linear-gradient(180deg, #ffffff, #ece8e2);
  box-shadow:
    inset 0 -1px 0 rgba(0, 0, 0, 0.1),
    inset 0 1px 0 #fff,
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 12px 34px -12px color-mix(in srgb, var(--sodium) calc(var(--glow, 0.3) * 100%), transparent);
}

.btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.btn__words {
  font-size: 14px;
  font-weight: 620;
  font-variation-settings: 'wdth' 100;
  white-space: nowrap;
  transition: font-variation-settings 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (hover: hover) {
  .btn:hover .btn__words {
    font-variation-settings: 'wdth' 112;
  }
}

.btn__icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.btn__check {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

/* the second button: frosted glass with a highlight that follows the pointer */
.ghost {
  position: relative;
  overflow: hidden;
  height: clamp(40px, 6.2vh, 46px);
  display: inline-flex;
  align-items: center;
  padding: 0 clamp(14px, 4vw, 19px);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 540;
  color: var(--ink);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  backdrop-filter: blur(12px) saturate(1.3);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: background-color 0.3s, box-shadow 0.3s;
}

.ghost__shine {
  position: absolute;
  left: var(--mx, 50%);
  top: var(--my, 50%);
  width: 140px;
  height: 140px;
  margin: -70px 0 0 -70px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 214, 170, 0.22), rgba(255, 214, 170, 0));
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}

.ghost__words {
  position: relative;
}

@media (hover: hover) {
  .ghost:hover {
    background: rgba(255, 255, 255, 0.07);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
  .ghost:hover .ghost__shine {
    opacity: 1;
  }
}

.hint {
  margin: 0;
  padding: 0 16px clamp(10px, 3vh, 22px);
  text-align: center;
  font-size: 11.5px;
  color: color-mix(in srgb, var(--muted) 70%, transparent);
  letter-spacing: 0.01em;
}

@media (max-height: 460px) {
  .hint {
    display: none;
  }
}

@media (max-width: 380px) {
  .ticket {
    font-size: 11px;
  }
}

[data-in],
.title__line {
  opacity: 0;
}
