/* Diwan marketing site — tokens + shared styles. English-only. */

:root {
  --surface:          #F4EDDD;
  --surface-soft:     #FAF5E8;
  --surface-deep:     #E8DEC4;
  --surface-raised:   #FFFFFF;
  --surface-inverted: #0B1E3B;

  --ink:          #0B1E3B;
  --ink-soft:     #2A3A53;
  --ink-muted:    #5A6579;
  --ink-inverted: #F4EDDD;

  --rule:          #E8E2D4;
  --rule-strong:   #D4CBB8;

  --brand:       #0B1E3B;
  --accent:      #C9A349;
  --accent-fg:   #0B1E3B;
  --teal:        #2A6F7B;
  --oud:         #3E2A1F;

  --danger:  #B3422E;
  --ok:      #2E7D5F;

  --shadow-1: 0 1px 2px 0 rgba(11, 30, 59, 0.06);
  --shadow-2: 0 4px 12px -2px rgba(11, 30, 59, 0.08), 0 2px 4px rgba(11, 30, 59, 0.04);
  --shadow-3: 0 12px 32px -8px rgba(11, 30, 59, 0.16), 0 4px 8px rgba(11, 30, 59, 0.04);

  --ease:     cubic-bezier(0.2, 0.8, 0.2, 1);
  --duration: 180ms;

  --font-serif: "Fraunces", "GT Sectra", "Tiempos Headline", Georgia, serif;
  --font-sans:  "Inter", "Söhne", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--teal); text-decoration: none; transition: color var(--duration) var(--ease); }
a:hover { color: #1B565F; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-serif);
  letter-spacing: -0.01em;
  margin: 0 0 0.4em;
  color: var(--ink);
  font-weight: 600;
}

h1 { font-size: clamp(2.25rem, 4.5vw + 0.5rem, 4.5rem); line-height: 1.05; font-weight: 500; }
h2 { font-size: clamp(1.75rem, 2.5vw + 0.5rem, 2.75rem); line-height: 1.1; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; color: var(--ink-soft); max-width: 65ch; }

code, pre, .mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; }

/* Layout primitives */
.container { max-width: 1200px; margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2.5rem); }
.narrow    { max-width: 860px; margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2.5rem); }
.section   { padding: clamp(4rem, 10vh, 8rem) 0; position: relative; scroll-margin-top: 80px; }
.section-rule { border-top: 1px solid var(--rule); }

.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.lead {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 58ch;
}

/* ─── Top nav with scroll shadow + scrollspy ─────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.nav.scrolled {
  border-bottom-color: var(--rule);
  box-shadow: 0 1px 0 0 rgba(11, 30, 59, 0.04);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 64px;
}
.nav a {
  color: var(--ink-soft);
  font-size: 0.9rem;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
  position: relative;
}
.nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 4%, transparent); }
.nav a.active { color: var(--ink); }
.nav a.active::after {
  content: "";
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.04em;
}
.nav-brand:hover { color: var(--ink); }
.nav-links { display: flex; gap: 0.15rem; align-items: center; }
.nav-cta { background: var(--ink); color: var(--ink-inverted) !important; padding: 0.45rem 0.9rem; }
.nav-cta:hover { background: var(--ink-soft); color: var(--ink-inverted) !important; }
@media (max-width: 820px) { .nav-links > a:not(.nav-cta) { display: none; } }

/* Scroll progress */
.scrollbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  z-index: 30;
}
.scrollbar > span {
  display: block; height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 120ms var(--ease);
}

/* Back-to-top button */
.to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ink-inverted);
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-2);
  transition: transform var(--duration) var(--ease), opacity var(--duration) var(--ease);
  cursor: pointer;
  border: 0;
  z-index: 25;
}
.to-top.show { display: flex; animation: fade-in 200ms var(--ease); }
.to-top:hover { transform: translateY(-2px); }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 44px;
  padding: 0 1.1rem;
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background var(--duration) var(--ease), opacity var(--duration), transform var(--duration);
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--ink);
  color: var(--ink-inverted);
  box-shadow: var(--shadow-1);
}
.btn-primary:hover { color: var(--ink-inverted); background: var(--ink-soft); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}
.btn-ghost:hover { background: var(--surface-soft); color: var(--ink); }

/* Cards */
.card {
  background: var(--surface-raised);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-1);
  transition: transform var(--duration), box-shadow var(--duration);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }

/* Grid helpers */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Decorative motif */
.motif {
  position: absolute;
  opacity: 0.32;
  pointer-events: none;
  color: var(--rule-strong);
}
.motif-tr { top: -120px; right: -120px; width: 520px; height: 520px; }
.motif-bl { bottom: -140px; left: -140px; width: 480px; height: 480px; }

.divider {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rule-strong), transparent);
  position: relative;
  margin: 3rem auto;
  max-width: 360px;
}
.divider::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 6px;
  height: 6px;
  background: var(--accent);
}

/* Parchment texture */
.parchment::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--surface-deep) 50%, transparent) 0, transparent 40%),
    radial-gradient(circle at 80% 80%, color-mix(in srgb, var(--surface-deep) 35%, transparent) 0, transparent 40%);
  pointer-events: none;
  z-index: 0;
}
.parchment > * { position: relative; z-index: 1; }

/* Pillars */
.pillar { padding: 1.5rem 0; border-top: 1px solid var(--rule); }
.pillar h3 { font-family: var(--font-serif); font-size: 1.35rem; }
.pillar p { margin-top: 0.55rem; color: var(--ink-soft); }

/* Module row */
.module-row {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 1.2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
  align-items: baseline;
}
.module-row .name { font-family: var(--font-serif); font-weight: 600; }
.module-row .desc { color: var(--ink-soft); font-size: 0.95rem; }
@media (max-width: 600px) { .module-row { grid-template-columns: 1fr; gap: 0.25rem; } }

/* Reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

/* Footer */
footer {
  padding: 3rem 0 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.hero {
  position: relative;
  padding: clamp(4rem, 12vh, 10rem) 0 clamp(3rem, 8vh, 6rem);
  overflow: hidden;
}
.hero .cta-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}
