/* =============================================================
   CSS Showcase — base layer
   ============================================================= */

@property --rainbow-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
@property --rainbow-hue {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
@property --storm-darkness {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}
@property --rain-density {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}
@property --accent-hue {
  syntax: '<number>';
  inherits: true;
  initial-value: 16; /* terracotta */
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--lw-paper);
  color: var(--lw-ink);
  font-family: var(--lw-font-sans);
  font-size: var(--lw-text-md);
  line-height: var(--lw-lh-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  cursor: none; /* custom cursor */
}

::selection { background: var(--lw-terra); color: var(--lw-paper); }

/* ---------- Custom cursor ----------- */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--lw-terra);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: multiply;
  transition: width 320ms var(--lw-ease), height 320ms var(--lw-ease), background 320ms var(--lw-ease);
}
.cursor.ring {
  position: fixed;
  top: 0; left: 0;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--lw-ink-3);
  background: transparent;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  opacity: .6;
  transition: width 500ms var(--lw-ease), height 500ms var(--lw-ease), border-color 500ms var(--lw-ease), opacity 500ms;
}
body.dark-cursor .cursor { background: var(--lw-paper); mix-blend-mode: screen; }
body.dark-cursor .cursor.ring { border-color: var(--lw-paper); mix-blend-mode: screen; }

@media (hover: none) { body { cursor: auto; } .cursor { display: none; } }

/* ---------- Layout utilities ----------- */
.container {
  width: min(100% - 48px, var(--lw-container));
  margin-inline: auto;
}
.narrow {
  width: min(100% - 48px, 720px);
  margin-inline: auto;
}

/* ---------- Eyebrow / scene label ----------- */
.eyebrow {
  font-family: var(--lw-font-sans);
  font-weight: var(--lw-w-medium);
  font-size: var(--lw-text-xs);
  text-transform: uppercase;
  letter-spacing: var(--lw-tr-eyebrow);
  color: var(--lw-ink-3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--lw-terra);
}
.eyebrow.light { color: rgba(255,255,255,0.7); }

.h-display {
  font-family: var(--lw-font-serif);
  font-weight: var(--lw-w-light);
  font-style: italic;
  font-size: clamp(60px, 11vw, 180px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-variation-settings: "opsz" 144;
  margin: 0;
  text-wrap: balance;
}
.h-section {
  font-family: var(--lw-font-serif);
  font-weight: var(--lw-w-light);
  font-style: italic;
  font-size: clamp(44px, 7vw, 110px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-variation-settings: "opsz" 120;
  margin: 0;
  text-wrap: balance;
}
.h-upright {
  font-family: var(--lw-font-serif);
  font-weight: var(--lw-w-regular);
  font-size: clamp(28px, 3.5vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}

.lede {
  font-family: var(--lw-font-serif);
  font-weight: var(--lw-w-light);
  font-size: clamp(19px, 1.6vw, 24px);
  line-height: 1.5;
  font-variation-settings: "opsz" 72;
  max-width: 56ch;
}

.body { color: var(--lw-ink-2); line-height: 1.7; max-width: 62ch; }

/* ---------- Nav ----------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  font-family: var(--lw-font-sans);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lw-ink);
  mix-blend-mode: difference;
  color: white;
}
.nav .brand {
  font-family: var(--lw-font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 24px;
  letter-spacing: -0.02em;
  text-transform: none;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
.nav .brand .dot { color: var(--lw-terra); }
.nav ul { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav a { color: inherit; text-decoration: none; opacity: .75; }
.nav a:hover { opacity: 1; }

/* ---------- Scene scaffolding ----------- */
section.act {
  position: relative;
  min-height: 100vh;
  padding: 120px 0;
  overflow: hidden;
}
.act-label {
  position: absolute;
  top: 32px; left: 32px;
  font-family: var(--lw-font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--lw-ink-3);
  z-index: 5;
}
.act-number {
  font-family: var(--lw-font-serif);
  font-style: italic;
  font-size: 14px;
  color: var(--lw-terra);
  margin-right: 8px;
}

/* ---------- Horizontal rule motif ----------- */
.rule {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 48px 0;
}
.rule::before {
  content: "";
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.3;
}
.rule::after {
  content: "";
  width: 10px; height: 10px;
  background: var(--lw-terra);
  border-radius: 50%;
}

/* ---------- Scroll progress ----------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: var(--lw-terra);
  z-index: 200;
  transform-origin: 0 50%;
  animation: progress-grow linear;
  animation-timeline: scroll(root);
  width: 100%;
  transform: scaleX(0);
}
@keyframes progress-grow {
  to { transform: scaleX(1); }
}
