:root {
  --ink: #1a2238;
  --ink-2: #252f4d;
  --ink-3: #34406a;
  --dusk: #4b3f72;
  --amber: #f4a93b;
  --sky: #9cc3e6;
  --paper: #eef1f7;
  --white: #ffffff;
  --text: #1a2238;
  --muted: #5a6382;
  --line: #d5dbe8;
  --good: #2f8f6a;
  --radius: 10px;
  --wrap: 1120px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Archivo", system-ui, sans-serif;
  font-stretch: 100%;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
}
a { color: var(--dusk); }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-head { background: var(--ink); color: var(--white); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; font-stretch: 125%; font-weight: 800; font-size: 19px; letter-spacing: -0.01em; }
.brand:hover { color: var(--white); }
.brand svg { flex: none; }
.nav { display: flex; gap: 22px; }
.nav a { color: #c9d3ea; text-decoration: none; font-size: 15px; }
.nav a:hover { color: var(--white); }

/* ---------- Hero ---------- */
.hero { background: var(--ink); color: var(--white); padding: 40px 0 48px; }
.hero-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.here-label { color: var(--sky); font-size: 15px; margin: 0 0 4px; }
.big-time {
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(64px, 14vw, 168px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  margin: 0;
}
.big-time .sec { font-size: 0.32em; font-weight: 600; color: var(--amber); letter-spacing: 0; margin-left: 0.15em; }
.big-time .ampm { font-size: 0.26em; font-weight: 600; color: var(--sky); letter-spacing: 0; margin-left: 0.2em; }
.here-date { font-size: 20px; margin: 10px 0 0; color: #dfe5f3; }
.here-zone { font-size: 15px; color: #9aa6c6; margin: 2px 0 0; }

.toggle { display: inline-flex; border: 1px solid var(--ink-3); border-radius: 999px; padding: 3px; background: var(--ink-2); }
.toggle button { appearance: none; border: 0; background: transparent; color: #c9d3ea; font: inherit; font-size: 14px; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.toggle button[aria-pressed="true"] { background: var(--amber); color: var(--ink); font-weight: 700; }

/* The world ribbon: one 24-hour day, with each pinned city placed at its local hour */
.ribbon-wrap { margin-top: 40px; }
.ribbon-caption { display: flex; justify-content: space-between; color: #9aa6c6; font-size: 14px; margin-bottom: 10px; gap: 12px; }
.ribbon {
  position: relative;
  border-radius: var(--radius);
  background: linear-gradient(90deg,
    #121a30 0%, #1b2547 18%, var(--dusk) 24%, #e88f5a 27%, var(--sky) 33%,
    #bcd8f0 50%, var(--sky) 70%, #e88f5a 77%, var(--dusk) 81%, #1b2547 87%, #121a30 100%);
  height: 14px;
}
.ribbon-hours { position: relative; height: 22px; margin-top: 6px; color: #7f8bb0; font-size: 12px; font-variant-numeric: tabular-nums; }
.ribbon-hours span { position: absolute; transform: translateX(-50%); }
.ribbon-pins { position: relative; }
.pin { position: absolute; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; white-space: nowrap; transition: left 0.8s linear; }
.pin-stem { width: 2px; background: #6c78a0; }
.pin-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--white); border: 2px solid var(--ink); margin-top: -7px; }
.pin-label { font-size: 13px; color: #dfe5f3; margin-top: 4px; }
.pin-label b { font-weight: 700; color: var(--white); font-variant-numeric: tabular-nums; }
.pin.is-here .pin-dot { background: var(--amber); width: 16px; height: 16px; margin-top: -9px; }
.pin.is-here .pin-label { color: var(--amber); }

/* ---------- Ad slots ---------- */
.ad { margin: 32px auto; text-align: center; }
.ad ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }

/* ---------- Sections ---------- */
section.block { padding: 56px 0; }
section.block + section.block { border-top: 1px solid var(--line); }
h2 { font-stretch: 112%; font-weight: 800; font-size: clamp(28px, 4vw, 38px); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 8px; }
h3 { font-stretch: 105%; font-weight: 700; font-size: 21px; line-height: 1.25; margin: 0 0 6px; }
.lede { color: var(--muted); margin: 0 0 28px; max-width: 62ch; }

/* ---------- Clock list ---------- */
.clock-tools { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.search { position: relative; flex: 1 1 320px; max-width: 520px; }
.search input { width: 100%; font: inherit; padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--white); color: var(--text); }
.search input:focus { border-color: var(--dusk); outline: none; }
.results { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 30px rgba(26, 34, 56, 0.16); list-style: none; margin: 0; padding: 6px; max-height: 320px; overflow: auto; }
.results[hidden] { display: none; }
.results li { padding: 9px 10px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.results li small { color: var(--muted); }
.results li[aria-selected="true"], .results li:hover { background: var(--paper); }
.results .empty { color: var(--muted); cursor: default; }

.clock-list { list-style: none; margin: 0; padding: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.clock-row { display: grid; grid-template-columns: 34px 1fr auto auto 40px; align-items: center; gap: 14px; padding: 16px 18px; }
.clock-row + .clock-row { border-top: 1px solid var(--line); }
.clock-row .sky { width: 28px; height: 28px; }
.city-name { font-weight: 700; font-size: 18px; line-height: 1.2; }
.city-meta { color: var(--muted); font-size: 14px; }
.city-time { font-stretch: 115%; font-weight: 800; font-size: 30px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; text-align: right; line-height: 1; }
.city-time small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.city-day { color: var(--muted); font-size: 14px; text-align: right; min-width: 110px; }
.clock-row.is-here { background: #fff8ec; }
.clock-row.is-here .city-name::after { content: "You are here"; font-size: 12px; font-weight: 600; color: #9a5d00; background: #fde6c0; padding: 2px 8px; border-radius: 999px; margin-left: 8px; vertical-align: 2px; }
.remove { appearance: none; border: 0; background: transparent; color: var(--muted); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 20px; line-height: 1; }
.remove:hover { background: var(--paper); color: var(--ink); }

/* ---------- Converter ---------- */
.convert-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; margin-bottom: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.field select, .field input { font: inherit; font-size: 16px; color: var(--text); padding: 10px 12px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--white); min-width: 160px; }
.btn { appearance: none; border: 0; font: inherit; font-weight: 700; padding: 12px 18px; border-radius: var(--radius); background: var(--ink); color: var(--white); cursor: pointer; }
.btn:hover { background: var(--dusk); }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.btn.ghost:hover { border-color: var(--ink); background: transparent; }

.convert-table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.convert-table th, .convert-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.convert-table th { font-size: 14px; color: var(--muted); font-weight: 600; background: #f7f8fc; }
.convert-table td.t { font-weight: 800; font-stretch: 112%; font-variant-numeric: tabular-nums; font-size: 20px; }
.tag { display: inline-block; font-size: 13px; padding: 2px 10px; border-radius: 999px; }
.tag.work { background: #dcf1e7; color: #1d6a4c; }
.tag.edge { background: #fdf0d8; color: #8a5600; }
.tag.sleep { background: #e5e7f2; color: #4b5375; }
.legend { color: var(--muted); font-size: 14px; margin-top: 12px; }

/* ---------- Guide ---------- */
.guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 48px; }
.guide article p { margin: 0 0 12px; max-width: 62ch; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 18px; }
.faq details p { margin: 10px 0 0; max-width: 70ch; color: #333c5a; }

/* ---------- Plain pages ---------- */
.page { padding: 56px 0; }
.page .wrap { max-width: 760px; }
.page h1 { font-stretch: 115%; font-weight: 800; font-size: clamp(32px, 5vw, 46px); line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 20px; }
.page h2 { font-size: 24px; margin-top: 32px; }
.page p, .page li { max-width: 68ch; }

/* ---------- Footer ---------- */
.site-foot { background: var(--ink); color: #9aa6c6; padding: 36px 0; font-size: 15px; margin-top: 40px; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.visits { margin: 0; color: var(--amber); font-weight: 600; font-variant-numeric: tabular-nums; }
.site-foot a { color: #c9d3ea; text-decoration: none; margin-right: 18px; }
.site-foot a:hover { color: var(--white); }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav { gap: 14px; }
  .nav a:nth-child(n+3) { display: none; }
  .hero { padding-top: 28px; }
  .guide { grid-template-columns: 1fr; }
  .clock-row { grid-template-columns: 28px 1fr auto 34px; gap: 10px; padding: 14px 12px; }
  .clock-row .city-day { grid-column: 2 / 3; grid-row: 2; text-align: left; min-width: 0; }
  .city-time { font-size: 24px; }
  .clock-row.is-here .city-name::after { display: none; }
  .pin-label { font-size: 11px; }
  .convert-table th:nth-child(3), .convert-table td:nth-child(3) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pin { transition: none; }
}

/* ---------- City pages ---------- */
.crumbs { color: #9aa6c6; font-size: 14px; margin: 0 0 14px; }
.crumbs a { color: #c9d3ea; }
.city-hero h1.here-label { font-size: 20px; font-weight: 600; margin: 0 0 6px; }
.vs-you { color: var(--amber); font-weight: 600; margin: 8px 0 0; }
.city-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 48px; }
.facts { padding-left: 20px; margin: 12px 0; }
.facts li { margin: 6px 0; }
.related { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.related ul, .city-list { list-style: none; padding: 0; margin: 10px 0 0; }
.related li, .city-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.related a, .city-list a { font-weight: 600; text-decoration: none; }
.related a:hover, .city-list a:hover { text-decoration: underline; }
.city-list span { color: var(--muted); font-size: 14px; float: right; font-variant-numeric: tabular-nums; }
.page .wrap.wide { max-width: var(--wrap); }
.region-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; margin-top: 12px; }
.region-grid h2 { font-size: 24px; }
.popular { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 24px; }
.popular a { font-weight: 600; text-decoration: none; }
.popular a:hover { text-decoration: underline; }
@media (max-width: 760px) {
  .city-grid, .related, .region-grid { grid-template-columns: 1fr; gap: 28px; }
  .popular { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
