/* Polyphasic landing. Desktop reproduces the Paper artboard "F · Sun slices + blocks"
   (1440×900 design units) and scales it with `zoom` (--z, set in app.js). Phones get a
   stacked layout below 760px. Colours are the app's Dusk theme (ReefPalette.Values.dusk). */

:root {
  --ground: #1A1310;
  --surface: #2A201B;
  --line: #4A3830;
  --text: #F6F1EA;
  --muted: #B3A89F;
  --muted-2: #ADADAD;
  --ghost: #8A776B;
  --ink: #1E1206;
  --deep: #0B0807;

  --z: 1;          /* canvas zoom */
  --g: 1;          /* scale for backdrop glow sizes */
  --hz: 440px;     /* horizon y (page px) */
  --sx: 50vw;      /* sun centre x (page px) */
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--deep);
  color: var(--text);
  font-family: Figtree, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }

/* ---------- Backdrop ---------- */
.backdrop { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.sky {
  position: absolute; left: 0; right: 0; top: 0; height: var(--hz);
  background: linear-gradient(180deg, #0F0B09 0%, #1A1310 45%, #2E1D14 80%, #46291A 100%);
}
.water {
  position: absolute; left: 0; right: 0; top: var(--hz); height: calc(560px * var(--g));
  background: linear-gradient(180deg, #22160F 0%, #140E0B 40%, var(--deep) 100%);
}
.glow {
  position: absolute;
  width: calc(1000px * var(--g)); height: calc(800px * var(--g));
  left: calc(var(--sx) - 500px * var(--g)); top: calc(var(--hz) - 400px * var(--g));
  background: radial-gradient(50% 50% at 50% 50%, rgba(233,160,76,0.22) 0%, rgba(233,160,76,0.08) 40%, rgba(233,160,76,0) 70%);
}
.sheen {
  position: absolute;
  width: calc(800px * var(--g)); height: calc(260px * var(--g));
  left: calc(var(--sx) - 400px * var(--g)); top: calc(var(--hz) + 1px);
  background: radial-gradient(50% 50% at 50% 0%, rgba(217,115,63,0.20) 0%, rgba(217,115,63,0.06) 50%, rgba(217,115,63,0) 100%);
}
.horizon {
  position: absolute; left: 0; right: 0; top: var(--hz); height: 1px;
  background: linear-gradient(90deg, rgba(244,196,106,0) 0%, rgba(244,196,106,0.35) 30%, rgba(244,196,106,0.55) 50%, rgba(244,196,106,0.35) 70%, rgba(244,196,106,0) 100%);
}

/* ---------- Nav ---------- */
.nav {
  position: absolute; z-index: 5; top: 0; left: 0; right: 0;
  height: 86px; padding: 0 48px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.mark { display: block; border-radius: 7px; }
.nav-right { display: flex; align-items: center; gap: 28px; font-size: 15px; }
.nav-link { color: var(--muted); transition: color .15s; }
.nav-link:hover { color: var(--text); }
.nav-login { font-weight: 500; }
.nav-login:hover { opacity: .8; }
.nav-cta {
  display: inline-flex; align-items: center; height: 38px; padding: 0 18px; border-radius: 999px;
  background: var(--text); color: var(--ink); font-weight: 600;
  transition: transform .15s, background .15s;
}
.nav-cta:hover { background: #fff; transform: translateY(-1px); }

/* ---------- Hero canvas (desktop: 1440×900 design units) ---------- */
.hero { position: relative; z-index: 1; display: flex; justify-content: center; }
.canvas { position: relative; width: 1440px; height: 900px; flex-shrink: 0; zoom: var(--z); }
.art { position: absolute; inset: 0; pointer-events: none; }
.stars { position: absolute; left: 0; top: 0; }
.sun-wrap { position: absolute; left: 470px; top: 140px; width: 500px; height: 210px; overflow: hidden; }
.sun { display: block; width: 100%; height: 100%; animation: sun-in 1.4s cubic-bezier(.2,.7,.2,1) both; }
.reflection { position: absolute; left: 470px; top: 352px; animation: fade-in 1.6s .2s ease both; }
.ripples { position: absolute; left: 0; top: 362px; }

/* Water shimmer: each ripple line drifts a few px on its own clock. */
.reflection rect, .ripples rect, .block-reflection rect { animation: drift 5s ease-in-out infinite alternate; transform-box: fill-box; }
.reflection rect:nth-child(3n)   { animation-duration: 3.8s; animation-delay: -1.2s; }
.reflection rect:nth-child(3n+1) { animation-duration: 4.6s; animation-direction: alternate-reverse; }
.reflection rect:nth-child(4n)   { animation-duration: 6.2s; animation-delay: -2.4s; }
.ripples rect:nth-child(2n), .block-reflection rect:nth-child(2n) { animation-duration: 7s; animation-direction: alternate-reverse; }

/* ---------- Day blocks (the app's block grammar, scaled ~1.2×) ---------- */
.blocks { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; pointer-events: none; }
.block {
  position: absolute; display: flex; align-items: center; gap: 14px;
  height: 64px; padding: 0 20px; border-radius: 18px;
  box-shadow: 0 18px 40px rgba(0,0,0,.45), 0 3px 6px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,226,170,.28);
  animation: block-in .9s cubic-bezier(.2,.8,.2,1) both;
  pointer-events: auto;
}
.block-text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.block-title { font-weight: 700; font-size: 19px; line-height: 24px; white-space: nowrap; }
.block-sub { font-weight: 600; font-size: 15px; line-height: 20px; white-space: nowrap; }
.session { color: #fff; }
.green { background: linear-gradient(180deg, #2A8039 0%, #237033 100%); }
.blue  { background: linear-gradient(180deg, #3D63C9 0%, #3456B5 100%); }
.coral { background: linear-gradient(180deg, #C4502A 0%, #B04524 100%); }

.walk    { left: 316px; top: 147px; width: 340px; padding-right: 14px; --from: 70px;  animation-delay: .45s; }
.work    { left: 838px; top: 234px; width: 370px; --from: -70px; animation-delay: .6s; }
.workout { left: 226px; top: 312px; width: 350px; --from: 70px;  animation-delay: .75s; }
.side    { left: 900px; top: 396px; width: 340px; height: 72px; --from: -70px; animation-delay: .9s; }

.start {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  height: 40px; padding: 0 16px 0 14px; border-radius: 999px;
  background: #fff; color: #2A8039; font-weight: 800; font-size: 16px;
}
.fixed {
  justify-content: space-between;
  background: var(--surface); border: 2px dashed var(--line);
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
}
.fixed .block-title { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.lock { color: var(--muted-2); }
.block-detail { font-weight: 600; font-size: 15px; color: var(--muted-2); white-space: nowrap; }
.block-reflection { position: absolute; left: 0; top: 78px; pointer-events: none; }

/* ---------- Copy ---------- */
.copy { position: absolute; left: 0; right: 0; top: 538px; display: flex; flex-direction: column; align-items: center; text-align: center; }
h1 { margin: 0; font-weight: 600; font-size: 80px; line-height: 84px; letter-spacing: -0.03em; }
.h1-a, .h1-b { display: block; }
.h1-a { color: var(--text); }
.h1-b { color: var(--ghost); }
.sub { margin: 0; padding-top: 20px; max-width: 640px; font-size: 19px; line-height: 28px; color: var(--muted); }
.ctas { display: flex; gap: 12px; padding-top: 28px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 600; font-size: 16px;
  transition: transform .15s, background .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--text); color: var(--ink); }
.btn-primary:hover { background: #fff; }
.btn-ghost { border: 1px solid var(--line); background: rgba(26,19,16,.6); color: var(--text); }
.btn-ghost:hover { border-color: #6A5246; }
.btn:focus-visible, .nav a:focus-visible { outline: 2px solid #F4B860; outline-offset: 3px; }

.foot { position: relative; z-index: 1; margin-top: auto; padding: 24px; text-align: center; font-size: 13px; color: #6E6159; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 10; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  padding: 12px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  color: var(--text); font-size: 15px; box-shadow: 0 18px 40px rgba(0,0,0,.45);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 40px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Motion ---------- */
@keyframes sun-in { from { transform: translateY(26px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes block-in { from { opacity: 0; transform: translateX(var(--from, 0)); } to { opacity: 1; transform: none; } }
@keyframes drift { from { transform: translateX(-3px); } to { transform: translateX(3px); } }

/* ---------- Phones ---------- */
/* Phones and portrait tablets (must match MOBILE_QUERY in app.js). */
@media (max-width: 759px), (max-width: 1099px) and (max-aspect-ratio: 1/1) {
  .nav { height: 64px; padding: 0 20px; }
  .nav-link, .nav-cta { display: none; }
  .nav-login { font-size: 16px; }

  .canvas { width: 100%; height: auto; zoom: 1; display: flex; flex-direction: column; padding-top: 64px; }
  .art { position: relative; inset: auto; height: 290px; overflow: hidden; }
  .stars { left: 50%; margin-left: -720px; }
  .sun-wrap { left: calc(50% - 155px); top: 40px; width: 310px; height: 130px; }
  .reflection { left: calc(50% - 155px); top: 172px; width: 310px; height: 112px; }
  .ripples { display: none; }

  .copy { order: 2; position: relative; top: auto; padding: 6px 20px 0; }
  h1 { font-size: 50px; line-height: 54px; }
  .sub { font-size: 17px; line-height: 25px; padding-top: 16px; max-width: 330px; }
  .ctas { flex-direction: column; width: 100%; max-width: 330px; gap: 10px; padding-top: 26px; }
  .btn { height: 50px; }

  .blocks { order: 3; position: relative; inset: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 20px 8px; }
  .block { position: relative; left: auto; top: auto; width: min(100%, 330px); height: 60px; padding: 0 16px; border-radius: 16px; }
  .block-title { font-size: 17px; line-height: 22px; }
  .block-sub, .block-detail { font-size: 13px; }
  .start { height: 34px; font-size: 14px; padding: 0 13px 0 11px; }
  .walk    { translate: -14px 0; padding-right: 12px; }
  .work    { translate: 14px 0; }
  .workout { translate: -8px 0; }
  .side    { translate: 12px 0; height: 64px; }
  .block-reflection { display: none; }
  .block { --from: 0; }
  @keyframes block-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
