/* ============ Shadow Mail ============ */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/inter-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url('/fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2');
}

:root {
  --bg: #060606;
  --fg: rgba(255, 255, 255, 0.94);
  --fg-2: rgba(255, 255, 255, 0.62);
  --fg-3: rgba(255, 255, 255, 0.42);
  --fg-4: rgba(255, 255, 255, 0.24);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --glass: rgba(255, 255, 255, 0.035);
  --glass-2: rgba(255, 255, 255, 0.07);
  --panel: rgba(14, 14, 14, 0.62);
  --accent: #a78bfa;
  --accent-soft: rgba(167, 139, 250, 0.14);
  --ok: #34d399;
  --danger: #f87171;
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100svh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
input, select { font: inherit; color: inherit; }
::selection { background: rgba(255, 255, 255, 0.24); color: #fff; }
:focus-visible { outline: 2px solid rgba(167, 139, 250, 0.7); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- backdrop: grey light + eclipse ---------- */

.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.backdrop > * { position: absolute; }
.backdrop .base { inset: 0; background: radial-gradient(120% 90% at 50% 45%, #1b1b1b 0%, #0c0c0c 55%, #040404 100%); }
.backdrop .glow-a {
  left: -35%; top: -5%; width: 120%; height: 80%; opacity: 0.95; transform: rotate(-28deg);
  background: radial-gradient(closest-side, rgba(175, 175, 175, 0.32), rgba(110, 110, 110, 0.13) 45%, transparent 70%);
}
.backdrop .glow-b {
  left: -15%; bottom: -20%; width: 75%; height: 70%; opacity: 0.85; transform: rotate(18deg);
  background: radial-gradient(closest-side, rgba(165, 165, 165, 0.26), rgba(80, 80, 80, 0.1) 50%, transparent 70%);
}
.backdrop .glow-c {
  right: -10%; bottom: -20%; width: 60%; height: 60%; opacity: 0.5;
  background: radial-gradient(closest-side, rgba(140, 120, 200, 0.16), transparent 70%);
}
.backdrop .eclipse { width: 95vw; height: 95vw; left: 38.5vw; top: calc(21vh - 47.5vw); }
.backdrop .eclipse::before, .backdrop .eclipse::after { content: ''; position: absolute; inset: 0; border-radius: 50%; }
.backdrop .eclipse::before {
  background: radial-gradient(60% 60% at 38% 62%, rgba(30, 30, 30, 0.92) 0%, rgba(12, 12, 12, 0.96) 55%, #050505 80%);
  box-shadow: inset 18px -10px 40px rgba(255, 255, 255, 0.1), inset -80px 60px 160px rgba(0, 0, 0, 0.9), 0 40px 120px rgba(0, 0, 0, 0.6);
}
.backdrop .eclipse::after {
  background: conic-gradient(from 200deg, transparent 0deg, rgba(255, 255, 255, 0.3) 40deg, rgba(200, 185, 255, 0.1) 90deg, transparent 140deg, transparent 360deg);
  -webkit-mask: radial-gradient(closest-side, transparent 98.6%, #000 99.2%, #000 100%);
  mask: radial-gradient(closest-side, transparent 98.6%, #000 99.2%, #000 100%);
  animation: rim 18s ease-in-out infinite alternate;
}
.backdrop .grain {
  inset: 0; opacity: 0.06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%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");
}
.backdrop.dim .eclipse { opacity: 0.55; }
.backdrop.dim .glow-a, .backdrop.dim .glow-b { opacity: 0.45; }
@keyframes rim { from { transform: rotate(-6deg); } to { transform: rotate(10deg); } }

/* ---------- motion ---------- */

.rise { opacity: 0; animation: rise 0.8s var(--ease) forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---------- brand ---------- */

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--fg); }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand span { font-size: 13px; letter-spacing: 0.24em; text-transform: uppercase; }

/* ---------- buttons & inputs ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 50px; padding: 0 32px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap;
  transition: transform 0.3s var(--ease), opacity 0.3s, background-color 0.25s, border-color 0.25s, color 0.25s;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: #fff; color: #000; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); }
.btn-primary:hover { transform: scale(1.02); opacity: 0.92; }
.btn-ghost { border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.03); color: var(--fg-2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-weight: 500; }
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.3); color: #fff; }
.btn-soft { border: 1px solid var(--line); background: var(--glass-2); color: var(--fg); }
.btn-soft:hover { border-color: var(--line-2); background: rgba(255, 255, 255, 0.12); }
.btn-danger { border: 1px solid rgba(248, 113, 113, 0.3); background: rgba(248, 113, 113, 0.08); color: #fca5a5; }
.btn-danger:hover { background: rgba(248, 113, 113, 0.16); border-color: rgba(248, 113, 113, 0.5); }
.btn-block { width: 100%; height: 52px; }
.btn-sm { height: 36px; padding: 0 16px; font-size: 11px; }
.btn:disabled { opacity: 0.38; pointer-events: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 999px;
  color: var(--fg-3); border: 1px solid transparent; transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}
.icon-btn:hover { color: var(--fg); background: var(--glass-2); border-color: var(--line); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.danger:hover { color: var(--danger); }

.label { display: block; margin-bottom: 8px; font-size: 10px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-3); }
.field {
  width: 100%; height: 52px; padding: 0 20px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.04); color: var(--fg);
  transition: border-color 0.2s, background-color 0.2s;
}
.field::placeholder { color: var(--fg-4); }
.field:focus { outline: none; border-color: rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.06); }
.field.mono { font-size: 13.5px; letter-spacing: 0.04em; }
.field.invalid { border-color: rgba(248, 113, 113, 0.55); }

.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--fg-2); cursor: pointer; user-select: none; }
.check input { appearance: none; flex: none; width: 18px; height: 18px; margin: 1px 0 0; border-radius: 6px; border: 1px solid var(--line-2); background: var(--glass); display: grid; place-items: center; cursor: pointer; }
.check input::after { content: ''; width: 9px; height: 5px; border: solid #000; border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.check input:checked { background: #fff; border-color: #fff; }
.check input:checked::after { opacity: 1; }

.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(167, 139, 250, 0.85); }

.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 999px; white-space: nowrap; flex: none;
  border: 1px solid var(--line); background: var(--glass); font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-2);
}
.pill svg { width: 13px; height: 13px; flex: none; }
.live-dot { position: relative; width: 7px; height: 7px; flex: none; }
.live-dot::before, .live-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--ok); }
.live-dot::before { animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite; }
.live-dot::after { box-shadow: 0 0 8px var(--ok); }
.live-dot.off::before { animation: none; opacity: 0; }
.live-dot.off::after { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

/* ---------- toast ---------- */

.toasts { position: fixed; z-index: 100; left: 50%; bottom: 28px; transform: translateX(-50%); display: grid; gap: 10px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-radius: 16px;
  background: rgba(22, 22, 22, 0.86); border: 1px solid var(--line-2); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); font-size: 13.5px; color: var(--fg); pointer-events: auto;
  animation: toast-in 0.45s var(--ease);
}
.toast .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; box-shadow: 0 0 10px currentColor; }
.toast.error .dot { background: var(--danger); }
.toast.info .dot { background: var(--accent); }
.toast.out { animation: toast-out 0.3s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- modal ---------- */

.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fade 0.25s ease; }
.modal-card {
  width: min(480px, 100%); padding: 32px; border-radius: 28px;
  background: linear-gradient(180deg, rgba(28, 28, 28, 0.95), rgba(14, 14, 14, 0.95));
  border: 1px solid var(--line-2); box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: rise 0.45s var(--ease);
}
.modal-card h2 { margin: 0 0 8px; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.modal-card p { margin: 0 0 20px; color: var(--fg-2); font-size: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }

/* ============ Landing ============ */

.site-header {
  position: absolute; inset: 0 0 auto; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: 3.3rem 2.75rem 0;
}
.site-nav { display: flex; align-items: center; gap: 8px; }
.site-nav a:not(.btn) { padding: 8px 14px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-3); transition: color 0.2s; }
.site-nav a:not(.btn):hover { color: var(--fg); }

.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding: 120px 7vw 90px; overflow: hidden; }
.hero-copy { position: relative; z-index: 10; max-width: 570px; }
.hero h1 { margin: 20px 0 0; font-size: clamp(2.4rem, 4.2vw, 3.8rem); font-weight: 700; line-height: 1.06; letter-spacing: -0.035em; color: rgba(255, 255, 255, 0.95); }
.hero h1 em { font-style: normal; color: transparent; background: linear-gradient(100deg, #fff 10%, #b9b0d8 55%, #6f6a80 100%); -webkit-background-clip: text; background-clip: text; }
.hero-lead { margin: 24px 0 0; max-width: 470px; font-size: 15px; font-weight: 300; line-height: 1.75; color: var(--fg-2); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 36px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line); max-width: 470px; }
.hero-stats div { display: grid; gap: 2px; }
.hero-stats b { font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--fg); }
.hero-stats div > span { font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-3); }

.scroll-hint { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); display: grid; justify-items: center; gap: 8px; font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--fg-4); }
.scroll-hint i { width: 1px; height: 34px; background: linear-gradient(var(--fg-3), transparent); animation: drip 2.4s ease-in-out infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); opacity: 1; } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* ----- 3D envelope ----- */

.stage { position: absolute; z-index: 15; right: 10vw; top: 50%; transform: translateY(-50%); display: grid; justify-items: center; }
.stage-hint { margin-bottom: 36px; }
.envelope-btn { perspective: 1400px; perspective-origin: 50% 40%; -webkit-tap-highlight-color: transparent; }
.env-float { animation: float 7s ease-in-out infinite; }
.envelope {
  --w: 330px; --h: 210px; --paper: #e8e6e1; --paper-2: #dcd9d2; --paper-3: #d2cec6;
  position: relative; width: var(--w); height: var(--h); transform-style: preserve-3d;
  transform: rotateX(14deg) rotateY(-22deg) rotateZ(3deg);
  transition: transform 1s var(--ease);
  animation: sway 11s ease-in-out infinite;
}
.envelope-btn:hover .envelope, .envelope.open { animation-play-state: paused; }
.env-back { position: absolute; inset: 0; border-radius: 10px; background: linear-gradient(160deg, var(--paper-2), var(--paper-3)); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55); }
.env-letter {
  position: absolute; left: 14px; right: 14px; top: 12px; height: calc(var(--h) - 24px); padding: 16px 18px;
  border-radius: 8px; background: #fbfaf8; color: #111; text-align: left;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12); transform: translateZ(1px); transition: transform 0.9s var(--ease) 0.15s;
}
.envelope.open .env-letter { transform: translateZ(1px) translateY(-150px); }
.env-letter .lt-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid #e7e5e0; }
.env-letter .lt-brand { display: flex; align-items: center; gap: 8px; }
.env-letter .lt-brand svg { width: 22px; height: 22px; color: #111; }
.env-letter .lt-brand b { display: block; font-family: var(--mono); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; }
.env-letter .lt-brand small { display: block; font-size: 7.5px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: #9a968d; }
.env-letter .lt-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3); font-size: 8px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #047857; }
.env-letter .lt-badge i { width: 5px; height: 5px; border-radius: 50%; background: #10b981; }
.env-letter h3 { margin: 10px 0 3px; font-size: 13.5px; font-weight: 800; letter-spacing: -0.01em; }
.env-letter p { margin: 0; font-size: 10px; line-height: 1.5; color: #57534e; }
.env-letter dl { margin: 10px 0 0; display: grid; gap: 5px; }
.env-letter dl div { display: flex; justify-content: space-between; gap: 10px; font-size: 9px; }
.env-letter dt { font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #8a867d; }
.env-letter dd { margin: 0; font-family: var(--mono); font-weight: 700; color: #1c1917; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.env-pocket { position: absolute; inset: 0; transform: translateZ(2px); pointer-events: none; }
.env-pocket i { position: absolute; inset: 0; border-radius: 10px; }
.env-pocket .l { background: linear-gradient(100deg, var(--paper) 0%, #e2dfd9 100%); clip-path: polygon(0 0, 52% 58%, 0 100%); }
.env-pocket .r { background: linear-gradient(260deg, var(--paper) 0%, #dedbd4 100%); clip-path: polygon(100% 0, 48% 58%, 100% 100%); }
.env-pocket .b { background: linear-gradient(0deg, #ecebe7, #e2dfd8); clip-path: polygon(0 100%, 50% 46%, 100% 100%); filter: drop-shadow(0 -1px 0 rgba(0, 0, 0, 0.06)); }
.env-pocket .stamp {
  position: absolute; right: 16px; bottom: 14px; width: 44px; height: 52px; padding: 4px; border-radius: 3px;
  background: repeating-linear-gradient(90deg, transparent 0 3px, var(--paper) 3px 5px) top/100% 3px no-repeat, repeating-linear-gradient(90deg, transparent 0 3px, var(--paper) 3px 5px) bottom/100% 3px no-repeat, #1a1a1f;
  display: grid; place-items: center; color: #d6d3f0; font-size: 6.5px; font-weight: 800; letter-spacing: 0.14em;
}
.env-pocket .stamp svg { width: 20px; height: 20px; }
.env-pocket .addr { position: absolute; left: 18px; bottom: 16px; font-family: var(--mono); font-size: 8px; font-weight: 700; letter-spacing: 0.1em; color: #57534e; line-height: 1.6; text-transform: uppercase; }
.env-flap {
  position: absolute; left: 0; right: 0; top: 0; height: 62%; transform-origin: top center; transform: translateZ(3px) rotateX(0deg);
  transition: transform 0.7s var(--ease);
}
.env-flap::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, #d9d6cf, #cfcbc3); clip-path: polygon(0 0, 100% 0, 50% 100%); border-radius: 10px 10px 0 0; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.15)); }
.envelope.open .env-flap { transform: translateZ(-2px) rotateX(180deg); }
.env-seal {
  position: absolute; left: 50%; top: 62%; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%; z-index: 4;
  background: radial-gradient(circle at 35% 30%, #3a3a44, #121216 70%); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  display: grid; place-items: center; color: #cfcbe6; transform: translateZ(4px); transition: opacity 0.3s, transform 0.5s var(--ease);
}
.env-seal svg { width: 20px; height: 20px; }
.envelope.open .env-seal { opacity: 0; transform: translateZ(4px) scale(0.6); }
.env-shadow { width: 260px; height: 26px; margin-top: 46px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, 0.7), transparent); animation: shadow 7s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }
@keyframes shadow { 0%, 100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(0.84); opacity: 0.55; } }
@keyframes sway {
  0%, 100% { transform: rotateX(14deg) rotateY(-22deg) rotateZ(3deg); }
  50% { transform: rotateX(8deg) rotateY(-8deg) rotateZ(-1deg); }
}

/* ----- sections ----- */

.section { position: relative; padding: 110px 7vw; }
.section-head { max-width: 640px; margin-bottom: 52px; }
.section-head h2 { margin: 14px 0 0; font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 700; line-height: 1.12; letter-spacing: -0.03em; }
.section-head p { margin: 16px 0 0; color: var(--fg-2); font-weight: 300; line-height: 1.75; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  position: relative; padding: 28px; border-radius: 24px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.card .num { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.18em; color: var(--accent); }
.card h3 { margin: 18px 0 8px; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.card p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--fg-2); }
.card code { font-family: var(--mono); font-size: 12.5px; color: var(--fg); background: var(--glass-2); padding: 2px 6px; border-radius: 6px; }

.ledger { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ledger ul { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.ledger li { display: flex; gap: 12px; font-size: 14px; line-height: 1.55; color: var(--fg-2); }
.ledger li svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.ledger .yes svg { color: var(--ok); }
.ledger .no svg { color: var(--fg-4); }
.ledger h3 { display: flex; align-items: center; gap: 10px; margin: 0; }

.faq { max-width: 760px; display: grid; gap: 10px; }
.faq details { border: 1px solid var(--line); border-radius: 18px; background: var(--glass); transition: background-color 0.2s; }
.faq details[open] { background: rgba(255, 255, 255, 0.05); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 22px; font-weight: 500; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--mono); color: var(--fg-3); transition: transform 0.25s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0; padding: 0 22px 20px; color: var(--fg-2); font-size: 14px; line-height: 1.7; }

.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding: 36px 7vw 44px; border-top: 1px solid var(--line); font-size: 12px; color: var(--fg-3); }
.site-footer nav { display: flex; gap: 20px; }
.site-footer a:hover { color: var(--fg); }

/* ============ Login ============ */

.auth { min-height: 100svh; display: grid; place-items: center; padding: 100px 24px 60px; }
.auth .brand-corner { position: absolute; left: 2.75rem; top: 3.3rem; }
.auth-card { width: 100%; max-width: 460px; }
.auth-mark { display: grid; justify-items: center; margin-bottom: 40px; text-align: center; }
.auth-mark svg { width: 72px; height: 72px; margin-bottom: 16px; }
.auth-mark h1 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: 0.28em; text-transform: uppercase; }
.auth-mark p { margin: 6px 0 0; font-size: 13px; color: var(--fg-3); }
.auth form { display: grid; gap: 20px; }
.auth .alt { text-align: center; font-size: 12.5px; color: var(--fg-3); }
.auth .alt button, .link { color: var(--fg-2); text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.2); text-underline-offset: 3px; }
.auth .alt button:hover, .link:hover { color: #fff; }
.form-error { min-height: 18px; margin: -8px 0 0; font-size: 12.5px; color: var(--danger); text-align: center; }

.key-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 16px 22px; border-radius: 20px;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.05);
}
.key-box code { font-family: var(--mono); font-size: clamp(13px, 3.6vw, 16px); font-weight: 600; letter-spacing: 0.06em; color: #fff; word-break: break-all; }
.warn { display: flex; gap: 12px; margin: 18px 0; padding: 14px 16px; border-radius: 16px; background: rgba(245, 158, 11, 0.07); border: 1px solid rgba(245, 158, 11, 0.22); font-size: 13px; line-height: 1.55; color: #fcd34d; }
.warn svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }

/* ----- address picker ----- */

.picker { display: grid; gap: 10px; }
.picker-field, .picker-domain {
  display: flex; align-items: center; height: 52px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.04); transition: border-color 0.2s, background-color 0.2s;
}
.picker-field:focus-within, .picker-domain:focus-within { border-color: rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.06); }
.picker-field { padding: 0 8px 0 20px; }
.picker-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font-size: 14px; letter-spacing: 0.02em; }
.picker-field input::placeholder { color: var(--fg-4); }
.picker-field:has(input.invalid) { border-color: rgba(248, 113, 113, 0.55); }
.picker-domain { position: relative; gap: 6px; padding: 0 20px; cursor: pointer; }
.picker-domain span { font-family: var(--mono); color: var(--fg-3); }
.picker-domain select { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font-family: var(--mono); font-size: 14px; color: var(--fg); cursor: pointer; appearance: none; }
.picker-domain select option { background: #111; }
.picker-domain::after { content: ''; width: 7px; height: 7px; border: solid var(--fg-3); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-3px); pointer-events: none; }
.picker-preview { margin: 2px 0 0; padding: 0 6px; font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.picker-preview .l { color: #fff; font-weight: 600; }
.picker-preview .l.placeholder { color: var(--fg-4); font-weight: 400; }
.picker-preview .d { color: var(--fg-3); }
.picker.compact .picker-field, .picker.compact .picker-domain { height: 40px; border-radius: 14px; background: rgba(0, 0, 0, 0.25); }
.picker.compact .picker-field { padding: 0 4px 0 12px; }
.picker.compact .picker-domain { padding: 0 14px 0 12px; }
.picker.compact input, .picker.compact select, .picker.compact .picker-preview { font-size: 12px; }
.picker.compact .icon-btn { width: 32px; height: 32px; }

/* ============ Inbox app ============ */

.app { height: 100svh; display: grid; grid-template-rows: auto 1fr; padding: 0 20px 20px; gap: 16px; }
.app-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 76px; padding: 0 8px; }
.app-bar .right { display: flex; align-items: center; gap: 8px; }
.app-main { min-height: 0; display: grid; grid-template-columns: 280px minmax(320px, 400px) 1fr; gap: 16px; }
.pane {
  min-height: 0; display: flex; flex-direction: column; border-radius: 24px; border: 1px solid var(--line);
  background: var(--panel); backdrop-filter: blur(24px) saturate(120%); -webkit-backdrop-filter: blur(24px) saturate(120%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04); overflow: hidden;
}
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 18px 14px 22px; }
.pane-title { font-size: 10.5px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--fg-3); }
.pane-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.12) transparent; }

/* sidebar */
.addr-list { display: grid; gap: 4px; padding: 0 10px 10px; }
.addr-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border-radius: 14px; text-align: left;
  border: 1px solid transparent; transition: background-color 0.2s, border-color 0.2s;
}
.addr-item:hover { background: var(--glass-2); }
.addr-item.active { background: rgba(255, 255, 255, 0.09); border-color: var(--line); }
.addr-item .ic { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--glass-2); color: var(--fg-3); }
.addr-item.active .ic { background: #fff; color: #000; }
.addr-item .ic svg { width: 15px; height: 15px; }
.addr-item .txt { min-width: 0; flex: 1; }
.addr-item .local { display: block; font-family: var(--mono); font-size: 12.5px; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.addr-item .dom { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #0b0717; font-size: 11px; font-weight: 700; display: grid; place-items: center; }

.new-addr { margin: 4px 10px 12px; padding: 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--glass); display: grid; gap: 10px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); }
.seg button { height: 30px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-3); transition: background-color 0.2s, color 0.2s; }
.seg button.on { background: rgba(255, 255, 255, 0.12); color: var(--fg); }
.new-addr .err { font-size: 12px; color: var(--danger); }

.side-foot { padding: 14px 18px 18px; border-top: 1px solid var(--line); display: grid; gap: 10px; font-size: 11.5px; color: var(--fg-3); line-height: 1.5; }
.side-foot div { display: flex; gap: 9px; align-items: flex-start; }
.side-foot svg { flex: none; width: 14px; height: 14px; margin-top: 2px; color: var(--fg-3); }

/* message list */
.addr-hero { padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.addr-hero .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.addr-hero .current { display: flex; align-items: center; gap: 4px; min-width: 0; margin-top: 10px; }
.addr-hero .current code { min-width: 0; font-family: var(--mono); font-size: 14.5px; font-weight: 600; color: #fff; overflow-wrap: anywhere; }
.addr-hero .actions { display: flex; gap: 2px; }
.msg-list { display: grid; }
.msg-item { position: relative; display: grid; gap: 3px; width: 100%; padding: 15px 20px 15px 26px; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, 0.05); transition: background-color 0.2s; }
.msg-item:hover { background: rgba(255, 255, 255, 0.035); }
.msg-item.active { background: rgba(255, 255, 255, 0.075); }
.msg-item.unread::before { content: ''; position: absolute; left: 11px; top: 21px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.msg-item.fresh { animation: fresh 1.6s var(--ease); }
@keyframes fresh { from { background: rgba(167, 139, 250, 0.18); } }
.msg-item .top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.msg-item .from { font-size: 13.5px; font-weight: 500; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-item.unread .from { color: #fff; font-weight: 600; }
.msg-item time { flex: none; font-size: 11px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.msg-item .subj { font-size: 13.5px; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-item .prev { font-size: 12.5px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-item .meta { display: flex; gap: 12px; margin-top: 4px; font-size: 10.5px; color: var(--fg-4); font-family: var(--mono); }
.msg-item .meta span { display: inline-flex; align-items: center; gap: 4px; }
.msg-item .meta svg { width: 11px; height: 11px; }

.empty { flex: 1; display: grid; place-items: center; align-content: center; gap: 14px; padding: 40px 28px; text-align: center; }
.empty h3 { margin: 0; font-size: 15px; font-weight: 600; }
.empty p { margin: 0; max-width: 300px; font-size: 13px; color: var(--fg-3); line-height: 1.6; }
.radar { position: relative; width: 92px; height: 92px; display: grid; place-items: center; margin-bottom: 8px; }
.radar i { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(167, 139, 250, 0.35); animation: radar 3s var(--ease) infinite; opacity: 0; }
.radar i:nth-child(2) { animation-delay: 1s; }
.radar i:nth-child(3) { animation-delay: 2s; }
.radar svg { position: relative; width: 30px; height: 30px; color: var(--fg-2); }
@keyframes radar { 0% { transform: scale(0.35); opacity: 0.9; } 100% { transform: scale(1.3); opacity: 0; } }

/* reader */
.reader-head { padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.reader-head .bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.reader-head h2 { margin: 0; font-size: 19px; font-weight: 650; line-height: 1.3; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.sender { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.avatar { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #0b0b0b; background: linear-gradient(135deg, #f5f5f4, #a8a29e); }
.sender .who { min-width: 0; flex: 1; }
.sender .name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sender .addr { font-family: var(--mono); font-size: 11.5px; color: var(--fg-3); overflow-wrap: anywhere; }
.sender .when { flex: none; text-align: right; font-size: 11.5px; color: var(--fg-3); line-height: 1.5; }
.reader-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.reader-tools .seg { width: 170px; }
.remote-note { display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 14px; border-radius: 999px; background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.2); font-size: 11.5px; color: #fcd34d; }
.remote-note button { padding: 4px 10px; border-radius: 999px; background: rgba(245, 158, 11, 0.16); font-size: 11px; font-weight: 600; }
.remote-note button:hover { background: rgba(245, 158, 11, 0.28); }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.att { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; padding: 8px 14px 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); font-size: 12.5px; transition: border-color 0.2s, background-color 0.2s; }
.att:hover { border-color: var(--line-2); background: var(--glass-2); }
.att svg { flex: none; width: 16px; height: 16px; color: var(--fg-3); }
.att .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.att .s { color: var(--fg-3); font-family: var(--mono); font-size: 11px; }
.reader-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px; }
.mail-frame { display: block; width: 100%; min-height: 240px; border: 0; border-radius: 16px; background: #fff; }
.mail-text { margin: 0; padding: 20px 22px; border-radius: 16px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); font-family: var(--mono); font-size: 13px; line-height: 1.7; color: var(--fg); white-space: pre-wrap; overflow-wrap: anywhere; }
.mail-text a { color: #c4b5fd; text-decoration: underline; text-underline-offset: 2px; }
.back-btn { display: none; }

/* key popover */
.menu { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 50; width: min(350px, calc(100vw - 24px)); padding: 16px; border-radius: 20px;
  background: rgba(20, 20, 20, 0.96); border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); animation: rise 0.3s var(--ease);
}
.menu-pop .key-line { display: flex; align-items: center; gap: 6px; padding: 10px 8px 10px 14px; margin: 8px 0 12px; border-radius: 14px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); }
.menu-pop .key-line code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-pop .menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px; font-size: 13px; color: var(--fg-2); text-align: left; }
.menu-pop .menu-item:hover { background: var(--glass-2); color: var(--fg); }
.menu-pop .menu-item svg { width: 16px; height: 16px; }
.menu-pop .menu-item.danger { color: #fca5a5; }
.menu-pop .menu-item.danger:hover { background: rgba(248, 113, 113, 0.1); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
.menu-pop .small { font-size: 11.5px; color: var(--fg-3); line-height: 1.5; }

.skeleton { height: 76px; margin: 0 16px 1px; border-radius: 12px; background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ============ Docs ============ */

.docs { max-width: 900px; margin: 0 auto; padding: 150px 24px 80px; }
.docs h1 { margin: 16px 0 0; font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; }
.docs > p { color: var(--fg-2); font-weight: 300; line-height: 1.75; max-width: 640px; }
.docs h2 { margin: 56px 0 16px; font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.endpoint { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--glass); overflow: hidden; }
.endpoint header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; }
.endpoint .verb { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; padding: 3px 9px; border-radius: 8px; }
.verb.get { background: rgba(52, 211, 153, 0.12); color: #6ee7b7; }
.verb.post { background: rgba(167, 139, 250, 0.14); color: #c4b5fd; }
.verb.delete { background: rgba(248, 113, 113, 0.12); color: #fca5a5; }
.endpoint .path { font-family: var(--mono); font-size: 13.5px; }
.endpoint .desc { flex-basis: 100%; font-size: 13.5px; color: var(--fg-2); }
pre.code { margin: 0; padding: 18px 20px; overflow-x: auto; background: rgba(0, 0, 0, 0.35); border-top: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: #e7e5e4; }
pre.code .c { color: var(--fg-3); }
.docs .card + .card { margin-top: 12px; }

/* ============ Responsive ============ */

@media (max-width: 1280px) {
  .stage { right: 4vw; transform: translateY(-50%) scale(0.88); }
  .app-main { grid-template-columns: 250px minmax(300px, 360px) 1fr; }
}
@media (max-width: 1100px) {
  .stage { display: none; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  .app { padding: 0 12px 12px; gap: 10px; }
  .app-bar { height: 64px; padding: 0 4px; }
  .app-main { grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: 10px; }
  .pane-sidebar { max-height: none; }
  .pane-sidebar .pane-scroll { flex: none; overflow: visible; }
  .pane-sidebar .addr-list { display: flex; gap: 6px; overflow-x: auto; padding: 0 12px 12px; scrollbar-width: none; }
  .pane-sidebar .addr-item { width: auto; flex: none; max-width: 240px; }
  .pane-sidebar .side-foot { display: none; }
  .pane-sidebar .pane-head { padding: 14px 14px 10px 18px; }
  .app[data-view='list'] .pane-reader { display: none; }
  .app[data-view='reader'] .pane-list, .app[data-view='reader'] .pane-sidebar { display: none; }
  .app[data-view='reader'] .app-main { grid-template-rows: 1fr; }
  .back-btn { display: inline-grid; }
}
@media (max-width: 760px) {
  .site-header { padding: 24px 20px 0; }
  .site-nav a:not(.btn) { display: none; }
  .hero { padding: 120px 24px 100px; }
  .section { padding: 80px 24px; }
  .ledger { grid-template-columns: 1fr; }
  .auth .brand-corner { left: 20px; top: 24px; }
  .modal-card { padding: 24px; border-radius: 24px; }
  .hero-cta .btn { flex: 1 1 100%; }
  .app-bar .brand span { display: none; }
  .reader-head { padding: 18px; }
  .reader-body { padding: 12px; }
  .sender .when { display: none; }
}
