/* ==========================================================================
   Code Hamlet LLC — Main Stylesheet
   ========================================================================== */

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

:root {
  --color-bg:        #ffffff;
  --color-surface:   #f5f7fa;
  --color-border:    #e2e8f0;
  --color-ink:       #1a202c;
  --color-muted:     #4a5568;
  --color-accent:    #1a202c;
  --color-accent-h:  #2d3748;
  --color-white:     #ffffff;
  --radius:          8px;
  --shadow-sm:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:       0 4px 12px rgba(0,0,0,.10);
  --font-sans:       'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --max-w:           1120px;
  --nav-h:           72px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-ink);
  background: var(--color-bg);
}

img { max-width: 100%; display: block; }
a   { color: inherit; }

/* ── Typography ────────────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: 1.25rem; }

p { color: var(--color-muted); }

/* ── Layout helpers ────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 24px;
}

.section {
  padding-block: 80px;
}

.section--alt {
  background: var(--color-surface);
}

/* ── Button ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
  border: none;
}

.btn--primary {
  background: var(--color-accent);
  color: var(--color-white);
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background: var(--color-accent-h);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn--outline {
  background: transparent;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
}

.btn--outline:hover {
  background: var(--color-accent);
  color: var(--color-white);
  transform: translateY(-1px);
}

/* ── Navigation ────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

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

.nav__logo {
  height: 56px;
  width: auto;
}

.nav__logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--color-ink);
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav__logo-text span.caret { color: #555; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav__links a {
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-muted);
  transition: color 0.15s;
}

.nav__links a:hover,
.nav__links a.active {
  color: var(--color-ink);
}

.nav__cta {
  padding: 8px 20px;
  font-size: 0.9rem;
}

/* Hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-ink);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

.nav__hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__hamburger.open span:nth-child(2) { opacity: 0; }
.nav__hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  padding-block: 100px 80px;
  text-align: center;
}

.hero__badge {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  margin-bottom: 24px;
}

.hero__title {
  max-width: 800px;
  margin-inline: auto;
  margin-bottom: 24px;
}

.hero__subtitle {
  font-size: 1.2rem;
  max-width: 560px;
  margin-inline: auto;
  margin-bottom: 40px;
}

.hero__actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero__logo {
  max-width: 500px;
  margin-inline: auto;
  margin-bottom: 48px;
}

/* ── Feature grid ──────────────────────────────────────────────────────── */
.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  margin-top: 56px;
}

.feature-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) * 1.5);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

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

.feature-card__icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.feature-card__title {
  margin-bottom: 10px;
  color: var(--color-ink);
}

/* ── Section headers ───────────────────────────────────────────────────── */
.section-header {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
}

.section-header p {
  margin-top: 12px;
  font-size: 1.1rem;
}

/* ── Services ──────────────────────────────────────────────────────────── */
.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 56px;
}

.service-item {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
}

.service-item__icon {
  font-size: 2.4rem;
  margin-bottom: 16px;
}

.service-item h3 {
  margin-bottom: 8px;
}

/* ── Values ────────────────────────────────────────────────────────────── */
.values__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-top: 56px;
  text-align: center;
}

.value-item__number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-ink);
  line-height: 1;
  margin-bottom: 6px;
}

.value-item__label {
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 6px;
}

/* ── CTA Banner ────────────────────────────────────────────────────────── */
.cta-banner {
  background: var(--color-ink);
  color: var(--color-white);
  text-align: center;
  padding-block: 72px;
}

.cta-banner h2 { color: var(--color-white); }
.cta-banner p  { color: rgba(255,255,255,.7); margin-top: 12px; font-size: 1.1rem; }

.cta-banner__actions {
  margin-top: 36px;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn--white {
  background: var(--color-white);
  color: var(--color-ink);
}

.btn--white:hover {
  background: #f0f0f0;
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--color-white);
  border: 2px solid rgba(255,255,255,.4);
}

.btn--ghost:hover {
  border-color: var(--color-white);
  background: rgba(255,255,255,.1);
}

/* ── Footer ────────────────────────────────────────────────────────────── */
.footer {
  background: #0d1117;
  color: rgba(255,255,255,.65);
  padding-block: 56px 32px;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.footer__brand p {
  margin-top: 12px;
  font-size: 0.9rem;
  line-height: 1.7;
  max-width: 300px;
  color: rgba(255,255,255,.5);
}

.footer__logo-text {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--color-white);
  text-decoration: none;
  letter-spacing: -0.03em;
}

.footer__heading {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,.4);
  margin-bottom: 16px;
}

.footer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer__links a {
  text-decoration: none;
  font-size: 0.9rem;
  color: rgba(255,255,255,.55);
  transition: color 0.15s;
}

.footer__links a:hover { color: var(--color-white); }

.footer__bottom {
  margin-top: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: rgba(255,255,255,.35);
}

.footer__bottom a {
  text-decoration: none;
  color: rgba(255,255,255,.45);
  transition: color 0.15s;
}

.footer__bottom a:hover { color: var(--color-white); }

/* ── Privacy / ToS page ────────────────────────────────────────────────── */
.page-hero {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding-block: 60px 48px;
  text-align: center;
}

.page-hero__eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 12px;
}

.page-hero h1 { margin-bottom: 16px; }

.page-hero p {
  max-width: 560px;
  margin-inline: auto;
  font-size: 1.05rem;
}

.doc-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: start;
  padding-block: 64px;
}

/* Sticky sidebar TOC */
.doc-toc {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}

.doc-toc__heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  margin-bottom: 12px;
}

.doc-toc__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.doc-toc__list a {
  text-decoration: none;
  font-size: 0.875rem;
  color: var(--color-muted);
  transition: color 0.15s;
  padding: 2px 0;
  display: block;
}

.doc-toc__list a:hover { color: var(--color-ink); }

/* Doc content */
.doc-content h2 {
  font-size: 1.5rem;
  margin-top: 56px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-border);
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.doc-content h2:first-of-type { margin-top: 0; }

.doc-content h3 {
  margin-top: 32px;
  margin-bottom: 10px;
}

.doc-content p,
.doc-content li {
  color: var(--color-muted);
  font-size: 0.975rem;
}

.doc-content p { margin-bottom: 14px; }

.doc-content ul,
.doc-content ol {
  padding-left: 24px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.doc-content strong { color: var(--color-ink); }

/* Highlighted compliance box */
.compliance-box {
  background: #f0f4ff;
  border: 2px solid #c7d7ff;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.compliance-box p {
  color: #1e3a8a;
  font-size: 0.95rem;
  margin-bottom: 0;
}

.compliance-box strong {
  color: #1e3a8a;
}

.updated-notice {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 8px;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer__brand {
    grid-column: 1 / -1;
  }

  .doc-layout {
    grid-template-columns: 1fr;
  }

  .doc-toc {
    position: static;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
  }
}

@media (max-width: 640px) {
  :root { --nav-h: 64px; }

  .section { padding-block: 56px; }

  .nav__links {
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--color-bg);
    padding: 24px;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    border-top: 1px solid var(--color-border);
    overflow-y: auto;
  }

  .nav__links.open {
    transform: translateX(0);
  }

  .nav__links li { width: 100%; }

  .nav__links a {
    display: block;
    padding: 14px 0;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--color-border);
  }

  .nav__hamburger { display: flex; }

  .hero { padding-block: 64px 48px; }

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

  .footer__bottom { flex-direction: column; align-items: flex-start; }
}
