/* ==========================================================================
   karvel — design tokens
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,500&family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --bg:        #0e0d0b;
  --bg-alt:    #17150f;
  --bg-raised: #1e1b13;
  --line:      #35301f;
  --line-soft: #221f16;
  --fg:        #f3ede2;
  --fg-dim:    #a39885;
  --fg-faint:  #6e6551;
  --accent:    #ff5a1f;
  --accent-dim:#7a3419;
  --teal:      #4fd1c5;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'IBM Plex Sans', -apple-system, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, monospace;

  --container: 1120px;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--grain);
  pointer-events: none;
  z-index: 999;
  mix-blend-mode: overlay;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

/* Graph-paper backdrop used behind the hero -------------------------------- */
.grid-field {
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center -1px;
}

/* Nav ----------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(14, 13, 11, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
}

.brand .dot { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-dim);
  position: relative;
  padding-bottom: 4px;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--fg); }

.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 8px 12px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Hero ----------------------------------------------------------------------- */
.hero {
  padding: 96px 0 88px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
}

.hero-tag {
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  opacity: 0;
  animation: rise 0.7s ease 0.05s forwards;
}

.hero-tag::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--teal);
  display: inline-block;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(79,209,197,0.15);
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 5rem);
  max-width: 15ch;
  opacity: 0;
  animation: rise 0.8s ease 0.15s forwards;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  margin-top: 28px;
  max-width: 52ch;
  color: var(--fg-dim);
  font-size: 1.08rem;
  opacity: 0;
  animation: rise 0.8s ease 0.3s forwards;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 44px;
  opacity: 0;
  animation: rise 0.8s ease 0.42s forwards;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Buttons --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  transition: all 0.25s ease;
}

.btn-solid {
  background: var(--accent);
  border-color: var(--accent);
  color: #150c07;
  font-weight: 500;
}
.btn-solid:hover { background: #ff7440; border-color: #ff7440; }

.btn-ghost { color: var(--fg); }
.btn-ghost:hover { border-color: var(--fg); background: var(--bg-raised); }

/* Section scaffolding ----------------------------------------------------------- */
section { padding: 84px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }

.eyebrow {
  color: var(--fg-faint);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--fg-faint); }

.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); max-width: 20ch; }
.section-head p { color: var(--fg-dim); max-width: 34ch; margin: 0; }

/* Product/pillar cards ------------------------------------------------------------ */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); }
.card {
  background: var(--bg);
  padding: 40px 32px;
  position: relative;
  transition: background 0.25s ease;
}
.card:hover { background: var(--bg-alt); }
.card .num { font-family: var(--font-mono); color: var(--accent); font-size: 0.78rem; }
.card h3 { font-size: 1.3rem; margin: 18px 0 14px; }
.card p { color: var(--fg-dim); margin: 0; font-size: 0.95rem; }

/* Principles list ---------------------------------------------------------------- */
.principles { border-top: 1px solid var(--line-soft); }
.principle {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 32px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: baseline;
}
.principle .idx { font-family: var(--font-mono); color: var(--fg-faint); font-size: 0.85rem; }
.principle h3 { font-size: 1.15rem; margin-bottom: 8px; }
.principle p { color: var(--fg-dim); margin: 0; max-width: 60ch; }

/* Stat strip ----------------------------------------------------------------------- */
.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.stat .val { font-family: var(--font-display); font-size: 2.6rem; color: var(--accent); }
.stat .label { font-family: var(--font-mono); font-size: 0.75rem; color: var(--fg-faint); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 6px; }

/* CTA band --------------------------------------------------------------------------- */
.cta-band {
  text-align: center;
  padding: 96px 0;
}
.cta-band h2 { font-size: clamp(2rem, 4vw, 3rem); max-width: 18ch; margin: 0 auto 32px; }

/* Footer ---------------------------------------------------------------------------- */
footer {
  border-top: 1px solid var(--line-soft);
  padding: 56px 0 40px;
  background: var(--bg-alt);
}
.footer-row { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-col h4 { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-faint); margin-bottom: 16px; }
.footer-col a, .footer-col p { display: block; color: var(--fg-dim); margin-bottom: 10px; font-size: 0.92rem; }
.footer-col a:hover { color: var(--fg); }
.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  color: var(--fg-faint);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-wrap: wrap;
  gap: 12px;
}

/* Inner pages (about/privacy/terms/contact) ------------------------------------------- */
.page-hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--line-soft);
}
.page-hero h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); }
.page-hero p { color: var(--fg-dim); max-width: 56ch; margin-top: 20px; font-size: 1.05rem; }

.prose { max-width: 72ch; }
.prose h2 { font-size: 1.4rem; margin: 48px 0 16px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--fg-dim); font-size: 0.98rem; }
.prose ul { padding-left: 20px; }
.prose strong { color: var(--fg); }
.prose .updated { font-family: var(--font-mono); font-size: 0.75rem; color: var(--fg-faint); text-transform: uppercase; letter-spacing: 0.05em; }

.contact-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 64px; }
.contact-card {
  border: 1px solid var(--line);
  padding: 32px;
  background: var(--bg-alt);
}
.contact-card .num { font-family: var(--font-mono); color: var(--accent); font-size: 0.78rem; display: block; margin-bottom: 14px; }
.contact-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.contact-card p { color: var(--fg-dim); margin: 0 0 4px; }
.contact-card + .contact-card { margin-top: 1px; }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }

/* Responsive --------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-block; }
  .grid-3 { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: 1fr; gap: 28px; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .contact-grid, .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .principle { grid-template-columns: 1fr; gap: 8px; }
  .footer-row { flex-direction: column; gap: 32px; }
}
