/* DEARWORK — landing page and password gate */
:root {
  --cream: #f8f1e6;
  --ivory: #fbf7f0;
  --beige: #e9dcc7;
  --taupe: #b8a58b;
  --brown: #4a3826;
  --brown-soft: #6e5a44;
  --gold: #9e7747;
  --gold-deep: #8a6639;
  --error: #9a3b2a;
  --serif: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

.landing-body {
  background: #e7d6bd;
  color: var(--brown);
  font-family: var(--sans);
  overflow: hidden;
}

.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;
}

/* ---------- Landing scene ---------- */
.landing {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

/* Soft blurred copy fills any space the photo does not cover (tall phones). */
.scene-backdrop {
  position: absolute;
  inset: -40px;
  background: url("../assets/paris-workspace.webp") center / cover no-repeat;
  filter: blur(28px) saturate(0.9);
  transform: scale(1.1);
}
.scene-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(246, 236, 220, 0.35);
}

/* The photo is sized like background-size: cover, but as a real box so the
   button can be pinned to the exact spot it occupies in the picture. */
.scene {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100vw, 150vh);
  width: max(100vw, 150dvh);
  aspect-ratio: 3 / 2;
  transform: translate(-50%, -50%);
  container-type: inline-size;
}
.scene-img {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

/* Portrait screens: keep the Eiffel Tower and the cat in frame. */
@media (max-aspect-ratio: 1/1) {
  .scene {
    width: max(100vw, min(150vh, 230vw));
    width: max(100vw, min(150dvh, 230vw));
    box-shadow: 0 0 60px 30px rgba(233, 216, 192, 0.55);
  }
  .scene::before, .scene::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    height: 14%;
    pointer-events: none;
    z-index: 1;
  }
  .scene::before { top: 0; background: linear-gradient(rgba(233, 216, 192, 0.9), transparent); }
  .scene::after { bottom: 0; background: linear-gradient(transparent, rgba(233, 216, 192, 0.9)); }
}

/* Positioned over the button painted in the photograph (538–1010 × 420–502 of 1536×1024). */
.enter-btn {
  position: absolute;
  z-index: 2;
  left: 34.8%;
  top: 40.7%;
  width: 31.2%;
  height: 8.6%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.6em;
  padding: 0 1em;
  border: 1px solid rgba(255, 241, 218, 0.6);
  border-radius: 1.45cqw;
  background: rgba(158, 119, 71, 0.97);
  color: #fbf3e5;
  font-family: var(--sans);
  font-weight: 400;
  font-size: max(11px, 1.3cqw);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 0.6cqw 2cqw rgba(74, 56, 38, 0.18);
  transition: background-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.enter-btn .arrow { letter-spacing: 0; font-size: 1.15em; }
.enter-btn:hover {
  background: rgba(138, 102, 57, 0.98);
  box-shadow: 0 0.8cqw 2.6cqw rgba(74, 56, 38, 0.28);
}
.enter-btn:active { transform: translateY(1px); }
.enter-btn:focus-visible {
  outline: 2px solid #fff6e8;
  outline-offset: 4px;
}

.wordmark {
  position: fixed;
  z-index: 3;
  top: max(22px, env(safe-area-inset-top));
  left: 28px;
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.42em;
  color: rgba(74, 56, 38, 0.82);
  text-shadow: 0 1px 10px rgba(251, 244, 232, 0.9);
  pointer-events: none;
}

/* ---------- Password gate ---------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(64, 46, 28, 0.28);
  backdrop-filter: blur(10px) saturate(0.95);
  -webkit-backdrop-filter: blur(10px) saturate(0.95);
  opacity: 0;
  transition: opacity 0.25s ease;
  overflow-y: auto;
}
.gate[hidden] { display: none; }
.gate.is-open { opacity: 1; }

.gate-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 44px 40px 36px;
  border: 1px solid rgba(184, 165, 139, 0.45);
  border-radius: 20px;
  background: rgba(251, 247, 240, 0.94);
  box-shadow: 0 24px 60px rgba(64, 46, 28, 0.22), 0 2px 8px rgba(64, 46, 28, 0.08);
  text-align: center;
  transform: translateY(8px);
  transition: transform 0.3s ease;
}
.gate.is-open .gate-card { transform: none; }

.gate-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--brown-soft);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.gate-close:hover { background: rgba(184, 165, 139, 0.18); }
.gate-close:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.gate-brand {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.42em;
  color: var(--gold);
}
.gate-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 40px;
  line-height: 1.1;
  color: var(--brown);
}
.gate-desc {
  margin: 10px 0 26px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--brown-soft);
}

.gate-input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(184, 165, 139, 0.75);
  border-radius: 12px;
  background: #fffdf9;
  color: var(--brown);
  font-family: var(--sans);
  font-size: 16px; /* 16px stops iOS zooming on focus */
  text-align: center;
  letter-spacing: 0.08em;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.gate-input::placeholder { color: #a8977f; letter-spacing: 0.04em; }
.gate-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(158, 119, 71, 0.22);
}
.gate-input[aria-invalid="true"] { border-color: var(--error); }

.gate-error {
  min-height: 20px;
  margin: 10px 0 8px;
  font-size: 13px;
  color: var(--error);
}

.gate-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.4em;
  width: 100%;
  height: 50px;
  border: 1px solid rgba(255, 241, 218, 0.5);
  border-radius: 12px;
  background: var(--gold);
  color: #fbf3e5;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(74, 56, 38, 0.16);
  transition: background-color 0.2s ease;
}
.gate-submit .arrow { letter-spacing: 0; font-size: 1.15em; }
.gate-submit:hover { background: var(--gold-deep); }
.gate-submit:focus-visible { outline: 2px solid var(--brown); outline-offset: 3px; }

.shake { animation: shake 0.35s ease; }
@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

@media (max-width: 480px) {
  .gate-card { padding: 40px 24px 28px; border-radius: 18px; }
  .gate-title { font-size: 34px; }
  .wordmark { left: 18px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .gate, .gate-card, .enter-btn { transition: none; }
  .shake { animation: none; }
}
