/* ──────────────────────────────────────────────
   DarojaAI — Site stylesheet
   Built on the brand system in DarojAI Brand Guide
────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold:  #E6B340;
  --red:   #B34A35;
  --azure: #3299BB;
  --green: #708238;
  --gray:  #636C70;
  --cream: #F5F0E8;
  --cream-2:#EDE6D8;
  --ink:   #1C1A16;
  --rule:  rgba(28,26,22,.10);
  --rule-2:rgba(28,26,22,.18);
  --muted: rgba(28,26,22,.55);

  --accent: var(--gold);

  --container: 1280px;
  --pad-x: clamp(24px, 5vw, 80px);
  --pad-y: clamp(72px, 9vw, 120px);

  --f-sans: 'Sora', sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* ── Themes ─────────────────────────────────── */
html[data-theme="ink"] {
  --cream: #1C1A16;
  --cream-2:#26231E;
  --ink:   #F5F0E8;
  --rule:  rgba(245,240,232,.10);
  --rule-2:rgba(245,240,232,.18);
  --muted: rgba(245,240,232,.55);
}
html[data-accent="azure"]  { --accent: var(--azure); }
html[data-accent="green"]  { --accent: var(--green); }
html[data-accent="red"]    { --accent: var(--red); }
html[data-accent="gold"]   { --accent: var(--gold); }

html { scroll-behavior: smooth; }
body {
  font-family: var(--f-sans);
  font-weight: 300;
  background: var(--cream);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Subtle grain on body */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 1; mix-blend-mode: multiply;
}
main, footer, nav { position: relative; z-index: 2; }

/* ── Type system ─────────────────────────────── */
.h1, h1 {
  font-family: var(--f-sans);
  font-weight: 200;
  font-size: clamp(48px, 7.5vw, 112px);
  line-height: .96;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.h2, h2 {
  font-family: var(--f-sans);
  font-weight: 200;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1.05;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.h3, h3 {
  font-family: var(--f-sans);
  font-weight: 300;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.2;
  letter-spacing: -.005em;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 500;
  opacity: .55;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.eyebrow.plain::before { display: none; }
.lede {
  font-size: clamp(17px, 1.6vw, 22px);
  line-height: 1.5;
  font-weight: 300;
  color: var(--muted);
  max-width: 60ch;
  text-wrap: pretty;
}
p { max-width: 64ch; text-wrap: pretty; }
.mono { font-family: var(--f-mono); font-feature-settings: "ss01"; }

a { color: inherit; }
a.link {
  text-decoration: none;
  border-bottom: 1px solid var(--rule-2);
  padding-bottom: 1px;
  transition: border-color .2s, color .2s;
}
a.link:hover { border-color: var(--accent); color: var(--ink); }

/* ── Layout primitives ───────────────────────── */
.wrap {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}
section {
  padding-block: var(--pad-y);
  border-bottom: 1px solid var(--rule);
}
section.tight { padding-block: clamp(56px, 7vw, 88px); }
section.flush { border-bottom: none; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 64px); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 24px); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(16px, 2vw, 24px); }
@media (max-width: 880px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.stack-6  { display: flex; flex-direction: column; gap: 6px; }
.stack-12 { display: flex; flex-direction: column; gap: 12px; }
.stack-20 { display: flex; flex-direction: column; gap: 20px; }
.stack-32 { display: flex; flex-direction: column; gap: 32px; }
.stack-48 { display: flex; flex-direction: column; gap: 48px; }
.row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

hr.rule { border: none; border-top: 1px solid var(--rule); margin-block: 56px; }

/* ── Buttons ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-family: var(--f-sans);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: .04em;
  text-decoration: none;
  border: 1px solid var(--rule-2);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: all .2s ease;
  border-radius: 0;
}
.btn:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}
.btn.primary {
  background: var(--red);
  color: var(--cream);
  border-color: var(--red);
}
.btn.primary:hover {
  background: color-mix(in oklab, var(--red) 80%, black);
  border-color: color-mix(in oklab, var(--red) 80%, black);
}
.btn.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}
.btn.accent:hover { transform: translateY(-1px); filter: brightness(.95); }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(3px); }

/* ── Nav ─────────────────────────────────────── */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center;
  padding: 0 var(--pad-x);
  height: 72px;
  background: color-mix(in oklab, var(--cream) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.site-nav .brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--ink);
  margin-right: auto;
}
.site-nav .brand img { width: 32px; height: 32px; display: block; object-fit: contain; }
.site-nav .brand .wm {
  font-family: var(--f-sans); font-weight: 200;
  font-size: 19px; letter-spacing: .005em;
}
.site-nav .links {
  display: flex; gap: 36px; align-items: center;
  margin-right: 28px;
}
.site-nav .links a {
  text-decoration: none; color: var(--ink);
  font-size: 13px; letter-spacing: .02em;
  opacity: .55; transition: opacity .2s;
  position: relative; padding: 24px 0;
}
.site-nav .links a:hover { opacity: 1; }
.site-nav .links a[aria-current="page"] {
  opacity: 1;
}
.site-nav .links a[aria-current="page"]::after {
  content: ''; position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px; background: var(--accent);
}
@media (max-width: 720px) {
  .site-nav .links { display: none; }
}

/* ── Footer ──────────────────────────────────── */
.site-footer {
  margin-top: 0;
}
.site-footer .color-strip {
  display: flex; height: 4px;
}
.site-footer .color-strip span { flex: 1; }
.site-footer .content {
  padding: 64px var(--pad-x) 36px;
  max-width: var(--container);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
}
@media (max-width: 880px) {
  .site-footer .content { grid-template-columns: 1fr 1fr; }
}
.site-footer .col h4 {
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  font-weight: 500; opacity: .5; margin-bottom: 18px;
}
.site-footer .col a {
  display: block; text-decoration: none; color: var(--ink);
  opacity: .72; font-size: 13px; margin-bottom: 10px;
  transition: opacity .2s;
}
.site-footer .col a:hover { opacity: 1; }
.site-footer .meta {
  padding: 24px var(--pad-x);
  max-width: var(--container); margin-inline: auto;
  border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between;
  font-size: 11px; opacity: .45; letter-spacing: .05em;
}
.site-footer .brand-foot {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--f-sans); font-weight: 200; font-size: 22px;
}
.site-footer .brand-foot img { width: 36px; height: 36px; object-fit: contain; }
.site-footer .tag { color: var(--muted); font-size: 13px; margin-top: 16px; max-width: 32ch; }

/* ── Cards ───────────────────────────────────── */
.card {
  background: color-mix(in oklab, var(--cream) 75%, white);
  border: 1px solid var(--rule);
  padding: 28px;
  transition: border-color .2s, transform .2s;
  position: relative;
  overflow: hidden;
}
.card:hover { border-color: var(--rule-2); }
.card .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  margin-bottom: 24px;
}
.card .num {
  font-family: var(--f-sans); font-weight: 200;
  font-size: 13px; letter-spacing: .14em;
  opacity: .42; margin-bottom: 18px;
  font-variant-numeric: tabular-nums;
}
html[data-theme="ink"] .card { background: #211E18; }

/* ── Placeholder media ───────────────────────── */
.media-slot {
  position: relative;
  background-color: var(--cream-2);
  background-image:
    repeating-linear-gradient(135deg,
      transparent 0 16px,
      rgba(28,26,22,.04) 16px 32px);
  border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: .14em; text-transform: uppercase;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.media-slot.tall    { aspect-ratio: 3 / 4; }
.media-slot.square  { aspect-ratio: 1; }
.media-slot.wide    { aspect-ratio: 16 / 9; }
.media-slot .label  { padding: 8px 12px; }
html[data-theme="ink"] .media-slot {
  background-color: #211E18;
  background-image: repeating-linear-gradient(135deg, transparent 0 16px, rgba(245,240,232,.04) 16px 32px);
}

/* ── Color tag ───────────────────────────────── */
.tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; opacity: .7;
}
.tag::before {
  content: '';
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}
.tag.gold::before  { background: var(--gold); }
.tag.azure::before { background: var(--azure); }
.tag.green::before { background: var(--green); }
.tag.red::before   { background: var(--red); }
.tag.gray::before  { background: var(--gray); }

/* ── Forms ───────────────────────────────────── */
.field {
  display: flex; flex-direction: column; gap: 6px;
}
.field label {
  font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; opacity: .55;
  font-weight: 500;
}
.field input, .field textarea, .field select {
  font: inherit;
  font-size: 15px;
  padding: 14px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule-2);
  color: var(--ink);
  outline: none;
  transition: border-color .2s;
  font-family: var(--f-sans);
  border-radius: 0;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-bottom-color: var(--accent);
}
.field textarea { resize: vertical; min-height: 96px; padding-block: 14px; }

/* ── Stat ────────────────────────────────────── */
.stat .n {
  font-family: var(--f-sans); font-weight: 200;
  font-size: clamp(48px, 6vw, 88px);
  line-height: 1; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.stat .n sup { font-size: .4em; opacity: .55; vertical-align: top; margin-left: 2px; font-weight: 300; }
.stat .l {
  font-size: 12px; letter-spacing: .12em;
  text-transform: uppercase; opacity: .55;
  margin-top: 12px;
}

/* ── Misc ────────────────────────────────────── */
.divider-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); display: inline-block;
}
.kbd {
  display: inline-block; font-family: var(--f-mono);
  font-size: 11px; padding: 2px 6px;
  border: 1px solid var(--rule-2);
  background: color-mix(in oklab, var(--cream) 60%, white);
}

/* Reveal anim — visible by default, animate from hidden only when motion is allowed */
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rise { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .rise   { animation: rise .7s cubic-bezier(.2,.7,.2,1) forwards; }
  .rise-1 { animation-delay: .05s; }
  .rise-2 { animation-delay: .12s; }
  .rise-3 { animation-delay: .2s; }
  .rise-4 { animation-delay: .28s; }
  .rise-5 { animation-delay: .36s; }
}
