/* ==========================================================================
   IONION — main stylesheet
   Light, editorial deep-tech look: white space, large grotesk headlines,
   mono labels, flat die imagery. All two-column layouts share one grid.
   ========================================================================== */

:root {
    --ink: #0b0f19;          /* headings, primary text */
    --ink-soft: #4b5262;     /* body text */
    --muted: #8b91a0;        /* labels, captions */
    --line: #e6e8ec;         /* hairlines */
    --paper: #ffffff;
    --paper-2: #f5f6f8;      /* alternate section */
    --die: #262b3a;          /* die background tone, image placeholders */
    --accent: #0e9fb5;       /* routing cyan, darkened for white */
    --gold: #c58a14;         /* metal-layer gold, darkened for white */
    --grad: linear-gradient(90deg, #12b5cc 0%, #e0a431 100%);

    --font-display: "Inter Tight", "Inter", system-ui, sans-serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

    --container: 1280px;
    --gutter: clamp(20px, 4vw, 48px);
    --col-gap: clamp(32px, 6vw, 96px);
    --section-y: clamp(88px, 11vw, 160px);
    --radius: 12px;
    --header-h: 76px;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 140px; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    color: var(--ink-soft);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.025em;
    line-height: 1.08;
}
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, textarea { font: inherit; color: inherit; }
body.nav-open { overflow: hidden; }

/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin: 0 auto;
    padding: 0 var(--gutter);
}
.section { padding: var(--section-y) 0; }
.section--alt { background: var(--paper-2); }
.section--line { border-top: 1px solid var(--line); }

/* The one shared two-column grid: every split on the site uses it,
   so second columns start at the same x everywhere. */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--col-gap);
    row-gap: 40px;
}
.grid-2--center { align-items: center; }
.grid-2--end { align-items: end; }

/* ---------- Typography ---------- */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
}
.display {
    font-size: clamp(48px, 8vw, 116px);
    font-weight: 600;
    letter-spacing: -0.045em;
    line-height: .96;
}
.h1 { font-size: clamp(44px, 6.4vw, 92px); letter-spacing: -0.042em; line-height: 1; }
.h2 { font-size: clamp(34px, 4.4vw, 60px); letter-spacing: -0.035em; }
.h3 { font-size: clamp(24px, 2.2vw, 30px); }
.lead {
    font-size: clamp(18px, 1.5vw, 21px);
    line-height: 1.55;
    color: var(--ink-soft);
    max-width: 580px;
}
.statement {
    font-family: var(--font-display);
    font-size: clamp(28px, 3.4vw, 48px);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: var(--ink);
}
.statement .dim { color: #a9aebb; }
.gradient-text {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- Buttons & links ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 15px 26px;
    border: 1px solid transparent;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.btn svg { width: 16px; height: 16px; transition: transform .3s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: var(--accent); }
.btn--outline { border-color: #cfd3da; color: var(--ink); background: transparent; }
.btn--outline:hover { border-color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: var(--ink);
    border-bottom: 1px solid currentColor;
    padding-bottom: 3px;
    transition: color .25s;
}
.link-arrow svg { width: 14px; height: 14px; transition: transform .3s var(--ease); }
.link-arrow:hover { color: var(--accent); }
.link-arrow:hover svg { transform: translateX(4px); }

/* ---------- Header ---------- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    border-bottom: 1px solid transparent;
    transition: border-color .3s;
}
/* The blur lives on a pseudo-element: a backdrop-filter on the header itself
   would become the containing block of the fixed mobile menu and clip it. */
.site-header::before {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: -2;
    background: rgba(255, 255, 255, .86);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
}
.brand img { height: 32px; width: auto; }

.nav { display: flex; align-items: center; gap: 36px; }
.nav__list { display: flex; gap: 32px; }
.nav__list a {
    position: relative;
    font-size: 15px;
    font-weight: 500;
    color: var(--ink-soft);
    transition: color .25s;
}
.nav__list a:hover, .nav__list a[aria-current="page"] { color: var(--ink); }
.nav__list a[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -6px;
    height: 2px;
    border-radius: 2px;
    background: var(--grad);
}
.nav .btn { padding: 11px 20px; font-size: 14px; }

.nav-toggle {
    display: none;
    position: relative;
    width: 44px;
    height: 44px;
    margin-right: -10px;
    border: 0;
    background: none;
    cursor: pointer;
}
.nav-toggle span {
    position: absolute;
    left: 11px; right: 11px;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
    transition: transform .35s var(--ease), top .35s var(--ease);
}
.nav-toggle span:nth-child(1) { top: 17px; }
.nav-toggle span:nth-child(2) { top: 25px; }
.nav-open .nav-toggle span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { top: 21px; transform: rotate(-45deg); }

/* ---------- Hero (home) & page hero ---------- */
.hero { padding: calc(var(--header-h) + clamp(72px, 11vw, 150px)) 0 0; }
.hero .display { max-width: 1100px; }
.hero__intro { margin-top: clamp(40px, 5vw, 64px); }
.hero__visual {
    margin-top: clamp(56px, 7vw, 96px);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--die);
}
.hero__visual img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; }

.page-hero {
    padding: calc(var(--header-h) + clamp(64px, 9vw, 130px)) 0 clamp(56px, 7vw, 96px);
    border-bottom: 1px solid var(--line);
}
.page-hero .grid-2 > :first-child { grid-column: 1 / -1; }
.page-hero .lead { grid-column: 2; }

/* ---------- Section head ---------- */
.section-head { margin-bottom: clamp(48px, 6vw, 88px); }

/* ---------- Numbered columns ---------- */
.cols-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: clamp(24px, 3vw, 48px);
    border-top: 1px solid var(--line);
}
.col-item { padding-top: 32px; }
.col-item h3 { font-size: 22px; margin-bottom: 12px; }
.col-item p { font-size: 16px; }

/* ---------- Media ---------- */
.media {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--die);
}
.media img { width: 100%; height: 100%; object-fit: cover; }
.media--square img { aspect-ratio: 1 / 1; }
.media--wide img { aspect-ratio: 16 / 9; }

/* ---------- Check list ---------- */
.checks { margin: 32px 0 40px; border-top: 1px solid var(--line); }
.checks li {
    display: flex;
    gap: 16px;
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
    font-size: 16px;
    color: var(--ink);
}
.checks li::before {
    content: "";
    flex: none;
    width: 6px;
    height: 6px;
    margin-top: 10px;
    border-radius: 50%;
    background: var(--accent);
}

/* ---------- Tag ---------- */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 100px;
    border: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--ink-soft);
    background: var(--paper);
}

/* ---------- Facts ---------- */
.facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: var(--col-gap);
    margin-top: clamp(56px, 7vw, 104px);
    border-top: 1px solid var(--line);
}
.fact { padding-top: 32px; }
.fact__value {
    font-family: var(--font-display);
    font-size: clamp(36px, 4vw, 56px);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--ink);
    margin-bottom: 14px;
}
.fact__label { font-size: 15px; color: var(--muted); }

/* ---------- Products page ---------- */
.product + .product {
    margin-top: var(--section-y);
    padding-top: var(--section-y);
    border-top: 1px solid var(--line);
}
.product--reverse .product__media { order: 2; }
.product__body .tag { margin-bottom: 24px; }
.product__body h2 { font-size: clamp(48px, 5.6vw, 80px); letter-spacing: -0.045em; margin-bottom: 12px; }
.product__tagline {
    font-family: var(--font-display);
    font-size: clamp(20px, 1.7vw, 23px);
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-bottom: 24px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin: 32px 0 0;
    padding: 24px 0;
    border-top: 1px solid var(--line);
}
.stat__value {
    font-family: var(--font-display);
    font-size: clamp(28px, 2.6vw, 38px);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1;
    color: var(--ink);
    margin-bottom: 8px;
}
.stat__label { font-size: 13.5px; line-height: 1.4; color: var(--muted); }
.stats + .checks { margin-top: 0; }
.product__note { font-size: 15px; color: var(--muted); margin: -12px 0 28px; }

/* ---------- Applications ---------- */
.apps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--col-gap);
    row-gap: clamp(32px, 4vw, 56px);
}
.app__media {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--die);
    margin-bottom: 24px;
}
.app__media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform 1s var(--ease); }
.app:hover .app__media img { transform: scale(1.04); }
.app h3 { font-size: clamp(24px, 2.2vw, 30px); margin-bottom: 10px; }
.app p { font-size: 16px; max-width: 540px; }

/* ---------- Technology ---------- */
.subnav {
    position: sticky;
    top: var(--header-h);
    z-index: 20;
    background: rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.subnav ul { display: flex; gap: 36px; overflow-x: auto; scrollbar-width: none; }
.subnav ul::-webkit-scrollbar { display: none; }
.subnav a {
    display: block;
    padding: 18px 0 16px;
    font-size: 14.5px;
    font-weight: 500;
    white-space: nowrap;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    transition: color .25s, border-color .25s;
}
.subnav a:hover { color: var(--ink); }
.subnav a.is-active { color: var(--ink); border-color: var(--accent); }

/* Heading spans the row; lead and feature list start on the same line below it */
.tech-block { row-gap: 28px; }
.tech-title { grid-column: 1 / -1; }
.tech-aside { position: sticky; top: 150px; align-self: start; }
.tech-aside .media { margin-top: 40px; }
.tech-aside .media img { aspect-ratio: 16 / 10; }

.feature { padding: 28px 0; border-bottom: 1px solid var(--line); }
.feature:first-child { padding-top: 4px; }
.feature h3 { font-size: clamp(19px, 1.6vw, 22px); margin-bottom: 8px; }
.feature p { font-size: 16px; }

.overview .media { margin-bottom: clamp(48px, 6vw, 80px); }
.overview .col-item { padding-bottom: 28px; }

/* ---------- CTA ---------- */
.cta { background: var(--paper-2); }
.cta .h2 { max-width: 640px; }

/* ---------- Contact ---------- */
.info { border-top: 1px solid var(--line); margin-top: 8px; }
.info > div {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}
.info dt {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    padding-top: 3px;
}
.info dd { margin: 0; color: var(--ink); }
.info a:hover { color: var(--accent); }

.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.form .full { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 10px; font-size: 14px; font-weight: 500; color: var(--ink); }
.field input, .field textarea {
    width: 100%;
    padding: 15px 17px;
    border: 1px solid #dadde3;
    border-radius: 10px;
    background: var(--paper);
    font-size: 16px;
    color: var(--ink);
    transition: border-color .25s, box-shadow .25s;
}
.field textarea { min-height: 180px; resize: vertical; }
.field input:focus, .field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(14, 159, 181, .14);
}
.form__footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.form__note { font-size: 14px; color: var(--muted); margin: 0; max-width: 360px; }

/* ---------- Footer ---------- */
.site-footer {
    padding: clamp(64px, 8vw, 104px) 0 32px;
    border-top: 1px solid var(--line);
    font-size: 15px;
}
.footer__top {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: var(--col-gap);
    row-gap: 40px;
    padding-bottom: clamp(48px, 6vw, 80px);
}
.footer__brand img { height: 30px; width: auto; margin-bottom: 22px; }
.site-footer h4 {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 20px;
}
.site-footer li + li { margin-top: 10px; }
.site-footer a { color: var(--ink); transition: color .25s; }
.site-footer a:hover { color: var(--accent); }
.footer__social { display: flex; gap: 12px; margin-top: 22px; }
.footer__social a {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 50%;
}
.footer__social a:hover { border-color: var(--ink); color: var(--ink); }
.footer__social svg { width: 16px; height: 16px; fill: currentColor; }
.footer__bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 24px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
    font-size: 13.5px;
    color: var(--muted);
}

/* ---------- Reveal on scroll ---------- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .9s var(--ease), transform .9s var(--ease);
    transition-delay: var(--d, 0s);
}
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
    .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer__top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    :root { --header-h: 68px; }
    .nav-toggle { display: block; }
    .nav {
        position: fixed;
        top: 0; right: 0; bottom: 0; left: 0;
        z-index: -1;
        overflow-y: auto;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 40px;
        padding: calc(var(--header-h) + 32px) var(--gutter) 40px;
        background: var(--paper);
        opacity: 0;
        visibility: hidden;
        transition: opacity .35s var(--ease), visibility .35s;
    }
    .nav-open .nav { opacity: 1; visibility: visible; }
    .nav__list { flex-direction: column; gap: 6px; }
    .nav__list a { font-family: var(--font-display); font-size: 40px; font-weight: 600; letter-spacing: -0.03em; color: var(--ink); }
    .nav__list a[aria-current="page"]::after { display: none; }
    .nav__list a[aria-current="page"] { color: var(--accent); }
    .nav .btn { padding: 15px 26px; font-size: 15px; }

    .grid-2, .apps { grid-template-columns: minmax(0, 1fr); }
    .page-hero .lead { grid-column: auto; }
    .grid-2 > div:empty { display: none; }
    .product--reverse .product__media { order: 0; }
    .tech-aside { position: static; }
    .cols-3 { grid-template-columns: minmax(0, 1fr); }
    .hero__visual img { aspect-ratio: 16 / 10; }
}

/* Phones in landscape: keep the whole menu on screen */
@media (max-width: 900px) and (max-height: 520px) {
    .nav { justify-content: flex-start; gap: 20px; }
    .nav__list { gap: 0; }
    .nav__list a { font-size: 26px; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .facts, .form, .footer__top { grid-template-columns: minmax(0, 1fr); }
    .info > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}
