:root {
  --ink: #f7ecda;
  --ink-soft: #dccbb4;
  --muted: #aa9a83;
  --page: #100d0a;
  --surface: #1a1510;
  --surface-soft: #241d15;
  --line: rgba(247, 236, 218, 0.16);
  --quiet: #88a985;
  --release: #bd6e54;
  --memory: #5d85a8;
  --hope: #b8b06a;
  --amber: #e2b36f;
  --danger: #cf6658;
  --shadow: rgba(0, 0, 0, 0.42);
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--ink);
  font-size: 16px;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 5%, rgba(79, 125, 153, 0.15), transparent 34rem),
    radial-gradient(circle at 84% 12%, rgba(226, 179, 111, 0.11), transparent 30rem),
    linear-gradient(180deg, #070605, var(--page) 24rem);
}

body::selection {
  color: #1b130f;
  background: var(--amber);
}

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

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 20;
  transform: translateY(-180%);
  padding: 0.75rem 1rem;
  border-radius: 999px;
  color: var(--page);
  background: var(--ink);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 3vw, 2rem);
  background: linear-gradient(180deg, rgba(10, 8, 6, 0.86), rgba(10, 8, 6, 0.12));
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50% 50% 6px 6px;
  color: var(--amber);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.65rem;
}

.nav-links,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.8rem, 2vw, 1.5rem);
  color: var(--ink-soft);
  font-size: 0.93rem;
}

.nav-links a,
.footer-links a {
  border-bottom: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.footer-links a:hover,
.footer-links a:focus-visible {
  border-color: currentColor;
  color: var(--ink);
  outline: none;
}

main {
  min-height: 80vh;
}

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: 5rem clamp(1rem, 4vw, 4rem) 2rem;
  overflow: hidden;
  background-image:
    linear-gradient(180deg, rgba(8, 7, 5, 0.18), rgba(8, 7, 5, 0.5) 38%, rgba(8, 7, 5, 0.94)),
    radial-gradient(circle at 74% 22%, rgba(226, 179, 111, 0.24), transparent 20rem),
    url("assets/hero-rainlit-house.png");
  background-image:
    linear-gradient(180deg, rgba(8, 7, 5, 0.18), rgba(8, 7, 5, 0.5) 38%, rgba(8, 7, 5, 0.94)),
    radial-gradient(circle at 74% 22%, rgba(226, 179, 111, 0.24), transparent 20rem),
    image-set(url("assets/hero-rainlit-house.webp") type("image/webp"), url("assets/hero-rainlit-house.png") type("image/png"));
  background-size: cover;
  background-position: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(100deg, transparent 0 46%, rgba(247, 236, 218, 0.08) 47%, transparent 49%),
    repeating-linear-gradient(92deg, transparent 0 2.4rem, rgba(137, 181, 210, 0.08) 2.45rem 2.5rem, transparent 2.58rem 5.2rem);
  opacity: 0.26;
  mix-blend-mode: screen;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 28vh;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(8, 7, 5, 0.72) 58%, #090706);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  margin-inline: auto;
  text-align: center;
  min-width: 0;
}

.eyebrow,
.section-kicker,
.card-kicker,
.room-kicker {
  margin: 0 0 0.75rem;
  color: var(--amber);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  margin-inline: auto;
  font-size: clamp(3.2rem, 8vw, 6.8rem);
  line-height: 0.95;
  text-wrap: balance;
}

h2 {
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  line-height: 1.1;
}

.hero-lede,
.section-lede {
  max-width: 620px;
  margin: 1.15rem auto 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.7;
}

.room-door-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  width: min(1120px, 100%);
  margin: clamp(1.5rem, 4vw, 3rem) auto 1.35rem;
}

.room-door {
  position: relative;
  min-width: 0;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.1rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(19, 15, 11, 0.58);
  backdrop-filter: blur(4px);
  box-shadow: 0 18px 44px var(--shadow);
  transform: translateY(0);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.room-door::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.84)),
    radial-gradient(circle at 20% 14%, color-mix(in srgb, var(--room-accent), transparent 72%), transparent 13rem),
    var(--door-image);
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
  transition: transform 220ms ease, opacity 220ms ease;
}

.room-door::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(247, 236, 218, 0.16);
  border-radius: 6px;
  pointer-events: none;
}

.room-door:hover,
.room-door:focus-visible {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--room-accent), var(--ink) 18%);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.58), 0 0 0 1px color-mix(in srgb, var(--room-accent), transparent 58%);
  outline: none;
}

.room-door:hover::before,
.room-door:focus-visible::before {
  transform: scale(1.08);
}

.door-content {
  position: relative;
  z-index: 1;
  text-align: left;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.72);
}

.door-content h2 {
  color: var(--ink);
  font-size: 1.25rem;
  text-transform: uppercase;
}

.door-content p {
  min-height: 3.7rem;
  margin: 0.85rem 0 1rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

.button,
.secondary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.72rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #1b130f;
  background: var(--accent, var(--amber));
  font-weight: 650;
  text-align: center;
}

.button:hover,
.button:focus-visible,
.secondary-button:hover,
.secondary-button:focus-visible,
.ghost-button:hover,
.ghost-button:focus-visible,
.danger-button:hover,
.danger-button:focus-visible {
  outline: 2px solid rgba(247, 236, 218, 0.8);
  outline-offset: 3px;
}

.secondary-button {
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
}

.ghost-button {
  color: var(--ink-soft);
  background: transparent;
  border-color: transparent;
}

.danger-button {
  color: #fff8f0;
  background: var(--danger);
}

.privacy-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  max-width: 100%;
  margin-inline: auto;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(16, 13, 10, 0.64);
  backdrop-filter: blur(10px);
}

.section {
  padding: clamp(3.5rem, 8vw, 7rem) clamp(1rem, 4vw, 4rem);
}

.section-inner {
  width: min(1180px, 100%);
  margin-inline: auto;
}

.split-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: end;
  margin-bottom: 2rem;
}

.room-preview-grid,
.result-grid,
.shelf-grid,
.faq-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.room-preview,
.result-card,
.faq-item,
.shelf-card,
.empty-state,
.ritual-panel,
.legal-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
}

.room-preview {
  overflow: hidden;
}

.room-preview img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.room-preview-body {
  min-height: 190px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
}

.room-preview-body p {
  color: var(--ink-soft);
  line-height: 1.55;
}

.room-preview-body .button {
  margin-top: auto;
}

.result-card,
.shelf-card {
  min-height: 250px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(16, 13, 10, 0.16), rgba(16, 13, 10, 0.84)),
    var(--card-image, linear-gradient(135deg, var(--surface), var(--surface-soft)));
  background-size: cover;
  background-position: center;
}

.card-text {
  max-width: 16rem;
  margin: 1rem 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  line-height: 1.14;
}

.card-detail {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
}

.room-page {
  padding-top: 5rem;
}

.room-hero {
  min-height: 46vh;
  display: grid;
  align-items: end;
  padding: clamp(5rem, 12vw, 10rem) clamp(1rem, 4vw, 4rem) clamp(2rem, 5vw, 4rem);
  background:
    linear-gradient(180deg, rgba(16, 13, 10, 0.22), rgba(16, 13, 10, 0.94)),
    var(--room-image);
  background-size: cover;
  background-position: center;
}

.room-hero-inner {
  width: min(980px, 100%);
  margin-inline: auto;
}

.room-hero h1 {
  margin: 0;
  max-width: 660px;
  font-size: clamp(3rem, 7vw, 6rem);
  text-align: left;
}

.room-hero p {
  max-width: 620px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.ritual-wrap {
  width: min(960px, 100%);
  margin: 0 auto;
}

.ritual-panel {
  padding: clamp(1rem, 4vw, 2rem);
}

.field {
  display: grid;
  gap: 0.55rem;
  margin: 1.2rem 0;
}

.field label {
  color: var(--ink);
  font-weight: 650;
}

textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.28);
}

textarea:focus {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 1.35rem;
}

.choice {
  min-height: 44px;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.04);
}

.choice[aria-pressed="true"] {
  color: #1b130f;
  background: var(--accent, var(--amber));
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 1rem 0;
  color: var(--ink-soft);
}

.toggle-row input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent, var(--amber));
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.status-note {
  min-height: 1.5rem;
  margin-top: 1rem;
  color: var(--ink-soft);
}

.result-zone {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(280px, 0.58fr);
  gap: 1rem;
  align-items: stretch;
  margin-top: 1.5rem;
}

.shelf-page,
.legal-page {
  padding: 7rem clamp(1rem, 4vw, 4rem) 4rem;
}

.page-inner {
  width: min(1120px, 100%);
  margin-inline: auto;
}

.shelf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.empty-state,
.legal-panel {
  padding: clamp(1rem, 4vw, 2rem);
}

.legal-panel {
  max-width: 820px;
}

.legal-panel p,
.legal-panel li,
.faq-item p {
  color: var(--ink-soft);
  line-height: 1.65;
}

.faq-item {
  padding: 1.1rem;
}

.support-panel {
  border-color: color-mix(in srgb, var(--danger), var(--line) 50%);
}

.site-footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 2rem clamp(1rem, 4vw, 4rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #0b0907;
}

.footer-brand {
  color: var(--ink);
}

.site-footer p {
  max-width: 360px;
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  max-width: min(360px, calc(100vw - 2rem));
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(21, 17, 13, 0.94);
  box-shadow: 0 18px 44px var(--shadow);
}

.hidden {
  display: none !important;
}

@media (max-width: 960px) {
  .room-door-grid,
  .room-preview-grid,
  .result-grid,
  .shelf-grid,
  .faq-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-heading,
  .result-zone,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .site-footer,
  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .site-header {
    position: absolute;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.8rem;
  }

  .brand {
    font-size: 0.95rem;
  }

  .nav-links {
    max-width: 100%;
    justify-content: flex-start;
    gap: 0.6rem 1rem;
    font-size: 0.86rem;
  }

  .hero {
    padding-top: 7rem;
    padding-inline: 1rem;
    background-position: 36% center;
  }

  h1 {
    max-width: 21rem;
    font-size: 2.24rem;
    line-height: 1.02;
  }

  .hero-lede {
    width: min(100%, 18rem);
    font-size: 1rem;
  }

  .room-door-grid,
  .room-preview-grid,
  .result-grid,
  .shelf-grid,
  .faq-grid {
    grid-template-columns: 1fr;
  }

  .room-door-grid {
    width: 100%;
    gap: 0.85rem;
    margin-top: 2rem;
  }

  .room-door {
    width: 100%;
    min-height: 232px;
    padding: 1rem;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.38);
  }

  .room-door::after {
    inset: 10px;
  }

  .door-content p {
    min-height: auto;
  }

  .privacy-note {
    align-items: flex-start;
    border-radius: 8px;
    text-align: left;
  }

  .section {
    padding-block: 3rem;
  }

  .result-zone {
    gap: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
