/* ============================================================
   Doorbell — A door, somewhere in the world.
   Design: Deep cosmic + warm glow. Apple-grade typography.
   ============================================================ */

:root {
  --bg: #0a0a14;
  --bg-2: #12122a;
  --bg-3: #1a1a35;
  --ink: #f5f5f7;
  --ink-mute: #a8a8b8;
  --ink-dim: #6a6a7a;
  --accent: #ffd166;
  --accent-warm: #ff9e6b;
  --accent-cool: #4cc9f0;
  --accent-pink: #ff6b9d;
  --accent-green: #06d6a0;
  --line: rgba(255,255,255,.08);
  --line-strong: rgba(255,255,255,.16);
  --glass: rgba(20,20,40,.65);
  --glass-strong: rgba(20,20,40,.88);
  --shadow-lg: 0 30px 80px -20px rgba(0,0,0,.6), 0 8px 24px -8px rgba(0,0,0,.4);
  --shadow-glow: 0 0 60px rgba(255,209,102,.25);
  --serif: "Cormorant Garamond", "Noto Serif JP", serif;
  --sans: "Inter", "Noto Sans JP", -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-feature-settings: "ss01","cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  overflow-x: hidden;
}
body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }

/* ============== HERO ============== */
.hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(76,201,240,.08), transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(255,107,157,.10), transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(255,209,102,.04), transparent 60%),
    linear-gradient(180deg, #0a0a14 0%, #12122a 100%);
  z-index: 0;
}
.stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 23% 14%, #fff 100%, transparent),
    radial-gradient(1px 1px at 67% 38%, #fff 100%, transparent),
    radial-gradient(1px 1px at 12% 72%, #fff 100%, transparent),
    radial-gradient(1px 1px at 89% 81%, #fff 100%, transparent),
    radial-gradient(1px 1px at 45% 22%, #fff 100%, transparent),
    radial-gradient(1px 1px at 78% 55%, #fff 100%, transparent),
    radial-gradient(2px 2px at 33% 88%, #fff 100%, transparent),
    radial-gradient(1px 1px at 95% 12%, #fff 100%, transparent),
    radial-gradient(1px 1px at 5% 45%, #fff 100%, transparent),
    radial-gradient(2px 2px at 56% 67%, #fff 100%, transparent);
  background-size: 100% 100%;
  opacity: .5;
  animation: twinkle 4s ease-in-out infinite alternate;
}
.stars-2 {
  background-image:
    radial-gradient(1px 1px at 14% 32%, #ffd166 100%, transparent),
    radial-gradient(1px 1px at 71% 18%, #4cc9f0 100%, transparent),
    radial-gradient(1px 1px at 42% 84%, #ff6b9d 100%, transparent),
    radial-gradient(1px 1px at 88% 49%, #ffd166 100%, transparent);
  opacity: .8;
  animation: twinkle 6s ease-in-out infinite alternate-reverse;
}
@keyframes twinkle {
  0% { opacity: .3; }
  100% { opacity: .9; }
}
.aurora {
  position: absolute; left: 50%; top: 50%;
  width: 900px; height: 900px;
  transform: translate(-50%, -50%);
  background: conic-gradient(from 0deg, transparent, rgba(255,209,102,.08), transparent, rgba(76,201,240,.06), transparent);
  filter: blur(60px);
  animation: rotate 60s linear infinite;
  opacity: .6;
}
@keyframes rotate {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.nav {
  position: relative; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px 5vw;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 20px; letter-spacing: -0.02em;
}
.logo-emoji { font-size: 22px; filter: drop-shadow(0 0 8px rgba(255,209,102,.4)); }
.nav-links { display: flex; gap: 28px; align-items: center; font-size: 14px; }
.nav-links a { color: var(--ink-mute); transition: color .2s; }
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line-strong);
  padding: 10px 18px; border-radius: 999px;
  color: var(--ink) !important;
  backdrop-filter: blur(10px);
  transition: all .25s;
}
.nav-cta:hover {
  background: var(--accent);
  color: var(--bg) !important;
  border-color: var(--accent);
  box-shadow: 0 0 30px rgba(255,209,102,.4);
}

.hero-content {
  position: relative; z-index: 5;
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 5vw 100px;
  text-align: center;
}
.hero-eyebrow {
  font-family: var(--serif);
  font-style: italic;
  color: var(--accent);
  font-size: 16px;
  letter-spacing: 0.05em;
  margin-bottom: 28px;
  opacity: 0;
  animation: fadeUp .8s .2s forwards;
}
.hero-title {
  font-size: clamp(38px, 7vw, 84px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
}
.hero-title .line {
  display: block;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp .9s forwards;
}
.hero-title .line:nth-child(1) { animation-delay: .4s; }
.hero-title .line:nth-child(2) { animation-delay: .65s; }
.hero-title .accent {
  background: linear-gradient(110deg, var(--accent) 0%, var(--accent-warm) 50%, var(--accent-pink) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: italic;
  font-family: var(--serif);
  font-weight: 600;
  position: relative;
}
.hero-sub {
  color: var(--ink-mute);
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.85;
  max-width: 560px;
  margin-bottom: 44px;
  opacity: 0;
  animation: fadeUp .9s .9s forwards;
}
.hero-cta {
  display: flex; gap: 14px; flex-wrap: wrap; justify-content: center;
  opacity: 0;
  animation: fadeUp .9s 1.1s forwards;
}
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  color: #1a1208;
  padding: 16px 30px;
  border-radius: 999px;
  font-weight: 700; font-size: 15px;
  letter-spacing: -0.01em;
  box-shadow: 0 10px 40px -10px rgba(255,209,102,.6), 0 0 0 1px rgba(255,255,255,.1) inset;
  transition: all .3s cubic-bezier(.4,0,.2,1);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 50px -10px rgba(255,209,102,.8), 0 0 0 1px rgba(255,255,255,.2) inset;
}
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.04);
  color: var(--ink);
  padding: 16px 26px;
  border-radius: 999px;
  font-weight: 500; font-size: 14px;
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(10px);
  transition: all .25s;
}
.btn-secondary:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.3); }
.btn-ghost {
  background: transparent; color: var(--ink-mute);
  padding: 14px 22px; border-radius: 999px;
  font-weight: 500; font-size: 14px;
  transition: color .2s;
}
.btn-ghost:hover { color: var(--ink); }

.hero-stats {
  display: flex; gap: 32px; align-items: center;
  margin-top: 64px;
  opacity: 0;
  animation: fadeUp .9s 1.4s forwards;
}
.stat { text-align: center; }
.stat b {
  display: block;
  font-size: 28px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--ink), var(--accent));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}
.stat span {
  display: block; margin-top: 4px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-dim);
}
.stat-divider { width: 1px; height: 32px; background: var(--line-strong); }

.hero-floating-doors { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.floating-door {
  position: absolute;
  left: var(--x); top: var(--y);
  font-size: 32px;
  opacity: 0;
  animation: float-door 6s var(--d) ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(255,209,102,.4));
}
@keyframes float-door {
  0%, 100% { opacity: 0; transform: translateY(0) scale(.8); }
  50% { opacity: .35; transform: translateY(-20px) scale(1); }
}

.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  width: 24px; height: 40px;
  border: 2px solid var(--line-strong);
  border-radius: 14px;
  display: flex; justify-content: center; padding-top: 8px;
  z-index: 5;
}
.scroll-hint span {
  width: 3px; height: 8px; background: var(--ink-mute); border-radius: 2px;
  animation: scroll-anim 1.6s ease-in-out infinite;
}
@keyframes scroll-anim {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(14px); opacity: 0; }
}

/* ============== HOW IT WORKS ============== */
.how {
  padding: 120px 5vw 100px;
  position: relative;
  background: linear-gradient(180deg, #12122a 0%, #0a0a14 100%);
}
.section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.025em;
  text-align: center;
  margin-bottom: 64px;
  max-width: 900px;
  margin-left: auto; margin-right: auto;
  line-height: 1.3;
}
.how-grid {
  max-width: 1100px; margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.how-card {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 36px 30px;
  position: relative;
  transition: transform .4s cubic-bezier(.4,0,.2,1), border-color .4s;
}
.how-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
}
.how-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}
.how-emoji { font-size: 44px; margin-bottom: 18px; line-height: 1; }
.how-card h3 { font-size: 22px; font-weight: 700; margin-bottom: 12px; letter-spacing: -0.01em; }
.how-card p { color: var(--ink-mute); line-height: 1.75; font-size: 14.5px; }

/* ============== APP / MAP ============== */
.app {
  position: relative;
  height: 100vh;
  min-height: 600px;
  background: #0a0a14;
}
.app-toolbar {
  position: absolute; top: 16px; left: 16px; right: 16px;
  z-index: 1000;
  display: flex; justify-content: space-between; align-items: center;
  pointer-events: none;
}
.toolbar-left, .toolbar-right { display: flex; gap: 8px; align-items: center; pointer-events: auto; }
.toolbar-left {
  background: var(--glass-strong);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--line-strong);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-mute);
}
.status-dot {
  width: 8px; height: 8px; background: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-green);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot { 50% { opacity: .5; } }
.tool-btn {
  position: relative;
  background: var(--glass-strong);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--line-strong);
  width: 44px; height: 44px;
  border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink);
  transition: all .2s;
}
.tool-btn:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); }
.tool-btn.primary {
  width: auto;
  padding: 0 18px;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  color: #1a1208;
  border: none;
  font-weight: 600; font-size: 14px;
  box-shadow: 0 8px 24px -6px rgba(255,209,102,.5);
}
.tool-btn.primary:hover { transform: translateY(-1px); }
.tool-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: var(--accent-pink);
  color: #fff;
  border-radius: 999px;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.tool-badge:empty, .tool-badge[data-empty="true"] { display: none; }

.map {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
/* Leaflet dark theme override */
.leaflet-container { background: #0a0a14; font-family: var(--sans); }
.leaflet-control-attribution {
  background: rgba(10,10,20,.7) !important;
  color: var(--ink-dim) !important;
  font-size: 10px !important;
  backdrop-filter: blur(10px);
}
.leaflet-control-attribution a { color: var(--ink-mute) !important; }
.leaflet-control-zoom {
  border: 1px solid var(--line-strong) !important;
  background: var(--glass-strong) !important;
  backdrop-filter: blur(20px);
  border-radius: 14px !important;
  overflow: hidden;
  margin-bottom: 16px !important;
  margin-left: 16px !important;
}
.leaflet-control-zoom a {
  background: transparent !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
  font-size: 18px !important;
  width: 36px !important; height: 36px !important; line-height: 36px !important;
}
.leaflet-control-zoom a:hover { background: rgba(255,255,255,.08) !important; }

/* Door marker (custom) */
.door-marker {
  width: 36px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform .2s;
}
.door-marker:hover { transform: scale(1.15); z-index: 1000 !important; }
.door-marker .door-svg {
  width: 32px; height: 40px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.5)) drop-shadow(0 0 8px var(--door-color, #ffd166));
}
.door-marker.mine .door-svg { filter: drop-shadow(0 4px 12px rgba(0,0,0,.5)) drop-shadow(0 0 12px #4cc9f0); }
.door-marker .door-pulse {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--door-color, #ffd166);
  opacity: .4;
  animation: door-pulse 2.5s ease-out infinite;
  z-index: -1;
}
@keyframes door-pulse {
  0% { transform: scale(.5); opacity: .6; }
  100% { transform: scale(2); opacity: 0; }
}

.placement-hint {
  position: absolute; top: 80px; left: 50%; transform: translateX(-50%);
  z-index: 999;
  display: none;
}
.placement-hint.show { display: block; animation: fadeUp .4s; }
.placement-hint-inner {
  background: var(--glass-strong);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--accent);
  padding: 14px 20px;
  border-radius: 999px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 10px 40px -10px rgba(255,209,102,.4);
}
.placement-hint-emoji { font-size: 20px; animation: bounce 1.4s ease-in-out infinite; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.placement-hint-text { font-size: 14px; color: var(--ink); }
.placement-hint-text b { color: var(--accent); font-weight: 600; }
.placement-hint-cancel {
  font-size: 12px; color: var(--ink-mute);
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  transition: all .2s;
}
.placement-hint-cancel:hover { color: var(--ink); border-color: rgba(255,255,255,.3); }

/* ============== MANIFESTO ============== */
.manifesto {
  padding: 140px 5vw;
  background: linear-gradient(180deg, #0a0a14 0%, #12122a 100%);
  position: relative;
}
.manifesto-inner {
  max-width: 760px; margin: 0 auto;
  text-align: center;
}
.manifesto-eyebrow {
  font-family: var(--serif); font-style: italic;
  color: var(--accent); margin-bottom: 24px; font-size: 15px;
  letter-spacing: 0.08em;
}
.manifesto-title {
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.55;
  margin-bottom: 36px;
}
.manifesto-title .dq {
  font-family: var(--serif); font-style: italic; font-weight: 600;
  background: linear-gradient(110deg, var(--accent), var(--accent-pink));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.manifesto-body {
  color: var(--ink-mute);
  font-size: 16px; line-height: 1.95;
  margin-bottom: 32px;
}
.manifesto-sign {
  font-family: var(--serif); font-style: italic;
  color: var(--accent);
  font-size: 15px;
}

/* ============== FOOTER ============== */
.footer {
  padding: 50px 5vw 40px;
  text-align: center;
  border-top: 1px solid var(--line);
  background: #0a0a14;
}
.footer-logo { font-weight: 700; margin-bottom: 12px; }
.footer p { color: var(--ink-dim); font-size: 13px; margin-bottom: 18px; }
.footer-links { display: flex; gap: 24px; justify-content: center; }
.footer-links a {
  font-size: 13px; color: var(--ink-mute);
  transition: color .2s;
}
.footer-links a:hover { color: var(--accent); }

/* ============== MODALS ============== */
.modal-backdrop {
  position: fixed; inset: 0;
  z-index: 9999;
  background: rgba(5,5,15,.75);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadein .25s;
}
.modal-backdrop[hidden] { display: none; }
@keyframes fadein { from { opacity: 0; } }

.modal {
  position: relative;
  background: linear-gradient(180deg, #1a1a35 0%, #12122a 100%);
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  width: 100%; max-width: 460px;
  max-height: 90vh; overflow-y: auto;
  padding: 36px 30px 30px;
  box-shadow: var(--shadow-lg);
  animation: modal-in .4s cubic-bezier(.16,1,.3,1);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  color: var(--ink-mute);
  font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.modal-close:hover { background: rgba(255,255,255,.12); color: var(--ink); transform: rotate(90deg); }

.modal-header { text-align: center; margin-bottom: 26px; }
.modal-emoji { font-size: 42px; display: block; margin-bottom: 12px; line-height: 1; }
.modal-header h3 {
  font-size: 24px; font-weight: 700; letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.modal-sub {
  font-size: 13px; color: var(--ink-mute);
  font-family: var(--serif); font-style: italic;
}
.modal-body { display: flex; flex-direction: column; gap: 18px; }
.modal-footer {
  margin-top: 26px;
  display: flex; justify-content: flex-end; gap: 8px;
  align-items: center;
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field-label {
  font-size: 12px; font-weight: 600;
  color: var(--ink-mute);
  letter-spacing: 0.04em; text-transform: uppercase;
  display: flex; justify-content: space-between; align-items: center;
}
.field-label i {
  font-style: normal; font-weight: 400;
  text-transform: none; letter-spacing: 0;
  color: var(--ink-dim);
}
.field input, .field textarea {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 15px;
  outline: none;
  transition: border-color .2s, background .2s;
  resize: none;
  line-height: 1.6;
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-dim); }
.field input:focus, .field textarea:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,.06);
}
textarea { font-family: inherit; }

.color-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.color {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid transparent;
  transition: all .2s;
  position: relative;
}
.color:hover { transform: scale(1.1); }
.color.selected {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--c), 0 0 20px var(--c);
}

.hint {
  font-size: 12.5px; color: var(--ink-dim);
  background: rgba(255,209,102,.05);
  border: 1px solid rgba(255,209,102,.15);
  padding: 10px 14px; border-radius: 12px;
  line-height: 1.6;
}

/* Knock modal — door visual */
.modal-knock { max-width: 480px; }
.door-visual {
  height: 200px;
  background: radial-gradient(ellipse at center, rgba(255,209,102,.1) 0%, transparent 70%);
  display: flex; align-items: center; justify-content: center;
  margin: -36px -30px 24px;
  border-radius: 28px 28px 0 0;
  position: relative;
  overflow: hidden;
}
.door-3d { perspective: 1000px; }
.door-frame {
  width: 80px; height: 130px;
  position: relative;
  transform-style: preserve-3d;
}
.door-panel {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--door-color, #ffd166), color-mix(in srgb, var(--door-color, #ffd166) 60%, #000));
  border-radius: 6px 6px 2px 2px;
  border: 2px solid rgba(0,0,0,.2);
  position: relative;
  transform-origin: left center;
  transform: rotateY(-15deg);
  transition: transform .8s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 20px 60px -10px rgba(0,0,0,.6), 0 0 40px var(--door-color, #ffd166);
}
.door-panel.open { transform: rotateY(-75deg); }
.door-handle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 6px; height: 6px;
  background: #2a2a2a;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0,0,0,.3);
}
.door-knock-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.knock-circle {
  position: absolute;
  width: 60px; height: 60px;
  border: 2px solid #fff;
  border-radius: 50%;
  opacity: 0;
}
.knocking .knock-circle {
  animation: knock-ripple 1s ease-out;
}
.knocking .knock-circle:nth-child(2) { animation-delay: .15s; }
.knocking .knock-circle:nth-child(3) { animation-delay: .3s; }
@keyframes knock-ripple {
  0% { transform: scale(.5); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

.knock-info { text-align: center; }
.knock-meta {
  display: flex; justify-content: center; align-items: center; gap: 10px;
  margin-bottom: 14px;
  font-size: 13px; color: var(--ink-mute);
}
.knock-flag { font-size: 18px; }
.knock-time::before { content: "·"; margin-right: 8px; color: var(--ink-dim); }
.knock-name {
  font-size: 22px; font-weight: 700; margin-bottom: 16px;
  letter-spacing: -0.01em;
}
.knock-message {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink);
  padding: 20px 24px;
  background: rgba(255,255,255,.03);
  border-left: 2px solid var(--accent);
  border-radius: 4px 14px 14px 4px;
  margin-bottom: 24px;
  text-align: left;
  white-space: pre-wrap;
}
.knock-actions { margin-bottom: 0; }
.knock-actions .btn-primary { width: 100%; justify-content: center; }

.reply-section { margin-top: 24px; text-align: left; }
.reply-section textarea {
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 14px 16px; border-radius: 14px;
  font-size: 15px; line-height: 1.6;
  outline: none;
  margin-bottom: 12px;
  resize: none;
}
.reply-section textarea:focus { border-color: var(--accent); }
.reply-section .btn-primary { width: 100%; justify-content: center; }

.divider-text {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 0 16px;
  color: var(--ink-dim); font-size: 12px;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.divider-text::before, .divider-text::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

.thread { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; text-align: left; }
.letter {
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 14px; line-height: 1.6;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
}
.letter.mine {
  background: rgba(255,209,102,.06);
  border-color: rgba(255,209,102,.2);
  margin-left: 24px;
}
.letter-meta {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--ink-dim);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}

/* Inbox / My Doors list */
.inbox-list { display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow-y: auto; padding: 4px; }
.inbox-item {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all .2s;
  display: flex; gap: 14px; align-items: center;
}
.inbox-item:hover { background: rgba(255,255,255,.06); border-color: var(--line-strong); transform: translateX(2px); }
.inbox-item .ii-emoji { font-size: 24px; }
.inbox-item .ii-body { flex: 1; min-width: 0; }
.inbox-item .ii-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.inbox-item .ii-msg { font-size: 12.5px; color: var(--ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-item .ii-time { font-size: 11px; color: var(--ink-dim); white-space: nowrap; }
.inbox-item.unread .ii-title::after {
  content: "";
  display: inline-block; margin-left: 6px;
  width: 6px; height: 6px;
  background: var(--accent-pink);
  border-radius: 50%;
}
.empty-state {
  text-align: center;
  color: var(--ink-dim);
  padding: 40px 20px;
  font-size: 14px; line-height: 1.8;
}

/* ============== TOAST ============== */
.toast-stack {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 10000;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--glass-strong);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--line-strong);
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 14px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: toast-in .4s cubic-bezier(.16,1,.3,1);
  pointer-events: auto;
}
.toast.success { border-color: rgba(6,214,160,.4); }
.toast.knock { border-color: rgba(255,209,102,.4); }
.toast-emoji { font-size: 18px; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(20px); }
}

/* ============== MOBILE ============== */
@media (max-width: 720px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .nav { padding: 16px 5vw; }
  .hero-content { padding: 40px 5vw 80px; }
  .hero-stats { gap: 18px; margin-top: 44px; }
  .stat b { font-size: 22px; }
  .stat span { font-size: 10px; }
  .how { padding: 80px 5vw 60px; }
  .manifesto { padding: 90px 5vw; }
  .modal { padding: 30px 22px 22px; border-radius: 22px; }
  .door-visual { margin: -30px -22px 20px; height: 170px; }
  .door-frame { width: 64px; height: 110px; }
  .knock-message { font-size: 16px; padding: 16px 18px; }
  .tool-btn.primary span { display: none; }
  .tool-btn.primary { width: 44px; padding: 0; }
  .toolbar-left { font-size: 12px; padding: 8px 14px; }
  .placement-hint-inner { padding: 12px 16px; }
  .placement-hint-text { font-size: 13px; }
}

/* ============== UTILS ============== */
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

[hidden] { display: none !important; }
::selection { background: var(--accent); color: #1a1208; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }
