/* nazdeek.co.in
 *
 * A utility, not a brand: a single narrow column, plain controls, and colour
 * only where it carries meaning. Line colours are generated from metro.db's
 * line table at build time -- see site/build.py.
 */

:root {
  --paper: #fbfaf7;
  --raised: #ffffff;
  --ink: #1b1a16;
  --ink-soft: #5c594f;
  --ink-faint: #8a867a;
  --rule: #ddd9cd;
  --rule-strong: #c3beae;
  --focus: #1b56b8;
  /* W2-C5: without this the radio and checkbox render in the browser's own
     blue, which is the only blue anywhere on the site. */
  accent-color: #3a372e;

    --line-LN1: #c0282c;
    --line-LN2: #87760e;
    --line-LN3: #3b76c0;
    --line-LN4: #3b76c0;
    --line-LN5: #428542;
    --line-LN6: #8115ff;
    --line-LN7: #a16389;
    --line-LN8: #d100d1;
    --line-LN9: #767676;
    --line-LN10: #c35306;
    --line-LN11: #008577;
    --line-LN12: #6b7280;
    --line-LN14: #428542;
    --line-LN15: #a16389;
    --line-LN16: #d100d1;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151410;
    --raised: #1e1d18;
    --ink: #eeece2;
    --ink-soft: #a7a397;
    --ink-faint: #7d796d;
    --rule: #33312a;
    --rule-strong: #46433a;
    --focus: #7fa9ff;
    accent-color: #cbc8bc;

    --line-LN1: #ce575a;
    --line-LN2: #f6d71a;
    --line-LN3: #4980c4;
    --line-LN4: #4980c4;
    --line-LN5: #54ab55;
    --line-LN6: #a050ff;
    --line-LN7: #ed91c9;
    --line-LN8: #f300f3;
    --line-LN9: #808080;
    --line-LN10: #f46808;
    --line-LN11: #088d7f;
    --line-LN12: #777d8a;
    --line-LN14: #54ab55;
    --line-LN15: #ed91c9;
    --line-LN16: #f300f3;
  }
}

@font-face {
  font-family: "Plex";
  src: url("fonts/plex-latin-400.woff2") format("woff2");
  font-weight: 400; font-display: swap;
  unicode-range: U+0000-024F, U+20B9, U+2013, U+2014, U+2018-201D, U+2192;
}
@font-face {
  font-family: "Plex";
  src: url("fonts/plex-latin-600.woff2") format("woff2");
  font-weight: 600; font-display: swap;
  unicode-range: U+0000-024F, U+20B9, U+2013, U+2014, U+2018-201D, U+2192;
}
@font-face {
  font-family: "Plex";
  src: url("fonts/plex-deva-400.woff2") format("woff2");
  font-weight: 400; font-display: swap;
  unicode-range: U+0900-097F, U+A8E0-A8FF, U+200C-200D;
}

* { box-sizing: border-box; }

html { background: var(--paper); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 16px 56px;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 "Plex", system-ui, sans-serif;
  font-feature-settings: "tnum" 1;
}

@media (min-width: 700px) { body { font-size: 17px; } }

.bar, main, footer { max-width: 40rem; margin: 0 auto; }

a { color: var(--ink); text-underline-offset: 2px; }
a:focus-visible, input:focus-visible, button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

h1, h2, h3 { font-weight: 600; line-height: 1.25; }
h1 { font-size: 1.4rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 28px 0 8px; }
h3 { font-size: 0.95rem; margin: 16px 0 6px; }

.muted { color: var(--ink-soft); }
.small { font-size: 0.9rem; }
.hi { color: var(--ink-soft); font-size: 0.92em; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* --- Header and footer -------------------------------------------------- */

.bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 18px 0 22px;
}

.wordmark { font-weight: 600; text-decoration: none; }
.tagline { margin: 2px 0 0; color: var(--ink-soft); font-size: 0.92rem; }
.bar-link { color: var(--ink-soft); font-size: 0.92rem; }

footer {
  margin-top: 48px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  color: var(--ink-faint);
  font-size: 0.88rem;
}
footer p { margin: 0; }
footer a { color: var(--ink-soft); }

/* --- Intro -------------------------------------------------------------- */
/* The only block on the site that describes Nazdeek rather than being it.
   Kept short on purpose: the planner has to stay near the top of a 1440x900
   window, so the screenshot is narrow rather than the text being long. */

.intro {
  display: grid;
  gap: 20px;
  padding: 22px 0 6px;
}

.lockup { display: flex; align-items: center; gap: 13px; }

.app-icon {
  width: 56px; height: 56px;
  border-radius: 13px;     /* the squircle Android draws it with */
  display: block;
}

.intro h1 {
  margin: 0;
  font-size: 2.5rem;
  letter-spacing: -0.025em;
  line-height: 1;
}

.intro-hi { margin: 3px 0 0; color: var(--ink-soft); font-size: 1rem; }

.intro-line {
  margin: 16px 0 0;
  font-size: 1.12rem;
  font-weight: 600;
  max-width: 27rem;
  text-wrap: balance;
}

.intro-sub {
  margin: 5px 0 0;
  text-wrap: pretty;
  color: var(--ink-soft);
  font-size: 0.97rem;
  max-width: 26rem;
}

/* One sentence now, so it reads at full strength rather than trailing off
   into a muted half. */
.intro-live {
  margin: 10px 0 0;
  font-size: 0.97rem;
  max-width: 27rem;
  text-wrap: pretty;
}

.intro-get { margin: 15px 0 0; }

.button {
  display: inline-block;
  padding: 9px 17px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.97rem;
}
.button:hover { opacity: 0.88; }

.intro-jump { margin: 10px 0 0; font-size: 0.95rem; }
.intro-jump a { color: var(--ink-soft); }

.intro-shot { margin: 0; }

/* Flat, hairline border, corners matching the phone's. No frame, no tilt,
   no shadow. */
.intro-shot img {
  display: block;
  width: 58%;
  max-width: 208px;
  height: auto;
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
}

.plan-head {
  margin: 26px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 1rem;
  color: var(--ink-soft);
  font-weight: 600;
  scroll-margin-top: 12px;
}

/* --- Planner ------------------------------------------------------------ */

.planner { margin: 0; }

.fields {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 10px;
  align-items: end;
}

.field { display: flex; flex-direction: column; gap: 3px; }
.field:nth-of-type(1) { grid-column: 1; grid-row: 1; }
.field:nth-of-type(2) { grid-column: 1; grid-row: 2; }

.field label {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.field input {
  width: 100%;
  padding: 9px 10px;
  font: inherit;
  color: var(--ink);
  background: var(--raised);
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
}

.field input::placeholder { color: var(--ink-faint); }

#swap {
  grid-column: 2; grid-row: 1 / span 2;
  align-self: center;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  color: var(--ink-soft);
  background: var(--raised);
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  cursor: pointer;
}
#swap:hover { color: var(--ink); border-color: var(--ink-faint); }

/* --- Suggestions -------------------------------------------------------- */

#suggestions {
  position: absolute;
  top: 100%; left: 0; right: 0;
  z-index: 10;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  background: var(--raised);
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  max-height: 19rem;
  overflow-y: auto;
}

#suggestions li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--rule);
}
#suggestions li:last-child { border-bottom: 0; }
#suggestions li:hover, #suggestions li.is-highlighted { background: var(--paper); }

.chip-rail { display: inline-flex; gap: 3px; flex: 0 0 auto; position: relative; top: -1px; }
.chip-rail i { width: 7px; height: 7px; border-radius: 50%; display: block; }

.suggest-names { display: flex; flex-direction: column; min-width: 0; }
.suggest-names b { font-weight: 400; }

/* --- Options ------------------------------------------------------------ */

#options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 16px 0 0;
  padding: 0;
  border: 0;
  font-size: 0.93rem;
  color: var(--ink-soft);
}
#options label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
#options .avoid { margin-left: auto; }

@media (max-width: 460px) { #options .avoid { margin-left: 0; width: 100%; } }

/* --- Empty state -------------------------------------------------------- */

#empty { margin-top: 20px; font-size: 0.95rem; }
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { padding: 7px 0; border-bottom: 1px solid var(--rule); }
.recent a { color: var(--ink); }

/* --- Result ------------------------------------------------------------- */

#result { margin-top: 24px; }

.summary { padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.summary .time { display: block; font-size: 1.75rem; font-weight: 600; line-height: 1.1; }
.summary .facts { margin: 4px 0 0; color: var(--ink); }
.summary p { margin: 3px 0 0; }

.timeline { list-style: none; margin: 0; padding: 0; }

/* One row per thing that happens. The rail runs down the whole timeline and
   each row's dot takes the colour of the train it concerns. */
.row {
  position: relative;
  padding: 0 0 0 24px;
}

.row::before {
  content: "";
  position: absolute;
  left: 5px; top: 0; bottom: 0;
  width: 4px;
  background: var(--line);
}

.row.board::before { top: 11px; border-radius: 2px 2px 0 0; }
.row.arrive::before { bottom: auto; height: 11px; border-radius: 0 0 2px 2px; }

.board, .change, .arrive { padding-top: 4px; padding-bottom: 4px; }

.board > .station::before,
.change > .station::before,
.arrive > .station::before {
  content: "";
  position: absolute;
  left: 0; top: 6px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--line);
}

.station { margin: 0; }
.station a { font-weight: 600; text-decoration: none; }
.station a:hover { text-decoration: underline; }
.station .hi { font-size: 0.82em; margin-left: 5px; }

.meta { margin: 1px 0 0; color: var(--ink-soft); font-size: 0.93rem; }
.change .meta { color: var(--ink); }

.ride { padding-top: 6px; padding-bottom: 10px; }
.ride-label {
  margin: 0;
  color: var(--ink-faint);
  font-size: 0.9rem;
}
summary.ride-label { cursor: pointer; }
summary.ride-label::marker { color: var(--rule-strong); }

.stops { list-style: none; margin: 6px 0 0; padding: 0; }
.stops li { padding: 3px 0; font-size: 0.9rem; }
.stops a { color: var(--ink-soft); }

/* --- Station pages ------------------------------------------------------ */

.station-page h1 { font-size: 1.5rem; }
.station-page > .hi { margin: 2px 0 0; font-size: 1rem; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; }
.chips li {
  font-size: 0.86rem;
  padding: 3px 9px 3px 7px;
  border: 1px solid var(--rule-strong);
  border-left: 4px solid var(--line);
  border-radius: 3px;
  color: var(--ink-soft);
}
.chips .level { color: var(--ink-faint); }

.actions { display: flex; gap: 8px; margin: 16px 0 0; }
.actions a {
  padding: 7px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  background: var(--raised);
  text-decoration: none;
  font-size: 0.93rem;
}
.actions a:hover { border-color: var(--ink-faint); }

.notice {
  margin: 16px 0 0;
  padding: 9px 11px;
  border-left: 3px solid var(--rule-strong);
  color: var(--ink-soft);
  font-size: 0.93rem;
}

.rows { list-style: none; margin: 0; padding: 0; }
.rows li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
}
.rows li b { font-weight: 400; }
.rows li span { color: var(--ink-soft); text-align: right; flex: 0 1 auto; }

.line-head {
  padding-left: 9px;
  border-left: 4px solid var(--line);
  color: var(--ink-soft);
  font-weight: 400;
}

.desc { color: var(--ink-soft); font-size: 0.95rem; }

.letter { font-size: 0.8rem; letter-spacing: 0.08em; color: var(--ink-faint); margin: 24px 0 4px; }
.station-list { list-style: none; margin: 0; padding: 0; }
.station-list li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 7px 0; border-bottom: 1px solid var(--rule);
}

/* --- Prose -------------------------------------------------------------- */

.prose p { max-width: 34rem; }
.placeholder {
  padding: 12px 14px;
  border: 1px dashed var(--rule-strong);
  border-radius: 3px;
  color: var(--ink-faint);
}

/* Until the network loads there is nothing to type into. */
body.loading .planner { opacity: 0.5; pointer-events: none; }


/* --- Intro on a wide screen --------------------------------------------- */
/* Text left, phone right, and the phone narrow enough that "Plan a trip" and
   the From/To fields are still on screen at 1440x900. */

@media (min-width: 760px) {
  .intro {
    grid-template-columns: 1fr auto;
    gap: 40px;
    align-items: center;   /* the text block was ending halfway up the phone */
    padding-top: 30px;
  }
  .intro-shot img { width: 212px; max-width: none; }
  .intro h1 { font-size: 3.1rem; }
  .app-icon { width: 64px; height: 64px; border-radius: 15px; }
}
