/* ==========================================================================
   base.css - design tokens, reset, typography, buttons, accessibility helpers
   Theme is switched with data-theme="light|dark" on <html> (see js/theme.js).
   ========================================================================== */

:root {
  /* typography */
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Sora", "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* sizing */
  --maxw: 1200px;
  --gutter: clamp(18px, 4vw, 40px);
  --radius: 18px;
  --radius-sm: 10px;
  --header-h: 68px;

  /* light theme: clinical white with a teal / lab-green identity */
  --bg: #f4fafa;
  --surf: #ffffff;
  --surf-2: #e6f4f4;
  --ink: #06262e;
  --mut: #4a6670;
  --line: #d3e6e6;
  --pri: #007f7c;
  --pri-hover: #006866;
  --on-pri: #ffffff;
  --hot: #e4572e;
  --acc-text: #00706a;
  --shadow: 0 14px 34px rgba(6, 38, 46, 0.1);

  /* brand colors that do not change with the theme */
  --navy: #03191e;
  --navy-2: #062a31;
  --cyan: #4fedf0;
  --blue: #3ec1f0;
  --coral: #ff7a59;
  --on-dark: #ffffff;
  --on-dark-mut: #b5d3d4;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #02161a;
  --surf: #06262d;
  --surf-2: #041d23;
  --ink: #e4f7f7;
  --mut: #93b5b5;
  --line: #11393f;
  --pri: #2fdde0;
  --pri-hover: #6bf0f2;
  --on-pri: #04222a;
  --hot: #ff8f70;
  --acc-text: #4fedf0;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 64px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.7 var(--font-body);
  /* Do NOT use overflow-x: hidden here: it makes <body> its own scroll container,
     which breaks anchor jumps (#capability links) and scroll-triggered reveals.
     Sideways overflow is contained with overflow-x: clip on <main> (layout.css). */
  transition: background 0.3s, color 0.3s;
}

img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2rem, 4.4vw, 3.6rem); font-weight: 700; }
/* Below 960px the hero is a single column, so the headline can scale with the screen.
   8.2vw keeps "Engineering Solutions." on one line down to a 320px phone, which is what
   holds the hero to three lines instead of four. */
@media (max-width: 959px) { h1 { font-size: clamp(1.6rem, 8.2vw, 3.6rem); } }

/* The hero headline is three separate lines. Both rules live here together on purpose:
   if the stylesheet loads, each .line is its own block and the <br> fallbacks are hidden;
   if it ever fails to load, the <br> tags still break the heading in the same three places
   instead of running the sentences together. */
.hero h1 .line { display: block; }
.hero h1 br { display: none; }
h2 { font-size: clamp(1.65rem, 4vw, 2.6rem); font-weight: 700; }
h3 { font-size: clamp(1.1rem, 2vw, 1.3rem); font-weight: 600; letter-spacing: -0.01em; }

p { margin: 0 0 1em; max-width: 70ch; }
a { color: var(--pri); text-underline-offset: 3px; }
.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--mut); }
.muted { color: var(--mut); }
.note { font-size: 0.9rem; color: var(--mut); }

/* ---------- accessibility ---------- */
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: #fff; color: #000; padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { left: 8px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  min-height: 48px; padding: 0.7rem 1.5rem;
  border: 2px solid var(--pri); border-radius: 999px;
  background: var(--pri); color: var(--on-pri);
  font: 700 1rem var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}
@media (hover: hover) and (pointer: fine) { .btn:hover { background: var(--pri-hover); border-color: var(--pri-hover); transform: translateY(-2px); box-shadow: var(--shadow); } }
.btn:active { transform: scale(0.97); }
.btn--ghost { background: transparent; color: var(--ink); border-color: currentColor; }
@media (hover: hover) and (pointer: fine) { .btn--ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); } }
.btn--light { background: var(--cyan); border-color: var(--cyan); color: #04222a; }
@media (hover: hover) and (pointer: fine) { .btn--light:hover { background: #8bf5f7; border-color: #8bf5f7; } }
.btn--ghost-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.7); }
@media (hover: hover) and (pointer: fine) { .btn--ghost-light:hover { background: #fff; color: var(--navy); border-color: #fff; } }
.btn svg { width: 18px; height: 18px; transition: transform 0.2s; }
@media (hover: hover) and (pointer: fine) { .btn:hover svg { transform: translateX(4px); } }

/* ---------- rich text ---------- */
h1, h2 { text-wrap: balance; }
p { text-wrap: pretty; }

/* Accent words inside headings: <em>.
   Same typeface as the heading, one themed color, no italic - the decorative serif
   italic was removed so every heading reads as a single consistent piece of type. */
em {
  font-family: inherit; font-style: normal; font-weight: inherit;
  letter-spacing: inherit; color: var(--acc-text);
}
.hero em, .section--navy em, .cta-band em, .site-footer em { color: var(--cyan); }

/* Key phrases: <mark class="hl"> - bold in the themed green, no highlight or underline. */
.hl {
  background: none; padding: 0; font-weight: 700; color: var(--acc-text);
}
.hero .hl, .section--navy .hl, .cta-band .hl { color: var(--cyan); }

/* Opening letter of the founder biography and the large statement line */
.dropcap::first-letter {
  float: left; font: 700 3.1em/0.86 var(--font-head); padding: 0.04em 0.1em 0 0; color: var(--acc-text);
}
.statement {
  font: 700 clamp(1.5rem, 3.6vw, 2.5rem)/1.25 var(--font-head); color: #fff;
  max-width: 26ch; margin: 0 0 28px; letter-spacing: -0.02em;
}
.statement .fw { color: rgba(255, 255, 255, 0.22); transition: color 0.35s; }
.statement .fw.is-lit { color: #fff; }
.statement .fw:nth-child(3n).is-lit { color: var(--cyan); }

/* typing line in the hero */
.rotator { font-weight: 600; color: #fff; min-height: 1.7em; }
.rotator__word { color: var(--cyan); border-bottom: 2px solid var(--cyan); padding-bottom: 2px; }
.caret { display: inline-block; width: 2px; height: 1.1em; margin-left: 3px; vertical-align: -0.18em; background: var(--cyan); animation: caret 1s steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }
