:root {
  color: #080808;
  background: #fff;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #080808;
  --muted: #66635d;
  --line: rgba(8, 8, 8, 0.19);
  --paper: rgba(255, 255, 255, 0.92);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #fff;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  color: var(--ink);
  background: #fff;
}

a {
  color: inherit;
}

.landing-ink {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.88;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 36% 34% at 50% 46%, transparent 0 66%, rgba(0, 0, 0, 0.24) 77%, #000 100%);
  mask-image: radial-gradient(ellipse 36% 34% at 50% 46%, transparent 0 66%, rgba(0, 0, 0, 0.24) 77%, #000 100%);
}

.landing-shell {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 32px));
  min-height: 100%;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 0 24px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(22px, 4.6vh, 38px);
}

.landing-hero {
  display: grid;
  justify-items: center;
  gap: 20px;
  text-align: center;
}

.landing-wordmark {
  display: grid;
  justify-items: center;
  gap: 0.02em;
  margin: 0;
  color: #050505;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.8rem, 13vw, 6.5rem);
  font-weight: 400;
  line-height: 0.82;
  letter-spacing: 0;
  opacity: 0.77;
  transform: translateX(0.04em);
}

.landing-wordmark-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  white-space: nowrap;
}

.landing-wordmark-row--top {
  transform: translateX(-0.03em);
}

.landing-wordmark-row--bottom {
  transform: translateY(-0.04em);
}

.landing-m-mark {
  width: 2.05em;
  height: 1.28em;
  margin-right: -0.1em;
  object-fit: contain;
  object-position: center bottom;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.landing-wordmark-text {
  position: relative;
  z-index: 1;
  transform: translateX(-0.18em);
}

.landing-prompt {
  margin: 0;
  color: #242321;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 3.5vw, 1.22rem);
  line-height: 1.35;
}

.landing-prompt span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font: 600 0.66em/1.3 Inter, ui-sans-serif, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mode-picker {
  width: min(560px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.mode-choice {
  position: relative;
  min-width: 0;
  min-height: 112px;
  padding: 20px 16px 17px;
  overflow: hidden;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: 0 14px 40px rgba(8, 8, 8, 0.055);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.mode-choice::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 12px;
  left: 14px;
  height: 1px;
  transform: scaleX(0);
  transform-origin: center;
  background: currentColor;
  transition: transform 180ms ease;
}

.mode-choice:hover,
.mode-choice:focus-visible,
.mode-choice.is-selected {
  color: #fff;
  background: #0a0a0a;
  border-color: #0a0a0a;
  transform: translateY(-2px);
  outline: none;
}

.mode-choice:hover::after,
.mode-choice:focus-visible::after,
.mode-choice.is-selected::after {
  transform: scaleX(1);
}

.mode-choice-label {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 5vw, 2.05rem);
  line-height: 1;
}

.mode-choice-caption {
  color: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  opacity: 0.58;
  text-transform: uppercase;
}

.mode-choice-memory {
  position: absolute;
  top: 8px;
  right: 9px;
  padding: 3px 6px;
  color: #fff;
  background: #080808;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mode-choice:hover .mode-choice-memory,
.mode-choice:focus-visible .mode-choice-memory,
.mode-choice.is-selected .mode-choice-memory {
  color: #080808;
  background: #fff;
}

.mode-reveal {
  width: min(660px, 100%);
}

.mode-details {
  width: 100%;
  padding: clamp(20px, 4vw, 30px);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(180px, 0.8fr);
  align-items: start;
  gap: 18px 30px;
  color: #171714;
  text-align: left;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: 0 18px 58px rgba(8, 8, 8, 0.08);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: details-rise 280ms cubic-bezier(0.22, 0.8, 0.3, 1) both;
}

.mode-details[hidden] {
  display: none;
}

.mode-details-kicker {
  margin: 0 0 7px;
  color: #5f5c55;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mode-details h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 4vw, 2rem);
  font-weight: 400;
  line-height: 1.08;
}

.mode-details p:not(.mode-details-kicker) {
  margin: 12px 0 0;
  color: #55524d;
  font-size: 0.88rem;
  line-height: 1.55;
}

.mode-details ul {
  margin: 2px 0 0;
  padding: 0;
  display: grid;
  gap: 9px;
  color: #44423e;
  font-size: 0.77rem;
  line-height: 1.4;
  list-style: none;
}

.mode-details li {
  position: relative;
  padding-left: 15px;
}

.mode-details li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: #080808;
}

.mode-continue {
  grid-column: 1 / -1;
  min-height: 48px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #fff;
  background: #080808;
  border: 1px solid #080808;
  text-decoration: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.02rem;
  transition: color 160ms ease, background-color 160ms ease;
}

.mode-continue:hover,
.mode-continue:focus-visible {
  color: #080808;
  background: #fff;
  outline: 1px solid #080808;
  outline-offset: 3px;
}

.mode-memory-note {
  width: min(560px, 100%);
  margin: -16px 0 0;
  display: none;
  color: #68655f;
  text-align: center;
  font-size: 0.68rem;
  line-height: 1.45;
}

body.has-mode-selection .mode-memory-note {
  display: block;
}

.site-footer {
  position: relative;
  z-index: 2;
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0 max(16px, env(safe-area-inset-bottom));
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
}

.site-footer a {
  color: #67645e;
  font-size: 0.66rem;
  text-underline-offset: 3px;
}

.site-footer a:focus-visible {
  outline: 1px solid #080808;
  outline-offset: 3px;
}

body.has-mode-selection .landing-shell {
  align-content: start;
}

body.has-mode-selection .landing-hero {
  gap: 10px;
}

body.has-mode-selection .landing-wordmark {
  font-size: clamp(3rem, 10vw, 4.6rem);
}

@keyframes details-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 620px) {
  .landing-shell {
    width: min(100% - 22px, 520px);
    padding-top: max(18px, env(safe-area-inset-top));
    gap: 20px;
  }

  .landing-hero {
    gap: 14px;
  }

  .landing-wordmark {
    font-size: clamp(3.45rem, 20.5vw, 5.4rem);
  }

  .mode-picker {
    gap: 9px;
  }

  .mode-choice {
    min-height: 102px;
    padding: 18px 9px 15px;
  }

  .mode-choice-memory {
    top: 6px;
    right: 6px;
    max-width: calc(100% - 12px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mode-details {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px;
  }

  .mode-continue {
    grid-column: 1;
  }

  .mode-memory-note {
    margin-top: -9px;
  }

  body.has-mode-selection .landing-wordmark {
    font-size: clamp(2.8rem, 17vw, 4rem);
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  body {
    display: block;
  }

  .landing-shell {
    width: min(940px, calc(100% - 32px));
    min-height: calc(100svh - 32px);
    padding: max(12px, env(safe-area-inset-top)) 0 max(12px, env(safe-area-inset-bottom));
    grid-template-columns: minmax(220px, 0.72fr) minmax(340px, 1fr);
    grid-template-areas:
      "hero picker"
      "hero reveal"
      "hero note";
    align-content: center;
    align-items: center;
    gap: 12px 30px;
  }

  .landing-hero {
    grid-area: hero;
  }

  .landing-wordmark {
    font-size: clamp(3.05rem, 8.3vw, 5rem);
  }

  .mode-picker {
    grid-area: picker;
  }

  .mode-choice {
    min-height: 88px;
  }

  .mode-reveal {
    grid-area: reveal;
  }

  .mode-details {
    grid-template-columns: 1fr 0.8fr;
    gap: 10px 20px;
    padding: 16px 18px;
  }

  .mode-details p:not(.mode-details-kicker) {
    margin-top: 7px;
    font-size: 0.77rem;
  }

  .mode-details ul {
    gap: 5px;
    font-size: 0.68rem;
  }

  .mode-continue {
    min-height: 40px;
  }

  .mode-memory-note {
    grid-area: note;
    margin: 0;
  }

  .site-footer {
    display: none;
  }

  body.has-mode-selection .landing-wordmark {
    font-size: clamp(3rem, 8vw, 4.7rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mode-choice,
  .mode-choice::after,
  .mode-continue {
    transition: none;
  }

  .mode-details {
    animation: none;
  }
}

/* While auto-continuing to the remembered mode, keep the page blank so the
   chooser never flashes before the redirect commits. */
html[data-mode-forwarding] body {
  visibility: hidden;
}
