/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --ink: #0f172a;
  --ink-soft: #475569;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --surface: #ffffff;

  --indigo: #4f46e5;
  --indigo-dark: #4338ca;

  --radius-sm: 8px;
  --radius-md: 12px;

  --shadow-card: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 28px -16px rgba(15, 23, 42, .18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a { color: inherit; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .08em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: .5rem;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 0;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(-100%);
  z-index: 2000;
  background: var(--indigo);
  color: #fff;
  padding: .75rem 1.25rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Focus visibility for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

/* ==========================================================================
   Site header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(248, 250, 252, .85);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1rem;
}

.brand {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -.02em;
  text-decoration: none;
}

.brand__accent { color: var(--indigo); }

.site-nav {
  gap: 1.75rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: .93rem;
}

.site-nav a:hover { color: var(--ink); }

.site-header__cta {
  border-radius: var(--radius-sm);
  font-weight: 600;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding: 5.5rem 0 4.5rem;
  text-align: center;
}

.hero__inner {
  max-width: 760px;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.hero .eyebrow { display: flex; justify-content: center; }

.hero__title {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.hero__subtitle {
  font-size: 1.08rem;
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 560px;
  margin: 0 auto 2rem;
}

.hero__cta {
  background: var(--indigo);
  border-color: var(--indigo);
  border-radius: var(--radius-sm);
  padding: .75rem 1.75rem;
  font-weight: 600;
}

.hero__cta:hover,
.hero__cta:focus {
  background: var(--indigo-dark);
  border-color: var(--indigo-dark);
}

/* ==========================================================================
   How it works
   ========================================================================== */
.how-it-works {
  padding: 3rem 0 5rem;
  text-align: center;
}

.how-it-works__grid {
  margin-top: 2.5rem;
  row-gap: 1.75rem;
}

.how-step {
  position: relative;
  text-align: left;
  padding: 0 .5rem;
}

.how-step__card {
  position: relative;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.5rem;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.how-step__card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
  border-color: #c7d2fe;
}

.how-step__index {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .78rem;
  color: #cbd5e1;
}

.how-step__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: #eef2ff;
  color: var(--indigo);
  margin-bottom: 1.1rem;
}

.how-step h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: .4rem;
}

.how-step p {
  color: var(--ink-soft);
  font-size: .95rem;
  line-height: 1.55;
  margin-bottom: 0;
}

/* ==========================================================================
   Templates section
   ========================================================================== */
.templates {
  padding: 1rem 0 6rem;
  text-align: center;
}

.templates__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
  margin-bottom: 2.5rem;
}

.templates__hint {
  max-width: 340px;
  color: var(--ink-soft);
  font-size: .95rem;
  margin-bottom: 0;
}

.templates__grid {
  row-gap: 1.5rem;
}

.template-card {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 0;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.template-card:hover,
.template-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
  border-color: #c7d2fe;
}

.template-card__preview {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1.5rem 1.35rem;
  min-height: 230px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.template-card__preview::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
}

.template-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .9rem 1.35rem;
}

.template-card__meta {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-width: 0;
}

.template-card__meta strong {
  font-size: .95rem;
  font-weight: 700;
}

.template-card__desc {
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.4;
}

.template-card__cta {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  flex-shrink: 0;
  font-size: .82rem;
  font-weight: 600;
  color: var(--indigo);
}

.template-card__cta svg {
  transition: transform .15s ease;
}

.template-card:hover .template-card__cta svg,
.template-card:focus-visible .template-card__cta svg {
  transform: translateX(3px);
}

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

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.5rem;
}

.site-footer__brand-group {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .5rem .75rem;
}

.site-footer__brand {
  font-size: 1rem;
}

.site-footer__version {
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .2rem .65rem;
}

.site-footer__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
}

/* Once the brand group and badges no longer fit on one line, stack and
   center both instead of leaving them ragged-left on their own lines. */
@media (max-width: 991.98px) {
  .site-footer__inner {
    justify-content: center;
    text-align: center;
  }

  .site-footer__brand-group,
  .site-footer__badges {
    justify-content: center;
    width: 100%;
  }

  .site-footer__brand-group {
    flex-direction: column;
    align-items: center;
    gap: .2rem;
  }
}

.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .35rem .75rem .35rem .65rem;
}

.footer-badge svg {
  flex-shrink: 0;
  color: #22c55e;
}
