/* ==========================================================================
   nokkela — shared design system (brand.css)
   CI: canonical Rust #d2622e on anthracite black (#201e1c) – uniform across all sites.
   Space Grotesk, glow/data-stream effects. Vanilla CSS, self-hosted, GDPR-friendly.
   ========================================================================== */

/* ---- Font: self-hosted (no Google Fonts connection) --------------------- */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/SpaceGrotesk.woff2') format('woff2');
}

/* ---- Design tokens ------------------------------------------------------ */
:root {
  /* Surfaces – Obsidian (deep, warm-neutral dark) */
  --bg:            #201e1c;   /* anthracite black – base tone    */
  --bg-2:          #161413;   /* deeper – footer/depth contrast  */
  --surface:       #2b2825;   /* Cards – anthracite, a bit lighter*/
  --surface-2:     #363330;   /* Hover/raised                    */
  --border:        rgba(214,170,140,.14);
  --border-strong: rgba(226,118,60,.38);

  /* Text – warm off-white */
  --text:    #efe6df;
  --muted:   #b8a99d;
  --faint:   #8a7a6d;

  /* Brand / accents – Continium Rust (rust/copper) */
  --accent:    #d2622e;   /* Rust – base accent              */
  --accent-2:  #e8763c;   /* Copper – highlight/glow/logo nodes */
  --accent-ink:#bb521f;   /* deep rust – buttons             */
  --rust-deep: #9c4a25;
  --ember:     #f0a35e;
  --grad: linear-gradient(90deg, #f0a35e, #db6a34, #b5451f);
  --grad-soft: linear-gradient(135deg, rgba(226,118,60,.18), rgba(155,74,37,.12));

  /* Status */
  --ok:   #34d399;
  --warn: #fbbf24;
  --err:  #f87171;

  /* Dimensions */
  --maxw: 1200px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --gap: clamp(1rem, 2.5vw, 2rem);
  --section-y: clamp(3.5rem, 8vw, 7rem);
  --shadow: 0 10px 30px rgba(10,5,2,.55);
  --glow: 0 0 22px rgba(226,118,60,.30);
  --glow-strong: 0 0 34px rgba(226,118,60,.48);

  --font: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto,
          'Helvetica Neue', Arial, sans-serif;
}

/* Uniform Rust for all domains (no per-domain accent any more). */

/* ---- Reset / base ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* Only remove large/position-related motion … */
  .float-soft, .spin, .spin-rev { animation: none !important; }
  .typewriter { animation: none !important; width: auto !important; border-right: 0 !important; }
  .reveal { transition: none !important; opacity: 1 !important; transform: none !important; }
  /* … the subtle data stream and the gentle pulsing stay active. */
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Subtle background gradient (static, lightweight) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60vw 60vw at 85% -10%, rgba(226,118,60,.10), transparent 60%),
    radial-gradient(50vw 50vw at 0% 100%, rgba(155,74,37,.10), transparent 55%);
  pointer-events: none;
}

img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .2s ease; }
a:hover { color: #f0a35e; }
ul { list-style: none; padding: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Typography --------------------------------------------------------- */
h1, h2, h3, h4 { line-height: 1.15; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 5.2vw, 3.8rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.45rem); }
p  { color: var(--muted); }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: #d9ccc0; }

.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .9rem;
}

/* ---- Layout ------------------------------------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.section { padding-block: var(--section-y); }
.section-head { max-width: 760px; margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.section-head.center { margin-inline: auto; text-align: center; }
.grid { display: grid; gap: var(--gap); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .cols-3, .cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  --b: var(--accent-ink);
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .8rem 1.4rem;
  border-radius: var(--radius-pill);
  font-weight: 600; font-size: .98rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--b); color: #1b0f07; box-shadow: var(--glow); }
.btn-primary:hover { background: var(--accent); color: #1b0f07; box-shadow: var(--glow-strong); }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--accent); }
.btn-ghost:hover { background: rgba(226,118,60,.10); color: #f0a35e; }
.btn svg { width: 18px; height: 18px; }

/* ---- Cards -------------------------------------------------------------- */
.card {
  background: rgba(43,40,37,.6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.3rem, 2.5vw, 1.8rem);
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  backdrop-filter: blur(6px);
}
.card:hover { transform: translateY(-5px); border-color: var(--border-strong); box-shadow: var(--glow); }
.card h3 { color: #f4ede7; margin-bottom: .55rem; }
.card .ico {
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center; margin-bottom: 1rem;
  background: var(--grad-soft); border: 1px solid var(--border-strong);
  color: var(--accent);
}
.card .ico svg { width: 26px; height: 26px; }
.card ul.checks { margin-top: .9rem; display: grid; gap: .45rem; }
.card ul.checks li { position: relative; padding-left: 1.6rem; color: var(--muted); font-size: .95rem; }
.card ul.checks li::before {
  content: ''; position: absolute; left: 0; top: .45em;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2);
}
.card-link { display: block; color: inherit; }
.card-link:hover { color: inherit; }

/* Cross-link cards (domains among each other) */
.domain-card { position: relative; overflow: hidden; }
.domain-card .badge {
  display: inline-block; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--border-strong); border-radius: 999px;
  padding: .15rem .6rem; margin-bottom: .9rem;
}
.domain-card .arrow { color: var(--accent); transition: transform .25s ease; }
.domain-card:hover .arrow { transform: translateX(4px); }

/* ---- Pills / Tags ------------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .8rem; border-radius: 999px; font-size: .85rem;
  background: rgba(43,40,37,.72); border: 1px solid var(--border); color: var(--muted);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 7px var(--accent-2); }
.taglist { display: flex; flex-wrap: wrap; gap: .55rem; }

/* ---- Trust bar ---------------------------------------------------------- */
.trust {
  display: flex; flex-wrap: wrap; gap: 1.2rem 2rem; align-items: center;
  padding: 1.1rem 0; color: var(--faint); font-size: .9rem;
}
.trust span { display: inline-flex; align-items: center; gap: .5rem; }

/* ---- Header / Navigation ----------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(32,30,28,.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .8rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--text); font-weight: 700; }
.brand:hover { color: var(--text); }
.brand img { width: 38px; height: 38px; border-radius: 10px; }
.brand .name { font-size: 1.15rem; letter-spacing: -.02em; }
.brand .sub { color: var(--accent); font-weight: 600; }
.nav-links { display: flex; align-items: center; gap: .3rem; }
.nav-links a { color: var(--muted); font-weight: 500; padding: .5rem .8rem; border-radius: 10px; }
.nav-links a:hover { color: var(--text); background: rgba(214,170,140,.09); }
.nav-actions { display: flex; align-items: center; gap: .6rem; }
.lang-switch { display: inline-flex; gap: .15rem; align-items: center; font-size: .85rem; font-weight: 600; }
.lang-switch a, .lang-switch span { color: var(--faint); padding: .25rem .45rem; border-radius: 7px; }
.lang-switch a:hover { color: var(--text); background: rgba(214,170,140,.09); }
.lang-switch .active { color: var(--accent); }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); cursor: pointer; padding: .4rem; }
.nav-toggle svg { width: 26px; height: 26px; }

@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; inset: 100% 0 auto 0;
    flex-direction: column; align-items: stretch;
    background: rgba(30,28,26,.97); border-bottom: 1px solid var(--border);
    padding: .6rem 1rem 1rem; gap: .2rem;
    transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
  }
  .nav-links.open { transform: translateY(0); opacity: 1; visibility: visible; }
  .nav-links a { padding: .8rem .6rem; }
  .nav-actions .btn-ghost { display: none; }
}

/* ---- Hero --------------------------------------------------------------- */
.hero { position: relative; padding-block: clamp(3.5rem, 9vw, 7rem) var(--section-y); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { margin-bottom: 1.1rem; }
.hero .lead { margin-bottom: 1.8rem; max-width: 56ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 1.6rem; }

/* Mini "AI assistant" input (visual, optionally wired up) */
.ai-prompt {
  display: flex; gap: .5rem; align-items: center;
  background: rgba(43,40,37,.72); border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill); padding: .45rem .45rem .45rem 1.1rem;
  box-shadow: var(--glow); max-width: 520px;
}
.ai-prompt input { flex: 1; background: none; border: 0; color: var(--text); font: inherit; font-size: .98rem; }
.ai-prompt input::placeholder { color: var(--faint); }
.ai-prompt input:focus { outline: none; }

/* ---- Animated graphics -------------------------------------------------- */
/* Particles (generated via JS) */
#particles { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.ai-particle { position: absolute; background: rgba(226,118,60,.55); border-radius: 50%; pointer-events: none; }

/* Subtle & calm: slow rotation, gentle pulsing, flowing data stream.
   Deliberately restrained – no hectic blinking. */

/* Very slow rotation (orbits/rings) */
.spin { transform-origin: center; animation: spin 70s linear infinite; }
.spin-rev { transform-origin: center; animation: spin 90s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Nodes: low amplitude, slow, staggered (no synchronous blinking) */
.pulse { animation: pulse 5.5s ease-in-out infinite; transform-origin: center; }
@keyframes pulse { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
.pulse:nth-of-type(2) { animation-delay: -1.1s; }
.pulse:nth-of-type(3) { animation-delay: -2.2s; }
.pulse:nth-of-type(4) { animation-delay: -3.3s; }
.pulse:nth-of-type(5) { animation-delay: -4.4s; }
.pulse:nth-of-type(6) { animation-delay: -2.7s; }
.pulse:nth-of-type(7) { animation-delay: -1.6s; }
.pulse:nth-of-type(8) { animation-delay: -3.9s; }

/* Connections = flowing data stream: small points of light glide slowly
   along the line. dasharray sum 15 -> offset -45 (3 periods) = seamless. */
.dash { stroke-dasharray: 5 11; stroke-linecap: round; animation: dash 4.5s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -48; } }
.dash:nth-of-type(2) { animation-delay: -1.5s; }
.dash:nth-of-type(3) { animation-delay: -3s; }
.dash:nth-of-type(4) { animation-delay: -.8s; }
.dash:nth-of-type(5) { animation-delay: -2.3s; }

/* Two-layer data stream (hero graphics): static baseline + gliding
   light packet. An identical copy with class .stream sits on the baseline.
   dasharray 4 36 -> exactly ONE short packet per 40 units; offset -80 (2x) = seamless. */
.stream { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round;
          filter: drop-shadow(0 0 5px var(--accent)); }
/* Animation directly on the lines/paths -> reliable in all browsers */
.stream > * {
  stroke-dasharray: 5 180;
  animation: stream 5.5s linear infinite;
}
@keyframes stream { to { stroke-dashoffset: -370; } }

/* Optional: thin, static baseline under the data stream (own class) */
.stream-base { opacity: .25; }

/* Very gentle floating */
.float-soft { animation: floaty 10s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.glow-node { filter: drop-shadow(0 0 5px var(--accent-2)); }

/* Typewriter (hero subline) */
.typewriter {
  overflow: hidden; white-space: nowrap;
  border-right: .12em solid var(--accent);
  width: 0; animation: typing 3.2s steps(38, end) forwards, caret 1.2s step-end infinite;
}
@keyframes typing { to { width: 100%; } }
@keyframes caret { 50% { border-color: transparent; } }

/* Scroll-Reveal */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---- Comparison table --------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.compare { width: 100%; border-collapse: collapse; min-width: 660px; }
table.compare th, table.compare td { padding: .9rem 1.1rem; text-align: left; border-bottom: 1px solid var(--border); }
table.compare thead th { color: #f4ede7; background: rgba(43,40,37,.66); font-size: .9rem; letter-spacing: .03em; }
table.compare td { color: var(--muted); font-size: .95rem; }
table.compare tr:last-child td { border-bottom: 0; }
table.compare .yes { color: var(--ok); font-weight: 600; }
table.compare .no { color: var(--err); }

/* ---- Process steps ------------------------------------------------------ */
.steps { counter-reset: step; display: grid; gap: var(--gap); }
.step { position: relative; padding-left: 3.4rem; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700;
  color: #1b0f07; background: var(--grad); box-shadow: var(--glow);
}

/* ---- Form --------------------------------------------------------------- */
.form-card { background: rgba(43,40,37,.6); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1.5rem, 3vw, 2.4rem); }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: .9rem; font-weight: 600; color: #d9ccc0; margin-bottom: .4rem; }
.field .req { color: var(--accent-2); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: .98rem;
  color: var(--text); background: rgba(22,20,18,.6);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .75rem .9rem; transition: border-color .2s ease, box-shadow .2s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--border-strong); box-shadow: 0 0 0 3px rgba(226,118,60,.18);
}
.field textarea { min-height: 130px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
/* Honeypot – invisible to humans */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .88rem; color: var(--muted); }
.consent input { width: auto; margin-top: .25rem; }
.form-note { font-size: .82rem; color: var(--faint); margin-top: .8rem; }
.alert { border-radius: var(--radius-sm); padding: .9rem 1.1rem; margin-bottom: 1.2rem; font-size: .95rem; }
.alert-ok { background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.4); color: #a7f3d0; }
.alert-err { background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.4); color: #fecaca; }

/* ---- Blog --------------------------------------------------------------- */
.post-card { display: flex; flex-direction: column; height: 100%; }
.post-card .meta { font-size: .82rem; color: var(--faint); margin-bottom: .5rem; }
.post-card h3 { margin-bottom: .5rem; }
.post-card .excerpt { flex: 1; }
.post-card .more { margin-top: 1rem; color: var(--accent); font-weight: 600; }
.article { max-width: 760px; margin-inline: auto; }
.article h2 { margin-top: 2.2rem; margin-bottom: .8rem; }
.article h3 { margin-top: 1.6rem; margin-bottom: .6rem; color: #f4ede7; }
.article p, .article li { color: #d9ccc0; margin-bottom: 1rem; }
.article ul { list-style: disc; padding-left: 1.3rem; }
.article li { margin-bottom: .4rem; }

/* ---- CTA-Band ----------------------------------------------------------- */
.cta-band {
  background: var(--grad-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
}

/* ---- Footer ------------------------------------------------------------- */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--border); margin-top: var(--section-y); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; padding-block: 3rem 2rem; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 1rem; }
.site-footer ul li { margin-bottom: .55rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); padding-block: 1.3rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; color: var(--faint); font-size: .85rem; }
.footer-bottom a { color: var(--faint); }
.footer-bottom a:hover { color: var(--accent); }

/* ---- Helper classes ----------------------------------------------------- */
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.6rem; }
.mb-0 { margin-bottom: 0; }
.w-full { width: 100%; }
.items-start { align-items: start; }
.justify-center { justify-content: center; }
.muted { color: var(--muted); }
.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 { position: absolute; left: -999px; top: 0; background: var(--accent); color: #1b0f07; padding: .6rem 1rem; border-radius: 0 0 8px 0; z-index: 100; }
.skip-link:focus { left: 0; }
