/* ==========================================================================
   SenAI — SCHEMATIC / LIVE · design system
   One engineering drawing that draws itself. Ink = raw. Gradient = SenAI acted.
   ========================================================================== */

@property --w {
    syntax: '<number>';
    inherits: false;
    initial-value: 620;
}

:root {
    --paper: #ffffff;
    --ink: #0b1220;
    --navy: #5551d8;
    --indigo: #4f46e5;
    --dia: #6366f1;
    --dia-soft: #c7d2fe;
    --dia-fill: #f5f6ff;
    --red: #e0566f;
    --tint: #f8f9ff;
    --lav: #e8e5ff;
    --r: 16px;
    --body: #4b5565;
    --rule: rgba(79, 70, 229, 0.14);
    --rule-strong: rgba(79, 70, 229, 0.34);
    --mute: rgba(11, 18, 32, 0.38);
    --film: rgba(79, 70, 229, 0.06);
    --sig-a: #3f9ce8;
    --sig-b: #9f5edf;
    --sig: linear-gradient(90deg, var(--sig-a), var(--sig-b));
    --sig-mid: #6e7ee6;

    --margin: clamp(16px, 4vw, 64px);
    --gutter: 24px;
    --cols: 12;
    --maxw: 1680px;
    --pad-y: clamp(96px, 14vh, 176px);
    --nav-h: 80px;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-io: cubic-bezier(0.87, 0, 0.13, 1);
    --f-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --f-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

    --t-display: clamp(48px, 6vw, 104px);
    --t-h1: clamp(40px, 4.8vw, 84px);
    --t-h2: clamp(28px, 3vw, 48px);
    --t-quote: clamp(28px, 3.2vw, 52px);
    --t-mega: clamp(120px, 18vw, 300px);
    --t-plat: clamp(64px, 7vw, 120px);
}

@media (max-width: 767px) {
    :root {
        --gutter: 16px;
        --cols: 4;
    }
}

/* ---------- reset ---------- */
html {
    font-family: var(--f-sans);
    font-feature-settings: 'ss01', 'cv11', 'calt';
    color: var(--ink);
    background: var(--paper);
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
}

html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

body.sx {
    margin: 0;
    overflow-anchor: none;
    overflow-x: clip;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--f-sans);
    font-size: 18px;
    line-height: 1.5;
    letter-spacing: -0.011em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

body.sx ::selection {
    background: var(--ink);
    color: #fff;
}

body.sx :focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

body.sx a {
    color: inherit;
    text-decoration: none;
}

body.sx h1,
body.sx h2,
body.sx h3,
body.sx p,
body.sx ul,
body.sx ol,
body.sx dl,
body.sx dd,
body.sx figure,
body.sx blockquote {
    margin: 0;
    padding: 0;
}

body.sx ul,
body.sx ol {
    list-style: none;
}

body.sx img,
body.sx video,
body.sx svg {
    display: block;
    max-width: 100%;
}

body.sx button {
    font: inherit;
    color: inherit;
}

.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.num,
[data-num] {
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum', 'ss01';
}

/* ---------- grid ---------- */
.wrap {
    position: relative;
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 var(--margin);
    display: grid;
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    column-gap: var(--gutter);
}

.paper {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.paper .wrap {
    height: 100%;
}

.paper i {
    display: block;
    height: 100%;
    border-left: 1px solid var(--film);
    transform-origin: top;
}

.paper i:last-child {
    border-right: 1px solid var(--film);
}

@media (max-width: 767px) {
    .paper {
        display: none;
    }
}

main#main {
    position: relative;
    z-index: 2;
}

/* ---------- type ---------- */
.h1 {
    font-size: var(--t-h1);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.035em;
    color: var(--ink);
}

.h2 {
    font-size: var(--t-h2);
    font-weight: 560;
    line-height: 1.08;
    letter-spacing: -0.028em;
    color: var(--ink);
}

.h3 {
    font-size: 22px;
    font-weight: 560;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.lead {
    font-size: 18px;
    line-height: 1.5;
    color: var(--body);
    max-width: 46ch;
}

.anno {
    font-family: var(--f-mono);
    font-size: 12px;
    line-height: 1.4;
    letter-spacing: 0;
    color: var(--navy);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.anno__lead {
    display: inline-block;
    width: var(--len, 24px);
    height: 1px;
    background: var(--rule-strong);
    transform: rotate(var(--rot, 0deg));
    transform-origin: left center;
    flex: none;
}

.ticks li {
    position: relative;
    padding-left: 20px;
    color: var(--body);
    line-height: 1.5;
}

.ticks li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.75em;
    width: 8px;
    height: 1px;
    background: var(--ink);
}

.ticks li + li {
    margin-top: 8px;
}

/* ---------- sections ---------- */
.s {
    position: relative;
    padding-block: var(--pad-y);
}

.sheet-no {
    grid-column: 1 / 2;
    font-weight: 600;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--ink);
    padding-top: 0.6em;
}

.sheet-no::after {
    content: '';
    width: 24px;
    height: 1px;
    background: var(--ink);
    margin-top: 0.62em;
}

@media (max-width: 767px) {
    .sheet-no {
        grid-column: 1 / -1;
        padding-top: 0;
        margin-bottom: 16px;
    }
}

/* crop marks */
.crop {
    position: absolute;
    inset: 16px;
    pointer-events: none;
    z-index: 1;
}

.crop i {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 0 solid var(--rule-strong);
}

.crop i:nth-child(1) { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.crop i:nth-child(2) { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.crop i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.crop i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }

.frame {
    position: relative;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--r);
}

.frame > img,
.frame > video {
    border-radius: calc(var(--r) - 1px);
}

.frame .crop {
    inset: -10px;
}

/* ---------- buttons & links ---------- */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 16px;
    height: 54px;
    padding: 0 26px;
    border-radius: 999px;
    background: var(--sig);
    color: #fff !important;
    font: 500 15px/1 var(--f-sans);
    letter-spacing: -0.01em;
    border: 0;
    cursor: pointer;
    overflow: hidden;
    isolation: isolate;
    white-space: nowrap;
    transition: transform 0.2s var(--ease-out);
}

.btn:focus-visible {
    outline-color: var(--sig-mid);
}

.btn__bar {
    position: absolute;
    inset: 0;
    background: var(--ink);
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform 0.45s var(--ease-out);
    z-index: -1;
}

.btn:hover .btn__bar {
    transform: scaleX(1);
    transform-origin: left center;
}

.btn__lbl {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    height: 1.1em;
    overflow: hidden;
    line-height: 1.1;
}

.btn__lbl > span {
    display: block;
    transition: transform 0.35s var(--ease-out);
}

.btn:hover .btn__lbl > span {
    transform: translateY(-100%);
}

.btn__arr {
    transition: transform 0.35s var(--ease-out);
}

.btn:hover .btn__arr {
    transform: translateX(4px);
}

.btn:active {
    transform: scale(0.98);
}

.btn--wide {
    width: 100%;
    height: 64px;
    justify-content: space-between;
}

.link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 15px;
    color: var(--ink);
    padding: 4px 0;
}

.link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: currentColor;
    transform-origin: left;
}

.link:hover::after {
    animation: link-redraw 0.5s var(--ease-out);
}

@keyframes link-redraw {
    0% { transform: scaleX(1); transform-origin: right; }
    45% { transform: scaleX(0); transform-origin: right; }
    46% { transform: scaleX(0); transform-origin: left; }
    100% { transform: scaleX(1); transform-origin: left; }
}

/* ---------- rail + title block ---------- */
#rail {
    position: fixed;
    left: calc(var(--margin) - 1px);
    top: 0;
    width: 1px;
    height: 100vh;
    background: linear-gradient(180deg, var(--sig-a), var(--sig-b));
    transform-origin: top;
    transform: scaleY(0);
    z-index: 3;
    pointer-events: none;
}

@media (max-width: 767px) {
    #rail {
        display: none;
    }
}

#plot {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.tblock {
    position: fixed;
    right: var(--margin);
    bottom: 16px;
    z-index: 60;
    display: grid;
    grid-template-columns: auto auto auto;
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--rule-strong);
    border-radius: 12px;
    overflow: hidden;
    padding: 0;
    font: 400 11px/1 var(--f-mono);
    color: var(--navy);
    cursor: pointer;
    font-variant-numeric: tabular-nums;
}

.tblock > span {
    padding: 9px 12px;
    white-space: nowrap;
}

.tblock > span + span {
    border-left: 1px solid var(--rule);
}

.tblock b {
    font-weight: 500;
    color: var(--ink);
}

.tblock:hover {
    border-color: var(--ink);
}

body.sx .tblock {
    font: 400 11px/1 var(--f-mono);
    color: var(--navy);
}

@media (max-width: 767px) {
    body.sx .tblock,
    .sheet-index {
        display: none;
    }
}

.sheet-index {
    position: fixed;
    right: var(--margin);
    bottom: 56px;
    z-index: 61;
    width: min(360px, calc(100vw - 2 * var(--margin)));
    background: var(--paper);
    border: 1px solid var(--rule-strong);
    border-radius: 14px;
    overflow: hidden;
    font: 400 12px/1 var(--f-mono);
}

.sheet-index a {
    display: grid;
    grid-template-columns: 40px 1fr;
    padding: 12px 14px;
    border-top: 1px solid var(--rule);
    color: var(--navy);
}

.sheet-index a:first-child {
    border-top: 0;
}

.sheet-index a:hover,
.sheet-index a.is-cur {
    background: var(--lav);
    color: var(--indigo);
}

/* ---------- nav (injected by main.js) ---------- */
body.sx #header nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 70;
    height: var(--nav-h);
    background: var(--paper);
    border-bottom: 1px solid transparent;
    box-shadow: none;
    padding: 0;
    transition: transform 0.4s var(--ease-out), border-color 0.3s;
}

body.sx #header nav.is-ruled {
    border-bottom-color: var(--rule);
}

body.sx .nav-container {
    max-width: var(--maxw);
    height: 100%;
    margin: 0 auto;
    padding: 0 var(--margin);
    display: flex;
    align-items: center;
    gap: 40px;
}

body.sx .logo {
    color: var(--ink);
    display: flex;
}

body.sx .logo svg {
    height: 21px;
    width: auto;
}

body.sx .nav-links {
    display: flex;
    gap: 28px;
    margin: 0 0 0 auto;
    padding: 0;
    list-style: none;
}

body.sx .nav-links > li > a {
    position: relative;
    font: 500 15px/1 var(--f-sans);
    color: var(--ink);
    padding: 6px 0;
    background: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

body.sx .nav-links > li > a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--ink);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s var(--ease-out);
}

body.sx .nav-links > li > a:hover::after,
body.sx .nav-links > li > a.is-active::after {
    transform: scaleX(1);
    transform-origin: left;
}

body.sx .dropbtn i {
    display: none;
}

body.sx .dropbtn::before {
    content: '↓';
    order: 2;
    font-size: 11px;
    color: var(--mute);
}

body.sx .dropdown {
    position: relative;
}

body.sx .dropdown-content {
    position: absolute;
    top: calc(100% + 14px);
    left: -16px;
    min-width: 220px;
    background: var(--paper);
    border: 1px solid var(--rule-strong);
    border-radius: 14px;
    overflow: hidden;
    padding: 0;
    box-shadow: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.25s, transform 0.35s var(--ease-out), visibility 0.25s;
    display: block;
}

body.sx .dropdown.is-open .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: none;
}

body.sx .dropdown-content a {
    display: block;
    padding: 14px 16px;
    font-size: 15px;
    color: var(--ink);
    background: none;
}

body.sx .dropdown-content a:hover {
    background: var(--ink);
    color: #fff;
}

body.sx .cta-button {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 20px;
    border-radius: 999px;
    background: var(--sig);
    color: #fff;
    font: 500 14px/1 var(--f-sans);
    border: 0;
    box-shadow: none;
    transition: background 0.3s;
    white-space: nowrap;
}

body.sx .cta-button:hover {
    background: var(--ink);
    transform: none;
}

body.sx .nav-pct {
    font: 400 12px/1 var(--f-mono);
    color: var(--navy);
    font-variant-numeric: tabular-nums;
    min-width: 36px;
    text-align: right;
}

body.sx .mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    background: none;
    border: 1px solid var(--rule-strong);
    border-radius: 999px;
    color: var(--ink);
    cursor: pointer;
    font-size: 16px;
}

body.sx .mobile-menu {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    height: calc(100dvh - var(--nav-h));
    background: var(--paper);
    border-top: 1px solid var(--rule);
    padding: 24px var(--margin);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    clip-path: inset(0 0 100% 0);
    transition: clip-path 0.6s var(--ease-io);
    box-shadow: none;
}

body.sx .mobile-menu.active {
    clip-path: inset(0);
    display: flex;
}

body.sx .mobile-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

body.sx .mobile-menu > ul > li {
    border-bottom: 1px solid var(--rule);
    padding: 18px 0;
}

body.sx .mobile-menu > ul > li > a,
body.sx .mobile-menu .mobile-dropdown-title {
    font-size: 32px !important;
    font-weight: 600 !important;
    letter-spacing: -0.04em;
    color: var(--ink) !important;
}

body.sx .mobile-menu .cta-button {
    justify-content: center;
    height: 56px;
}

@media (max-width: 960px) {
    body.sx .nav-links,
    body.sx .nav-container > .cta-button,
    body.sx .nav-pct {
        display: none;
    }

    body.sx .mobile-menu-toggle {
        display: grid;
        place-items: center;
        margin-left: auto;
    }
}

/* ---------- footer (injected by main.js) ---------- */
body.sx .site-footer {
    position: relative;
    z-index: 2;
    background:
        radial-gradient(40% 120% at 0% 100%, rgba(63, 156, 232, 0.06), rgba(63, 156, 232, 0) 70%),
        radial-gradient(40% 120% at 100% 100%, rgba(159, 94, 223, 0.06), rgba(159, 94, 223, 0) 70%),
        var(--paper);
    color: var(--ink);
    border-top: 1px solid var(--rule);
    padding: clamp(48px, 7vh, 80px) 0 clamp(28px, 4vh, 40px);
    margin: 0;
}

/* Same 12-col grid as .wrap; content starts at column 2 so it clears the left rail. */
body.sx .footer-content,
body.sx .footer-bottom {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 var(--margin);
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
}

body.sx .footer-content {
    align-items: start;
    row-gap: 32px;
}

body.sx .footer-brand {
    grid-column: 2 / 7;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

body.sx .footer-logo {
    display: inline-flex;
    width: max-content;
}

body.sx .footer-logo img {
    display: block;
    height: 32px;
    width: auto;
}

body.sx .footer-tagline {
    font-size: 17px;
    line-height: 1.5;
    color: var(--body);
    max-width: 32ch;
}

body.sx .footer-nav {
    grid-column: 7 / -1;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 14px 32px;
    padding-top: 6px;
}

body.sx .footer-nav a {
    position: relative;
    font-size: 16px;
    font-weight: 500;
    color: var(--ink);
    transition: color 0.25s;
}

body.sx .footer-nav a:hover {
    color: var(--indigo);
}

body.sx .footer-nav .footer-cta {
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--sig);
    color: #fff;
}

body.sx .footer-nav .footer-cta:hover {
    color: #fff;
    background: var(--ink);
}

body.sx .footer-bottom {
    margin-top: clamp(40px, 6vh, 64px);
    align-items: center;
    font-size: 14px;
    color: var(--mute);
}

/* divider spans the content columns only (not across the rail) */
body.sx .footer-bottom::before {
    content: '';
    grid-column: 2 / -1;
    grid-row: 1;
    height: 1px;
    background: var(--rule);
    margin-bottom: 22px;
}

body.sx .footer-meta {
    grid-column: 2 / 9;
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 28px;
}

body.sx .footer-bottom p {
    margin: 0;
    color: inherit;
}

body.sx .footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
}

body.sx .footer-legal a {
    color: var(--body);
    transition: color 0.25s;
}

body.sx .footer-legal a:hover {
    color: var(--indigo);
}

body.sx .footer-top {
    grid-column: 9 / -1;
    grid-row: 2;
    justify-self: end;
    color: var(--body);
    transition: color 0.25s;
}

body.sx .footer-top:hover {
    color: var(--indigo);
}

@media (max-width: 1023px) {
    body.sx .footer-brand,
    body.sx .footer-nav,
    body.sx .footer-bottom::before,
    body.sx .footer-meta {
        grid-column: 1 / -1;
    }

    body.sx .footer-nav {
        justify-content: flex-start;
        padding-top: 0;
    }

    body.sx .footer-top {
        grid-column: 1 / -1;
        grid-row: 3;
        justify-self: start;
        margin-top: 10px;
    }
}

/* tablets still show the left rail (hidden < 768px): keep footer content off it */
@media (min-width: 768px) and (max-width: 1023px) {
    body.sx .footer-content,
    body.sx .footer-bottom {
        padding-left: calc(var(--margin) + 24px);
    }
}

/* ---------- phones: tighter vertical rhythm ---------- */
@media (max-width: 767px) {
    :root {
        --pad-y: 56px;
        /* slimmer nav bar on phones (80px felt too tall) */
        --nav-h: 64px;
    }

    body.sx .mobile-menu-toggle {
        width: 40px;
        height: 40px;
    }

    /* section corner marks just add visual noise in the gaps on small screens */
    main .s > .crop {
        display: none;
    }
}

/* ---------- intro gate ---------- */
html.js-intro .hero-line {
    clip-path: inset(-0.2em 100% -0.35em -0.1em);
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    body.sx *,
    body.sx *::before,
    body.sx *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }

    #rail {
        transform: scaleY(1);
    }
}
