/*
  LUMORA ROOM 54 follows the published site system:
  Instrument Sans for interface and EB Garamond for editorial scale.
*/
@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:ital,wght@0,300;0,400;0,600;1,300;1,400&family=EB+Garamond:ital,wght@0,400;1,400&display=swap');

:root {
  --r54-carbon: oklch(13.7% 0 0);
  --r54-carbon-2: oklch(18% 0.006 80);
  --r54-terracotta: oklch(55.3% 0.126 47.2);
  --r54-ivory: oklch(94.1% 0.011 80.4);
  --r54-ivory-2: oklch(90.7% 0.013 80.1);
  --r54-titanium: oklch(83.7% 0.005 90);
  --r54-ash: oklch(62.5% 0 0);
  --r54-line-dark: oklch(13.7% 0 0 / 0.14);
  --r54-line-light: oklch(94.1% 0.011 80.4 / 0.18);
  --r54-ease: cubic-bezier(0.23, 1, 0.32, 1);
  --r54-serif: 'EB Garamond', Georgia, serif;
  --r54-sans: 'Instrument Sans', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--r54-ivory); color: var(--r54-carbon); }
body {
  margin: 0;
  min-height: 100svh;
  background: var(--r54-ivory);
  color: var(--r54-carbon);
  font-family: var(--r54-sans);
  line-height: 1.7;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.28em; }
button, input { font: inherit; }
button { border-radius: 0; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 1px solid var(--r54-terracotta);
  outline-offset: 4px;
}

.r54-shell { min-height: 100svh; overflow-x: clip; }
.r54-top {
  position: fixed;
  z-index: 50;
  inset: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 22px clamp(20px, 5vw, 72px);
  color: var(--r54-carbon);
  background: oklch(94.1% 0.011 80.4 / 0.86);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--r54-line-dark);
}
.r54-top--dark {
  color: var(--r54-ivory);
  background: oklch(13.7% 0 0 / 0.86);
  border-bottom-color: var(--r54-line-light);
}
.r54-mark { display: inline-flex; align-items: center; width: 56px; min-width: 56px; }
.r54-mark img { display: block; width: 56px; height: 56px; object-fit: contain; }
.r54-nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 32px); font-size: 12px; letter-spacing: 0.08em; }
.r54-nav a { text-decoration: none; opacity: 0.86; transition: opacity 220ms var(--r54-ease); }
.r54-nav a:hover { opacity: 1; }
.r54-nav .r54-nav-room {
  color: var(--r54-terracotta);
  opacity: 1;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.r54-section { padding: clamp(76px, 11vw, 160px) clamp(22px, 6vw, 92px); }
.r54-section--dark { background: var(--r54-carbon); color: var(--r54-ivory); }
.r54-section--warm { background: var(--r54-ivory-2); }
.r54-inner { width: min(1160px, 100%); margin: 0 auto; }
.r54-narrow { width: min(760px, 100%); margin: 0 auto; }
.r54-kicker {
  display: block;
  margin-bottom: 18px;
  color: var(--r54-terracotta);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.r54-title {
  margin: 0;
  font-family: var(--r54-serif);
  font-size: clamp(46px, 9vw, 128px);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: 0.035em;
}
.r54-subtitle {
  max-width: 620px;
  margin: 28px 0 0;
  color: oklch(13.7% 0 0 / 0.66);
  font-size: clamp(15px, 1.45vw, 18px);
}
.r54-section--dark .r54-subtitle { color: oklch(94.1% 0.011 80.4 / 0.82); }
.r54-heading {
  margin: 0 0 24px;
  font-family: var(--r54-serif);
  font-size: clamp(34px, 5.8vw, 76px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: 0.035em;
}
.r54-copy { max-width: 720px; color: oklch(13.7% 0 0 / 0.72); font-size: 16px; }
.r54-section--dark .r54-copy { color: oklch(94.1% 0.011 80.4 / 0.84); }

.r54-hero {
  min-height: 100svh;
  display: grid;
  place-items: end start;
  padding: clamp(132px, 16vw, 220px) clamp(22px, 6vw, 92px) clamp(68px, 9vw, 118px);
}
.r54-hero--dark {
  background:
    radial-gradient(circle at 78% 42%, oklch(55.3% 0.126 47.2 / 0.18), transparent 26%),
    linear-gradient(90deg, oklch(13.7% 0 0 / 0.28), oklch(13.7% 0 0 / 0.92) 74%),
    linear-gradient(180deg, oklch(13.7% 0 0 / 0.22), oklch(13.7% 0 0 / 0.94)),
    var(--r54-carbon);
  color: var(--r54-ivory);
  position: relative;
  overflow: hidden;
}
.r54-room-lock {
  place-items: center;
  padding-top: clamp(116px, 12vw, 170px);
  padding-bottom: clamp(42px, 6vw, 78px);
  text-align: center;
}
.r54-room-lock .r54-hero-text {
  width: min(1040px, 100%);
  display: grid;
  justify-items: center;
}
.r54-room-lock .r54-hero-line {
  max-width: 620px;
}
.r54-room-lock .r54-form {
  text-align: left;
}
.r54-hero--journal {
  background:
    linear-gradient(180deg, oklch(94.1% 0.011 80.4 / 0.42), oklch(94.1% 0.011 80.4 / 0.96)),
    radial-gradient(circle at 72% 20%, oklch(55.3% 0.126 47.2 / 0.16), transparent 34%),
    var(--r54-ivory);
}
.r54-hero-text { position: relative; z-index: 2; width: min(940px, 100%); opacity: 0; transform: translateY(18px); animation: r54Fade 1300ms var(--r54-ease) 260ms forwards; }
.r54-hero-line { display: block; margin-top: 22px; color: oklch(94.1% 0.011 80.4 / 0.84); font-size: clamp(16px, 1.6vw, 20px); }
.r54-hero--journal .r54-hero-line { color: oklch(13.7% 0 0 / 0.68); }

.r54-editorial-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 0.55fr);
  gap: clamp(36px, 7vw, 100px);
  align-items: start;
}
.r54-image-field {
  min-height: clamp(340px, 52vw, 720px);
  background:
    linear-gradient(135deg, oklch(13.7% 0 0 / 0.06), transparent 42%),
    oklch(90.7% 0.013 80.1);
  border: 1px solid var(--r54-line-dark);
  position: relative;
  overflow: hidden;
}
.r54-image-field::after {
  content: '';
  position: absolute;
  inset: 14%;
  border: 1px solid oklch(13.7% 0 0 / 0.10);
  transform: rotate(-2deg);
}
.r54-caption {
  margin-top: 14px;
  color: oklch(13.7% 0 0 / 0.55);
  font-size: 12px;
  letter-spacing: 0.06em;
}
.r54-word-hidden { opacity: 0.42; letter-spacing: 0.16em; }
.r54-data {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--r54-line-dark);
  border: 1px solid var(--r54-line-dark);
}
.r54-data div { background: var(--r54-ivory); padding: 22px; }
.r54-data b {
  display: block;
  margin-bottom: 8px;
  color: var(--r54-terracotta);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.r54-data span { font-size: 15px; }
.r54-section--dark .r54-data div { background: var(--r54-carbon-2); }
.r54-section--dark .r54-data { background: var(--r54-line-light); border-color: var(--r54-line-light); }

.r54-library { margin-top: 40px; display: grid; gap: 28px; }
.r54-library-name {
  display: block;
  margin-bottom: 12px;
  font-family: var(--r54-serif);
  font-size: 20px;
  letter-spacing: 0.03em;
}
.r54-pull {
  margin: 22px 0 0;
  max-width: 640px;
  font-family: var(--r54-serif);
  font-style: italic;
  font-size: clamp(19px, 2.4vw, 28px);
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: inherit;
}

.r54-link-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.r54-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 240ms var(--r54-ease), transform 240ms var(--r54-ease);
}
.r54-button:hover { transform: translateY(-1px); }
.r54-button--solid { border-color: var(--r54-terracotta); background: var(--r54-terracotta); color: var(--r54-carbon); }
.r54-button--room {
  border-color: var(--r54-terracotta);
  color: var(--r54-terracotta);
  letter-spacing: 0.16em;
}
.r54-button--room:hover {
  background: oklch(55.3% 0.126 47.2 / 0.10);
}

.r54-form {
  display: grid;
  gap: 14px;
  width: min(520px, 100%);
  margin-top: 36px;
}
.r54-form label {
  display: grid;
  gap: 8px;
  color: oklch(94.1% 0.011 80.4 / 0.84);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.r54-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid oklch(94.1% 0.011 80.4 / 0.34);
  background: oklch(94.1% 0.011 80.4 / 0.08);
  color: var(--r54-ivory);
  padding: 12px 14px;
  border-radius: 0;
}
.r54-message {
  min-height: 26px;
  color: oklch(94.1% 0.011 80.4 / 0.82);
  font-size: 13px;
}
.r54-form.is-silent { opacity: 0.38; pointer-events: none; transition: opacity 420ms var(--r54-ease); }
.r54-door-signal {
  margin-top: 24px;
  color: var(--r54-terracotta);
  font-family: var(--r54-serif);
  font-size: clamp(44px, 8vw, 118px);
  line-height: 0.9;
  letter-spacing: 0.12em;
  opacity: 0.22;
  animation: r54Pulse 2800ms ease-in-out infinite;
}
.r54-chamber-locked .r54-chamber-content { display: none; }
.r54-chamber-unlocked .r54-chamber-lock { display: none; }
.r54-chamber-content { opacity: 0; transform: translateY(18px); animation: r54Fade 900ms var(--r54-ease) forwards; }

.r54-room { background: var(--r54-carbon); color: var(--r54-ivory); min-height: 100svh; }
.r54-room-open .r54-room-lock { display: none; }
.r54-room:not(.r54-room-open) .r54-room-inner { display: none; }
.r54-door {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  background: var(--r54-carbon);
  color: var(--r54-ivory);
  place-items: center;
}
.r54-door.is-active { display: grid; }
.r54-door-panel {
  width: min(440px, 72vw);
  height: min(620px, 72vh);
  border: 1px solid var(--r54-line-light);
  background: oklch(18% 0.006 80);
  transform-origin: left center;
  animation: r54Door 2200ms var(--r54-ease) 1500ms forwards;
}
.r54-door-text {
  position: absolute;
  bottom: clamp(38px, 7vw, 84px);
  left: clamp(24px, 7vw, 92px);
  opacity: 0;
  animation: r54Fade 1400ms var(--r54-ease) 3900ms forwards;
}
.r54-title--room {
  max-width: 640px;
  color: var(--r54-ivory);
  font-family: var(--r54-sans);
  font-size: clamp(36px, 6vw, 96px);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: 0.05em;
}
.r54-status {
  display: inline-flex;
  margin-top: 18px;
  border-left: 1px solid var(--r54-terracotta);
  padding-left: 14px;
  color: var(--r54-terracotta);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.26em;
}
.r54-phrase {
  margin-top: 36px;
  font-family: var(--r54-serif);
  font-size: clamp(30px, 5vw, 68px);
  line-height: 1.08;
  letter-spacing: 0.04em;
}
.r54-lock-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
  max-width: 320px;
}
.r54-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  opacity: 0.42;
}
.r54-lock svg { width: 17px; height: 19px; overflow: visible; }
.r54-lock-shackle {
  fill: none;
  stroke: var(--r54-ivory);
  stroke-width: 1.6;
  stroke-linecap: round;
  transform-origin: 7px 12px;
  transition: transform 480ms var(--r54-ease), stroke 480ms var(--r54-ease);
}
.r54-lock-body {
  fill: none;
  stroke: var(--r54-ivory);
  stroke-width: 1.6;
  transition: stroke 480ms var(--r54-ease);
}
.r54-lock.is-open { opacity: 1; }
.r54-lock.is-open .r54-lock-shackle {
  stroke: var(--r54-terracotta);
  transform: translateX(-3px) rotate(-26deg);
}
.r54-lock.is-open .r54-lock-body { stroke: var(--r54-terracotta); }
.r54-lock.is-animating { animation: r54LockPop 620ms var(--r54-ease); }
@keyframes r54LockPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.r54-room-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 56px;
  background: var(--r54-line-light);
  border: 1px solid var(--r54-line-light);
}
.r54-room-nav a {
  min-height: 118px;
  display: flex;
  align-items: end;
  padding: 22px;
  background: var(--r54-carbon);
  color: var(--r54-ivory);
  text-decoration: none;
}

@keyframes r54Fade {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes r54Door {
  to { opacity: 0.18; transform: perspective(900px) rotateY(-68deg) translateX(-8%); }
}
@keyframes r54Pulse {
  0%, 100% { opacity: 0.18; filter: blur(0); }
  50% { opacity: 0.38; filter: blur(0.3px); }
}

@media (max-width: 760px) {
  .r54-top { padding: 16px 20px; }
  .r54-nav { gap: 14px; font-size: 10px; letter-spacing: 0.04em; }
  .r54-nav a:not(.r54-nav-room):nth-child(n+3) { display: none; }
  .r54-editorial-grid, .r54-data, .r54-room-nav { grid-template-columns: 1fr; }
  .r54-section { padding: 72px 20px; }
  .r54-title { font-size: clamp(44px, 18vw, 74px); }
  .r54-title--room { font-size: clamp(34px, 12vw, 56px); letter-spacing: 0.02em; }
}
