:root {
  --ink: #1c2430;
  --ink-soft: #3a4656;
  --mist: #d7e0ea;
  --paper: #f3efe6;
  --brass: #b8893d;
  --brass-deep: #8f6a2c;
  --fog: rgba(148, 168, 190, 0.35);
  --shadow: rgba(28, 36, 48, 0.18);
  --font-display: "Fraunces", "Palatino Linotype", Palatino, serif;
  --font-body: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 700px at 15% 10%, #eef3f8 0%, transparent 55%),
    radial-gradient(900px 600px at 90% 85%, #e7dcc8 0%, transparent 50%),
    linear-gradient(160deg, #cfd9e4 0%, #e8e2d6 48%, #d5cfc3 100%);
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.fog {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  filter: blur(40px);
  background: var(--fog);
  opacity: 0.7;
  animation: drift 18s ease-in-out infinite alternate;
}

.fog-a {
  top: -18vmax;
  left: -12vmax;
}

.fog-b {
  right: -20vmax;
  bottom: -22vmax;
  animation-duration: 24s;
  animation-direction: alternate-reverse;
  background: rgba(184, 137, 61, 0.12);
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.dossier-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.22;
}

.ink-path {
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: draw-ink 4.5s ease forwards;
}

.ink-path.delay {
  animation-delay: 0.7s;
  stroke: var(--brass);
  opacity: 0.7;
}

/* --- Landing shell (two-column on desktop) --- */

.landing {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: stretch;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1.5rem, 5vw, 4rem);
  max-width: 1200px;
  margin: 0 auto;
}

.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 1.25rem;
  max-width: 44rem;
  padding: 0;
}

.case-file {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.4rem, 12vw, 6.5rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
}

.brand-novel {
  display: block;
  color: var(--ink);
}

.brand-holmes {
  display: block;
  color: var(--brass-deep);
  background: linear-gradient(120deg, var(--brass-deep), var(--brass), #d2b06a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pitch {
  margin: 0;
  max-width: 34rem;
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink-soft);
  font-weight: 400;
}

.waitlist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  width: 100%;
  max-width: 28rem;
  margin-top: 0.5rem;
}

.waitlist input {
  flex: 1 1 14rem;
  min-height: 3rem;
  border: 1px solid rgba(28, 36, 48, 0.18);
  background: rgba(243, 239, 230, 0.72);
  backdrop-filter: blur(6px);
  color: var(--ink);
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.waitlist input:focus {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(184, 137, 61, 0.22);
  background: rgba(243, 239, 230, 0.95);
}

.waitlist button {
  min-height: 3rem;
  border: 0;
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.waitlist button:hover:not(:disabled) {
  background: #10161f;
  transform: translateY(-1px);
}

.waitlist button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.status {
  flex: 1 1 100%;
  margin: 0;
  min-height: 1.25rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.status.ok {
  color: #2f6b4f;
}

.status.err {
  color: #8b3a32;
}

.teaser {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
  opacity: 0.85;
}

/* --- Reusable detective figure (landing + future chat) --- */

.detective-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin: 0;
  min-height: 0;
  pointer-events: none;
}

.detective {
  position: relative;
  margin: 0;
  width: min(100%, 34rem);
  aspect-ratio: 3 / 4;
  isolation: isolate;
}

.detective__art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 18px 40px var(--shadow));
  transform-origin: 55% 80%;
  animation: coat-sway 7.5s ease-in-out infinite alternate;
}

.detective__mist {
  position: absolute;
  inset: 55% -8% -6% -8%;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(215, 224, 234, 0.55) 0%, transparent 70%),
    radial-gradient(ellipse at 30% 60%, rgba(243, 239, 230, 0.4) 0%, transparent 65%);
  filter: blur(18px);
  opacity: 0.85;
  mix-blend-mode: soft-light;
  animation: detective-mist 12s ease-in-out infinite alternate;
  z-index: 1;
  pointer-events: none;
}

.detective__glint {
  position: absolute;
  top: 42%;
  left: 58%;
  width: 2.8%;
  height: 2.2%;
  border-radius: 50%;
  background: radial-gradient(circle, #f4e4b8 0%, var(--brass) 45%, transparent 72%);
  box-shadow: 0 0 10px rgba(184, 137, 61, 0.45);
  opacity: 0;
  animation: glass-glint 5.5s ease-in-out infinite;
  z-index: 2;
  pointer-events: none;
}

/* Chat / app reuse: compact sidebar variant */
.detective--compact {
  width: min(100%, 18rem);
}

.detective--compact .detective__glint {
  top: 42%;
  left: 58%;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.case-file.reveal { animation-delay: 0.05s; }
.brand.reveal { animation-delay: 0.18s; }
.pitch.reveal { animation-delay: 0.34s; }
.waitlist.reveal { animation-delay: 0.5s; }
.teaser.reveal { animation-delay: 0.68s; }
.detective-stage.reveal { animation-delay: 0.4s; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(4vmax, 2vmax, 0) scale(1.08); }
}

@keyframes draw-ink {
  to { stroke-dashoffset: 0; }
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes coat-sway {
  from { transform: translate3d(0, 0, 0) rotate(-0.4deg); }
  to { transform: translate3d(0, -0.6%, 0) rotate(0.55deg); }
}

@keyframes detective-mist {
  from { transform: translate3d(-2%, 0, 0) scale(1); opacity: 0.7; }
  to { transform: translate3d(3%, -2%, 0) scale(1.06); opacity: 0.95; }
}

@keyframes glass-glint {
  0%,
  62%,
  100% { opacity: 0; transform: scale(0.7); }
  70%,
  78% { opacity: 0.9; transform: scale(1.15); }
}

@media (max-width: 900px) {
  .landing {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(14rem, 42vh);
    min-height: auto;
    padding-bottom: 0;
  }

  .hero {
    max-width: none;
    padding-top: clamp(1.5rem, 6vw, 3rem);
    padding-bottom: 0.5rem;
  }

  .detective-stage {
    align-items: flex-end;
    margin: 0 -1rem;
    opacity: 0.72;
  }

  .detective {
    width: min(100%, 22rem);
    max-height: 42vh;
  }

  .detective__art {
    object-position: center 30%;
  }
}

@media (max-width: 560px) {
  .hero {
    align-items: stretch;
  }

  .waitlist button {
    width: 100%;
  }

  .detective-stage {
    opacity: 0.55;
  }

  .detective {
    width: min(100%, 18rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fog,
  .ink-path,
  .reveal,
  .detective__art,
  .detective__mist,
  .detective__glint {
    animation: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .ink-path {
    stroke-dashoffset: 0;
  }

  .detective__glint {
    opacity: 0.35;
  }
}
