/* LumaLog site. Tokens mirror apps/mobile/lib/theme/lumalog_theme.dart.
   The page follows the system theme, but .hearth sections stay dark in both:
   glow only reads against dark, the same rule as the app's hearth colour. */

:root {
  --canvas: #fbf8f3;
  --surface: #f4efe7;
  --ink: #261f1e;
  --muted: #766b60;
  --line: #e6ded2;
  --ember: #b8612a;
  --ember-soft: #f6e3d3;
  --on-ember: #fff;
  --focus: #b8612a;

  --font: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --measure: 34rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #1f1b18;
    --surface: #2b2521;
    --ink: #ded8d3;
    --muted: #a89b8a;
    --line: #3d3530;
    --ember: #d9772e;
    --ember-soft: #4a2e1c;
    --on-ember: #1f1b18;
    --focus: #f7a84a;
    color-scheme: dark;
  }
}

.hearth {
  --canvas: #14110f;
  --surface: #2b2521;
  --ink: #ded8d3;
  --muted: #a89b8a;
  --line: #3d3530;
  --ember: #d9772e;
  --ember-soft: #4a2e1c;
  --on-ember: #1f1b18;
  --focus: #f7a84a;
  color-scheme: dark;
  background: var(--canvas);
  color: var(--ink);
}

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

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--ember);
}

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

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.05;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  letter-spacing: -0.045em;
  line-height: 0.95;
}

h2 {
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  letter-spacing: -0.035em;
}

h3 {
  font-size: 1.2rem;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

p {
  margin: 0;
  text-wrap: pretty;
}

.wrap {
  width: 100%;
  max-width: 76rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.lede {
  color: var(--muted);
  font-size: clamp(1.125rem, 1.6vw, 1.3rem);
  max-width: var(--measure);
}

.muted {
  color: var(--muted);
}

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

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--ember);
  color: var(--on-ember);
  border-radius: 8px;
}

.skip:focus {
  top: 1rem;
}

/* ---------- Header ---------- */

.site-header {
  position: relative;
  z-index: 2;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.logo img {
  width: 8.5rem;
  height: auto;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.site-header nav a {
  text-decoration: none;
  color: var(--muted);
}

.site-header nav a:hover {
  color: var(--ink);
}

/* ---------- Hero ---------- */

/* On the landing pages the header sits on the photo. */
.site-header.overlay {
  position: absolute;
  inset: 0 0 auto;
  background: transparent;
}

.hero {
  position: relative;
  overflow: hidden;
}

/* The cabin photo, full bleed. The lit render sits exactly on the unlit one
   and scripts/site.js drives its opacity with the app's fire model. */
.scene {
  position: absolute;
  inset: 0;
  margin: 0;
}

.scene img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 50%;
}

.scene .lit {
  opacity: 0.8;
  will-change: opacity;
}

/* Darkens the busy left of the photo so the headline reads, and fades the
   bottom into the page. */
.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgb(20 17 15 / 0.9) 0%, rgb(20 17 15 / 0.72) 32%, rgb(20 17 15 / 0) 60%),
    linear-gradient(0deg, #14110f 0%, rgb(20 17 15 / 0) 24%),
    linear-gradient(180deg, rgb(20 17 15 / 0.55) 0%, rgb(20 17 15 / 0) 20%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 32rem) minmax(0, 1fr);
  gap: 2rem;
  min-height: max(38rem, min(56.25vw, 100svh));
  padding-top: 7rem;
  padding-bottom: 2.5rem;
}

.hero-copy {
  align-self: center;
}

.hero-copy .lede {
  margin-top: 1.5rem;
  color: #cfc6bc;
}

.hero-modes {
  align-self: end;
  justify-self: end;
  text-align: right;
}

.modes {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.modes legend {
  float: left;
  width: 100%;
  margin-bottom: 0.5rem;
  color: #cfc6bc;
  font-size: 0.95rem;
}

.modes label {
  position: relative;
  cursor: pointer;
}

.modes input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.modes span {
  display: inline-block;
  padding: 0.5rem 1.05rem;
  border: 1px solid rgb(222 216 211 / 0.28);
  border-radius: 999px;
  background: rgb(20 17 15 / 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 0.95rem;
  color: var(--ink);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.modes input:checked + span {
  background: var(--ember);
  border-color: var(--ember);
  color: var(--on-ember);
}

.modes input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.modes label:hover span {
  border-color: rgb(222 216 211 / 0.6);
}

.mode-note {
  margin-top: 0.75rem;
  min-height: 1.6em;
  color: #cfc6bc;
  font-size: 0.95rem;
  text-shadow: 0 1px 8px rgb(20 17 15 / 0.8);
}

/* ---------- Waitlist ---------- */

.waitlist {
  margin-top: 2.25rem;
  max-width: 30rem;
}

.waitlist-note {
  margin-top: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
}

.hero .waitlist-note {
  color: #b9ada0;
}

.button {
  display: inline-block;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.8rem 1.25rem;
  border: 0;
  border-radius: 10px;
  background: var(--ember);
  color: var(--on-ember);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.button:hover {
  color: var(--on-ember);
  filter: brightness(1.08);
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(4rem, 10vw, 8rem) 0;
}

.section + .section:not(.hearth) {
  border-top: 1px solid var(--line);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}

.split .lede {
  margin-top: 1.25rem;
}

.points {
  display: grid;
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.points p {
  margin-top: 0.4rem;
  color: var(--muted);
  max-width: var(--measure);
}

/* How it works: diagram beside the points */
.diagram {
  margin-top: 2.5rem;
  max-width: 26rem;
}

.diagram svg {
  width: 100%;
  height: auto;
}

.diagram figcaption {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---------- Woods ---------- */

.woods {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2.5rem);
  margin: 3rem 0 0;
  padding: 0;
  list-style: none;
}

.wood {
  text-align: left;
}

/* End grain, like the "o" in the logo. */
.grain {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 0.55rem solid var(--bark);
  background:
    radial-gradient(circle at 48% 52%, var(--heart) 0 6%, transparent 7%),
    repeating-radial-gradient(circle at 48% 52%, var(--ring) 0 1.2%, var(--wood) 1.6% 7.5%);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.12);
}

.wood h3 {
  margin-top: 1rem;
}

.wood p {
  font-size: 0.95rem;
  color: var(--muted);
}

.wood.soon .grain {
  opacity: 0.55;
}

.birch {
  --bark: #e9e3d8;
  --wood: #ecdcc0;
  --ring: #d9c29c;
  --heart: #c9a877;
}

.oak {
  --bark: #5b4633;
  --wood: #c49a66;
  --ring: #a67a48;
  --heart: #8a5f33;
}

.alder {
  --bark: #6b6259;
  --wood: #d08a58;
  --ring: #b56f40;
  --heart: #9c5a30;
}

.walnut {
  --bark: #3b2c22;
  --wood: #7a5438;
  --ring: #5e3e27;
  --heart: #4a2f1d;
}

/* ---------- App ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem clamp(1.5rem, 4vw, 3.5rem);
  margin: 3.5rem 0 0;
  padding: 0;
  list-style: none;
}

.features p {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 1rem;
}

.aside-note {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  max-width: 40rem;
}

/* ---------- Safety ---------- */

.safety {
  padding: clamp(3rem, 7vw, 5rem) 0;
}

.safety .wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.5rem 2rem;
  align-items: start;
}

.safety svg {
  width: 3rem;
  height: 3rem;
  color: var(--ember);
}

.safety p {
  margin-top: 0.5rem;
  color: var(--muted);
  max-width: 40rem;
}

/* ---------- FAQ ---------- */

.faq {
  margin-top: 2.5rem;
  max-width: 46rem;
}

.faq details {
  border-top: 1px solid var(--line);
}

.faq details:last-child {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1.15rem 2rem 1.15rem 0;
  font-weight: 600;
  position: relative;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 0.25rem;
  top: 1.05rem;
  font-weight: 400;
  font-size: 1.3rem;
  color: var(--muted);
  transition: transform 0.2s;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details p {
  padding: 0 0 1.25rem;
  color: var(--muted);
  max-width: var(--measure);
}

/* ---------- Closing call ---------- */

.closing {
  text-align: left;
  position: relative;
  overflow: hidden;
}

.closing::before {
  content: "";
  position: absolute;
  inset: 30% -10% -60% -10%;
  background: radial-gradient(closest-side at 50% 60%, rgb(217 119 46 / 0.22), transparent);
  pointer-events: none;
}

.closing .wrap {
  position: relative;
}

.closing p {
  margin: 1.25rem 0 2rem;
}

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

.site-footer {
  padding: 3rem 0;
  font-size: 0.95rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem 3rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer .symbol {
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.75rem;
}

/* ---------- Simple pages (privacy, thanks, 404) ---------- */

.page {
  padding: clamp(3rem, 8vw, 6rem) 0;
  min-height: 60vh;
}

.page .wrap {
  max-width: 44rem;
}

.page h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
}

.page h2 {
  font-size: 1.35rem;
  letter-spacing: -0.015em;
  margin-top: 2.5rem;
}

.page p,
.page ul {
  margin-top: 1rem;
  color: var(--muted);
}

.page .lede {
  margin-top: 1.25rem;
}

.page .button {
  margin-top: 2rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Phones and tablets: the photo becomes a block cropped to the fireplace,
     the mode buttons sit under it, then the headline. */
  .scene {
    position: relative;
    aspect-ratio: 4 / 3;
  }

  .scene img {
    object-position: 76% 50%;
  }

  .scene::after {
    background:
      linear-gradient(0deg, #14110f 0%, rgb(20 17 15 / 0) 30%),
      linear-gradient(180deg, rgb(20 17 15 / 0.6) 0%, rgb(20 17 15 / 0) 30%);
  }

  .hero-inner {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-top: 0;
    padding-bottom: 3.5rem;
    margin-top: -3.5rem;
  }

  .hero-copy,
  .hero-modes {
    align-self: stretch;
  }

  .hero-modes {
    order: -1;
    justify-self: auto;
    text-align: left;
    margin-bottom: 2.25rem;
  }

  .modes {
    justify-content: flex-start;
  }

  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .woods {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  body {
    font-size: 1.0625rem;
  }

  .site-header nav .nav-join {
    display: none;
  }

  .features {
    grid-template-columns: minmax(0, 1fr);
  }

  .safety .wrap {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .modes span,
  .faq summary::after {
    transition: none;
  }
}

/* ---------- Diagram ---------- */

.dg-floor {
  stroke: var(--line);
  stroke-width: 2;
}

.dg-log {
  fill: var(--surface);
  stroke: var(--muted);
  stroke-width: 1.5;
}

.dg-luma {
  fill: var(--ember-soft);
  stroke: var(--ember);
  stroke-width: 2;
}

.dg-cavity {
  fill: none;
  stroke: var(--ember);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}

.dg-ray {
  stroke: var(--ember);
  stroke-width: 2;
  stroke-linecap: round;
}

.dg-tip {
  fill: var(--ember);
}

.dg-label {
  fill: var(--muted);
  font-family: var(--font);
  font-size: 14px;
}

.section h2 + .lede {
  margin-top: 1.25rem;
}
