/* ==========================================================================
   AegirLogic — single stylesheet, no dependencies, no webfonts.
   Palette is sampled from the brand mark: navy #14243B, teal #17ADA4.
   ========================================================================== */

:root {
  --ink: #0a1420;
  --navy: #14243b;
  --navy-2: #1c3250;
  --teal: #17ada4;
  --teal-deep: #0f8178;
  --paper: #f7f9fb;
  --paper-2: #eef2f6;
  --line: #dbe3ec;
  --muted: #5a6b80;
  --white: #ffffff;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --wrap: 1140px;
  --gutter: clamp(20px, 5vw, 40px);
  --radius: 14px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--navy);
  font: 400 17px/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--teal-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--navy); }

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

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.028em; line-height: 1.05; }
p { margin: 0; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  font: 500 12px/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal-deep);
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--navy);
  color: var(--white);
  border-radius: 8px;
  font-size: 14px;
  transition: top 0.18s var(--ease);
}
.skip-link:focus { top: 16px; color: var(--white); }

/* ---------- Buttons ------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: 600 15px/1 var(--font-sans);
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s var(--ease), background 0.16s var(--ease),
    box-shadow 0.16s var(--ease), border-color 0.16s var(--ease);
}
.btn--primary {
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 10px 24px -14px rgba(20, 36, 59, 0.8);
}
.btn--primary:hover { background: var(--ink); color: var(--white); transform: translateY(-2px); }
.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--navy);
}
.btn--ghost:hover { border-color: var(--navy); transform: translateY(-2px); }
.btn--teal {
  background: var(--teal);
  color: #04211f;
}
.btn--teal:hover { background: #1fc0b6; color: #04211f; transform: translateY(-2px); }
.btn .arrow { transition: transform 0.18s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Header ------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 249, 251, 0.86);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.site-header[data-scrolled="true"] {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 24px -22px rgba(10, 20, 32, 0.55);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 72px;
}
.brand { display: flex; align-items: center; text-decoration: none; }
.brand picture { display: block; }
.brand img { width: clamp(170px, 26vw, 214px); }

.nav { margin-left: auto; }
.nav ul {
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav a {
  color: var(--navy);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  position: relative;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 1px;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s var(--ease);
}
.nav a:hover::after, .nav a:focus-visible::after { transform: scaleX(1); }
.site-header .btn { padding: 11px 18px; }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 18px;
  height: 1.6px;
  background: currentColor;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle span { position: relative; margin-inline: auto; }
.nav-toggle span::before,
.nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

/* ---------- Hero --------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 9vw, 108px) 0 clamp(56px, 8vw, 96px);
  background:
    radial-gradient(900px 460px at 88% -10%, rgba(23, 173, 164, 0.16), transparent 62%),
    radial-gradient(700px 420px at 8% 110%, rgba(20, 36, 59, 0.07), transparent 60%),
    var(--paper);
}
/* Depth grid: the "chart" the headline sits on. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(20, 36, 59, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(20, 36, 59, 0.055) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(120% 90% at 70% 10%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 90% at 70% 10%, #000 30%, transparent 78%);
  pointer-events: none;
}
.hero__inner { position: relative; }

.hero h1 {
  max-width: 15ch;
  font-size: clamp(2.6rem, 6.4vw, 4.5rem);
  line-height: 0.98;
}
.hero h1 em {
  font-style: normal;
  color: var(--teal-deep);
  position: relative;
  white-space: nowrap;
}
.hero__lead {
  max-width: 56ch;
  margin-top: 26px;
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  color: var(--muted);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}
.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin: 38px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  font: 500 13px/1.4 var(--font-mono);
  letter-spacing: 0.02em;
  color: var(--navy);
}
.hero__facts li { display: flex; align-items: center; gap: 9px; }
.hero__facts li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--teal);
  transform: rotate(45deg);
}

/* ---------- Section scaffolding ----------------------------------------- */

.section { padding: clamp(64px, 9vw, 104px) 0; }
.section--tight { padding: clamp(48px, 6vw, 72px) 0; }
.section__head { max-width: 62ch; }
.section__head h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  margin-bottom: 18px;
}
.section__head p { color: var(--muted); font-size: 1.05rem; }

/* ---------- Services ----------------------------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: clamp(34px, 4vw, 52px);
  padding: 0;
  list-style: none;
}
.card {
  position: relative;
  padding: 26px 26px 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}
.card::after {
  content: "";
  position: absolute;
  left: 26px;
  right: 26px;
  top: -1px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--teal), transparent);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  border-color: #c9d6e4;
  box-shadow: 0 20px 40px -32px rgba(10, 20, 32, 0.5);
}
.card:hover::after { opacity: 1; }
.card__index {
  font: 500 12px/1 var(--font-mono);
  letter-spacing: 0.12em;
  color: var(--teal-deep);
}
.card h3 { margin: 14px 0 10px; font-size: 1.2rem; letter-spacing: -0.018em; }
.card p { color: var(--muted); font-size: 0.97rem; }
.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.card__tags li {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 500 11px/1.5 var(--font-mono);
  color: #41536a;
  background: var(--paper);
}

/* ---------- Process ------------------------------------------------------ */

.process { background: var(--paper-2); border-block: 1px solid var(--line); }
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0;
  margin: clamp(34px, 4vw, 50px) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.step {
  position: relative;
  padding: 26px 26px 26px 0;
  counter-increment: step;
}
.step + .step { padding-left: 26px; border-left: 1px solid var(--line); }
.step::before {
  content: "0" counter(step);
  display: block;
  font: 500 12px/1 var(--font-mono);
  letter-spacing: 0.14em;
  color: var(--teal-deep);
  margin-bottom: 14px;
}
.step h3 { font-size: 1.12rem; margin-bottom: 10px; }
.step p { color: var(--muted); font-size: 0.95rem; }

/* ---------- Etymology (dark band) ---------------------------------------- */

.etymology {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #0c1725 0%, #0f1f33 55%, #0b1523 100%);
  color: #dbe6f2;
}
.etymology::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(760px 380px at 82% 12%, rgba(23, 173, 164, 0.18), transparent 65%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 96px);
  pointer-events: none;
}
.etymology .wrap { position: relative; }
.etymology .eyebrow { color: #4fd3c9; }
.etymology h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  margin-bottom: 26px;
  color: var(--white);
}
.etymology__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 26px 48px;
  margin-top: 34px;
}
.etymology p { color: #b9c9db; }
.etymology strong { color: var(--white); font-weight: 600; }
.etymology em {
  font-style: normal;
  color: #6fe0d6;
  font-family: var(--font-mono);
  font-size: 0.94em;
}
.etymology__rule {
  width: 100%;
  height: 1px;
  margin: 42px 0 0;
  border: 0;
  background: linear-gradient(90deg, rgba(23, 173, 164, 0.9), rgba(255, 255, 255, 0.06) 60%);
}
.pull {
  margin: 30px 0 0;
  padding-left: 20px;
  border-left: 2px solid var(--teal);
  font-size: clamp(1.15rem, 2.1vw, 1.5rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--white);
  max-width: 34ch;
}

/* ---------- Stack -------------------------------------------------------- */

.stack { padding: clamp(44px, 6vw, 64px) 0; border-bottom: 1px solid var(--line); }
.stack__label {
  font: 500 12px/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.chips li {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  font: 500 12.5px/1.3 var(--font-mono);
  color: #33465d;
}

/* ---------- Contact ------------------------------------------------------ */

.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}
.contact h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 18px; }
.contact__lead { color: var(--muted); max-width: 44ch; }
.contact__direct {
  margin-top: 30px;
  padding: 20px 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.contact__direct dt {
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.contact__direct dd {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 600;
}
.contact__direct dd:last-child { margin-bottom: 0; }
.contact__direct a { text-decoration: none; }
.contact__direct a:hover { text-decoration: underline; }

.form {
  display: grid;
  gap: 14px;
  padding: clamp(22px, 3vw, 30px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 30px 60px -50px rgba(10, 20, 32, 0.6);
}
.field { display: grid; gap: 6px; }
.field label {
  font: 500 12px/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--navy);
  font: 400 15px/1.5 var(--font-sans);
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}
.field textarea { resize: vertical; min-height: 118px; }
.field input:focus, .field select:focus, .field textarea:focus {
  background: var(--white);
  border-color: var(--teal);
  outline: none;
  box-shadow: 0 0 0 3px rgba(23, 173, 164, 0.16);
}
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form .btn { justify-content: center; }
.form__note { font-size: 12.5px; color: var(--muted); }
.opt { text-transform: none; letter-spacing: 0; font-weight: 400; opacity: 0.8; }

/* Honeypot: off-screen, never focusable — bots still fill it in. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__status { margin: 0; font-size: 14px; line-height: 1.5; }
.form__status:empty { display: none; }
.form__status.ok { color: var(--teal-deep); font-weight: 500; }
.form__status.err { color: #a3322a; font-weight: 500; }

/* ---------- Footer ------------------------------------------------------- */

.site-footer {
  padding: 40px 0 46px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 32px;
}
.site-footer img { width: 34px; height: 34px; }
.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-left: auto;
  padding: 0;
  list-style: none;
}
.site-footer__nav a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}
.site-footer__nav a:hover { color: var(--navy); }
.site-footer__legal {
  width: 100%;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.site-footer__legal span:last-child { margin-left: auto; }

/* ---------- Reveal on scroll -------------------------------------------- */

.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

/* ---------- Responsive --------------------------------------------------- */

@media (max-width: 900px) {
  .contact__grid { grid-template-columns: 1fr; }
  .step { padding: 20px 0 20px 0; }
  .step + .step { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .nav-toggle { display: grid; place-items: center; }
  .nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin: 0;
    padding: 12px var(--gutter) 20px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 32px -30px rgba(10, 20, 32, 0.6);
    display: none;
  }
  .nav[data-open="true"] { display: block; }
  .nav ul { flex-direction: column; gap: 4px; }
  .nav a { display: block; padding: 11px 0; font-size: 16px; }
  .site-header .btn--cta { display: none; }
  .hero h1 { max-width: 18ch; }
  .form__row { grid-template-columns: 1fr; }
  .site-footer__nav { margin-left: 0; }
}

@media (min-width: 761px) {
  .nav[data-open] { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Print -------------------------------------------------------- */
@media print {
  .site-header, .nav-toggle, .form, .hero::before { display: none !important; }
  body { background: #fff; color: #000; }
  .etymology { background: #fff; color: #000; }
  .etymology h2, .etymology strong, .etymology p { color: #000; }
}
