/* ============================================================
   Meriltec OÜ — base.css  (v1)
   Design system: tokens, reset, typography, buttons, utilities
   Concept: "Engineered precision" — clean light corporate with
   architectural blueprint detailing.
   ============================================================ */

:root {
  /* ---- Surfaces ---- */
  --bg:            #ffffff;
  --bg-alt:        #f1f5f9;   /* cool light section */
  --bg-deep:       #0d1722;   /* dark slate (footer, contrast bands) */
  --surface:       #ffffff;

  /* ---- Ink ---- */
  --ink:           #121a24;   /* headlines, primary text */
  --ink-soft:      #44515f;   /* body */
  --muted:         #586675;   /* labels, secondary — AA-compliant for small text */
  --on-deep:       #e7eef5;   /* text on dark slate */
  --on-deep-soft:  #9fb0c0;

  /* ---- Brand (overridden by [data-theme] in themes.css) ---- */
  --accent:        #1a63c2;   /* steel blue */
  --accent-deep:   #0e4b9e;
  --accent-bright: #5fa0ff;   /* lighter accent for use on dark backgrounds */
  --accent-tint:   rgba(26, 99, 194, 0.08);
  --cta:           #f1581e;   /* safety orange — actions only */
  --cta-deep:      #d6470f;
  --cta-ink:       #ffffff;   /* text colour on the CTA button */

  /* ---- Lines ---- */
  --line:          rgba(18, 26, 36, 0.10);
  --line-strong:   rgba(18, 26, 36, 0.18);
  --line-deep:     rgba(231, 238, 245, 0.12);

  /* ---- Type ---- */
  --font-display:  'Archivo', system-ui, sans-serif;
  --font-body:     'Hanken Grotesk', system-ui, sans-serif;
  --font-mono:     'Spline Sans Mono', ui-monospace, monospace;

  /* ---- Metrics ---- */
  --maxw:          1200px;
  --gutter:        clamp(1.25rem, 4vw, 3rem);
  --header-h:      80px;
  --radius:        10px;
  --radius-sm:     6px;

  /* ---- Motion ---- */
  --ease:          cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-sm:     0 1px 2px rgba(13,23,34,.05), 0 4px 14px rgba(13,23,34,.05);
  --shadow-md:     0 10px 30px rgba(13,23,34,.10), 0 2px 8px rgba(13,23,34,.06);
  --shadow-lg:     0 24px 60px rgba(13,23,34,.16);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, picture, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(4rem, 9vw, 7.5rem); position: relative; }
.section--alt { background: var(--bg-alt); }
.section--deep { background: var(--bg-deep); color: var(--on-deep); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.02em;
}
.section--deep h1, .section--deep h2, .section--deep h3 { color: #fff; }

.display {
  font-size: clamp(2.6rem, 6.5vw, 5.4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.98;
}
.h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
.h3 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); letter-spacing: -0.015em; }
.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-soft);
}
.section--deep .lead { color: var(--on-deep-soft); }

p { max-width: 62ch; }

/* ---- Eyebrow: technical label with tick + index ---- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--cta);
  display: inline-block;
}
.section--deep .eyebrow { color: var(--accent-bright); }

/* section intro block */
.section-head { max-width: 56ch; margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head .lead { margin-top: 1.1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  padding: 0.9rem 1.5rem;
  border-radius: var(--radius-sm);
  transition: transform .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease), color .25s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 1.05em; height: 1.05em; transition: transform .25s var(--ease); }
.btn:hover svg { transform: translateX(3px); }

.btn--cta { background: var(--cta); color: var(--cta-ink); box-shadow: 0 6px 18px color-mix(in srgb, var(--cta) 32%, transparent); }
.btn--cta:hover { background: var(--cta-deep); transform: translateY(-2px); box-shadow: 0 10px 26px color-mix(in srgb, var(--cta) 42%, transparent); }

.btn--solid { background: var(--ink); color: #fff; }
.btn--solid:hover { background: var(--accent); transform: translateY(-2px); }

.btn--ghost { border: 1.5px solid var(--line-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); background: var(--ink); color: #fff; transform: translateY(-2px); }

.section--deep .btn--ghost { border-color: var(--line-deep); color: #fff; }
.section--deep .btn--ghost:hover { background: #fff; color: var(--ink); border-color: #fff; }

/* text link with arrow */
.tlink {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-weight: 600; color: var(--accent);
  font-size: 0.95rem;
}
.tlink svg { width: 1em; height: 1em; transition: transform .25s var(--ease); }
.tlink:hover svg { transform: translateX(4px); }

/* ---------- Section depth (grid removed; subtle theme-aware glow) ---------- */
.blueprint { /* intentionally empty — clean flat background */ }
.blueprint--deep {
  background-image: radial-gradient(120% 90% at 88% 0%, color-mix(in srgb, var(--accent-bright) 12%, transparent), transparent 60%);
}

/* ---------- Scroll reveal ---------- */
/* Content is visible by default; only gated when JS is active (html.js),
   so a no-JS / headless render never ships a blank section. */
.reveal { transition: opacity .7s var(--ease), transform .7s var(--ease); }
html.js .reveal { opacity: 0; transform: translateY(26px); }
html.js .reveal.visible { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) {
  html.js .reveal, html.js .reveal.visible { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Misc utilities ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--ink); color: #fff; padding: .75rem 1.25rem; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }
.visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
.accent { color: var(--accent); }
.cta-text { color: var(--cta); }
