/* ==========================================================================
   Quantarête — main stylesheet
   Brand colours are sampled from the master logo (Design/logo).
   ========================================================================== */

@font-face {
  /* Logo typeface. Uppercase A–Z only: use for all-caps display text. */
  font-family: "Behatrice";
  src: url("../fonts/behatrice.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}

:root {
  /* Brand */
  --navy: #171034;
  --navy-deep: #0d0922;
  --navy-raised: #1f1742;
  --blue-dark: #1c4f9c;
  --blue: #297abc;
  --blue-light: #38aadf;
  --crimson: #9c1c27;
  --crimson-bright: #d02a38; /* for small text on navy (contrast) */
  --white: #ffffff;

  /* UI */
  --text: #e9e7f3;
  --text-muted: #a9a4c4;
  --line: rgba(255, 255, 255, 0.09);
  --ring-gradient: linear-gradient(180deg, var(--blue-dark), var(--blue-light));

  --font-display: "Behatrice", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --container: 1180px;
  --radius: 14px;
  --header-h: 76px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Reset ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: var(--navy-deep);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ol, dl, dd { margin: 0; }
ol { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--blue-light); outline-offset: 3px; border-radius: 4px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: var(--white); color: var(--navy); padding: .6rem 1rem; border-radius: 8px;
  font-weight: 600; text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 1rem; }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }

/* Type -------------------------------------------------------------------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: .75rem;
  font-size: .78rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  color: var(--blue-light);
  margin-bottom: 1.1rem;
}
.eyebrow::before {
  content: ""; width: 28px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--crimson-bright), transparent);
}
.accent { color: var(--crimson-bright); }

.display {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.3rem, 6.4vw, 5.2rem);
  line-height: .92;
  letter-spacing: .01em;
  color: var(--white);
}
.display span { display: block; }
.display .accent { color: var(--crimson-bright); }

.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--text-muted); max-width: 36rem; }

.section-title {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.02em;
  color: var(--white);
}
.section-intro { color: var(--text-muted); font-size: 1.12rem; max-width: 40rem; margin-top: 1.1rem; }

/* Buttons ----------------------------------------------------------------- */
.btn {
  --bg: var(--crimson);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .95rem 1.6rem; border-radius: 999px;
  background: var(--bg); color: var(--white);
  font-weight: 600; font-size: .98rem; letter-spacing: .01em; text-decoration: none;
  border: 1px solid transparent;
  box-shadow: 0 10px 30px -12px rgba(208, 42, 56, .7);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s;
}
.btn:active { transform: scale(.98); }
.btn-ghost {
  background: transparent; border-color: rgba(255, 255, 255, .22); box-shadow: none;
}
.btn-small { padding: .55rem 1.15rem; font-size: .9rem; min-height: 44px; }

/* Header ------------------------------------------------------------------ */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h);
  display: flex; align-items: center;
  transition: background-color .3s, backdrop-filter .3s, border-color .3s, height .3s;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  --header-h: 64px;
  background: rgba(13, 9, 34, .78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { display: inline-flex; align-items: center; min-height: 44px; }
.brand img { width: clamp(170px, 18vw, 220px); }

.site-nav { display: flex; align-items: center; gap: 2rem; }
.site-nav a:not(.btn) {
  position: relative; text-decoration: none; font-size: .95rem; font-weight: 500; color: var(--text-muted);
  padding: .7rem 0; /* 44px+ tap target for touch laptops / tablets */
  transition: color .2s;
}
.site-nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .35rem; height: 2px; border-radius: 2px;
  background: var(--ring-gradient); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.site-nav a:not(.btn):hover { color: var(--white); }
.site-nav a:not(.btn):hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer;
  position: relative; color: var(--white);
}
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  position: absolute; left: 11px; width: 22px; height: 2px; border-radius: 2px; background: currentColor;
  transition: transform .3s var(--ease), opacity .2s;
}
.nav-toggle-bar { top: 21px; }
.nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; left: 0; }
.nav-toggle-bar::before { top: -7px; }
.nav-toggle-bar::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }

/* Hero -------------------------------------------------------------------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100svh; display: flex; align-items: center;
  padding: calc(var(--header-h) + 3rem) 0 6rem;
  background:
    radial-gradient(60rem 40rem at 78% 30%, rgba(41, 122, 188, .22), transparent 60%),
    radial-gradient(40rem 30rem at 10% 90%, rgba(156, 28, 39, .18), transparent 60%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero::after {
  /* Blend the hero glow into the next section. */
  content: ""; position: absolute; inset: auto 0 0; height: 30%; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--navy-deep));
}
.hero-inner {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; gap: 3rem;
}
.hero-copy .lead { margin-top: 1.6rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.4rem; }

.hero-mark { position: relative; justify-self: center; width: min(100%, 440px); }
.hero-mark::before {
  content: ""; position: absolute; inset: 8% 10% 12%; z-index: -1; border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 170, 223, .35), transparent 65%);
  filter: blur(30px);
}
.hero-mark img { width: 100%; animation: float 9s ease-in-out infinite; filter: drop-shadow(0 30px 50px rgba(0, 0, 0, .45)); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

.scroll-cue {
  position: absolute; left: 50%; bottom: 2rem; translate: -50% 0;
  width: 26px; height: 42px; border: 2px solid rgba(255, 255, 255, .28); border-radius: 14px;
}
.scroll-cue span {
  position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px;
  background: var(--white); animation: cue 2s var(--ease) infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translateY(-4px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* Sections ---------------------------------------------------------------- */
.section { position: relative; padding: clamp(5rem, 10vw, 8.5rem) 0; }
.section-alt { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%); }
.section-alt::before, .section-alt::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 20%, var(--line) 80%, transparent);
}
.section-alt::before { top: 0; }
.section-alt::after { bottom: 0; }
.section-head { margin-bottom: clamp(2.5rem, 5vw, 4rem); }

/* Approach cards */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; }
.card {
  position: relative; padding: 2rem 1.6rem 2.1rem; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015));
  border: 1px solid var(--line);
  transition: transform .35s var(--ease), border-color .35s, background-color .35s;
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 2px; border-radius: var(--radius) var(--radius) 0 0;
  background: var(--ring-gradient); opacity: 0; transition: opacity .35s;
}
.card h3 { font-size: 1.15rem; font-weight: 650; color: var(--white); margin: 1.4rem 0 .6rem; }
.card p { color: var(--text-muted); font-size: .98rem; }
.card-icon {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(160deg, rgba(28, 79, 156, .5), rgba(56, 170, 223, .18));
  border: 1px solid rgba(56, 170, 223, .3);
}
.card-icon svg { width: 24px; height: 24px; fill: none; stroke: var(--blue-light); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ARÊTE method steps */
.steps { --mark: 60px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.5rem; position: relative; }
.steps::before {
  /* Runs from the centre of the first marker to the centre of the last. */
  content: ""; position: absolute; height: 2px;
  top: calc(var(--mark) / 2 - 1px); left: calc(var(--mark) / 2);
  right: calc((100% - 6rem) / 5 - var(--mark) / 2);
  background: linear-gradient(90deg, var(--blue-dark), var(--blue-light) 60%, var(--crimson-bright));
  opacity: .5;
}
.step { position: relative; }
.step-mark {
  position: relative; display: block; width: var(--mark); height: var(--mark); border-radius: 50%;
  background: var(--navy); border: 2px solid var(--blue);
  box-shadow: 0 0 0 6px var(--navy);
  transition: border-color .3s, box-shadow .3s, transform .3s var(--ease);
}
.step-mark svg { width: 100%; height: 100%; overflow: visible; }
.step-mark text { font-family: var(--font-display); font-size: 40px; text-anchor: middle; fill: var(--white); }
.step-mark path { fill: var(--white); }
.step:last-child .step-mark { border-color: var(--crimson-bright); }
.step h3 { font-size: 1.12rem; font-weight: 650; color: var(--white); margin: 1.25rem 0 .4rem; letter-spacing: .01em; }
.step .initial { color: var(--crimson-bright); }
.step p { color: var(--text-muted); font-size: .95rem; }

/* The name */
.name-inner { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(3rem, 7vw, 6rem); align-items: center; }
.name-visual { justify-self: center; width: min(100%, 340px); }
.defs { display: grid; gap: 1.1rem; margin: 2rem 0; }
.def {
  padding: 1.25rem 1.4rem; border-left: 3px solid var(--crimson-bright);
  background: linear-gradient(90deg, rgba(255, 255, 255, .045), transparent);
  border-radius: 0 10px 10px 0;
}
.def dt { display: flex; align-items: baseline; gap: .75rem; margin-bottom: .3rem; }
.def .term { font-size: 1.25rem; font-weight: 700; font-style: italic; color: var(--white); }
.def .greek, .def .pos { color: var(--blue-light); font-size: .95rem; }
.def .pos { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.def dd { color: var(--text-muted); }
.def em { color: var(--text); }
.name-copy > p:not(.eyebrow) { color: var(--text); font-size: 1.1rem; }
.name-copy .name-method { margin-top: 1rem; color: var(--text-muted); }
.name-method a { color: var(--white); text-decoration: none; border-bottom: 1px solid rgba(56, 170, 223, .5); }
.name-method a:hover { border-bottom-color: var(--blue-light); }
.name-method b { color: var(--crimson-bright); }

/* CTA */
.cta { text-align: center; isolation: isolate; }
.cta::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse 34rem 60% at 50% 50%, rgba(41, 122, 188, .16), transparent 70%);
}
.cta-inner { display: flex; flex-direction: column; align-items: center; }
.cta-mark { width: 88px; margin-bottom: 2rem; }
.cta .section-intro { margin-inline: auto; }

/* Footer ------------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--line); padding: 3rem 0 2.5rem; background: var(--navy-deep); }
.footer-inner { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem 2rem; align-items: center; }
.footer-inner img { width: 180px; }
.footer-copy { justify-self: end; color: var(--text-muted); font-size: .9rem; }
.disclaimer {
  grid-column: 1 / -1; padding-top: 1.5rem; border-top: 1px solid var(--line);
  color: #7d789a; font-size: .8rem; line-height: 1.6;
}

/* Reveal on scroll (only when JS is running) ------------------------------ */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* Hover effects only for devices with a real pointer (no sticky hover on touch) */
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translateY(-2px); background: #b3202d; box-shadow: 0 16px 36px -12px rgba(208, 42, 56, .8); }
  .btn-ghost:hover { background: rgba(255, 255, 255, .06); border-color: var(--blue-light); box-shadow: none; }
  .card:hover { transform: translateY(-6px); border-color: rgba(56, 170, 223, .35); }
  .card:hover::before { opacity: 1; }
  .step:hover .step-mark { transform: scale(1.06); border-color: var(--blue-light); box-shadow: 0 0 0 6px var(--navy), 0 0 24px rgba(56, 170, 223, .35); }
  .step:last-child:hover .step-mark { border-color: var(--crimson-bright); box-shadow: 0 0 0 6px var(--navy), 0 0 24px rgba(208, 42, 56, .35); }
}

/* Responsive -------------------------------------------------------------- */
@media (max-width: 1080px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { gap: 1.1rem; }
}

@media (max-width: 900px) {
  /* Method becomes a vertical timeline: marker left, text right. */
  .steps { --mark: 52px; grid-template-columns: 1fr; gap: 2rem; max-width: 40rem; }
  .steps::before { display: none; }
  .step:not(:last-child)::after {
    /* Connector from this marker down to the next one. */
    content: ""; position: absolute; left: calc(var(--mark) / 2 - 1px); top: var(--mark); width: 2px;
    height: calc(100% - var(--mark) + 2rem); opacity: .5;
    background: linear-gradient(180deg, var(--blue-dark), var(--blue-light));
  }
  .step:nth-last-child(2)::after { background: linear-gradient(180deg, var(--blue-light), var(--crimson-bright)); }
  .step { display: grid; grid-template-columns: var(--mark) 1fr; column-gap: 1.25rem; align-items: start; }
  .step-mark { grid-row: span 2; }
  .step h3 { margin: .15rem 0 .3rem; font-size: 1.15rem; }
}

@media (max-width: 860px) {
  :root { --header-h: 64px; }
  .nav-toggle { display: block; margin-right: -10px; }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 auto; flex-direction: column; align-items: stretch; gap: 0;
    max-height: calc(100dvh - var(--header-h)); overflow-y: auto; overscroll-behavior: contain;
    padding: .5rem 1.25rem 1.5rem; background: rgba(13, 9, 34, .98); border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .25s, transform .25s var(--ease), visibility .25s;
  }
  .site-nav.is-open { transform: none; opacity: 1; visibility: visible; box-shadow: 0 0 0 100vmax rgba(5, 3, 15, .6); clip-path: inset(0 0 -100vmax 0); }
  .site-nav a:not(.btn) {
    display: flex; align-items: center; min-height: 52px; padding: 0 .25rem;
    border-bottom: 1px solid var(--line); font-size: 1.05rem; color: var(--text);
  }
  .site-nav a:not(.btn)::after { display: none; }
  .site-nav .btn { margin-top: 1.25rem; padding: .95rem 1.6rem; font-size: 1rem; }
  /* Solid header while the menu is open, even at the top of the page. */
  .nav-open .site-header { background: rgba(13, 9, 34, .98); border-bottom-color: var(--line); }
  .nav-open { overflow: hidden; }

  .hero { min-height: auto; padding: calc(var(--header-h) + 3rem) 0 5rem; }
  .hero-inner { gap: 2rem; }
  .scroll-cue { display: none; }

  .section-intro { font-size: 1.05rem; }
  .name-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .name-visual { width: min(62vw, 240px); }

  .footer-inner { grid-template-columns: 1fr; }
  .footer-copy { justify-self: start; }
}

@media (max-width: 700px) {
  .hero { padding: calc(var(--header-h) + 2rem) 0 4.5rem; }
  .hero-inner { grid-template-columns: 1fr; text-align: left; gap: 1.75rem; }
  .display { font-size: clamp(2.3rem, 11.5vw, 4.2rem); }
  .hero-mark { order: -1; width: min(46vw, 210px); justify-self: start; }
  .hero-mark img { animation: none; }
}

@media (max-width: 560px) {
  body { font-size: 1rem; }
  .container { width: min(100% - 2.5rem, var(--container)); }
  .cards { grid-template-columns: 1fr; gap: 1rem; }
  .card { padding: 1.6rem 1.4rem 1.7rem; }
  .card h3 { margin-top: 1.1rem; }
  .hero-actions { gap: .75rem; }
  .hero-actions .btn { flex: 1 1 100%; }
  .eyebrow { letter-spacing: .18em; }
  .def { padding: 1.1rem 1.1rem; }
  .def dt { flex-wrap: wrap; gap: .25rem .75rem; }
}

@media (max-width: 360px) {
  .container { width: min(100% - 2rem, var(--container)); }
  .brand img { width: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
