/* Quaternion — single stylesheet. Mobile-first. */

@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("../fonts/sora-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("../fonts/sora-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --navy: #0B1220;
  --surface: #111A2C;
  --surface-2: #16213A;
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.16);
  --text: #E8ECF4;
  --muted: #9AA6BD;
  --violet: #A79BFF;
  --teal: #3ECBE0;
  --white: #FFFFFF;

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Sora", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --fs-body: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --fs-lead: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  --fs-h1: clamp(2rem, 1.2rem + 3.6vw, 3.75rem);
  --fs-h2: clamp(1.625rem, 1.25rem + 1.6vw, 2.5rem);
  --fs-h3: clamp(1.125rem, 1.05rem + 0.4vw, 1.375rem);
  --fs-small: 0.875rem;

  --radius: 6px;
  --gutter: 1.25rem;
  --header-h: 4rem;
  --ease: 0.25s ease;
}

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

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

body {
  margin: 0;
  background: var(--navy);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  padding-bottom: var(--banner-h, 0px);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--white);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.3; letter-spacing: -0.01em; }

p { margin: 0 0 1rem; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--teal); text-underline-offset: 0.2em; transition: color var(--ease); }
a:hover { color: var(--white); }
img, svg { display: block; max-width: 100%; }
code { font-family: var(--font-mono); font-size: 0.9em; }

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

.container { width: min(100% - 2 * var(--gutter), 72rem); margin-inline: auto; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--teal);
  color: var(--navy);
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
}
.skip-link:focus { top: 1rem; color: var(--navy); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 18, 32, 0.94);
  border-bottom: 1px solid var(--hairline);
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 0 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  color: var(--white);
  text-decoration: none;
}
.brand:hover { color: var(--white); }
.brand-mark { width: 1.75rem; height: 1.75rem; flex: none; }
.brand-word {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
}

.nav { flex-basis: 100%; padding-bottom: 0.75rem; }
.nav-list { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.nav-list a, .footer-links a, .cookie-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.nav-list a {
  white-space: nowrap;
  color: var(--text);
  font-family: var(--font-head);
  font-size: 0.9375rem;
  text-decoration: none;
}
.nav-list a:hover { color: var(--teal); }

.lang { display: inline-flex; align-items: center; gap: 0.25rem; margin-right: 0.75rem; }
.lang a, .lang span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  letter-spacing: 0.06em;
  text-decoration: none;
  border-radius: var(--radius);
}
.lang a { color: var(--muted); }
.lang a:hover { color: var(--white); }
.lang [aria-current="true"] { color: var(--navy); background: var(--violet); font-weight: 600; }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle svg { width: 24px; height: 24px; }
.nav-toggle .ico-close { display: none; }
.nav-toggle[aria-expanded="true"] .ico-open { display: none; }
.nav-toggle[aria-expanded="true"] .ico-close { display: block; }

.js .nav-toggle { display: inline-flex; }
.js .nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 0.75rem var(--gutter) 1.25rem;
  background: var(--navy);
  border-bottom: 1px solid var(--hairline);
  max-height: calc(100vh - var(--header-h) - var(--banner-h, 0px));
  overflow-y: auto;
}
.js .nav.is-open { display: block; }
.js .nav-list { flex-direction: column; gap: 0; margin-bottom: 0.75rem; }
.js .nav-list a { width: 100%; border-bottom: 1px solid var(--hairline); }
.nav .btn { margin-top: 0.25rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.2;
  text-decoration: none;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color var(--ease), color var(--ease), border-color var(--ease), transform var(--ease);
}
.btn .arrow { width: 1rem; height: 1rem; transition: transform var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.btn-primary { background: var(--teal); color: var(--navy); }
.btn-primary:hover { background: var(--white); color: var(--navy); }
.btn-secondary { background: transparent; color: var(--violet); border-color: var(--violet); }
.btn-secondary:hover { background: rgba(167, 155, 255, 0.14); color: var(--white); }
.btn-sm { min-height: 44px; padding: 0.5rem 1.125rem; }
.btn-lg { min-height: 56px; padding: 1rem 1.5rem; font-size: clamp(1rem, 0.85rem + 1.2vw, 1.375rem); max-width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

.link-btn {
  min-height: 44px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--teal);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
  transition: color var(--ease);
}
.link-btn:hover { color: var(--white); }

/* Typography helpers */
.eyebrow {
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--violet);
}
.lead { font-size: var(--fs-lead); color: var(--text); max-width: 38rem; }

/* Hero */
.hero { padding-block: 3rem 3.5rem; overflow: hidden; }
.hero-inner { display: grid; gap: 2.5rem; align-items: center; }
.hero-copy .lead { margin-top: 1.5rem; margin-bottom: 0; }
.hero-visual {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  padding: 1rem;
}
.hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(closest-side, rgba(132, 120, 232, 0.28), rgba(62, 203, 224, 0.08) 60%, transparent);
  pointer-events: none;
}
.hero-mark { position: relative; width: min(64vw, 17rem); height: auto; overflow: visible; }
.hero-caption {
  position: relative;
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--muted);
  letter-spacing: 0.04em;
}

.hero-mark .q1, .hero-mark .q2 {
  transform-box: view-box;
  transform-origin: 50% 50%;
  animation: quadrant-in 0.9s ease backwards;
}
.hero-mark .q2 { animation-delay: 0.15s; }
.hero-mark .q3, .hero-mark .q4, .hero-mark .q5 {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-in 1.1s ease backwards 0.3s;
}
.hero-mark .q4 { animation-delay: 0.5s; }
.hero-mark .q5 { animation-delay: 0.8s; }
@keyframes quadrant-in {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes draw-in {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

/* Sections */
.section { padding-block: 4rem; }
.section-alt { background: var(--surface); border-block: 1px solid var(--hairline); }
.section-head { max-width: 42rem; margin-bottom: 2.5rem; }
.section-intro { margin: 1rem 0 0; color: var(--muted); font-size: var(--fs-lead); }

/* Cards */
.cards { display: grid; gap: 1.25rem; }
.card {
  position: relative;
  overflow: hidden;
  padding: 2rem 1.5rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  transition: border-color var(--ease), transform var(--ease);
}
.card:hover { border-color: var(--hairline-strong); }
.card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 4rem;
  height: 4rem;
  border-bottom-left-radius: 100%;
  background: var(--violet);
  opacity: 0.9;
}
.card-2::before { background: var(--teal); }
.card h3 { padding-right: 3.5rem; }
.card-desc { margin: 0.75rem 0 1.5rem; color: var(--muted); }
.ticks { display: grid; gap: 0.75rem; }
.ticks li { display: flex; gap: 0.75rem; align-items: flex-start; }
.tick { flex: none; width: 1rem; height: 1rem; margin-top: 0.35rem; color: var(--teal); }
.card-1 .tick { color: var(--violet); }

/* Steps */
.steps { display: grid; gap: 1.25rem; }
.step {
  padding: 1.5rem 1.25rem 0.5rem;
  border-top: 1px solid var(--hairline-strong);
}
.step-num {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.15rem 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--teal);
  border: 1px solid var(--teal);
  border-radius: 999px 999px 999px 0;
}
.step p { margin: 0.5rem 0 0; color: var(--muted); }

/* Technologies */
.tech { display: grid; gap: 1.5rem; }
.tech-group { padding-top: 1.25rem; border-top: 1px solid var(--hairline-strong); }
.tech-group h3 {
  margin-bottom: 0.875rem;
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chips li {
  padding: 0.35rem 0.75rem;
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}

/* About */
.about { display: grid; gap: 2.5rem; }
.about-copy p { color: var(--text); max-width: 38rem; }
.about-copy .section-head { margin-bottom: 1.5rem; }
.principles { display: grid; gap: 1rem; align-content: start; }
.principle {
  padding: 1.25rem;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  border-top-right-radius: 2rem;
}
.principle p { margin: 0.4rem 0 0; color: var(--muted); }

/* Contact */
.contact { position: relative; overflow: hidden; }
.contact-inner { text-align: center; max-width: 44rem; }
.contact-inner .section-intro { margin-bottom: 2rem; }
.contact-inner::before {
  content: "";
  display: block;
  width: 3.5rem;
  height: 3px;
  margin: 0 auto 2rem;
  background: linear-gradient(90deg, var(--violet), var(--teal));
}

/* Footer */
.site-footer { padding-block: 2.5rem; border-top: 1px solid var(--hairline); background: var(--surface); }
.footer-inner { display: grid; gap: 1rem; justify-items: start; }
.copy { margin: 0; color: var(--muted); font-size: var(--fs-small); }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 1.5rem; font-size: var(--fs-small); }
.footer-links .link-btn { font-size: var(--fs-small); }
.lang-footer { margin-right: 0; }

/* Cookie banner */
.cookie {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 90;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--surface-2);
  border-top: 1px solid var(--violet);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
}
.cookie[hidden] { display: none; }
.cookie:focus { outline: none; }
.cookie:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.cookie-inner { display: grid; gap: 1rem; padding-block: 1rem; }
.cookie-title { margin: 0 0 0.25rem; font-family: var(--font-head); font-weight: 600; color: var(--white); }
.cookie-text { margin: 0; font-size: 0.9375rem; color: var(--text); }
.cookie-link { margin-top: 0.25rem; font-size: 0.9375rem; }
.cookie-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.cookie-actions .btn { width: 100%; }

/* Legal pages */
.legal { max-width: 46rem; padding-block: 3rem 4rem; }
.legal-head { margin-bottom: 2.5rem; }
.updated { margin: 1rem 0 0; color: var(--muted); font-size: var(--fs-small); }
.legal-sec { margin-bottom: 2.5rem; }
.legal-sec h2 { margin-bottom: 1rem; font-size: var(--fs-h3); }
.legal-sec p { max-width: 70ch; }
.table-wrap {
  overflow-x: auto;
  margin-bottom: 1rem;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
}
table { width: 100%; min-width: 38rem; border-collapse: collapse; font-size: 0.9375rem; }
th, td { padding: 0.75rem 1rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--hairline); }
th { font-family: var(--font-mono); font-size: var(--fs-small); font-weight: 400; letter-spacing: 0.04em; color: var(--muted); background: var(--surface); }
tbody tr:last-child td { border-bottom: 0; }

/* 404 */
.notfound { padding-block: 4rem; display: grid; gap: 3rem; }
.notfound section + section { padding-top: 3rem; border-top: 1px solid var(--hairline); }

/* Scroll reveal (class added by JS only) */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* Tablet */
@media (min-width: 600px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .principles { grid-template-columns: repeat(2, 1fr); }
  .tech { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr auto; align-items: center; justify-items: start; }
  .footer-links { grid-column: 1; }
  .lang-footer { grid-column: 2; grid-row: 1 / span 3; justify-self: end; }
}

@media (min-width: 860px) {
  :root { --header-h: 4.5rem; }
  .hero { padding-block: 5rem 6rem; }
  .hero-inner { grid-template-columns: 1.25fr 1fr; gap: 3rem; }
  .hero-mark { width: min(100%, 22rem); }
  .section { padding-block: 6rem; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .card { padding: 2.5rem 2.25rem 2.25rem; }
  .steps { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
  .step { padding-inline: 0; }
  .tech { grid-template-columns: repeat(3, 1fr); gap: 2rem 1.5rem; }
  .about { grid-template-columns: 1fr 1fr; gap: 4rem; }
  .cookie-inner { grid-template-columns: 1fr auto; align-items: center; gap: 2rem; }
  .cookie-body { max-width: 52rem; }
  .cookie-actions { grid-template-columns: repeat(2, 140px); }
}

@media (min-width: 1024px) {
  .header-inner { flex-wrap: nowrap; }
  .nav-toggle, .js .nav-toggle { display: none; }
  .nav, .js .nav {
    display: flex;
    position: static;
    flex: 1;
    flex-basis: auto;
    align-items: center;
    justify-content: flex-end;
    padding: 0;
    background: none;
    border: 0;
    max-height: none;
    overflow: visible;
  }
  .js .nav-list, .nav-list { flex-direction: row; flex-wrap: nowrap; gap: 0 1.5rem; margin: 0 1.25rem 0 0; }
  .js .nav-list a { width: auto; border-bottom: 0; }
  .nav .btn { margin-top: 0; }
}

@media (min-width: 1200px) {
  .nav-list { gap: 0 1.75rem; }
}

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