:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #15181d;
  --muted: #5d6673;
  --line: #dfe3e8;
  --accent: #1f6feb;
  --accent-hover: #195ccc;
  --accent-text: #ffffff;
  --ring: rgb(31 111 235 / 12%);
  --glow: rgb(31 111 235 / 10%);
  --danger: #c4362c;
  --radius: 14px;
  --bar: 52px;
  --logo-filter: none;
  --badge-ring: transparent;
  color-scheme: light;
}
/* Dark: the system's choice, unless the visitor picked one (settings, assets/theme.js). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1216;
    --surface: #181c22;
    --text: #e8ebef;
    --muted: #98a2ae;
    --line: #2a3038;
    --accent: #4c8dff;
    --accent-hover: #6ea2ff;
    --accent-text: #0b0d10;
    --ring: rgb(76 141 255 / 16%);
    --glow: rgb(76 141 255 / 12%);
    --danger: #ff7a6f;
    --logo-filter: invert(1);
    --badge-ring: rgb(255 255 255 / 22%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1216;
  --surface: #181c22;
  --text: #e8ebef;
  --muted: #98a2ae;
  --line: #2a3038;
  --accent: #4c8dff;
  --accent-hover: #6ea2ff;
  --accent-text: #0b0d10;
  --ring: rgb(76 141 255 / 16%);
  --glow: rgb(76 141 255 / 12%);
  --danger: #ff7a6f;
  --logo-filter: invert(1);
  --badge-ring: rgb(255 255 255 / 22%);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }

/* Home */
.home {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0 16px;
  overflow-x: clip;
}
.home > * { width: 100%; max-width: 760px; margin-left: auto; margin-right: auto; }
.hero {
  padding: max(10vh, 48px) 0 8px;
  position: relative;
}
/* A soft light behind the address box. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0 -20vw auto;
  height: 420px;
  background: radial-gradient(closest-side, var(--glow), transparent);
  z-index: -1;
  pointer-events: none;
}
.logo { margin: 0 auto 14px; width: fit-content; }
.logo img { display: block; width: min(300px, 78vw); height: auto; filter: var(--logo-filter); }
.tagline { text-align: center; color: var(--muted); margin: 0 auto 30px; max-width: 34em; font-size: 17px; font-weight: 400; line-height: 1.5; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: 6px 6px 6px 16px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 4%), 0 10px 32px rgb(0 0 0 / 7%);
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring), 0 10px 32px rgb(0 0 0 / 7%); }
.search-icon { flex: none; width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 12px 4px;
  font-size: 17px;
  outline: none;
}
.search input::placeholder { color: var(--muted); opacity: .85; }
.search button {
  display: flex;
  align-items: center;
  gap: 6px;
  align-self: stretch;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  padding: 0 18px 0 22px;
  cursor: pointer;
  transition: background .15s;
}
.search button:hover { background: var(--accent-hover); }
.search button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.error { color: var(--danger); text-align: center; margin: 12px 0 0; }
.notice {
  margin: 0 auto 20px;
  max-width: 40em;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  background: var(--surface);
  text-align: center;
}

.quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 20px 0 0; }
.quick button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 5px 14px 5px 5px;
  font-size: 14px;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.quick button:hover { border-color: var(--accent); transform: translateY(-1px); }
.quick span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--c);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 0 0 1px var(--badge-ring);
}

/* Three points, each with a small line drawing (no cards). */
.points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 72px; }
.point { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.point .art {
  width: 132px;
  height: 92px;
  color: var(--text);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.point .art .fill { fill: var(--accent); }
.point .art .on-fill { stroke: var(--accent-text); }
.point .art .on-fill.solid { fill: var(--accent-text); }
.point .art .dash { stroke-dasharray: 4 5; }
.point h2 { font-size: 17px; margin: 0; }
.point p { margin: 0; color: var(--muted); font-size: 15px; max-width: 270px; }

/* How to unblock: its own panel, heading at the side and the steps as a timeline, so it does
   not read as part of the three points above. */
.steps {
  margin-top: 80px;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 32px 48px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 36px 40px;
}
.steps-intro h2 { font-size: 24px; line-height: 1.2; margin: 0 0 10px; letter-spacing: -0.3px; }
.steps-intro p { margin: 0; color: var(--muted); font-size: 15px; }
.steps-intro .eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.steps ol { list-style: none; counter-reset: step; margin: 0; padding: 0; display: flex; flex-direction: column; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 26px 52px;
  color: var(--muted);
  font-size: 15px;
}
.steps li:last-child { padding-bottom: 0; }
/* The line joining the numbers. */
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 38px;
  bottom: 4px;
  border-left: 2px dashed var(--line);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ring);
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
}
.steps strong { display: block; color: var(--text); font-size: 16px; margin: 6px 0 2px; }

.faq { margin-top: 64px; }
.faq h2 { font-size: 20px; margin: 0 0 14px; text-align: center; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 32px 14px 2px;
  font-weight: 600;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 8px;
  height: 8px;
  border: solid var(--muted);
  border-width: 0 2px 2px 0;
  transform: translateY(-70%) rotate(45deg);
  transition: transform .2s;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq summary:hover { color: var(--accent); }
.faq details p { margin: 0 0 16px; padding: 0 2px; color: var(--muted); }

@media (max-width: 640px) {
  .hero { padding-top: max(7vh, 32px); }
  .tagline { font-size: 16px; }
  .points { grid-template-columns: 1fr; gap: 32px; margin-top: 48px; }
  .faq { margin-top: 44px; }
  .steps { margin-top: 56px; grid-template-columns: 1fr; gap: 24px; padding: 24px 20px; }
}
@media (max-width: 420px) {
  .search { padding-left: 12px; }
  .search-icon { display: none; }
  .search button { padding: 0 16px; }
  .search button svg { display: none; }
}

.foot {
  margin-top: auto;
  padding: 56px 0 24px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; }
.foot p { margin: 10px 0 0; font-size: 13px; opacity: .8; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); }

/* Browsing */
body.browsing { overflow: hidden; }
.bar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--bar);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  z-index: 2;
}
.icon {
  flex: none;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.icon:hover { background: var(--bg); }
a.icon { color: var(--text); }
.icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon svg circle { fill: currentColor; stroke: none; }
.bar-address { flex: 1; min-width: 0; margin: 0 4px; }
.bar-address input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  padding: 0 12px;
  font-size: 15px;
  outline: none;
  text-overflow: ellipsis;
}
.bar-address input:focus { border-color: var(--accent); background: var(--surface); }
@media (max-width: 520px) {
  #forward { display: none; }
}

.menu {
  position: absolute;
  top: calc(var(--bar) - 4px);
  right: 8px;
  min-width: 250px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 18%);
  padding: 6px;
  display: grid;
}
.menu button, .menu a {
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  cursor: pointer;
}
.menu button:hover, .menu a:hover { background: var(--bg); }

.progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 0;
  background: var(--accent);
  opacity: 0;
  transition: width .4s ease, opacity .3s;
}
.progress.on { opacity: 1; width: 70%; transition: width 6s cubic-bezier(.1,.6,.3,1), opacity .2s; }
.progress.done { opacity: 0; width: 100%; transition: width .2s, opacity .4s .2s; }

.view { position: fixed; inset: var(--bar) 0 0 0; }
.view iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }

/* Text pages */
.page { max-width: 720px; margin: 0 auto; padding: 32px 16px 0; min-height: 100%; display: flex; flex-direction: column; }
.page > .foot { padding-bottom: 24px; }
.page code { font-size: .92em; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; }
.page .back { display: inline-block; align-self: flex-start; margin-bottom: 24px; }
.page .back img { display: block; width: 200px; height: auto; filter: var(--logo-filter); }
.page h1 { font-size: 26px; line-height: 1.25; margin: 0 0 16px; }
.page h2 { font-size: 18px; margin: 28px 0 8px; }
.page p, .page li { color: var(--text); }
.page .muted { color: var(--muted); }

/* Home corner: theme switch and settings */
.home-tools { display: flex; justify-content: flex-end; gap: 4px; padding-top: 12px; max-width: 1100px; }
.home-tools + .hero { padding-top: max(calc(10vh - 50px), 24px); }
.home-tools .icon { color: var(--muted); }
.home-tools .icon:hover { color: var(--text); background: var(--surface); }
#theme-toggle .sun { display: none; }
:root[data-theme="dark"] #theme-toggle .sun { display: block; }
:root[data-theme="dark"] #theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) #theme-toggle .moon { display: none; }
}

/* Settings */
.settings {
  width: min(460px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 60px rgb(0 0 0 / 28%);
}
.settings::backdrop { background: rgb(10 12 16 / 45%); }
.settings form { padding: 6px 20px 20px; }
.settings-head { display: flex; align-items: center; justify-content: space-between; margin: 0 -8px 4px 0; }
.settings-head h2 { font-size: 18px; margin: 0; }
.setting { border: 0; margin: 0; padding: 14px 0; border-top: 1px solid var(--line); min-width: 0; }
.setting legend, .setting-title { display: block; float: left; width: 100%; padding: 0; margin-bottom: 10px; font-weight: 600; font-size: 15px; }
.setting legend + *, .setting-title + * { clear: both; }
.hint { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.hint:empty { display: none; }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; gap: 3px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; text-align: center; padding: 6px 0; border-radius: 7px; font-size: 14px; color: var(--muted); }
.segmented input:checked + span { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgb(0 0 0 / 12%); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

.settings select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  font: inherit;
  color: inherit;
}

.switch { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.switch input {
  appearance: none;
  flex: none;
  width: 40px;
  height: 24px;
  margin: 1px 0 0;
  border-radius: 12px;
  background: var(--line);
  position: relative;
  cursor: pointer;
  transition: background .15s;
}
.switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 25%);
  transition: transform .15s;
}
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-text, .action > span { font-size: 13px; color: var(--muted); }
.switch-text strong, .action strong { display: block; font-size: 14px; font-weight: 500; color: var(--text); }

.action { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.action > span { flex: 1; }
.button {
  flex: none;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.button:hover { border-color: var(--muted); }
.button.danger { color: var(--danger); }
.button.danger:hover { border-color: var(--danger); }
