/* ---------------------------------------------------------------
   Lennoy — the doorway
   A lit double door cut into the night. Opening January 2027.
   Type: Instrument Serif · Inter Tight · IBM Plex Mono
   --------------------------------------------------------------- */

:root {
  --ink: #07090f;
  --ink-2: #0b0f1a;
  --paper: #f6f3ec;
  --paper-warm: #efe1c9;
  --amber: #f2a33c;
  --blue: #2f5bff;
  --blue-2: #4d76ff;
  --green: #16a765;
  --serif: "Instrument Serif", "Iowan Old Style", "Times New Roman", serif;
  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }

html { background: var(--ink); }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--blue); color: #fff; }

a { color: inherit; }

/* ---------------------------------------------------------------
   The room
   --------------------------------------------------------------- */
.scene {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(14px, 2.4vh, 28px);
  padding: clamp(18px, 2.6vw, 34px) clamp(20px, 4vw, 54px) clamp(16px, 2.2vw, 26px);
  overflow: hidden;
  isolation: isolate;
}

/* the blue night behind the door */
.scene::before {
  content: "";
  position: absolute;
  inset: -12%;
  z-index: -2;
  background:
    radial-gradient(54% 44% at 50% 44%, rgba(47, 91, 255, 0.16), transparent 72%),
    radial-gradient(46% 34% at 50% 96%, rgba(242, 163, 60, 0.10), transparent 72%);
  filter: blur(22px);
  pointer-events: none;
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(118% 92% at 50% 48%, transparent 52%, rgba(3, 4, 8, 0.78) 100%);
}

.grain {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------
   Masthead + footer
   --------------------------------------------------------------- */
.top,
.bottom {
  position: relative;
  z-index: 5;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--paper);
  border-radius: 6px;
}
.brand:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 8px; }

.brand__mark { width: 26px; height: 26px; display: block; }

.brand__word {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.place {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(246, 243, 236, 0.42);
}

.place__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(22, 167, 101, 0.12);
}

.bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.countdown {
  display: flex;
  align-items: stretch;
}

.unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 clamp(14px, 2.4vw, 34px);
}
.unit + .unit { border-left: 1px solid rgba(246, 243, 236, 0.08); }

.unit b {
  font-family: var(--mono);
  font-size: clamp(19px, 2.1vw, 28px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  color: rgba(246, 243, 236, 0.92);
  font-variant-numeric: tabular-nums;
}

.unit span {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(246, 243, 236, 0.30);
}

.legal {
  margin: 0;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(246, 243, 236, 0.26);
}

/* ---------------------------------------------------------------
   The door
   --------------------------------------------------------------- */
.stage {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: clamp(8px, 2vh, 24px) 0;
  perspective: 1400px;
  isolation: isolate;
}

.door {
  position: relative;
  z-index: 1;
  width: min(44vw, calc((100svh - 230px) / 1.5), 430px);
  aspect-ratio: 2 / 3;
  transform-style: preserve-3d;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: transform;
}

/* the warm halo the door throws into the room */
.door::before {
  content: "";
  position: absolute;
  inset: -14% -22% -8%;
  z-index: -1;
  background: radial-gradient(58% 58% at 50% 42%, rgba(242, 163, 60, 0.26), rgba(47, 91, 255, 0.12) 56%, transparent 76%);
  filter: blur(26px);
  opacity: 0.68;
  pointer-events: none;
}

/* the light lying on the floor */
.door__spill {
  position: absolute;
  left: 50%;
  bottom: -30px;
  width: 156%;
  height: 74px;
  z-index: 0;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(242, 163, 60, 0.30), transparent 74%);
  filter: blur(18px);
  pointer-events: none;
}

/* the lit interior — the open double door */
.door__light {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 50% 50% 0 0 / 33.333% 33.333% 0 0;
  overflow: hidden;
  background:
    radial-gradient(142% 72% at 50% 0%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 62%),
    linear-gradient(180deg, #fdfbf7 0%, #f7f4ed 40%, #f0e3cd 72%, #e5c79b 100%);
  box-shadow:
    inset 0 0 0 1px rgba(11, 15, 26, 0.18),
    inset 0 0 78px rgba(122, 92, 52, 0.16),
    inset 0 -44px 84px rgba(190, 140, 80, 0.18);
}

.door__seam {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 1;
  width: 1px;
  transform: translateX(-0.5px);
  background: rgba(11, 15, 26, 0.10);
  box-shadow: 0 0 26px 5px rgba(11, 15, 26, 0.035);
  pointer-events: none;
}

.door__light::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(250px at var(--mx, 50%) var(--my, 44%), rgba(255, 255, 255, 0.5), transparent 72%);
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.door__copy {
  position: absolute;
  inset: 0;
  z-index: 2;
  text-align: center;
}

.door__head {
  position: absolute;
  left: 50%;
  top: 57%;
  width: 100%;
  transform: translate(-50%, -50%);
  transition: top 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.is-notifying .door__head { top: 42%; }

.is-notifying .date__month { font-size: clamp(30px, 3.2vw, 40px); }
.is-notifying .date__year { font-size: clamp(70px, 7.5vw, 96px); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(11, 15, 26, 0.52);
}

.eyebrow__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 91, 255, 0.10);
}

.date {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.03em;
}

.date__month {
  display: block;
  font-style: italic;
  font-size: clamp(38px, 4.6vw, 60px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: rgba(11, 15, 26, 0.86);
}

.date__year {
  display: block;
  margin-top: 2px;
  font-size: clamp(92px, 11.5vw, 156px);
  line-height: 0.78;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.date__month, .date__year { transition: font-size 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }

/* ---------------------------------------------------------------
   The quiet invitation — the door answers
   --------------------------------------------------------------- */
.notify-open {
  position: absolute;
  left: 50%;
  bottom: 5%;
  z-index: 3;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(11, 15, 26, 0.82);
  transition: color 0.2s, opacity 0.25s;
}
.notify-open:hover { color: var(--ink); }
.notify-open:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 8px; }

.notify-open__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 91, 255, 0.10);
  flex: none;
}

.notify-open__arrow {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s;
}
.notify-open:hover .notify-open__arrow { transform: translateX(3px); }
.is-notifying .notify-open__arrow { display: none; }

.notify {
  position: absolute;
  left: 50%;
  bottom: 13%;
  z-index: 2;
  width: 82%;
  max-width: 336px;
  transform: translate(-50%, 14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.is-notifying .notify {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.notify__label {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(11, 15, 26, 0.64);
}

.notify__line {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(20px, 2.5vw, 26px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: rgba(11, 15, 26, 0.92);
}

.notify__form {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.is-error .notify__form { animation: shake 0.32s ease; }

.notify__field {
  width: 100%;
  padding: 9px 0 8px;
  border: 0;
  border-bottom: 1px solid rgba(11, 15, 26, 0.26);
  border-radius: 0;
  background: none;
  outline: none;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink);
  transition: border-color 0.2s;
}
.notify__field::placeholder { color: rgba(11, 15, 26, 0.44); }
.notify__field:focus { border-color: rgba(11, 15, 26, 0.62); }
.notify__field.is-invalid { border-color: #b3362a; }

.notify__phone {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(11, 15, 26, 0.26);
  transition: border-color 0.2s;
}
.notify__phone:focus-within { border-color: rgba(11, 15, 26, 0.62); }
.notify__phone.is-invalid { border-color: #b3362a; }
.notify__phone .notify__field {
  flex: 1;
  width: auto;
  min-width: 0;
  border-bottom: 0;
}

.notify__prefix {
  flex: none;
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(11, 15, 26, 0.66);
}

.notify__go {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}
.notify__go:hover { transform: scale(1.08); background: #101624; }
.notify__go:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.notify__go[disabled] { opacity: 0.55; cursor: wait; transform: none; }
.notify__go svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.notify__error {
  margin: 9px 0 0;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  color: #b3362a;
}

.notify__done { display: none; flex-direction: column; align-items: center; }
.is-done .notify__ask { display: none; }
.is-done .notify__done { display: flex; animation: riseIn 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

.notify__check {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
  border: 1.5px solid rgba(11, 15, 26, 0.32);
  border-radius: 50%;
}
.notify__check svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
}
.is-done .notify__check svg { animation: drawCheck 0.7s ease 0.15s forwards; }

.notify__done-title {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1;
  color: var(--ink);
}

.notify__done-sub {
  max-width: 100%;
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 8.5px;
  line-height: 1.5;
  letter-spacing: 0.12em;
  color: rgba(11, 15, 26, 0.62);
  overflow-wrap: anywhere;
}

/* the door warms when someone is let in */
.door__light::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(64% 52% at 50% 78%, rgba(242, 163, 60, 0.42), transparent 72%);
  opacity: 0;
  pointer-events: none;
}
.is-done .door__light::after { animation: warmPulse 1.6s ease-out; }

.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 drawCheck { to { stroke-dashoffset: 0; } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}
@keyframes warmPulse {
  0% { opacity: 0; }
  28% { opacity: 1; }
  100% { opacity: 0; }
}

/* the drawn line around the light */
.door__frame {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.door__line {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.door__arch {
  fill: none;
  stroke: rgba(246, 243, 236, 0.45);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* the shared baseline the door stands on */
.door__threshold {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 4;
  width: 230%;
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent 0%, rgba(246, 243, 236, 0.20) 16%, rgba(246, 243, 236, 0.20) 84%, transparent 100%);
  pointer-events: none;
}

/* ---------------------------------------------------------------
   Arrival
   --------------------------------------------------------------- */
.js .top,
.js .bottom { opacity: 0; }

.js .door__arch {
  stroke-dasharray: 480;
  stroke-dashoffset: 480;
}

.js .door__light { clip-path: inset(0 49.85% 0 49.85%); }

.js .door__head > * { opacity: 0; transform: translateY(16px); }

.js .door__spill,
.js .door__threshold { opacity: 0; }

.is-ready .top {
  animation: fadeIn 1s ease-out 0.30s forwards;
}
.is-ready .bottom {
  animation: fadeIn 1.1s ease-out 1.70s forwards;
}
.is-ready .door__arch {
  animation: drawDoor 1.7s cubic-bezier(0.65, 0, 0.35, 1) 0.10s forwards;
}
.is-ready .door__light {
  animation: openDoor 1.9s cubic-bezier(0.65, 0, 0.35, 1) 0.45s forwards;
}
.is-ready .door__head > * {
  animation: riseIn 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.is-ready .eyebrow { animation-delay: 1.15s; }
.is-ready .date { animation-delay: 1.30s; }
.is-ready .door__spill {
  animation: fadeIn 1.6s ease-out 1.05s forwards;
}
.is-ready .door__threshold {
  animation: fadeIn 1.4s ease-out 1.20s forwards;
}
.is-ready .door::before {
  animation: breathe 9s ease-in-out 2.6s infinite;
}

@keyframes drawDoor {
  to { stroke-dashoffset: 0; }
}

@keyframes openDoor {
  from { clip-path: inset(0 49.85% 0 49.85%); }
  to   { clip-path: inset(0 0 0 0); }
}

@keyframes riseIn {
  to { opacity: 1; transform: none; }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes breathe {
  0%, 100% { opacity: 0.62; transform: scale(1); }
  50%      { opacity: 0.9;  transform: scale(1.03); }
}

/* ---------------------------------------------------------------
   Small screens
   --------------------------------------------------------------- */
@media (min-width: 641px) and (max-width: 900px) {
  .is-notifying .door__head { top: 37%; }
}

@media (max-width: 640px) {
  .door { width: min(92vw, calc((100svh - 200px) / 1.5), 390px); }

  .is-notifying .door__head { top: 38%; }
  .notify { width: 88%; bottom: 12%; }
  .notify-open { bottom: 3%; }
  .notify__line { font-size: 20px; }
  .notify__label { font-size: 8px; }
  .notify__field { font-size: 16px; }
  .notify__prefix { font-size: 12px; }
  .notify__field::placeholder { color: rgba(11, 15, 26, 0.50); }

  .countdown { width: 100%; justify-content: center; }
  .unit { padding: 0 clamp(10px, 3.2vw, 18px); }
  .unit b { font-size: clamp(17px, 4.6vw, 22px); }
  .unit span { font-size: 7px; letter-spacing: 0.18em; }
  .legal { font-size: 7.5px; }
}

@media (max-height: 560px) {
  .scene {
    min-height: 620px;
    gap: 12px;
    padding-block: 14px;
  }
  .door { width: min(46vw, 300px); }
  .is-notifying .door__head { top: 30%; }
  .notify { bottom: 12%; }
  .notify-open { bottom: 2%; }
  .bottom { gap: 10px; }
}

/* ---------------------------------------------------------------
   Stillness
   --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .door { transition: none; }
  .door__arch { stroke-dashoffset: 0 !important; }
  .door__light { clip-path: none !important; }
  .top,
  .bottom,
  .door__copy > *,
  .door__spill,
  .door__threshold { opacity: 1 !important; transform: none !important; animation: none !important; }
  .door::before { animation: none !important; }
  .door__head, .notify, .notify-open, .notify__go, .date__month, .date__year { transition: none !important; }
  .notify__done, .notify__check svg, .door__light::after { animation: none !important; }
  .notify__check svg { stroke-dashoffset: 0; }
}
