/* =============================================================
   CREAVASH — Design System
   A corporate IT holding / management-consultancy identity.
   Warm ivory canvas, ink-black structural type, one copper accent.
   ============================================================= */

/* ---------- Self-hosted variable fonts (no external requests) ---------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../assets/fonts/Inter.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../assets/fonts/JetBrainsMono.woff2") format("woff2");
}
@font-face {
  font-family: "Libre Baskerville";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/LibreBaskerville.woff2") format("woff2");
}

:root {
  /* --- Palette --- */
  --ink:        #1A1714;   /* near-black warm ink   */
  --ivory:      #F5F1E9;   /* warm paper background  */
  --ivory-2:    #ECE6DA;   /* subtle surface         */
  --paper:      #FBF8F2;   /* card / raised surface  */
  --copper:      #B5651D;    /* large / decorative accent */
  --copper-deep:#8A4A12;    /* accent on hover */
  --copper-text:#7A3F0E;    /* AA-safe copper for small text (6.2:1 on ivory) */
  --sage:       #6B7B5E;   /* secondary muted accent */
  --muted:      #6E655C;   /* secondary text         */
  --line:       #DdCeB9;   /* hairlines / borders     */

  /* --- Type --- */
  --font-display: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --font-sans:    "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;

  /* --- Space --- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-10: 4rem;
  --space-12: 6rem;

  --radius: 4px;
  --shadow-sm: 0 1px 2px rgba(26,23,20,0.06);
  --shadow-md: 0 12px 32px -12px rgba(26,23,20,0.18);

  --maxw: 1200px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --container: min(var(--maxw), 100% - 2 * var(--gutter));
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--ink); text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ---------- Layout ---------- */
.container {
  width: var(--container);
  margin-inline: auto;
}

section {
  padding-block: var(--space-12);
  border-top: 1px solid var(--line);
}
section:first-of-type { border-top: 0; }

/* ---------- Type scale ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--copper-text);
  margin: 0 0 var(--space-4);
}

.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 6.5vw, 5rem);
  line-height: 1.03;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

.lead {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 38ch;
  margin: 0;
}

h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-6);
  text-wrap: balance;
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 var(--space-3);
  letter-spacing: -0.01em;
}

p { text-wrap: pretty; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--ivory) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  height: 68px;
  width: var(--container);
  margin-inline: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}
.brand__glyph {
  width: 26px; height: 26px;
  color: var(--copper);
  flex: none;
}
.brand__word thinsub { color: var(--copper); }
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
  margin: 0; padding: 0;
  font-size: 0.92rem;
}
.nav__links a { color: var(--ink); position: relative; padding-bottom: 2px; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -3px;
  height: 1.5px; background: var(--copper);
  transition: right 0.25s ease;
}
.nav__links a:hover::after, .nav__links a:focus-visible::after { right: 0; }

.nav__cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.nav__cta:hover { background: var(--ink); color: var(--ivory); }

.nav__toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  border-top: 0;
  overflow: hidden;
  min-height: calc(100svh - 68px);
  display: grid;
  align-items: center;
  padding-block: clamp(3rem, 7vh, 5rem);
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--space-10);
  align-items: center;
}
.hero__meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--space-5);
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: var(--space-3) var(--space-6);
}
.hero__meta b { color: var(--ink); font-weight: 500; }
.hero__lead { margin-top: var(--space-6); max-width: 46ch; }
.hero__art {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  margin: 0;
}
.hero__motion {
  width: 100%;
  height: 100%;
  display: block;
}
.hero__art { --motion-state: paused; }
.privacy-ok .hero__art[data-motion-running] { --motion-state: running; }
.hero__motion-toggle {
  position: absolute;
  right: 0;
  bottom: 0;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ivory);
  color: var(--muted);
  font-size: 0.75rem;
}
.hero__motion-toggle:hover { border-color: var(--muted); color: var(--ink); }
.hero__scene {
  animation: hero-drift 24s ease-in-out infinite;
  animation-play-state: var(--motion-state);
}
.hero__flows { stroke: var(--copper); stroke-width: 2; opacity: 0.65; }
.hero__echo { stroke: var(--line); stroke-width: 1; }
.hero__signals { stroke: var(--copper-deep); stroke-width: 5; }
.hero__signal {
  stroke-dasharray: 12 120;
  stroke-dashoffset: 12;
  opacity: 0;
  animation: hero-transfer 12s linear infinite both;
  animation-play-state: var(--motion-state);
}
.hero__signal--route { animation-delay: 2.4s; }
.hero__signal--out { animation-delay: 5.4s; }
.hero__signal--deliver { animation-delay: 8.4s; }
.hero__nodes { fill: var(--ivory); stroke: var(--copper-deep); stroke-width: 2; }
.hero__cores { fill: var(--ink); }
.hero__orbit, .hero__pulse { transform-box: fill-box; transform-origin: center; }
.hero__orbits { stroke: var(--copper); stroke-width: 1; opacity: 0.65; }
.hero__orbit {
  stroke-dasharray: 25 20 4 30;
  animation: hero-orbit 24s linear infinite;
  animation-play-state: var(--motion-state);
}
.hero__orbit--reverse { animation-direction: reverse; }
.hero__pulses { stroke: var(--copper); stroke-width: 1; }
.hero__pulse {
  opacity: 0;
  animation: hero-pulse 12s ease-out var(--pulse-delay) infinite both;
  animation-play-state: var(--motion-state);
}
@keyframes hero-transfer {
  0% { stroke-dashoffset: 12; opacity: 0; }
  2% { opacity: 1; }
  23% { opacity: 1; }
  25%, 100% { stroke-dashoffset: -100; opacity: 0; }
}
@keyframes hero-orbit { to { transform: rotate(360deg); } }
@keyframes hero-pulse {
  0% { transform: scale(0.8); opacity: 0; }
  2% { opacity: 0.8; }
  16%, 100% { transform: scale(3.6); opacity: 0; }
}
@keyframes hero-drift {
  0%, 100% { transform: translateY(4px); }
  50% { transform: translateY(-8px); }
}
.hero__actions { display: flex; gap: var(--space-4); margin-top: var(--space-8); flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.92rem;
  font-weight: 500;
  transition: transform 0.12s ease, background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--ink); color: var(--ivory); }
.btn--primary:hover { background: var(--copper); }
.btn--ghost { border-color: var(--muted); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); }
.btn__arrow { transition: transform 0.15s ease; }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ---------- Cards / grids ---------- */
.cards {
  display: block;
  margin-top: var(--space-8);
  border-top: 1px solid var(--ink);
}
.card {
  display: grid;
  grid-template-columns: 4rem minmax(220px, 0.75fr) minmax(0, 1fr);
  align-items: start;
  gap: var(--space-5);
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.card__num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--copper-text);
  letter-spacing: 0.1em;
  padding-top: 0.38rem;
}
.card h3 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  font-weight: 400;
  line-height: 1.2;
  margin: 0;
}
.card p { max-width: 58ch; margin: 0; color: var(--muted); font-size: 0.96rem; }

/* ---------- Split (holding structure) ---------- */
.split {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: var(--space-10);
  align-items: start;
}
.tier {
  border-left: 2px solid var(--line);
  padding-left: var(--space-5);
  margin-bottom: var(--space-6);
}
.tier:last-child { margin-bottom: 0; }
.tier__k {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.tier__h {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0.25rem 0 0.4rem;
  letter-spacing: -0.01em;
}
.tier p { margin: 0; color: var(--muted); font-size: 0.96rem; }
.tier--parent { border-left-color: var(--copper); }

/* ---------- Data strip ---------- */
.data {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
  font-family: var(--font-mono);
}
.data__k { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.data__v { font-size: 1.02rem; color: var(--ink); margin-top: 0.35rem; }
.data__v small { color: var(--muted); display: block; font-size: 0.78rem; margin-top: 0.15rem; }

/* ---------- Process ---------- */
.process {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}
.process li {
  position: relative;
  border-top: 2px solid var(--ink);
  padding-top: var(--space-4);
}
.process li::before {
  counter-increment: step;
  content: "0" counter(step);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--copper-text);
  display: block;
  margin-bottom: var(--space-3);
}
.process h3 { font-size: 1.02rem; }
.process p { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding-block: var(--space-8);
  font-size: 0.86rem;
  color: var(--muted);
}
.footer__inner {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  gap: 3rem;
}
.footer h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 var(--space-4);
}
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.footer a { color: var(--muted); transition: color 0.15s; display: inline-block; min-height: 24px; line-height: 1.5; }
.footer a:hover { color: var(--copper-text); }
.footer__base {
  grid-column: 1 / -1;
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

/* ---------- Legal / Imprint ---------- */
.doc {
  max-width: 720px;
  margin-inline: auto;
  padding-block: var(--space-12);
}
.doc h1 { font-family: var(--font-display); font-size: clamp(2rem,5vw,3rem); margin: 0 0 var(--space-4); }
.doc section { border-top: 1px solid var(--line); padding-block: var(--space-8); padding-inline: 0; }
.doc section h2 { font-size: 1.35rem; margin-bottom: var(--space-4); }
.doc dl { display: grid; grid-template-columns: 150px 1fr; gap: var(--space-3) var(--space-6); }
.doc dt { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding-top: 0.1rem; }
.doc dd { margin: 0; }
.back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 24px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: var(--space-8);
}
.back:hover { color: var(--copper-text); }

/* ---------- Contact ---------- */
.contact-section {
  border-top: 0;
  background: var(--ink);
  color: var(--ivory);
  padding-block: clamp(3.5rem, 6vw, 4.5rem);
}
.contact-section .container {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  grid-template-areas: "heading email";
  align-items: center;
  gap: var(--space-8);
}
.contact-section h2 { grid-area: heading; color: var(--ivory); margin-bottom: 0; }
.contact__button {
  grid-area: email;
  justify-self: end;
  min-height: 48px;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  background: var(--copper);
  color: var(--ivory);
}
.contact__button:hover { background: var(--copper-deep); }

/* ---------- Privacy gate ---------- */
.privacy-gate { display: none; }
.js:not(.privacy-ok) body:has(.privacy-gate) { overflow: hidden; }
.js:not(.privacy-ok) .privacy-gate {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--space-5);
  overflow-y: auto;
  background: var(--ivory);
}
.privacy-gate__panel {
  width: min(100%, 540px);
  padding: clamp(1.5rem, 5vw, 3rem);
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--copper);
  box-shadow: var(--shadow-md);
}
.privacy-gate__panel h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-5);
}
.privacy-gate__panel > p { color: var(--muted); margin: 0 0 var(--space-5); }
.privacy-gate__policy {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  margin-bottom: var(--space-5);
  color: var(--copper-text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.privacy-gate__accept { width: 100%; justify-content: center; min-height: 48px; }
.privacy-gate__note {
  margin: var(--space-4) 0 0 !important;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.5;
}

/* ---------- Reveal on scroll ---------- */
 .js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
 }
 .js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .js .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero__art * { animation: none !important; }
  .hero__signals, .hero__pulses, .hero__motion-toggle { display: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .nav__links { gap: var(--space-4); }
  .hero__grid { grid-template-columns: 1fr; gap: var(--space-8); min-height: 0; }
  .hero { min-height: 0; }
  .hero__art { width: min(100%, 560px); }
  .split { grid-template-columns: 1fr; gap: var(--space-8); }
  .process { grid-template-columns: 1fr 1fr; }
  .data { grid-template-columns: 1fr 1fr; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .nav__toggle {
     display: inline-block;
     font-family: var(--font-mono);
     font-size: 0.75rem;
     letter-spacing: 0.1em;
     text-transform: uppercase;
       border: 1px solid var(--line);
       border-radius: var(--radius);
       padding: 0.85rem 0.95rem;
       background: transparent;
       color: var(--ink);
   }
  .nav__links {
     display: none;
     position: absolute;
     top: 68px;
     left: 0;
     right: 0;
     flex-direction: column;
     background: var(--ivory);
     border-bottom: 1px solid var(--line);
     padding: var(--space-4) var(--gutter);
     gap: var(--space-4);
     z-index: 40;
    }
   .nav__links.open {
     display: flex;
    }
    .hero { padding-block: var(--space-8) var(--space-10); }
    .hero__art { width: 100%; aspect-ratio: 4 / 3; }
    .card { grid-template-columns: 2.75rem 1fr; gap: var(--space-3); padding: 1.5rem 0; }
    .card p { grid-column: 2; line-height: 1.65; }
    .process, .data, .footer__inner { grid-template-columns: 1fr; }
    .contact-section .container {
      grid-template-columns: 1fr;
      grid-template-areas: "heading" "email";
      gap: var(--space-3);
    }
    .contact__button { justify-self: start; margin-top: var(--space-3); }
    .doc dl { grid-template-columns: 1fr; }
    .hero__meta { grid-template-columns: 1fr; gap: var(--space-2); }
   }

/* ---------- Focus visibility ---------- */
:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}
