/* Josiah Koplick — house index.
   Iron, parchment, and gold, shared with The Hidden Forge.
   Name on the left. Doors on the right. Plain language throughout. */

:root {
  --ink: #100e0b;
  --ink-card: #1b1711;
  --ink-card-hot: #241e16;
  --parchment: #ece2c6;
  --parchment-soft: #cbbd9e;
  --gold: #b8894a;
  --gold-bright: #d9a45c;
  --iron: #3a352a;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "Courier New", monospace;
}

* { box-sizing: border-box; }

html {
  background: var(--ink);
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ink);
  color: var(--parchment);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 2;
  padding: 0.4rem 0.7rem;
  background: var(--gold-bright);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.skip:focus { top: 1rem; }

.stage::before {
  content: "";
  position: absolute;
  inset: -12% -8%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(42% 32% at 16% 8%, rgba(217, 164, 92, 0.2), transparent 62%),
    radial-gradient(38% 30% at 94% 92%, rgba(122, 36, 32, 0.3), transparent 66%);
  animation: drift 22s ease-in-out infinite alternate;
}

.stage {
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding:
    max(1.5rem, env(safe-area-inset-top))
    max(1.25rem, env(safe-area-inset-right))
    max(1.5rem, env(safe-area-inset-bottom))
    max(1.25rem, env(safe-area-inset-left));
}

.wrap {
  width: min(68rem, 100%);
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.status {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1.75rem;
  color: var(--gold-bright);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.live::before {
  content: "";
  display: inline-block;
  width: 0.42rem;
  height: 0.42rem;
  margin-right: 0.55rem;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 0 0 rgba(217, 164, 92, 0.45);
  vertical-align: 0.05em;
  animation: pulse 2.8s ease-out infinite;
}

.kicker {
  margin: 0 0 0.85rem;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 8ch;
  font-family: var(--display);
  font-size: clamp(3.4rem, 6.4vw, 5.6rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.02;
  text-wrap: balance;
}

.lede {
  max-width: 26rem;
  margin: 1.35rem 0 0;
  padding-top: 1.15rem;
  border-top: 1px solid var(--iron);
  color: var(--parchment-soft);
  font-size: 1.22rem;
  line-height: 1.45;
  text-wrap: pretty;
}

.mast > * { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
.mast .kicker { animation-delay: 0.08s; }
.mast h1 { animation-delay: 0.16s; }
.mast .lede { animation-delay: 0.28s; }

#places {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.door {
  position: relative;
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  min-height: 5rem;
  padding: 0.95rem 1.1rem 0.95rem 1rem;
  border: 1px solid var(--iron);
  border-radius: 2px;
  background: rgba(27, 23, 17, 0.92);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  transition: border-color 180ms ease, background-color 180ms ease, translate 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.door:nth-child(1) { animation-delay: 0.22s; }
.door:nth-child(2) { animation-delay: 0.32s; }
.door:nth-child(3) { animation-delay: 0.42s; }
.door:nth-child(4) { animation-delay: 0.52s; }
.door:nth-child(5) { animation-delay: 0.62s; }

.door::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gold-bright);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 240ms ease;
}

.door:hover {
  border-color: var(--gold);
  background: var(--ink-card-hot);
  translate: 4px 0;
}

.door:hover::before,
.door:focus-visible::before { transform: scaleY(1); }

.door:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
  border-color: var(--gold);
  background: var(--ink-card-hot);
}

.idx {
  color: var(--gold-bright);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.title {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.note {
  color: var(--parchment-soft);
  font-size: 0.98rem;
}

.go {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  transition: translate 180ms ease, color 180ms ease;
}

.door:hover .go,
.door:focus-visible .go {
  translate: 3px 0;
  color: var(--gold-bright);
}

@keyframes rise {
  from { opacity: 0; translate: 0 12px; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-2.5%, 1.5%, 0) scale(1.05); }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(217, 164, 92, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(217, 164, 92, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 164, 92, 0); }
}

@media (max-width: 52rem) {
  .wrap {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  h1 { max-width: none; }

  .go { display: none; }

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

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .door,
  .door:hover,
  .go { translate: none; }
}

@media print {
  .status,
  .go,
  .skip { display: none; }

  body { background: #fff; color: #111; }

  .kicker,
  .lede,
  .note,
  .idx { color: #333; }

  .door {
    background: #fff;
    border-color: #ccc;
  }

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