/* ── Design tokens ─────────────────────────────────────────── */
:root {
  --bg: #faf6f0;
  --bg-warm: #f2ebe1;
  --bg-deep: #1a2e2a;
  --ink: #1a2e2a;
  --ink-muted: #5c6e69;
  --ink-faint: #8a9894;
  --accent: #c96f4a;
  --accent-hover: #b55e3b;
  --accent-soft: rgba(201, 111, 74, 0.12);
  --teal: #2d6a5a;
  --teal-soft: rgba(45, 106, 90, 0.1);
  --card: #ffffff;
  --border: rgba(26, 46, 42, 0.1);
  --shadow-sm: 0 2px 8px rgba(26, 46, 42, 0.06);
  --shadow-md: 0 8px 32px rgba(26, 46, 42, 0.1);
  --shadow-lg: 0 24px 64px rgba(26, 46, 42, 0.14);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Figtree", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 72px;
}

/* ── Reset & base ──────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

img, svg {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul[role="list"] {
  list-style: none;
}

.container {
  width: min(1120px, calc(100% - 2.5rem));
  margin-inline: auto;
}

/* ── Grain overlay ─────────────────────────────────────────── */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  border-radius: 999px;
  transition: transform 0.25s var(--ease-out), background 0.25s, color 0.25s, box-shadow 0.25s;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn:not(:disabled):hover {
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.5rem 1.1rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 0.85rem 1.6rem;
  font-size: 1rem;
}

.btn-primary {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 4px 16px rgba(45, 106, 90, 0.25);
}

.btn-primary:not(:disabled):hover {
  background: #245a4c;
  box-shadow: 0 6px 24px rgba(45, 106, 90, 0.35);
}

.btn-ghost {
  color: var(--ink);
  border: 1.5px solid var(--border);
  background: transparent;
}

.btn-ghost:hover {
  background: var(--teal-soft);
  border-color: rgba(45, 106, 90, 0.25);
}

.btn-light {
  background: #fff;
  color: var(--teal);
  box-shadow: var(--shadow-md);
}

.btn-light:not(:disabled):hover {
  background: var(--bg);
}

.btn-icon {
  transition: transform 0.25s var(--ease-out);
}

.btn-primary:not(:disabled):hover .btn-icon {
  transform: translateX(3px);
}

/* ── Header ────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(250, 246, 240, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--ink);
}

.logo-mark {
  display: flex;
  color: var(--teal);
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-muted);
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--teal);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 40px;
  height: 40px;
  padding: 8px;
}

.menu-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s var(--ease-out), opacity 0.3s;
}

.menu-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.mobile-nav[hidden] {
  display: none !important;
}

.mobile-nav:not([hidden]) {
  display: flex;
}

.mobile-nav-link {
  font-weight: 500;
  color: var(--ink-muted);
  padding: 0.4rem 0;
}

/* ── Reveal animations ─────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(4rem, 10vw, 7rem);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -10%;
  width: 60%;
  height: 80%;
  background: radial-gradient(ellipse, var(--accent-soft) 0%, transparent 70%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.hero-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--teal);
}

.hero-lead {
  font-size: 1.1rem;
  color: var(--ink-muted);
  max-width: 42ch;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.stat dt {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.15rem;
}

.stat dd {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

/* ── Hero visual / card stack ──────────────────────────────── */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 420px;
}

.card-stack {
  position: relative;
  width: 300px;
  height: 380px;
}

.contact-card {
  position: absolute;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.card-back {
  width: 240px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  top: 0;
  right: 0;
  transform: rotate(6deg);
  opacity: 0.7;
  animation: float-back 6s ease-in-out infinite;
}

.card-mid {
  width: 260px;
  padding: 1.1rem 1.35rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  top: 60px;
  left: 10px;
  transform: rotate(-4deg);
  opacity: 0.85;
  animation: float-mid 5s ease-in-out infinite;
}

.card-front {
  width: 280px;
  top: 120px;
  left: 50%;
  transform: translateX(-50%);
  animation: float-front 4s ease-in-out infinite;
  z-index: 2;
}

@keyframes float-back {
  0%, 100% { transform: rotate(6deg) translateY(0); }
  50% { transform: rotate(6deg) translateY(-8px); }
}

@keyframes float-mid {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  50% { transform: rotate(-4deg) translateY(-10px); }
}

@keyframes float-front {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-12px); }
}

.card-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.card-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-phone {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.card-address {
  font-size: 0.75rem;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 0;
}

.card-avatar-lg {
  width: 52px;
  height: 52px;
  font-size: 1rem;
  background: linear-gradient(135deg, var(--teal-soft), var(--accent-soft));
  color: var(--teal);
}

.card-menu {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px;
  opacity: 0.4;
}

.card-menu span {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink);
}

.card-body {
  padding: 0.75rem 1.25rem 1rem;
}

.card-name-lg {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.card-details {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-details li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.card-details svg {
  flex-shrink: 0;
  color: var(--accent);
}

.card-actions {
  display: flex;
  border-top: 1px solid var(--border);
}

.card-action {
  flex: 1;
  text-align: center;
  padding: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--teal);
}

.card-action-danger {
  color: var(--accent);
  border-left: 1px solid var(--border);
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero-orb-1 {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(45, 106, 90, 0.15), transparent 70%);
  bottom: 10%;
  left: 0;
}

.hero-orb-2 {
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(201, 111, 74, 0.12), transparent 70%);
  top: 5%;
  right: 5%;
}

/* ── Section shared ────────────────────────────────────────── */
.section-header {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 3.5rem;
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.section-lead {
  color: var(--ink-muted);
  font-size: 1.05rem;
}

/* ── Features ──────────────────────────────────────────────── */
.features {
  padding: clamp(4rem, 8vw, 6rem) 0;
  background: var(--bg-warm);
  border-block: 1px solid var(--border);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.5rem;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.feature-icon-add { background: rgba(45, 106, 90, 0.12); color: var(--teal); }
.feature-icon-edit { background: rgba(201, 111, 74, 0.12); color: var(--accent); }
.feature-icon-search { background: rgba(45, 106, 90, 0.12); color: var(--teal); }
.feature-icon-delete { background: rgba(180, 60, 60, 0.1); color: #b43c3c; }

.feature-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feature-desc {
  font-size: 0.9rem;
  color: var(--ink-muted);
  line-height: 1.55;
}

/* ── Preview ───────────────────────────────────────────────── */
.preview {
  padding: clamp(4rem, 8vw, 6rem) 0;
}

.preview-inner {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.preview-list {
  list-style: none;
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.preview-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--ink-muted);
}

.preview-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
}

.preview-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.preview-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.preview-search svg {
  flex-shrink: 0;
  color: var(--ink-faint);
}

.preview-add-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  background: var(--teal);
  color: #fff;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.55;
  cursor: not-allowed;
}

.preview-contacts {
  padding: 0.5rem;
}

.preview-contact {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
  cursor: default;
}

.preview-contact:hover {
  background: var(--teal-soft);
}

.preview-contact-active {
  background: var(--teal-soft);
  border-left: 3px solid var(--teal);
}

.preview-avatar {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: hsl(var(--hue, 160) 35% 88%);
  color: hsl(var(--hue, 160) 40% 32%);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-contact-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.preview-contact-info strong {
  font-size: 0.95rem;
  font-weight: 600;
}

.preview-contact-info span {
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.preview-address {
  color: var(--ink-faint) !important;
  font-size: 0.78rem !important;
}

/* ── CTA ───────────────────────────────────────────────────── */
.cta {
  padding: 0 0 clamp(4rem, 8vw, 6rem);
}

.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(2.5rem, 5vw, 3.5rem);
  background: var(--bg-deep);
  border-radius: var(--radius-lg);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.cta-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 90% 50%, rgba(201, 111, 74, 0.2), transparent 50%),
    radial-gradient(circle at 10% 80%, rgba(45, 106, 90, 0.25), transparent 40%);
  pointer-events: none;
}

.cta-content {
  position: relative;
}

.cta-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.cta-lead {
  color: rgba(255, 255, 255, 0.65);
  max-width: 40ch;
  position: relative;
}

.cta-inner .btn {
  position: relative;
  flex-shrink: 0;
}

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-brand .logo-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-top: 0.25rem;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--ink-faint);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 960px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-grid,
  .preview-inner {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    order: -1;
    min-height: 340px;
  }

  .card-stack {
    transform: scale(0.9);
  }
}

@media (max-width: 640px) {
  .nav {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .stat-divider {
    display: none;
  }

  .stat {
    flex: 1 1 40%;
  }

  .cta-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .contact-card {
    animation: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}
