:root { --ink: #f3ece0; --dim: rgba(243,236,224,.62); --serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif; --sans: 'Source Sans 3', system-ui, sans-serif; --han: 'Noto Serif SC', 'Songti SC', serif; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1d2128; color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
canvas { position: fixed; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; }
body:not(.ready) canvas { opacity: 0; }
body canvas { transition: opacity 2.4s ease; }
.hidden, .gone { display: none !important; }
#vignette { position: fixed; inset: 0; pointer-events: none; z-index: 1; background: radial-gradient(ellipse at 50% 46%, transparent 55%, rgba(18,16,14,.34) 100%); }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 2; opacity: 0; transition: opacity 1.6s ease 1.2s; }
#hud.on { opacity: 1; }
.hud-foot { position: absolute; left: 50%; bottom: max(26px, env(safe-area-inset-bottom)); transform: translateX(-50%); text-align: center; text-shadow: 0 1px 10px rgba(0,0,0,.35); }
#miles { font-family: var(--serif); font-size: 19px; letter-spacing: .08em; font-variant-numeric: oldstyle-nums; color: var(--ink); opacity: .86; }
#hud-dir { font-size: 10.5px; letter-spacing: .28em; text-transform: uppercase; color: var(--dim); margin-bottom: 5px; }
#hud-bar { width: 132px; height: 1px; margin: 9px auto 0; background: rgba(243,236,224,.22); }
#hud-bar-fill { display: block; height: 100%; width: 0; background: rgba(243,236,224,.8); transition: width .6s linear; }
#place { position: absolute; top: 15vh; left: 0; right: 0; text-align: center; opacity: 0; transform: translateY(6px); transition: opacity 2.2s ease, transform 2.8s ease, filter 2.2s ease; filter: blur(3px); text-shadow: 0 2px 22px rgba(20,16,12,.45); }
#place.show { opacity: 1; transform: none; filter: none; }
.pl-han { font-family: var(--han); font-weight: 300; font-size: 22px; letter-spacing: .5em; padding-left: .5em; color: rgba(243,236,224,.78); }
.pl-name { font-family: var(--serif); font-weight: 300; font-size: clamp(34px, 5vw, 54px); letter-spacing: .04em; line-height: 1.15; margin-top: 6px; }
.pl-line { font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--dim); margin-top: 6px; letter-spacing: .02em; }
#btn-touch-pause { display: none; }
body.touch.playing #btn-touch-pause { display: block; position: absolute; top: max(14px, env(safe-area-inset-top)); right: 16px; pointer-events: auto; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(243,236,224,.35); background: rgba(20,20,22,.18); color: var(--ink); font-size: 12px; letter-spacing: -.1em; backdrop-filter: blur(4px); }

/* touch */
#touch { position: fixed; inset: 0; z-index: 1; display: none; touch-action: none; }
body.touch.playing #touch { display: block; }
#stick-base { position: absolute; width: 108px; height: 108px; margin: -54px 0 0 -54px; border-radius: 50%; border: 1px solid rgba(243,236,224,.28); opacity: 0; transition: opacity .25s; }
#stick-base.on { opacity: 1; }
#stick-knob { position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; margin: -19px; border-radius: 50%; background: rgba(243,236,224,.32); }

/* screens */
#title, .screen { position: fixed; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; text-align: center; }
#title { cursor: pointer; animation: fadein 3s ease both; }
.veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(22,24,30,.0) 0%, rgba(22,24,30,.08) 45%, rgba(22,20,24,.5) 100%); }
#title .veil { background: radial-gradient(ellipse 70% 55% at 50% 52%, rgba(24,22,22,.30), rgba(24,22,22,0) 70%), linear-gradient(180deg, rgba(20,22,28,0) 50%, rgba(20,18,20,.45)); }
.veil.thin { background: rgba(18,18,22,.46); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.copy { position: relative; padding: 24px; max-width: 760px; text-shadow: 0 2px 26px rgba(18,14,10,.4); }
.kicker { font-size: 11.5px; letter-spacing: .42em; text-transform: uppercase; color: var(--dim); margin: 0 0 18px; padding-left: .42em; }
h1 { font-family: var(--serif); font-weight: 300; font-size: clamp(64px, 11vw, 138px); line-height: .92; margin: 0; letter-spacing: .015em; }
.han { font-family: var(--han); font-weight: 300; font-size: 15px; letter-spacing: .6em; padding-left: .6em; margin-top: 18px; color: rgba(243,236,224,.7); }
.sub { font-family: var(--serif); font-style: italic; font-size: 21px; color: var(--dim); margin: 12px 0 34px; }
.menu { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.menu button { font-family: var(--serif); font-size: 22px; font-weight: 400; letter-spacing: .06em; color: var(--ink); background: none; border: 0; padding: 7px 22px; cursor: pointer; opacity: .78; position: relative; transition: opacity .4s, letter-spacing .6s; }
.menu button::after { content: ''; position: absolute; left: 50%; right: 50%; bottom: 6px; height: 1px; background: currentColor; opacity: .55; transition: left .5s ease, right .5s ease; }
.menu button:hover, .menu button:focus-visible { opacity: 1; letter-spacing: .1em; outline: none; }
.menu button:hover::after, .menu button:focus-visible::after { left: 28%; right: 28%; }
.hint { margin-top: 30px; font-size: 11px; letter-spacing: .34em; text-transform: uppercase; color: rgba(243,236,224,.44); animation: breathe 4.5s ease-in-out infinite; }
.credit { position: absolute; bottom: max(18px, env(safe-area-inset-bottom)); left: 0; right: 0; margin: 0; font-size: 10.5px; letter-spacing: .24em; text-transform: uppercase; color: rgba(243,236,224,.36); }
body.touch .credit { display: none; }
.sliders { display: grid; gap: 16px; margin: 0 auto 30px; width: min(340px, 80vw); text-align: left; }
.sliders label { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 14px; font-family: var(--serif); font-size: 19px; }
.sliders em { font-style: italic; color: var(--dim); font-size: 14px; }
input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; width: 100%; height: 22px; }
input[type=range]::-webkit-slider-runnable-track { height: 1px; background: rgba(243,236,224,.4); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--ink); margin-top: -6px; }
input[type=range]::-moz-range-track { height: 1px; background: rgba(243,236,224,.4); }
input[type=range]::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: var(--ink); }
select { font-family: var(--serif); font-size: 17px; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid rgba(243,236,224,.4); padding: 2px 0; }
select option { color: #222; }
#ending .veil { background: linear-gradient(180deg, rgba(16,16,24,.15), rgba(16,14,20,.6)); animation: fadein 4s ease both; }
.end-line { font-family: var(--serif); font-weight: 300; font-size: clamp(26px, 3.6vw, 40px); margin: 0 0 10px; opacity: 0; }
#ending.play .end-line { animation: rise 3s ease forwards .6s; }
#ending.play .end-line.delay { animation-delay: 2.8s; font-style: italic; }
#ending.play .end-line.delay2 { animation-delay: 5s; }
.end-menu { margin-top: 38px; opacity: 0; }
#ending.play .end-menu { animation: fadein 2s ease forwards 7.4s; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes breathe { 50% { opacity: .2; } }
body.playing { cursor: none; }
body.nogl::after { content: 'Ten Miles needs WebGL.'; position: fixed; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 24px; }
