/* ─────────────────────────────────────────────────────────────────────────
   www.codenc.io — marketing site stylesheet
   Plain CSS, no build step. Mirrors the brand palette in
   web/src/index.css and docs/brand.md verbatim. Three colors total:
   charcoal #1a1a1a, terracotta #b8541f, white #ffffff.
   ───────────────────────────────────────────────────────────────────── */

:root {
  --charcoal: #1a1a1a;
  --terracotta: #b8541f;
  --terracotta-50: #fdf5ee;
  --terracotta-100: #fae5d3;
  --terracotta-700: #96441b;
  --white: #ffffff;

  /* Neutral gray scale, anchored on charcoal at 900. Pure neutral, no tint. */
  --gray-50: #fafafa;
  --gray-100: #f4f4f4;
  --gray-200: #e5e5e5;
  --gray-300: #d4d4d4;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 0.625rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;

  --measure: 65ch;
  --container: 1100px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--charcoal);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ─── Layout ─────────────────────────────────────────────────────────── */

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

main { padding-block: clamp(2rem, 6vw, 5rem); }

section { padding-block: clamp(2rem, 5vw, 4rem); }

section.hero { padding-block: clamp(3rem, 8vw, 6rem); }

/* ─── Typography ─────────────────────────────────────────────────────── */

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.6em;
  max-width: var(--measure);
}

h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem); }
h3 { font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem); }

p { margin: 0 0 1em; max-width: var(--measure); }

p.lead { font-size: clamp(1.125rem, 1rem + 0.6vw, 1.375rem); color: var(--gray-700); }

a { color: var(--terracotta); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

ul.bare { list-style: none; padding: 0; margin: 0; }

.muted { color: var(--gray-600); }
.tiny  { font-size: 0.875rem; }

/* ─── Header / Nav ───────────────────────────────────────────────────── */

header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--gray-200);
}

header.site .container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-block: 1rem;
}

header.site .brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--charcoal);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

header.site .brand:hover { text-decoration: none; }

header.site nav { margin-left: auto; display: flex; gap: 1.25rem; align-items: center; }

header.site nav a {
  color: var(--gray-700);
  font-weight: 500;
  font-size: 0.95rem;
}
header.site nav a:hover { color: var(--charcoal); text-decoration: none; }
header.site nav a.active { color: var(--charcoal); }

/* On phones, hide secondary links; CTAs stay. */
@media (max-width: 600px) {
  header.site nav .secondary { display: none; }
}

/* ─── Logo (CSS-rendered placeholder) ────────────────────────────────── */
/* The 3×3 grid: 8 terracotta dots + 1 charcoal square in the center.
   Replace with the official SVG when CodeMushroom delivers it. */

.logo-mark {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 18%;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
}
.logo-mark.lg { width: 4.5rem; height: 4.5rem; gap: 16%; }
.logo-mark .dot { background: var(--terracotta); border-radius: 50%; }
.logo-mark .square { background: var(--charcoal); border-radius: 8%; }

.wordmark {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--charcoal);
}
.wordmark .dot { color: var(--terracotta); }

/* ─── Beta badge ─────────────────────────────────────────────────────── */

.beta {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  background: var(--terracotta-100);
  color: var(--terracotta-700);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25em 0.6em;
  border-radius: var(--radius-full);
  vertical-align: middle;
  white-space: nowrap;
}

/* ─── Buttons ────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0.75em 1.25em;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background-color 200ms, color 200ms, border-color 200ms;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }

.btn.primary {
  background: var(--terracotta);
  color: var(--white);
}
.btn.primary:hover { background: var(--terracotta-700); }

.btn.secondary {
  background: var(--white);
  color: var(--charcoal);
  border-color: var(--gray-300);
}
.btn.secondary:hover { border-color: var(--charcoal); }

.btn.ghost {
  background: transparent;
  color: var(--charcoal);
}
.btn.ghost:hover { background: var(--gray-100); }

.btn.lg { font-size: 1rem; padding: 0.95em 1.5em; }

/* ─── Hero ───────────────────────────────────────────────────────────── */

.hero { text-align: center; }
.hero .container { max-width: 800px; }
.hero .hero-wordmark {
  /* Match the hero h1 — same clamp, same line-height, same letter-spacing.
     Weight stays 700 (h1 is 600) so the wordmark reads slightly heavier. */
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 auto 1.5rem;
}
.hero .logo-mark { margin: 0 auto 1.75rem; }
.hero h1 { margin: 0 auto 0.75rem; }
.hero .hero-beta { margin: 0 auto 1.25rem; }
.hero p.lead { margin-inline: auto; }
.hero .actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

/* ─── Cards / feature tiles ──────────────────────────────────────────── */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.tile {
  padding: 1.5rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: var(--white);
}
.tile h3 { margin-bottom: 0.4em; }
.tile p { margin: 0; color: var(--gray-700); font-size: 0.95rem; }

/* Icon badge — used both in home-page tiles and on the longer-form
   features page above each feature-block heading. Soft terracotta
   square; emoji or inline svg lives inside. */
.icon-tag {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius);
  background: var(--terracotta-50);
  color: var(--terracotta);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

/* CodeMushroom credit on the about page — image hosted at the canonical
   www.codemushroom.com S3 bucket so any logo update there propagates
   here automatically. Cap the height so wide images don't dominate. */
.codemushroom-logo {
  max-height: 56px;
  width: auto;
  display: inline-block;
  opacity: 0.92;
}
.codemushroom-logo:hover { opacity: 1; }

/* ─── Feature list (longer-form on /features) ────────────────────────── */

.feature-block { padding-block: 1.25rem; border-top: 1px solid var(--gray-200); }
.feature-block:first-of-type { border-top: 0; }
.feature-block h3 { color: var(--charcoal); }
.feature-block ul { padding-left: 1.25rem; color: var(--gray-700); }
.feature-block li { margin-bottom: 0.4em; }

/* ─── Footer ─────────────────────────────────────────────────────────── */

footer.site {
  border-top: 1px solid var(--gray-200);
  padding-block: 2.5rem;
  margin-top: 4rem;
  font-size: 0.9rem;
  color: var(--gray-600);
}
footer.site .container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: flex-start;
}
footer.site .col { min-width: 12rem; }
footer.site h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--charcoal);
  margin: 0 0 0.6em;
}
footer.site a { color: var(--gray-700); }
footer.site a:hover { color: var(--charcoal); text-decoration: underline; }

/* ─── Reduced motion ─────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* ─── Focus ring ─────────────────────────────────────────────────────── */

*:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
  border-radius: 4px;
}
