/* Shared chrome for every calcei.app page: tokens, reset, nav, footer, theme toggle.
   Page-specific content (hero, showcase, legal-doc typography) stays in each page's own <style>. */
:root {
  color-scheme: light dark;
  --bg: #fcfcfb;
  --ink: #13201d;
  --muted: #5c6b66;
  --accent: #146356;
  --accent-ink: #ffffff;
  --surface: #f1f5f3;
  --radius: 14px;
  --ink-fixed: #13201d;
  --bg-fixed: #fcfcfb;

  --font-display: 'Sora', system-ui, sans-serif;
  --font-text: 'Geist', system-ui, sans-serif;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);

  --margin: clamp(1.25rem, 4vw, 3.5rem);
  --gutter: clamp(1rem, 2vw, 2rem);
  --section: clamp(4rem, 10vw, 9rem);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-reveal: 800ms;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1312;
    --ink: #f1f3f1;
    --muted: #94a19c;
    --accent: #2fbf96;
    --accent-ink: #06211b;
    --surface: #16201d;
  }
}
/* manual override: a data-theme attribute set by the boot script / toggle button wins over
   the system prefers-color-scheme query either way, since an attribute selector on :root
   out-specifies a bare :root inside a media query */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1312;
  --ink: #f1f3f1;
  --muted: #94a19c;
  --accent: #2fbf96;
  --accent-ink: #06211b;
  --surface: #16201d;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fcfcfb;
  --ink: #13201d;
  --muted: #5c6b66;
  --accent: #146356;
  --accent-ink: #ffffff;
  --surface: #f1f5f3;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; scroll-padding-top: 5.5rem; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-text); font-weight: 400; font-size: var(--step-body); line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: clip; }
h1, h2 { margin: 0; font-family: var(--font-display); font-weight: 300; letter-spacing: -0.03em; text-wrap: balance; }
p { margin: 0; max-width: 62ch; }
img { display: block; max-width: 100%; height: auto; background: var(--surface); }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.wrap { padding-inline: var(--margin); }
.section { padding-block: calc(var(--section) / 2); }
.small { font-size: var(--step-small); }
.muted { color: var(--muted); }
.nums { font-variant-numeric: tabular-nums; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: 0 1.5rem; background: var(--accent); color: var(--accent-ink); border-radius: var(--radius); text-decoration: none; font-weight: 500; white-space: nowrap; transition: transform var(--t-press) var(--ease-out); }
.button:active { transform: scale(0.97); }
.button-pill { border-radius: 999px; min-height: 2.75rem; padding: 0 1.4rem; }
.link { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.2em; text-decoration-thickness: 0.07em; transition: text-decoration-color var(--t-hover) ease; }
@media (hover: hover) { .link:hover { text-decoration-color: currentColor; } }

/* ---------- nav ---------- */
/* wraps the header and its mobile-menu panel together so both stay attached to the
   top of the viewport while scrolling, same as the reference site's own header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
  /* a deliberate exception to the usual no-hairline rule: the user asked for this exact
     divider, matching a specific reference screenshot (lifemaxing.app's own header) */
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
}
.nav-right { display: flex; align-items: center; gap: 1.25rem; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; font-weight: 500; font-size: 1rem; flex-shrink: 0; }
.brand img { width: 24px; height: 24px; border-radius: 7px; }

.nav-center { display: none; align-items: center; gap: 1.75rem; }
.nav-link { font-size: var(--step-small); font-weight: 500; text-decoration: none; color: var(--muted); transition: color var(--t-hover) ease; }
.nav-link:hover, .nav-link:focus-visible { color: var(--ink); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: var(--surface);
  flex-shrink: 0;
  transition: transform var(--t-press) var(--ease-out);
}
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun, .theme-toggle .icon-moon { display: block; }
.theme-toggle [hidden] { display: none; }

.nav-burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: var(--surface);
  flex-shrink: 0;
}
.nav-burger svg { width: 18px; height: 18px; }

.mobile-menu {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem var(--margin) 1.25rem;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
}
.mobile-menu[hidden] { display: none; }
.mobile-menu .nav-link { padding: 0.6rem 0; font-size: var(--step-body); color: var(--ink); }
.mobile-menu .nav-lang { padding: 0.6rem 0; }

@media (min-width: 860px) {
  .nav-center { display: flex; }
  .nav-burger { display: none; }
  .mobile-menu { display: none !important; }
}
@media (max-width: 859px) {
  .nav-lang-desktop { display: none; }
}

/* ---------- footer ---------- */
footer { background: var(--ink-fixed); color: var(--bg-fixed); padding-block: 1.5rem 2.5rem; font-size: var(--step-small); text-align: center; }
footer .links { display: flex; justify-content: center; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 0.75rem; opacity: 0.75; }
footer a { text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer .copy { opacity: 0.55; }
