/* My Grandstream Phonebook — rebuilt stylesheet */

:root {
  --ink: #14202c;
  --ink-2: #1d2d3d;
  --text: #2a3a4a;
  --muted: #627284;
  --line: #e3e8ee;
  --bg: #ffffff;
  --bg-alt: #f5f8fa;

  --teal: #0eb3ce;
  --teal-dark: #0a8fa6;
  --green: #84e482;
  --mint: #02c6a4;
  --coral: #f26b5b;

  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(20, 32, 44, .06), 0 2px 6px rgba(20, 32, 44, .05);
  --shadow: 0 10px 30px -10px rgba(20, 32, 44, .18), 0 2px 6px rgba(20, 32, 44, .05);
  --shadow-lg: 0 30px 60px -20px rgba(20, 32, 44, .35);

  --container: 1120px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; height: auto; }

h1, h2, h3 { color: var(--ink); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2.25rem, 5vw + .5rem, 3.75rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 2.5vw + .75rem, 2.5rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: var(--teal-dark); }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--muted); }

.skip-link {
  position: absolute; left: 12px; top: -40px; z-index: 100;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 6px; }

/* Buttons */
.btn {
  --b: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: inherit; font-weight: 700; font-size: 1rem; line-height: 1;
  padding: .9em 1.4em; border-radius: 999px; border: 2px solid var(--b);
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { cursor: not-allowed; opacity: .55; }
.btn-sm { font-size: .9rem; padding: .65em 1.15em; }
.btn-lg { font-size: 1.05rem; padding: 1em 1.6em; }
.btn-block { width: 100%; }

.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 8px 20px -8px rgba(14, 179, 206, .7); }
.btn-primary:hover:not(:disabled) { background: var(--teal-dark); }
.btn-ghost { --b: rgba(255, 255, 255, .3); color: #fff; background: transparent; }
.btn-ghost:hover { --b: rgba(255, 255, 255, .7); }
.btn-outline { --b: var(--line); color: var(--ink); background: #fff; }
.btn-outline:hover:not(:disabled) { --b: var(--teal); color: var(--teal-dark); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(20, 32, 44, .85);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  transition: box-shadow .2s ease;
}
.site-header.is-scrolled { box-shadow: 0 6px 20px -10px rgba(0, 0, 0, .5); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; letter-spacing: -.01em; }
.brand img { width: 36px; height: 36px; }
.header-links { display: flex; align-items: center; gap: 20px; }
.header-links .link { color: rgba(255, 255, 255, .85); text-decoration: none; font-weight: 600; font-size: .95rem; }
.header-links .link:hover { color: #fff; }

@media (max-width: 540px) {
  .brand span { display: none; }
}

/* Hero */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 500px at 85% 10%, rgba(14, 179, 206, .28), transparent 60%),
    radial-gradient(700px 400px at 0% 100%, rgba(132, 228, 130, .14), transparent 60%),
    var(--ink);
  color: rgba(255, 255, 255, .82);
  padding: clamp(56px, 9vw, 110px) 0 0;
  margin-top: -68px; padding-top: calc(clamp(56px, 9vw, 110px) + 68px);
}
.hero h1 { color: #fff; }
.hero-grid { display: grid; gap: 48px; align-items: center; grid-template-columns: 1.05fr .95fr; }
.eyebrow {
  display: inline-block; margin-bottom: 18px;
  font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--green);
}
.lead { font-size: clamp(1.05rem, .6vw + .95rem, 1.25rem); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.hero-media {
  margin: 0; background: #fff; border-radius: var(--radius-lg);
  padding: clamp(16px, 3vw, 32px);
  box-shadow: var(--shadow-lg);
  transform: rotate(-1.5deg);
}
.hero-media img { width: 100%; }

.compat {
  position: relative; z-index: 1;
  margin: clamp(48px, 7vw, 80px) 0 -1px;
  background: #fff; color: var(--text);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 32px clamp(20px, 4vw, 48px) 8px;
  text-align: center;
}
.compat p { max-width: 760px; margin-inline: auto; }
.models { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.models b {
  font-size: .85rem; font-weight: 700; color: var(--ink);
  background: var(--bg-alt); border: 1px solid var(--line);
  padding: 4px 10px; border-radius: 999px;
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .lead { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-media { max-width: 520px; margin-inline: auto; transform: none; }
}

/* Sections */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-tight { padding-bottom: 0; }
.section-alt { background: var(--bg-alt); }
.section-title { text-align: center; margin-bottom: .6em; }
.section-header { text-align: center; max-width: 680px; margin: 0 auto 48px; }
.section-header p { color: var(--muted); font-size: 1.1rem; }

/* Features */
.feature-grid { display: grid; gap: 20px; grid-template-columns: repeat(4, 1fr); margin-top: 40px; }
@media (max-width: 960px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .feature-grid { grid-template-columns: 1fr; } }
.feature {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease;
}
.feature:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.feature-icon {
  width: 64px; height: 64px; display: grid; place-items: center;
  background: var(--bg-alt); border-radius: 16px; margin-bottom: 20px;
}
.feature p { color: var(--muted); margin: 0; font-size: .98rem; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; grid-template-columns: repeat(3, 1fr); counter-reset: none; }
.step {
  position: relative; background: #fff; border-radius: var(--radius);
  padding: 32px 28px 28px; box-shadow: var(--shadow-sm); border: 1px solid var(--line);
}
.step-num {
  display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 20px;
  border-radius: 12px; font-weight: 800; font-size: 1.15rem; color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--mint));
  box-shadow: 0 8px 18px -8px rgba(14, 179, 206, .8);
}
.step p { color: var(--muted); margin: 0; font-size: .98rem; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; } }

/* Pricing */
.pricing-grid {
  display: grid; gap: 24px; align-items: stretch;
  grid-template-columns: repeat(3, 1fr); margin-top: 48px;
}
.plan {
  position: relative; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 32px 28px; box-shadow: var(--shadow-sm);
}
.plan-name { font-size: 1.1rem; margin-bottom: 12px; }
.plan-price { font-size: 3rem; font-weight: 800; color: var(--ink); line-height: 1; letter-spacing: -.03em; margin-bottom: 8px; }
.plan-price .cur { font-size: 1.5rem; vertical-align: .9em; margin-right: 2px; }
.plan-price small { font-size: 1rem; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.plan-tag { color: var(--muted); font-size: .95rem; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.plan-features { list-style: none; padding: 0; margin: 4px 0 28px; flex: 1; }
.plan-features li { position: relative; padding: 8px 0 8px 30px; font-size: .98rem; }
.plan-features li::before {
  content: ""; position: absolute; left: 0; top: 12px; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(2, 198, 164, .14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 16 12'%3E%3Cpath d='M14.3.3L5 9.6 1.7 6.3c-.4-.4-1-.4-1.4 0-.4.4-.4 1 0 1.4l4 4c.2.2.4.3.7.3.3 0 .5-.1.7-.3l10-10c.4-.4.4-1 0-1.4-.4-.4-1-.4-1.4 0z' fill='%2300a88c'/%3E%3C/svg%3E") center / 10px no-repeat;
}

.plan-featured {
  border: 2px solid var(--teal);
  box-shadow: 0 24px 50px -20px rgba(14, 179, 206, .45);
}
.plan-badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--teal); color: #fff; font-size: .75rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}
.plan-soon { background: var(--bg-alt); }

.error { text-align: center; color: var(--coral); font-weight: 600; margin-top: 24px; min-height: 1em; }

@media (max-width: 960px) {
  .pricing-grid { grid-template-columns: 1fr; max-width: 440px; margin-inline: auto; }
  .plan-featured { order: -1; }
}

/* Footer */
.site-footer { background: var(--ink); color: rgba(255, 255, 255, .65); padding: 40px 0; font-size: .92rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.site-footer .brand img { width: 28px; height: 28px; }
.footer-meta { text-align: right; }
.footer-meta p { margin: 0; }
.footer-meta p + p { margin-top: 4px; }
.site-footer a:not(.brand) { color: #fff; }
@media (max-width: 640px) {
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-meta { text-align: center; }
}

/* Reveal animation (only active when JS adds .js-reveal) */
.js-reveal .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }
.js-reveal .hero-media.reveal { transform: translateY(18px) rotate(-1.5deg); }
.js-reveal .reveal.is-visible { opacity: 1; transform: none; }
.js-reveal .hero-media.reveal.is-visible { transform: rotate(-1.5deg); }
@media (max-width: 860px) {
  .js-reveal .hero-media.reveal.is-visible { transform: none; }
}
