/* Concept: a few words on top, and along the bottom one continuous line drawing of the three cities
   (Dublin, Sydney, Singapore) standing on the same water. It draws itself in, drifts with the pointer,
   the Flyer turns, the water shimmers. Dark-first, with a light version. */
:root {
  --bg: #0a101c;
  --ink: #eef1f6;
  --dim: #8f9aae;
  --line: rgba(214, 224, 240, .34);
  --line-hi: rgba(236, 241, 250, .78);
  --amber: #f3a64a;
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --bg: #eef1f5; --ink: #0f1726; --dim: #5a6579; --line: rgba(20, 32, 54, .32); --line-hi: rgba(15, 23, 38, .8); --amber: #c4661a; color-scheme: light; }
}
:root[data-theme="light"] { --bg: #eef1f5; --ink: #0f1726; --dim: #5a6579; --line: rgba(20, 32, 54, .32); --line-hi: rgba(15, 23, 38, .8); --amber: #c4661a; color-scheme: light; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--display); -webkit-font-smoothing: antialiased; }
a, button { color: inherit; font: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; border-radius: 4px; }

.page { position: relative; min-height: 100%; display: grid; grid-template-rows: 1fr auto; overflow: hidden; }

.words { align-self: center; width: 100%; max-width: 1240px; margin-inline: auto; padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); padding-block: clamp(48px, 10vh, 120px) 24px; }
h1 { margin: 0; font-weight: 700; font-size: clamp(48px, 8vw, 112px); line-height: .92; letter-spacing: -0.045em; }
.role { margin: 22px 0 0; font-size: clamp(19px, 2.1vw, 26px); line-height: 1.4; letter-spacing: -0.01em; color: var(--dim); max-width: 30ch; }
.role b { color: var(--ink); font-weight: 500; }
.role a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.role a:hover { color: var(--amber); }
.links { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px 26px; font-family: var(--mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.links a, .links button { color: var(--dim); text-decoration: none; transition: color .2s; }
.links a:hover, .links button:hover { color: var(--amber); }
.links .copied { color: var(--amber); }

/* Skyline */
.horizon { position: relative; width: 100%; overflow: hidden; padding-bottom: env(safe-area-inset-bottom, 0px); }
.track { width: 100%; }
.sky { display: block; width: 100%; height: auto; overflow: visible; }
.sky path, .sky ellipse, .sky circle:not(.lite):not(.cap) { fill: none; stroke: var(--line); stroke-width: 1.3; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; transition: stroke .5s ease; }
.sky .fine { stroke-width: .8; }
.sky .back path { stroke-width: 1; opacity: .55; }
.sky .front path { opacity: .8; }
.sky .lite { fill: var(--amber); opacity: .85; animation: twinkle 6s ease-in-out infinite; animation-delay: var(--d, 0s); }
.sky .cap { fill: var(--line); }
.sky .reflect { opacity: .32; }
.sky .reflect use { fill: none; stroke: var(--line); stroke-width: 1; }
.sky .wheel { animation: spin 160s linear infinite; }
.sky .labels text { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; fill: var(--dim); transition: fill .4s; }
.sky .labels .t { fill: var(--ink); }
.sky .labels .here { fill: var(--amber); }
.sky .c { transition: opacity .5s; }
.sky[data-hl] .c { opacity: .55; }
.sky[data-hl="dublin"] .c-dublin, .sky[data-hl="sydney"] .c-sydney, .sky[data-hl="singapore"] .c-singapore { opacity: 1; }
.sky[data-hl="dublin"] .c-dublin path, .sky[data-hl="sydney"] .c-sydney path, .sky[data-hl="singapore"] .c-singapore path,
.sky[data-hl="dublin"] .c-dublin ellipse, .sky[data-hl="singapore"] .c-singapore ellipse, .sky[data-hl="singapore"] .c-singapore circle:not(.lite):not(.cap) { stroke: var(--line-hi); }
.sky .layer { transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }

/* Draw-in on load */
.sky.drawing path, .sky.drawing ellipse, .sky.drawing circle:not(.lite):not(.cap) { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.6s cubic-bezier(.6,.1,.3,1) forwards; animation-delay: var(--dd, 0s); }
.sky.drawing .lite, .sky.drawing .cap, .sky.drawing .labels { opacity: 0; animation: fadein 1s ease forwards; animation-delay: 2.2s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: 1; } }
@keyframes twinkle { 0%, 100% { opacity: .85; } 50% { opacity: .25; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Narrow screens: the drawing keeps its size and slowly pans across the three cities */
@media (max-width: 760px) {
  .track { width: 1200px; animation: pan 46s ease-in-out infinite alternate; }
  .sky .labels text { font-size: 15px; }
  @keyframes pan { from { transform: translateX(0); } to { transform: translateX(calc(100vw - 1200px)); } }
}
@media (prefers-reduced-motion: reduce) {
  .sky .wheel, .sky .lite, .track { animation: none !important; }
  .sky.drawing * { animation: none !important; stroke-dashoffset: 0 !important; opacity: 1; }
  .sky .layer { transition: none; }
}
