/* =========================================================
   MailTheSnail — style.css
   ========================================================= */

:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --border: #e6eaf0;
  --border-soft: #eef1f5;
  --text: #1c2140;
  --muted: #5b6178;
  --muted-2: #8a90a3;
  --green: #1fa257;
  --green-dark: #178a4a;
  --green-soft: #e4f5ea;
  --green-line: #cbe9d6;
  --blue-soft: #e3ecfb;
  --blue-card: #eaf2fd;
  --purple-soft: #ece6fb;
  --pink-soft: #fde6ec;
  --red: #e0455c;
  --red-soft: #fdeaee;
  --dark: #1c2140;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(28, 33, 64, 0.06);
  --shadow-sm: 0 2px 8px rgba(28, 33, 64, 0.05);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --hand: "Caveat", "Segoe Script", "Bradley Hand", cursive;
  --container: 1040px;
  --gutter: 40px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
svg { flex-shrink: 0; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  white-space: nowrap;
  transition: background .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 4px 12px rgba(31, 162, 87, 0.28); }
.btn-primary:hover { background: var(--green-dark); }
.btn-dark { background: var(--dark); color: #fff; }
.btn-dark:hover { background: #2a3057; }
.btn-lg { padding: 13px 22px; font-size: 16px; }
.btn-block { width: 100%; }
.btn.is-busy { opacity: .7; pointer-events: none; }
.link-btn { font-weight: 500; color: var(--text); padding: 8px 10px; }
.link-btn:hover { color: var(--green-dark); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 248, 251, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 40px;
  height: 66px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-img { height: 34px; width: auto; }
.brand-img-sm { height: 26px; }
.brand-name { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.nav { display: flex; gap: 30px; flex: 1; }
.nav-link { font-weight: 500; color: var(--text); padding: 6px 0; position: relative; }
.nav-link.is-active { font-weight: 600; }
.nav-link:hover { color: var(--green-dark); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.menu-btn { display: none; padding: 8px; border-radius: 10px; }
.menu-btn:hover { background: #e9edf3; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 0 46%;
  background:
    radial-gradient(60% 55% at 60% 30%, #ffffff 0%, rgba(255,255,255,0) 70%),
    radial-gradient(40% 40% at 90% 70%, #dff3e6 0%, rgba(223,243,230,0) 70%),
    linear-gradient(180deg, #e9f1fb 0%, #f6f8fb 100%);
  border-bottom-left-radius: 60px;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding-top: 40px;
  padding-bottom: 36px;
}
.pill {
  display: inline-block;
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 600;
  font-size: 14px;
  padding: 7px 15px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.hero-title {
  font-size: clamp(44px, 6.2vw, 68px);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -0.035em;
  margin-bottom: 22px;
}
.hero-sub {
  font-size: 19px;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 26px;
}
.hero-form { margin-bottom: 18px; }
.hero-perks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 13.5px;
  color: var(--muted);
}
.hero-perks li { display: inline-flex; align-items: center; gap: 7px; }
.hero-perks svg { color: var(--green); }

.hero-art { position: relative; min-height: 380px; display: flex; align-items: flex-end; justify-content: center; }
.hero-img {
  width: 100%;
  max-width: 500px;
  height: auto;
  margin-bottom: -10px;
  filter: drop-shadow(0 20px 30px rgba(28, 33, 64, 0.15));
}
.hero-img.is-missing { visibility: hidden; }

/* ---------- Name input (shared) ---------- */
.name-form {
  display: flex;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px;
  box-shadow: var(--shadow-sm);
}
.name-input {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  border-radius: 10px;
  overflow: hidden;
}
.name-input input {
  flex: 1;
  min-width: 0;
  width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 500;
}
.name-input input::placeholder { color: var(--muted-2); }
.name-suffix {
  background: #f1f4f8;
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  white-space: nowrap;
}
.name-form:focus-within { border-color: #c9d2de; }

/* ---------- Scribbles (handwritten notes) ---------- */
.scribble {
  font-family: var(--hand);
  font-size: 26px;
  font-weight: 600;
  line-height: 0.95;
  color: var(--text);
  pointer-events: none;
}
.scribble-hero { position: absolute; top: 34px; right: 6%; transform: rotate(-12deg); text-align: center; }
.scribble-hero .scribble-arrow { display: block; margin: 4px auto 0; transform: rotate(6deg); }
.scribble-check { position: absolute; right: 10px; top: 58px; transform: rotate(-16deg); font-size: 24px; text-align: center; }
.scribble-check .scribble-arrow { display: block; margin: 2px 0 0 -6px; }
.scribble-footer { text-align: center; transform: rotate(-12deg); font-size: 22px; margin-left: auto; }
.scribble-footer b { display: block; font-weight: 500; font-size: 20px; margin-top: 4px; }

/* ---------- Features ---------- */
.features { padding: 40px 0 26px; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.feature { display: flex; gap: 14px; align-items: flex-start; }
.feature > div { min-width: 0; flex: 1; }
.feature h3 { font-size: 18px; font-weight: 700; line-height: 1.25; margin-bottom: 6px; letter-spacing: -0.01em; }
.feature p { color: var(--muted); font-size: 13.5px; line-height: 1.5; white-space: nowrap; }
.feature-icon {
  width: 50px; height: 50px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.feature-icon.is-green { background: var(--green-soft); color: var(--green); }
.feature-icon.is-blue { background: var(--blue-soft); color: #3c6fd6; }
.feature-icon.is-purple { background: var(--purple-soft); color: #7a5cd8; }
.feature-icon.is-pink { background: var(--pink-soft); color: #e2506a; }

/* ---------- Sections & cards ---------- */
.section { padding: 20px 0; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}
.card-title { font-size: 23px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; }
.card-sub { color: var(--muted); font-size: 15px; margin-bottom: 20px; }
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 24px;
  align-items: stretch;
}

/* ---------- Find your snail mail ---------- */
.card-find .name-form { margin-bottom: 16px; }
.result {
  border: 1px solid var(--green-line);
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.result.is-taken { border-color: #f6c9d1; }
.result-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.result-head strong { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; overflow-wrap: anywhere; min-width: 0; }
.status-dot {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.status-dot.is-ok { background: var(--green); }
.status-dot.is-bad { background: var(--red); }
.status-dot.is-busy { background: var(--muted-2); }
.status-dot.is-busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.suggest-label { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.suggest-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.suggest {
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 8px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  min-width: 0;
}
.suggest:hover { border-color: #cfd6e0; box-shadow: var(--shadow-sm); }
.suggest-name { display: flex; align-items: center; justify-content: space-between; gap: 3px; font-weight: 600; font-size: 12px; }
.suggest-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-name svg { color: var(--green); }
.suggest-status { font-size: 12px; color: var(--green-dark); margin-top: 3px; }
.suggest.is-taken .suggest-name svg { color: var(--red); }
.suggest.is-taken .suggest-status { color: var(--red); }

.field-error { color: var(--red); font-size: 13.5px; margin: -8px 0 14px; }

/* ---------- Inbox mockup ---------- */
.card-inbox { padding: 12px; background: #f9fbfd; }
.inbox {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  font-size: 13px;
}
.inbox-top {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.inbox-top .brand-name { font-size: 17px; }
.inbox-search {
  flex: 1;
  display: flex; align-items: center; gap: 8px;
  background: #f1f4f8;
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--muted-2);
}
.inbox-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 13px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: #e9edf3; color: #7c8397;
  display: inline-flex; align-items: center; justify-content: center;
}
.inbox-body { display: grid; grid-template-columns: 126px 1fr; flex: 1; }
.inbox-side { padding: 12px 10px; border-right: 1px solid var(--border-soft); }
.btn-compose { width: 100%; padding: 10px 12px; font-size: 13.5px; margin-bottom: 12px; border-radius: 10px; }
.folders { display: flex; flex-direction: column; gap: 4px; }
.folder {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  text-align: left;
}
.folder span { flex: 1; }
.folder:hover { background: #f3f5f9; }
.folder.is-active { background: var(--blue-soft); color: var(--text); font-weight: 600; }
.badge { background: #d6e2f7; color: var(--text); font-size: 11px; padding: 2px 7px; border-radius: 999px; font-weight: 600; }
.folder:not(.is-active) .badge { background: #eef1f5; }

.inbox-main { padding: 10px 14px 14px; display: flex; flex-direction: column; }
.mail-head, .mail-list li {
  display: grid;
  grid-template-columns: 84px 1fr 30px;
  gap: 8px;
  align-items: center;
}
.mail-head { color: var(--muted-2); font-size: 12px; padding: 4px 10px 8px; }
.mail-head span:last-child, .mail-list .time { text-align: right; }
.mail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.mail-list li {
  padding: 8px 10px;
  border-radius: 10px;
  background: #f9fafc;
  transition: background .15s;
  cursor: default;
}
.mail-list li:hover { background: #f1f4f8; }
.mail-list li.is-hidden { display: none; }
.from { display: flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.from-ico { width: 18px; height: 18px; border-radius: 50%; border: 1px solid #d5dbe5; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); flex-shrink: 0; }
.subj { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.time { color: var(--muted-2); font-size: 12px; }
.inbox-empty {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  padding: 28px 10px 14px;
  color: var(--muted);
  text-align: center;
  min-height: 130px;
}
.inbox-empty svg { color: var(--muted); margin-bottom: 8px; }
.inbox-empty strong { color: var(--text); font-weight: 600; font-size: 14px; }
.inbox-empty span { font-size: 12.5px; }

/* ---------- Email checker ---------- */
.checker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
  gap: 24px;
  align-items: stretch;
}
.card-checker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 276px;
  gap: 24px;
  align-items: center;
  position: relative;
}
.checker-left .card-sub { margin-bottom: 22px; }
.checker-left .card-title { white-space: nowrap; }
.email-form {
  display: flex;
  gap: 10px;
}
.email-form input {
  flex: 1;
  min-width: 0;
  width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 500;
  outline: 0;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.email-form input:focus { border-color: #c9d2de; }
.checker-result {
  background: #fbfcfe;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 16px 16px 14px;
  position: relative;
}
.checker-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.checker-head strong { display: block; font-size: 16px; font-weight: 700; color: var(--green-dark); line-height: 1.2; }
.checker-result.is-bad .checker-head strong { color: var(--red); }
.checker-addr { font-size: 13px; color: var(--muted); display: block; word-break: break-all; }
.checker-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.checker-rows li { display: grid; grid-template-columns: 16px 84px 60px; gap: 8px; align-items: center; font-size: 13.5px; }
.checker-rows i { color: var(--green); display: inline-flex; }
.checker-rows span { color: var(--muted); }
.checker-rows b { font-weight: 600; color: var(--green-dark); }
.checker-rows li.is-bad i, .checker-rows li.is-bad b { color: var(--red); }

.card-quote {
  background: var(--blue-card);
  border-color: #dfe9f8;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 30px 26px;
}
.quote {
  font-family: var(--hand);
  font-size: 34px;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.quote-sub { color: var(--muted); font-size: 14.5px; margin-bottom: 8px; }
.quote-by { color: var(--muted); font-size: 14px; }

/* ---------- Footer ---------- */
.site-footer { padding: 46px 0 40px; }
.footer-inner { display: flex; align-items: center; gap: 40px; flex-wrap: wrap; }
.footer-brand p { color: var(--muted); font-size: 14px; margin-top: 2px; }
.footer-links { display: flex; gap: 26px; font-size: 14px; color: var(--muted); margin-left: auto; }
.footer-links a:hover { color: var(--text); }
.footer-social { display: flex; gap: 22px; color: var(--muted-2); }
.footer-social a:hover { color: var(--text); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(28, 33, 64, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 20px;
  padding: 30px 28px 24px;
  box-shadow: 0 30px 60px rgba(28, 33, 64, 0.25);
  animation: pop .18s ease-out;
}
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal-close { position: absolute; top: 12px; right: 12px; padding: 8px; border-radius: 10px; color: var(--muted); }
.modal-close:hover { background: #f1f4f8; color: var(--text); }
.modal-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--green-soft); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; overflow: hidden; }
.modal-icon img { width: 44px; height: auto; }
.modal h3 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 4px; }
.modal-sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
.field > input, .field .name-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px;
  outline: 0;
  font-size: 15px;
  background: #fff;
}
.field .name-input { padding: 4px; display: flex; }
.field .name-input input { padding: 8px 10px; }
.field > input:focus, .field .name-input:focus-within { border-color: #c9d2de; }
.modal .field-error { margin: -4px 0 12px; }
.modal-foot { text-align: center; font-size: 13px; color: var(--muted); margin-top: 16px; }
.modal-foot button { color: var(--green-dark); font-weight: 600; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 110;
  background: var(--dark);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 14px;
  box-shadow: 0 12px 30px rgba(28, 33, 64, 0.3);
  animation: pop .18s ease-out;
  max-width: calc(100vw - 32px);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  :root { --gutter: 24px; }
  .header-inner { gap: 16px; }
  .nav {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 66px;
    flex-direction: column;
    gap: 4px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 12px var(--gutter) 16px;
    box-shadow: var(--shadow);
  }
  .nav.is-open { display: flex; }
  .nav-link { padding: 10px 0; }
  .menu-btn { display: inline-flex; }
  .link-btn { display: none; }

  .hero::before { inset: auto 0 0 0; height: 46%; border-radius: 40px 40px 0 0; }
  .hero-inner { grid-template-columns: 1fr; padding-top: 28px; }
  .hero-art { min-height: 0; margin-top: 12px; }
  .hero-img { max-width: 420px; }
  .scribble-hero { right: 4%; top: 0; }

  .features-grid { grid-template-columns: 1fr 1fr; }
  .two-col, .checker-row, .card-checker { grid-template-columns: 1fr; }
  .card-quote { min-height: 0; }
  .footer-links { margin-left: 0; width: 100%; }
}

@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .hero-title { font-size: 42px; }
  .hero-sub { font-size: 17px; }
  .hero-sub br, .hero-title br, .feature br { display: none; }
  .feature p { white-space: normal; }
  .name-form { flex-direction: column; }
  .name-form .btn { width: 100%; }
  .email-form { flex-direction: column; }
  .features-grid { grid-template-columns: 1fr; }
  .suggest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inbox-body { grid-template-columns: 1fr; }
  .inbox-side { border-right: 0; border-bottom: 1px solid var(--border-soft); }
  .folders { flex-direction: row; flex-wrap: wrap; }
  .folder span { flex: initial; }
  .mail-head, .mail-list li { grid-template-columns: 84px 1fr 30px; }
  .card { padding: 20px; }
  .scribble-hero { font-size: 20px; }
  .scribble-check { top: auto; bottom: 8px; right: 8px; font-size: 20px; }
  .scribble-footer { margin-left: 0; }
  .footer-links { gap: 16px; flex-wrap: wrap; }
  .modal { padding: 26px 20px 20px; }
}
