@import url('https://fonts.googleapis.com/css2?family=Syne:wght@500;700;800&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---------- Design tokens ---------- */
:root {
  --ink:       #0F1923;
  --mint:      #00E5A0;
  --mint-dark: #00C98A;
  --bg:        #F7F6F2;
  --surface:   #FFFFFF;
  --muted:     #6B7280;
  --border:    #E4E4E0;
  --danger:    #FF4D4D;

  --shadow-sm: 0 1px 2px rgba(15,25,35,.06);
  --shadow-md: 0 8px 30px rgba(15,25,35,.08);
  --radius:    14px;
  --radius-sm: 8px;

  --font-display: 'Syne', sans-serif;
  --font-ui:      'DM Sans', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;
}

[data-theme="dark"] {
  --ink:     #E8EDF2;
  --bg:      #0B1118;
  --surface: #131C26;
  --muted:   #8A95A3;
  --border:  #243240;
  --shadow-md: 0 8px 30px rgba(0,0,0,.4);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
.mono { font-family: var(--font-mono); }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 20px; }

/* ---------- Navbar ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(150%) blur(10px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 28px; height: 28px; border-radius: 6px; background: var(--ink);
  display: grid; place-items: center; flex: none;
}
.logo-mark svg { width: 17px; height: 17px; }
.logo-word { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
.logo-word .t { color: var(--mint-dark); }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  font-size: 14px; font-weight: 500; color: var(--muted);
  padding: 7px 13px; border-radius: 999px; transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nav-links a.pill { border: 1px solid var(--border); color: var(--ink); }
.theme-toggle {
  width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center;
  border: 1px solid var(--border); color: var(--muted); margin-left: 4px;
}
.theme-toggle:hover { color: var(--ink); }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 40px; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500;
  color: var(--mint-dark); background: color-mix(in srgb, var(--mint) 14%, transparent);
  padding: 6px 13px; border-radius: 999px; margin-bottom: 22px;
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--mint);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--mint) 60%, transparent);
  animation: pulse 2s infinite;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -.025em;
  font-size: clamp(32px, 6vw, 52px); line-height: 1.05; margin-bottom: 14px;
}
.hero h1 .accent { color: var(--mint-dark); }
.hero p.sub { color: var(--muted); font-size: 17px; max-width: 480px; margin: 0 auto 34px; }

/* ---------- Inbox card ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md); text-align: left; overflow: hidden;
}
.addr-bar {
  display: flex; align-items: center; gap: 10px; padding: 16px 18px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.addr {
  flex: 1 1 220px; min-width: 0; font-family: var(--font-mono); font-size: 16px; font-weight: 500;
  color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.addr .skeleton { display: inline-block; width: 180px; height: 18px; border-radius: 4px;
  background: linear-gradient(90deg, var(--border), color-mix(in srgb,var(--border) 40%, transparent), var(--border));
  background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm); display: grid; place-items: center;
  border: 1px solid var(--border); color: var(--muted); flex: none; transition: all .15s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }
.btn-copy {
  display: inline-flex; align-items: center; gap: 7px; padding: 0 15px; height: 38px;
  border-radius: var(--radius-sm); background: var(--ink); color: #fff; font-size: 14px; font-weight: 500;
  flex: none; transition: transform .12s, background .15s;
}
.btn-copy:hover { transform: translateY(-1px); }
.btn-copy.copied { background: var(--mint-dark); }
.btn-copy svg { width: 15px; height: 15px; }

/* TTL row */
.ttl-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 18px; background: color-mix(in srgb, var(--ink) 3%, transparent);
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.ttl-bar .left { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.ttl-bar .count { font-family: var(--font-mono); font-weight: 500; color: var(--ink); }
.ttl-bar .count.low { color: var(--danger); }
.btn-extend {
  font-size: 13px; font-weight: 500; color: var(--mint-dark);
  padding: 4px 10px; border-radius: 999px; border: 1px solid color-mix(in srgb,var(--mint) 40%, transparent);
}
.btn-extend:hover { background: color-mix(in srgb, var(--mint) 12%, transparent); }

/* OTP banner */
.otp-banner {
  display: none; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 18px; background: color-mix(in srgb, var(--mint) 12%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--mint) 30%, transparent);
  animation: slideIn .3s ease;
}
.otp-banner.show { display: flex; }
.otp-banner .label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--mint-dark); }
.otp-banner .code { font-family: var(--font-mono); font-size: 28px; font-weight: 500; letter-spacing: .12em; color: var(--ink); }
.otp-banner button {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500;
  padding: 8px 14px; border-radius: var(--radius-sm); background: var(--ink); color: #fff;
}

/* Email list */
.list { min-height: 230px; }
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 56px 20px; color: var(--muted); min-height: 230px;
}
.empty .ico {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--ink) 5%, transparent); margin-bottom: 16px;
  animation: pulse-soft 2.4s ease-in-out infinite;
}
.empty .ico svg { width: 26px; height: 26px; color: var(--muted); }
.empty h3 { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--ink); margin-bottom: 4px; }
.empty p { font-size: 14px; }

.row {
  display: flex; align-items: center; gap: 13px; padding: 14px 18px;
  border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s;
  animation: slideIn .35s ease;
}
.row:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.row.unread { border-left: 3px solid var(--mint); padding-left: 15px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 700; font-size: 16px; color: #fff; font-family: var(--font-display);
  background: var(--ink);
}
.row .body { flex: 1; min-width: 0; }
.row .top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.row .from { font-weight: 700; font-size: 14.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .time { font-size: 12px; color: var(--muted); flex: none; }
.row .subj { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .subj .otp-chip {
  font-family: var(--font-mono); font-size: 12px; color: var(--mint-dark);
  background: color-mix(in srgb,var(--mint) 14%, transparent); padding: 1px 7px; border-radius: 4px; margin-right: 6px;
}
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mint); flex: none; }

/* ---------- Features ---------- */
.features { padding: 64px 0 40px; }
.features .grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.feature .ico { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--mint) 14%, transparent); color: var(--mint-dark); margin-bottom: 14px; }
.feature .ico svg { width: 21px; height: 21px; }
.feature h3 { font-family: var(--font-display); font-weight: 700; font-size: 17px; margin-bottom: 6px; }
.feature p { font-size: 14px; color: var(--muted); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); margin-top: 40px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 0; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.status { display: flex; align-items: center; gap: 8px; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); animation: pulse 2.4s infinite; }

/* ---------- Modal (email viewer) ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(15,25,35,.55); backdrop-filter: blur(3px);
  display: none; align-items: flex-start; justify-content: center; padding: 5vh 16px; z-index: 100;
}
.modal-back.show { display: flex; animation: fade .2s ease; }
.modal {
  background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 680px;
  max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow-md); overflow: hidden;
  animation: slideUp .25s ease;
}
.modal-head { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-head h2 { font-family: var(--font-display); font-size: 18px; font-weight: 700; line-height: 1.25; }
.modal-head .meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.modal-head .meta .mono { color: var(--ink); }
.modal-actions { display: flex; gap: 6px; flex: none; }
.modal-body { flex: 1; overflow: auto; }
.modal-body iframe { width: 100%; border: none; min-height: 320px; background: #fff; }
.modal-body .text { padding: 20px; white-space: pre-wrap; font-size: 14px; }
.atts { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 8px; }
.att { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--ink); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Animations ---------- */
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--mint) 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes pulse-soft { 0%,100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .hero { padding: 36px 0 28px; }
  .features .grid { grid-template-columns: 1fr; }
  .nav-links a:not(.pill) { display: none; }
  .otp-banner .code { font-size: 23px; }
  .addr { flex-basis: 100%; order: -1; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
