/* Lotusreach: lotusreach.online
   Tokens follow the launcher's design system (lotusreach-launcher/docs/design.md). The site adds one voice, the
   storybook italic (Cormorant Garamond), for remembered moments. Gold (Crystal) is only for the crystal, live
   states and success. */

@font-face { font-family: "Marcellus SC"; src: url("/fonts/MarcellusSC-Regular.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/fonts/Figtree-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/fonts/Figtree-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/fonts/Figtree-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/fonts/Figtree-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/JetBrainsMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/JetBrainsMono-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("/fonts/cormorant-garamond-latin-400-italic.woff2") format("woff2"); font-style: italic; font-weight: 400; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("/fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2"); font-style: italic; font-weight: 500; font-display: swap; }

:root {
  color-scheme: dark;

  --night: #0F0B1E;
  --night-deep: #08060F;
  --dusk: #1B1533;
  --dusk-raised: #251D45;
  --lilac: #B7A3F0;
  --petal: #E39AC4;
  --crystal: #F3C76A;
  --crystal-light: #FFF1C9;
  --mist: #EEEAF8;
  --ash: #8E86AE;
  --ember: #F07A6B;

  --mist-80: rgb(238 234 248 / 0.8);
  --mist-60: rgb(238 234 248 / 0.6);
  --ash-40: rgb(142 134 174 / 0.4);
  --ash-20: rgb(142 134 174 / 0.2);
  --ash-15: rgb(142 134 174 / 0.15);
  --panel: rgb(27 21 51 / 0.78);
  --panel-solid: #17122C;

  /* The day's element, set on <body data-element> by the clock. */
  --el-fire: #F07A6B;
  --el-earth: #E2BE6A;
  --el-water: #77AEEB;
  --el-wind: #86D6A2;
  --el-ice: #A9E6F2;
  --el-lightning: #C99BF5;
  --el-light: #FFF4D6;
  --el-dark: #9A8CC4;
  --element: var(--el-light);

  --font-inscription: "Marcellus SC", "Cinzel", Georgia, serif;
  --font-story: "Cormorant Garamond", "Garamond", Georgia, serif;
  --font-ui: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --content: 1240px;
  --narrow: 720px;
  --radius-control: 10px;
  --radius-panel: 16px;

  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --rise: 180ms;
}

body[data-element="fire"] { --element: var(--el-fire); }
body[data-element="earth"] { --element: var(--el-earth); }
body[data-element="water"] { --element: var(--el-water); }
body[data-element="wind"] { --element: var(--el-wind); }
body[data-element="ice"] { --element: var(--el-ice); }
body[data-element="lightning"] { --element: var(--el-lightning); }
body[data-element="light"] { --element: var(--el-light); }
body[data-element="dark"] { --element: var(--el-dark); }

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--night);
  color: var(--mist);
  font: 400 1.0625rem/1.65 var(--font-ui);
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--lilac); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--mist); }

:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; border-radius: 4px; }

::selection { background: rgb(183 163 240 / 0.35); color: var(--mist); }

h1, h2, h3, h4 { margin: 0; font-weight: 400; }
p { margin: 0; }

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--lilac); color: var(--night); padding: 8px 14px; border-radius: var(--radius-control);
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap { width: min(100% - 2 * var(--gutter), var(--content)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2 * var(--gutter), var(--narrow)); margin-inline: auto; }

/* ---------- Type ---------- */

.eyebrow {
  font: 600 0.75rem/1.3 var(--font-ui);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--petal);
}

.inscription { font-family: var(--font-inscription); letter-spacing: 0.04em; }

.display {
  font-family: var(--font-inscription);
  font-size: clamp(2.9rem, 8.2vw, 7.6rem);
  line-height: 0.92;
  letter-spacing: 0.02em;
  text-wrap: balance;
}

.title-1 { font-family: var(--font-inscription); font-size: clamp(2.3rem, 5vw, 4.2rem); line-height: 1.02; letter-spacing: 0.02em; text-wrap: balance; }
.title-2 { font-family: var(--font-inscription); font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1.1; letter-spacing: 0.02em; text-wrap: balance; }
.title-3 { font: 600 1.125rem/1.35 var(--font-ui); }

.story {
  font-family: var(--font-story);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.3rem, 2.1vw, 1.75rem);
  line-height: 1.38;
  color: var(--mist-80);
  text-wrap: pretty;
}

.lead { font-size: clamp(1.05rem, 1.4vw, 1.2rem); line-height: 1.6; color: var(--mist-80); text-wrap: pretty; }
.muted { color: var(--ash); }
.small { font-size: 0.875rem; line-height: 1.5; }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1, "zero" 0; }

/* The gold rule: the wordmark's underline. */
.gold-rule {
  height: 1px; border: 0; margin: 0;
  background: linear-gradient(90deg, rgb(243 199 106 / 0), rgb(243 199 106 / 0.55), rgb(243 199 106 / 0));
}

/* ---------- Buttons ---------- */

.btn {
  --h: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h); padding: 0 24px;
  border-radius: 999px; border: 1px solid transparent;
  font: 600 1rem/1 var(--font-ui); letter-spacing: 0.01em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 120ms, border-color 120ms, color 120ms, transform 120ms, box-shadow 120ms;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-sm { --h: 38px; padding: 0 16px; font-size: 0.9375rem; }
.btn-lg { --h: 56px; padding: 0 30px; font-size: 1.0625rem; }

.btn-primary {
  background: rgb(183 163 240 / 0.92); color: var(--night);
  box-shadow: 0 10px 30px -12px rgb(183 163 240 / 0.7), inset 0 1px 0 rgb(255 255 255 / 0.35);
}
.btn-primary:hover { background: var(--lilac); color: var(--night); box-shadow: 0 14px 36px -10px rgb(183 163 240 / 0.85), inset 0 1px 0 rgb(255 255 255 / 0.4); }

.btn-ghost { background: rgb(15 11 30 / 0.25); color: var(--mist); border-color: var(--ash-40); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgb(238 234 248 / 0.08); color: var(--mist); border-color: rgb(238 234 248 / 0.5); }

.btn-danger { background: transparent; color: var(--ember); border-color: rgb(240 122 107 / 0.55); }
.btn-danger:hover { background: rgb(240 122 107 / 0.1); color: var(--ember); }

.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; }
.link-arrow::after { content: ""; width: 18px; height: 1px; background: currentColor; transition: width 160ms var(--ease-out); }
.link-arrow:hover::after { width: 30px; }

/* ---------- Top bar ---------- */

.topbar {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  height: 72px; padding: 0 var(--gutter);
  transition: background-color 240ms, backdrop-filter 240ms, height 240ms, border-color 240ms;
  border-bottom: 1px solid transparent;
}
.topbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(rgb(15 11 30 / 0.75), rgb(15 11 30 / 0));
  transition: opacity 240ms;
}
.topbar.is-solid { background: rgb(15 11 30 / 0.82); backdrop-filter: blur(14px) saturate(1.2); height: 64px; border-bottom-color: var(--ash-15); }
.topbar.is-solid::before { opacity: 0; }

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--mist); text-decoration: none; flex: none; }
.brand img { width: 36px; height: 36px; filter: drop-shadow(0 0 12px rgb(183 163 240 / 0.45)); }
.brand span { font-family: var(--font-inscription); font-size: 1.05rem; letter-spacing: 0.24em; }
.brand:hover { color: var(--mist); }

.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a {
  position: relative; padding: 8px 12px; border-radius: 8px;
  color: var(--mist-80); font: 600 0.9375rem/1 var(--font-ui); text-decoration: none;
}
.nav a:hover { color: var(--mist); background: rgb(238 234 248 / 0.06); }
.nav a[aria-current="page"] { color: var(--mist); }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 50%; bottom: 0; width: 16px; height: 1px; translate: -50% 0;
  background: linear-gradient(90deg, rgb(243 199 106 / 0), var(--crystal), rgb(243 199 106 / 0));
}

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.topbar-actions .signin { color: var(--mist-80); font-weight: 600; font-size: 0.9375rem; text-decoration: none; }
.topbar-actions .signin:hover { color: var(--mist); }

.account-chip { display: inline-flex; align-items: center; gap: 10px; color: var(--mist); text-decoration: none; font-weight: 600; font-size: 0.9375rem; }
.account-chip .avatar {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 999px;
  background: rgb(183 163 240 / 0.22); border: 1px solid rgb(183 163 240 / 0.45);
  font-family: var(--font-inscription); font-size: 1rem; color: var(--mist);
}

.menu-btn {
  display: none; margin-left: auto;
  width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--ash-40);
  background: rgb(15 11 30 / 0.4); color: var(--mist); cursor: pointer;
}
.menu-btn span, .menu-btn span::before, .menu-btn span::after {
  display: block; width: 18px; height: 1.5px; background: currentColor; margin: auto; position: relative; transition: transform 200ms, opacity 200ms;
}
.menu-btn span::before, .menu-btn span::after { content: ""; position: absolute; left: 0; }
.menu-btn span::before { top: -6px; }
.menu-btn span::after { top: 6px; }
.menu-btn[aria-expanded="true"] span { background: transparent; }
.menu-btn[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

.mobile-nav {
  position: fixed; inset: 0; z-index: 45; padding: 96px var(--gutter) 32px;
  background: rgb(15 11 30 / 0.97); backdrop-filter: blur(12px);
  display: flex; flex-direction: column; gap: 6px; overflow-y: auto;
}
.mobile-nav[hidden] { display: none; }
.mobile-nav a.big { font-family: var(--font-inscription); font-size: 2rem; color: var(--mist); text-decoration: none; padding: 10px 0; border-bottom: 1px solid var(--ash-15); }
.mobile-nav .mobile-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; }

@media (max-width: 1020px) {
  .nav, .topbar-actions { display: none; }
  .menu-btn { display: grid; place-items: center; }
}

body.menu-open { overflow: hidden; }

/* ---------- Footer ---------- */

.footer { position: relative; padding: 72px 0 40px; background: var(--night-deep); border-top: 1px solid var(--ash-15); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; }
.footer-brand { display: flex; flex-direction: column; gap: 16px; max-width: 360px; }
.footer-brand img { width: 56px; height: 56px; }
.footer h3 { font: 600 0.75rem/1 var(--font-ui); letter-spacing: 0.2em; text-transform: uppercase; color: var(--ash); margin-bottom: 16px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer ul a { color: var(--mist-80); text-decoration: none; font-size: 0.9375rem; }
.footer ul a:hover { color: var(--mist); }
.footer-legal { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--ash-15); display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; color: var(--ash); font-size: 0.8125rem; line-height: 1.6; }
.footer-legal p { max-width: 760px; }

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

/* ---------- Panels, forms ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--ash-20);
  border-radius: var(--radius-panel);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.4);
  backdrop-filter: blur(18px) saturate(1.15);
}

.field { display: grid; gap: 8px; }
.field + .field { margin-top: 18px; }
.field label, .field .label { font: 600 0.9375rem/1.3 var(--font-ui); color: var(--mist); }
.field .hint { font-size: 0.8125rem; line-height: 1.45; color: var(--ash); }

.input {
  width: 100%; height: 48px; padding: 0 14px;
  background: rgb(37 29 69 / 0.6); color: var(--mist);
  border: 1px solid rgb(142 134 174 / 0.35); border-radius: var(--radius-control);
  font: 400 1rem/1 var(--font-ui);
  transition: border-color 120ms, box-shadow 120ms, background-color 120ms;
}
.input::placeholder { color: rgb(142 134 174 / 0.75); }
.input:hover { border-color: rgb(142 134 174 / 0.6); }
.input:focus { outline: none; border-color: var(--lilac); box-shadow: 0 0 0 3px rgb(183 163 240 / 0.25); background: rgb(37 29 69 / 0.8); }
.input[aria-invalid="true"], .input.input-validation-error { border-color: var(--ember); }

.input-code {
  height: 64px; text-align: center;
  font: 500 2rem/1 var(--font-mono); letter-spacing: 0.5em; padding-left: 0.5em;
}

.field-error, .field-validation-error { color: var(--ember); font-size: 0.875rem; line-height: 1.4; }
.field-validation-valid { display: none; }

.check { display: flex; align-items: flex-start; gap: 12px; font-size: 0.9375rem; line-height: 1.5; color: var(--mist-80); cursor: pointer; }
.check input { appearance: none; flex: none; width: 20px; height: 20px; margin: 2px 0 0; border-radius: 6px; border: 1px solid var(--ash-40); background: rgb(37 29 69 / 0.6); display: grid; place-items: center; cursor: pointer; }
.check input:checked { background: var(--lilac); border-color: var(--lilac); }
.check input:checked::after { content: ""; width: 10px; height: 6px; border: 2px solid var(--night); border-top: 0; border-right: 0; rotate: -45deg; translate: 0 -1px; }

.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; font-size: 0.9375rem; line-height: 1.5; border: 1px solid var(--ash-20); background: rgb(37 29 69 / 0.55); }
.notice::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 8px; border-radius: 999px; background: var(--lilac); }
.notice-error { border-color: rgb(240 122 107 / 0.45); background: rgb(240 122 107 / 0.08); }
.notice-error::before { background: var(--ember); }
.notice-success { border-color: rgb(243 199 106 / 0.4); background: rgb(243 199 106 / 0.07); }
.notice-success::before { background: var(--crystal); box-shadow: 0 0 10px var(--crystal); }

.validation-summary-valid { display: none; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }

/* ---------- Status dot ---------- */

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; background: var(--ash); flex: none; }
.dot.is-online { background: var(--crystal); box-shadow: 0 0 0 3px rgb(243 199 106 / 0.18), 0 0 12px rgb(243 199 106 / 0.8); }
.dot.is-offline { background: var(--ember); }

/* ---------- Reveal on scroll ---------- */

.js [data-reveal] { opacity: 0; translate: 0 18px; transition: opacity 700ms var(--ease-out), translate 900ms var(--ease-out); transition-delay: var(--delay, 0ms); }
.js [data-reveal].is-in { opacity: 1; translate: 0 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .js [data-reveal] { opacity: 1; translate: none; }
}
