/* ============================================================
   DokoDocs — Brand stylesheet
   Palette & type per docs/BRAND.md (single source of truth).
   Teal #2E7D6B + Bamboo #D98F3D + neutrals. Low-weight, calm.
   ============================================================ */

:root {
  /* Brand colors (BRAND.md §2) */
  --teal: #2E7D6B;
  --teal-dark: #1F5A4C;
  --teal-light: #4E9E8A;
  --bamboo: #D98F3D;
  --ink: #1E2422;
  --muted: #6B7671;
  --surface: #F7F9F8;
  --surface-2: #EEF3F1;
  --white: #FFFFFF;
  --success: #3E8E5A;
  --error: #C1533F;
  --border: #E1E8E5;

  /* Typography — system default, low weight (BRAND.md §3) */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Noto Sans Devanagari", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;

  /* Spacing / layout */
  --maxw: 1120px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(30, 36, 34, 0.04), 0 8px 28px rgba(30, 36, 34, 0.06);
  --shadow-sm: 0 1px 2px rgba(30, 36, 34, 0.05), 0 2px 8px rgba(30, 36, 34, 0.05);
  --header-h: 68px;
}

/* ---------- Reset-ish ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img,
svg {
  max-width: 100%;
  display: block;
}
a {
  color: var(--teal-dark);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3,
h4 {
  font-weight: 500; /* nothing above w500 — BRAND.md §3 */
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 0.5em;
}
h1 {
  font-size: clamp(2rem, 5.2vw, 3.15rem);
}
h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
}
h3 {
  font-size: 1.2rem;
}
p {
  margin: 0 0 1rem;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.25rem;
}
.section {
  padding-block: clamp(3.5rem, 8vw, 6rem);
}
.section--tint {
  background: var(--white);
}
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.75rem;
}
.section-head {
  max-width: 640px;
  margin-bottom: 2.75rem;
}
.section-head.center {
  margin-inline: auto;
  text-align: center;
}
.lead {
  font-size: 1.12rem;
  color: var(--muted);
}
.text-mono {
  font-family: var(--font-mono);
}

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

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--teal);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 0;
  z-index: 1000;
}
.skip-link:focus {
  left: 0;
}

/* Focus visibility */
:focus-visible {
  outline: 3px solid var(--teal-light);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 500;
  font-size: 0.98rem;
  padding: 0.75rem 1.35rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease,
    border-color 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn--primary {
  background: var(--teal);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover {
  background: var(--teal-dark);
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}
.btn--ghost:hover {
  border-color: var(--teal-light);
  background: var(--white);
}
.btn--on-teal {
  background: #fff;
  color: var(--teal-dark);
}
.btn--on-teal:hover {
  background: var(--surface);
}
.btn svg {
  width: 18px;
  height: 18px;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(247, 249, 248, 0.82);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.site-header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 1px 0 rgba(30, 36, 34, 0.03);
}
.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.25rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
  font-size: 1.18rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.brand:hover {
  text-decoration: none;
}
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}
.brand .brand-doko {
  color: var(--teal);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  list-style: none;
  padding: 0;
  margin-block: 0;
}
.nav-links a {
  color: var(--ink);
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-links a:not(.btn):hover {
  text-decoration: none;
  background: var(--surface-2);
  color: var(--teal-dark);
}
.nav-links a.active:not(.btn) {
  color: var(--teal-dark);
  background: var(--surface-2);
}
.nav-cta {
  margin-left: 0.5rem;
}
.nav-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  color: var(--ink);
  align-items: center;
  justify-content: center;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3rem, 7vw, 5rem);
  background: linear-gradient(180deg, var(--surface) 0%, #eef4f2 100%);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%232E7D6B' stroke-width='2' opacity='0.06'%3E%3Cpath d='M-4 24 24 -4M-4 44 44 -4M16 44 44 16'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero .container {
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero h1 {
  margin-bottom: 0.65rem;
}
.hero .tagline-ne {
  font-size: 1.05rem;
  color: var(--teal-dark);
  margin-bottom: 1rem;
}
.hero-sub {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 34ch;
  margin-bottom: 1.75rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.hero-badges {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}
.hero-badges span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.hero-badges svg {
  width: 17px;
  height: 17px;
  color: var(--teal);
}
.hero-visual {
  position: relative;
}
.hero-visual img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* ---------- Feature cards ---------- */
.grid {
  display: grid;
  gap: 1.25rem;
}
.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: #d3ded9;
}
.card .icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(46, 125, 107, 0.1);
  color: var(--teal);
  margin-bottom: 1rem;
}
.card .icon svg {
  width: 24px;
  height: 24px;
}
.card h3 {
  margin-bottom: 0.35rem;
}
.card p {
  color: var(--muted);
  font-size: 0.96rem;
  margin: 0;
}

/* ---------- How it works ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  counter-reset: step;
}
.step {
  position: relative;
  padding: 1.5rem 1.25rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.step .num {
  counter-increment: step;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}
.step .num::before {
  content: counter(step);
}
.step h3 {
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}
.step p {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

/* ---------- Showcase (illustrations alternating) ---------- */
.showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.showcase:last-child {
  margin-bottom: 0;
}
.showcase.reverse .showcase-media {
  order: 2;
}
.showcase-media {
  background: linear-gradient(160deg, #ffffff, #eef4f2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: grid;
  place-items: center;
}
.showcase-media img {
  width: 100%;
  height: auto;
  max-height: 380px;
  object-fit: contain;
}
.showcase h3 {
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
}
.showcase ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.6rem;
}
.showcase li {
  position: relative;
  padding-left: 1.7rem;
  color: var(--ink);
}
.showcase li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 18px;
  height: 18px;
  background: no-repeat center/contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232E7D6B' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

/* ---------- Why / privacy band ---------- */
.band {
  background: var(--teal);
  color: #fff;
  border-radius: clamp(18px, 3vw, 28px);
  padding: clamp(2.5rem, 6vw, 4rem);
  position: relative;
  overflow: hidden;
}
.band::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='2' opacity='0.08'%3E%3Cpath d='M-4 24 24 -4M-4 44 44 -4M16 44 44 16'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.band > * {
  position: relative;
}
.band h2 {
  color: #fff;
  max-width: 20ch;
}
.band p {
  color: rgba(255, 255, 255, 0.9);
  max-width: 62ch;
  font-size: 1.08rem;
}
.band .btn--ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}
.band .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
}

/* ---------- Download section ---------- */
.download {
  text-align: center;
}
.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.75rem;
}
.store-badge {
  display: inline-flex;
  position: relative;
  border-radius: 9px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.store-badge img {
  height: 54px;
  width: auto;
}
a.store-badge:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.store-badge.disabled {
  cursor: default;
}
.store-badge .pill {
  position: absolute;
  top: -10px;
  right: -8px;
  background: var(--bamboo);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  text-transform: uppercase;
}
.download-note {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.notify {
  margin: 1.75rem auto 0;
  max-width: 460px;
  display: flex;
  gap: 0.6rem;
}
.notify input {
  flex: 1;
  font: inherit;
  padding: 0.7rem 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
}
.notify input:focus-visible {
  outline: 3px solid var(--teal-light);
  border-color: var(--teal);
}

/* ---------- Open source strip ---------- */
.os-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  text-align: center;
}
.os-stat {
  padding: 1.5rem 1rem;
}
.os-stat .k {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--teal-dark);
  display: block;
}
.os-stat .v {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #c9d1ce;
  padding-block: 3rem 2rem;
  margin-top: 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-brand .brand {
  color: #fff;
}
.footer-brand .brand .brand-doko {
  color: var(--teal-light);
}
.footer-brand p {
  color: #9aa5a1;
  font-size: 0.92rem;
  max-width: 34ch;
  margin-top: 0.85rem;
}
.footer-col h4 {
  color: #fff;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}
.footer-col a {
  color: #c9d1ce;
  font-size: 0.94rem;
}
.footer-col a:hover {
  color: #fff;
}
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  color: #9aa5a1;
  font-size: 0.88rem;
}
.footer-social {
  display: flex;
  gap: 0.6rem;
}
.footer-social a {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  color: #c9d1ce;
}
.footer-social a:hover {
  background: var(--teal);
  color: #fff;
}
.footer-social svg {
  width: 19px;
  height: 19px;
}

/* ---------- Legal / doc pages ---------- */
.doc {
  max-width: 760px;
  margin-inline: auto;
}
.doc h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
}
.doc .updated {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 2rem;
}
.doc h2 {
  font-size: 1.35rem;
  margin-top: 2.25rem;
}
.doc p,
.doc li {
  color: #303c39;
}
.doc ul {
  padding-left: 1.2rem;
}
.doc li {
  margin-bottom: 0.5rem;
}
.doc .callout {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}
.reveal.in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 820px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-sub {
    max-width: none;
  }
  .hero-actions,
  .hero-badges {
    justify-content: center;
  }
  .hero-visual {
    order: -1;
    max-width: 520px;
    margin-inline: auto;
  }
  .showcase,
  .showcase.reverse {
    grid-template-columns: 1fr;
  }
  .showcase.reverse .showcase-media {
    order: 0;
  }
  .showcase-text {
    order: 2;
  }

  /* mobile nav */
  .nav-toggle {
    display: inline-flex;
  }
  .nav-links {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.25rem 1.25rem;
    margin: 0;
    box-shadow: var(--shadow);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.2s ease, opacity 0.2s ease, visibility 0.2s;
  }
  .nav-links.open {
    transform: none;
    opacity: 1;
    visibility: visible;
  }
  .nav-links a {
    padding: 0.7rem 0.8rem;
  }
  .nav-cta {
    margin-left: 0;
    text-align: center;
  }
}
@media (max-width: 560px) {
  .grid-4,
  .steps,
  .grid-3,
  .grid-2,
  .os-strip {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .notify {
    flex-direction: column;
  }
}
