:root {
  --bg: #f7f6f3;        /* must match BG in main.js */
  --bg-raised: #ffffff;
  --line: #e0dcd4;
  --text: #1d1a16;
  --muted: #6b635a;
  --glow: #a8621a;      /* accent, dark enough to read on white */
  --lamp: #f2a33a;      /* the lit dot on the light switch */
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}

/* ---------- header ---------- */

.site-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 3;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 26px var(--gutter);
}

.wordmark {
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: 0.02em;
  font-style: italic;
}

.wordmark.small { font-size: 22px; }

.site-header nav {
  display: flex;
  gap: clamp(16px, 3vw, 36px);
  font-size: 14px;
  color: var(--muted);
}

.site-header nav a { padding: 6px 0; transition: color 0.2s; }
.site-header nav a:hover,
.site-header nav a:focus-visible { color: var(--text); }

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

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.stage {
  position: absolute;
  inset: 0;
}

#lamp-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  opacity: 0;
  transition: opacity 1.2s ease;
}

#lamp-canvas.ready { opacity: 1; }
#lamp-canvas:active { cursor: grabbing; }

/* Darken the left of the scene so the stand never sits behind the text. */
.stage::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 58%;
  background: linear-gradient(to right, var(--bg) 0%, var(--bg) 42%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

.stage-status {
  position: absolute;
  left: 60%;
  top: 40%;
  transform: translate(-50%, -50%);
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  transition: opacity 0.4s;
}

.stage-status.hidden { opacity: 0; pointer-events: none; }

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(40ch, 42vw);
  margin-left: var(--gutter);
  padding-top: 40px;
  pointer-events: none;
}

.hero-copy > * { pointer-events: auto; }

.eyebrow {
  margin: 0 0 18px;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--glow);
}

h1 { font-size: clamp(44px, 6vw, 84px); }

.lede {
  margin: 26px 0 0;
  color: var(--muted);
  max-width: 38ch;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 36px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  font: 500 14px/1 var(--sans);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.switch:hover { border-color: #b5ada1; }

.switch-plain { padding: 12px 20px; }
.switch-plain[aria-pressed="true"] { border-color: var(--glow); color: var(--glow); }

.switch-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c9c2b7;
  transition: background 0.3s, box-shadow 0.3s;
}

.switch[aria-pressed="true"] .switch-dot {
  background: var(--lamp);
  box-shadow: 0 0 10px 2px rgba(242, 163, 58, 0.6);
}

.hint { font-size: 13px; color: var(--muted); }

/* ---------- sections ---------- */

section:not(.hero) {
  padding: clamp(64px, 10vw, 128px) var(--gutter);
  border-top: 1px solid var(--line);
}

h2 {
  font-size: clamp(30px, 3.4vw, 44px);
  margin-bottom: 40px;
}

.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 32px 40px;
  margin: 0;
}

.specs dt {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.specs dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.25;
}

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  padding: 28px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
}

.card-live {
  background: var(--bg-raised);
  border-color: #d9cdb8;
  color: var(--text);
}

.card-tag {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.card h3 { font-size: 30px; margin-top: auto; }
.card p { margin: 8px 0 0; font-size: 14px; color: var(--muted); }

.about p {
  margin: 0;
  max-width: 34ch;
  font-family: var(--serif);
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.3;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  padding: 32px var(--gutter) 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.site-footer .wordmark { color: var(--text); }

/* ---------- small screens ---------- */

@media (max-width: 820px) {
  .site-header nav a:not(:first-child) { display: none; }

  .hero {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
  }

  .stage {
    position: relative;
    inset: auto;
    height: 62svh;
    min-height: 380px;
  }

  .stage-status { left: 50%; }
  .stage::before { display: none; }

  /* Fade the lit floor into the page so the canvas has no hard bottom edge. */
  .stage::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 28%;
    background: linear-gradient(to bottom, transparent, var(--bg));
    pointer-events: none;
  }

  .hero-copy {
    width: auto;
    margin: 0;
    padding: 8px var(--gutter) 56px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #lamp-canvas { transition: none; }
}
