:root {
  --ink: #1b2230;
  --ink-soft: #4a5466;
  --wash: rgba(255, 255, 255, 0.55);
  --glass: rgba(255, 255, 255, 0.42);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --line: rgba(27, 34, 48, 0.16);
  --sky: #eef2f7;
  --error: #a3322a;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
/* Phone browser edges (iPhone status strip and toolbar, Android address bar). --sky-top / --sky-bottom are the
   rendered golden-hour sky at the top and bottom of a 375x812 screen; the sky fades into them (.sky::after) so the
   bars run straight on. site.js copies them to --edge-top / --edge-bottom and theme-color, and swaps in the
   sheet-backdrop colours while a sheet is open. */
:root { --sky-top: #f7e8cc; --sky-bottom: #d1bca3; }
:root { --edge-top: var(--sky-top); --edge-bottom: var(--sky-bottom); }
html { background-color: var(--edge-top); }
body {
  background-color: var(--edge-top);
  color: var(--ink);
  font-family: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* The sky: still image first, the 3D clouds (.sky-gl, below) on top once they draw, then a white wash. */
.sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.sky-still, .sky-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sky-video { opacity: 0; transition: opacity 1.6s var(--ease); }
.sky-video.playing { opacity: 1; }
/* Top and bottom 14vh fade into the exact edge colours, so there's no band where the phone's bars meet the sky. */
.sky::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background:
    linear-gradient(to bottom, var(--sky-top), transparent) top / 100% 14vh no-repeat,
    linear-gradient(to top, var(--sky-bottom), transparent) bottom / 100% 14vh no-repeat;
}
.sky-wash {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0) 60%),
    var(--wash);
}

.stage {
  position: relative; z-index: 1;
  min-height: 100%;
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(24px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(72px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  text-align: center;
}

.logo { margin: 0; line-height: 0; }
.logo img {
  width: min(620px, 84vw); height: auto;
  opacity: 0;
  filter: blur(10px);
  transform: translateY(14px) scale(0.985);
  animation: arrive 2.4s var(--ease) 0.5s forwards;
}

.actions {
  display: flex; align-items: center; justify-content: center; gap: 26px;
  margin-top: clamp(14px, 4vh, 36px);
  opacity: 0;
  transform: translateY(8px);
  animation: rise 1.6s var(--ease) 2.3s forwards;
}

/* Footer sits at the bottom of the first screen (absolute, not fixed, so it never counts as a Safari bar sampler). */
.foot {
  position: absolute; z-index: 1; left: 0; right: 0; bottom: 0;
  display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center;
  padding: 0 16px calc(18px + env(safe-area-inset-bottom));
  font-size: 12px; letter-spacing: 0.08em; color: var(--ink-soft);
  opacity: 0; animation: rise 1.6s var(--ease) 3s forwards;
}
.foot a { color: inherit; text-decoration: none; }
.foot a:hover { color: var(--ink); }

@keyframes arrive { to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes rise { to { opacity: 1; transform: none; } }

/* Account links: plain text in tracked caps with a hairline divider; an underline draws in on hover. */
.link {
  position: relative;
  font: inherit; font-size: 13px; font-weight: 500; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--ink); background: none; border: 0; padding: 10px 0 10px 0.34em; cursor: pointer;
  /* Tracking also widens the spaces (a word gap was ~3x the letter gap), so pull words in: the gap is now ~2x. */
  word-spacing: -0.25em;
}
.link span { position: relative; display: inline-block; padding-bottom: 6px; }
.link span::after {
  content: ""; position: absolute; left: 0; right: 0.34em; bottom: 0; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: 50% 50%; transition: transform 0.5s var(--ease);
}
.link:hover span::after, .link:focus-visible span::after { transform: scaleX(1); }
.link:focus-visible { outline: none; }
.divider { width: 1px; height: 16px; background: rgba(27, 34, 48, 0.4); transform: translateY(-3px); }

/* Sheets: frosted glass, square corners, hairlines. */
.sheet {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  padding: 0; border: 1px solid rgba(255, 255, 255, 0.8); border-radius: 2px;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(24px) saturate(1.15); backdrop-filter: blur(24px) saturate(1.15);
  box-shadow: 0 30px 80px rgba(27, 34, 48, 0.14);
  color: var(--ink);
  overflow: auto;
}
.sheet[open] { animation: sheet-in 0.5s var(--ease); }
.sheet:focus, .sheet:focus-visible { outline: none; }
.sheet::backdrop { background: rgba(238, 242, 247, 0.4); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(10px); } }

.sheet-body { position: relative; padding: 40px 32px 30px; text-align: left; }
.sheet h2 { margin: 0 36px 10px 0; font-size: 15px; font-weight: 500; letter-spacing: 0.3em; text-transform: uppercase; }
.lede { margin: 0 0 26px; color: var(--ink-soft); font-size: 15px; font-weight: 300; line-height: 1.6; }
.close {
  position: absolute; top: 18px; right: 18px;
  width: 32px; height: 32px; border: 0; padding: 0;
  background: transparent; color: var(--ink-soft); font-size: 24px; font-weight: 300; line-height: 1; cursor: pointer;
}
.close:hover { color: var(--ink); }

label { display: block; margin-bottom: 18px; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-soft); }
.opt { color: #8a93a3; text-transform: none; letter-spacing: 0.04em; }
input, select {
  display: block; width: 100%; margin-top: 4px;
  font: inherit; font-size: 16px; font-weight: 400; letter-spacing: 0.01em; text-transform: none; color: var(--ink);
  padding: 8px 0 9px; border: 0; border-bottom: 1px solid rgba(27, 34, 48, 0.28); border-radius: 0;
  background: transparent;
  transition: border-color 0.25s var(--ease);
}
select { -webkit-appearance: none; appearance: none; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%234a5466'/%3E%3C/svg%3E") no-repeat right 2px center; padding-right: 20px; }
input:focus, select:focus { outline: none; border-bottom-color: var(--ink); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-bottom-color: var(--error); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.cta {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  margin-top: 10px; padding: 16px 0 12px;
  font: inherit; font-size: 13px; font-weight: 500; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink);
  background: none; border: 0; border-bottom: 1px solid var(--ink); cursor: pointer;
}
.cta i { font-style: normal; font-size: 18px; letter-spacing: 0; transition: transform 0.4s var(--ease); }
.cta:hover i, .cta:focus-visible i { transform: translateX(6px); }
.cta:focus-visible { outline: none; }
.cta[disabled] { opacity: 0.55; cursor: default; }
.fine { margin: 16px 0 0; font-size: 12px; font-weight: 300; color: #6b7486; }
.fine a { color: inherit; }
.status { margin: 10px 0 0; min-height: 1em; font-size: 14px; color: var(--error); }

@media (max-width: 420px) {
  .row { grid-template-columns: 1fr; gap: 0; }
  .actions { gap: 20px; }
  .link { letter-spacing: 0.28em; }
}

@media (prefers-reduced-motion: reduce) {
  .sky-video { display: none; }
  .logo img, .actions, .foot { animation-duration: 0.01s; animation-delay: 0s; filter: none; }
  .sheet[open] { animation: none; }
}

/* Sign in */
.pw { position: relative; display: block; }
.pw input { padding-right: 56px; }
.pw-toggle {
  position: absolute; right: 0; bottom: 8px;
  font: inherit; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-soft);
  background: none; border: 0; padding: 4px 0; cursor: pointer;
}
.pw-toggle:hover { color: var(--ink); }
.links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 14px 0 0; }
.textlink {
  font: inherit; font-size: 13px; font-weight: 400; color: var(--ink-soft);
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  text-decoration: underline; text-decoration-color: rgba(27, 34, 48, 0.25); text-underline-offset: 4px;
}
.textlink:hover { color: var(--ink); text-decoration-color: currentColor; }
.status.ok { color: var(--ink-soft); }

/* Invite code */
.code-input { font-size: 20px; letter-spacing: 0.4em; text-transform: uppercase; }
.fine.left { text-align: left; margin: -8px 0 6px; }
@media (max-width: 560px) {
  .actions { flex-direction: column; gap: 2px; }
  .actions .divider { display: none; }
}

/* Golden hour: the clouds recoloured toward sand. The only home look (data-look="golden" on <body>). */
[data-look] .sky-still, [data-look] .sky-video { transition: none; }
[data-look="golden"] .sky-still, [data-look="golden"] .sky-video { filter: sepia(0.35) saturate(0.85) brightness(1.04); }
[data-look="golden"] .sky::before { content: ""; position: absolute; inset: 0; z-index: 1; background: #d9c3a0; mix-blend-mode: color; opacity: 0.75; }
[data-look="golden"] .sky-wash { z-index: 2; background: radial-gradient(ellipse at 50% 45%, rgba(255, 250, 242, 0.4) 0%, rgba(255, 250, 242, 0) 60%), rgba(250, 245, 236, 0.42); }

/* Terms agreement at account creation */
.agree { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; margin: 6px 0 10px; font-size: 12px; letter-spacing: 0.02em; text-transform: none; line-height: 1.55; color: var(--ink-soft); }
.agree input { width: 18px; height: 18px; margin: 2px 0 0; padding: 0; accent-color: var(--ink); border: 0; }
.agree a { color: var(--ink); }
.agree.missing span { color: var(--error); }

/* iOS 26 Safari ignores theme-color and tints each bar from the solid background-color of the frontmost
   position:fixed element touching that edge (anything 10px tall or less is skipped). These two empty samplers
   carry --edge-top / --edge-bottom; background-clip:text keeps them invisible. Toggling html[data-edge-refresh]
   after a colour change makes Safari re-read them. */
.edge { position: fixed; left: 0; right: 0; height: 0; z-index: 2147483647; pointer-events: none; transition: none; background-clip: text; -webkit-background-clip: text; }
.edge.top { top: 0; background-color: var(--edge-top); }
.edge.bottom { bottom: 0; background-color: var(--edge-bottom); }
@supports (-webkit-touch-callout: none) { .edge { height: 11px; } html[data-edge-refresh] .edge { height: 12px; } }

/* 3D clouds: the WebGL sky (clouds.js) fades in over the still image once it has drawn. It is graded to golden hour
   in the shader, and the still is a frame of it, so the old photo's recolouring (sepia filter, colour-blend layer)
   is switched off for both. No WebGL, or a failed start: the still stays. */
.sky-gl { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.6s var(--ease); }
.sky-gl.on { opacity: 1; }
[data-look="golden"] .sky-still { filter: none; }
[data-look="golden"] .sky::before { display: none; }
[data-look="golden"] .sky-wash { background: radial-gradient(ellipse at 50% 45%, rgba(255, 250, 242, 0.42) 0%, rgba(255, 250, 242, 0) 55%), rgba(250, 245, 236, 0.12); }
