/* Morphism - base layout & components (load before cinematic.css) */

:root {
 --mono: 'DM Mono', 'IBM Plex Mono', ui-monospace, monospace;
 --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
 --ink: #0a0a0a;
 --ink-muted: #5c5c5c;
 --ink-light: #9a9a9a;
 --white: #ffffff;
 --border: #e8e6ef;
 --violet: #5b3de8;
 --violet-dim: rgba(91, 61, 232, 0.06);
 --violet-border: rgba(91, 61, 232, 0.25);
 --green: #16a34a;
 --red: #dc2626;
 --amber: #d97706;
 --dark: #000000;
 --dark-mid: #0a0a0a;
 --header-h: 72px;
}

/* ── Morph-spectrum text utility ───────────────────────
 Reusable gradient sweep applied via background-clip:text.
 Wrap any inline text in <span class="morph-text">…</span>
 to make it flow through the brand spectrum. */
@property --morph-text-pos {
 syntax: '<percentage>';
 inherits: false;
 initial-value: 0%;
}

.morph-text {
 display: inline-block;
 padding: 0 0.1em;
 margin: 0 -0.05em;
 background-image: linear-gradient(
 100deg,
 #5b3de8 0%,
 #8c6dff 18%,
 #38bdf8 36%,
 #34d399 54%,
 #fbbf24 72%,
 #ec4899 90%,
 #5b3de8 100%
 );
 background-size: 300% 100%;
 background-position: var(--morph-text-pos, 0%) 50%;
 -webkit-background-clip: text;
 background-clip: text;
 color: transparent;
 -webkit-text-fill-color: transparent;
 animation: morphTextShift 7s linear infinite;
}

@keyframes morphTextShift {
 to { --morph-text-pos: 300%; }
}

@media (prefers-reduced-motion: reduce) {
 .morph-text { animation: none; }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
 html { scroll-behavior: auto; }
}

body {
 margin: 0;
 font-family: var(--sans);
 font-size: 15px;
 color: var(--ink);
 background: var(--white);
 -webkit-font-smoothing: antialiased;
}

.page-body { min-height: 100vh; }

a { color: inherit; }

.container {
 width: 100%;
 max-width: 1120px;
 margin: 0 auto;
 padding: 0 24px;
}

/* ── Header ───────────────────────────────────────── */
#morphism-header {
 position: fixed;
 top: 0;
 left: 0;
 right: 0;
 z-index: 1000;
 height: var(--header-h);
 display: flex;
 align-items: center;
 justify-content: space-between;
 padding: 0 24px;
 background: rgba(255, 255, 255, 0.92);
 border-bottom: 1px solid transparent;
 transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

#morphism-header.header-scrolled {
 background: rgba(255, 255, 255, 0.98);
 border-bottom-color: var(--border);
 box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.logo {
 display: inline-flex;
 align-items: center;
 gap: 10px;
 font-family: var(--mono);
 font-size: 12px;
 font-weight: 400;
 letter-spacing: 0.12em;
 text-transform: uppercase;
 text-decoration: none;
 color: var(--ink);
}

.logo-img {
 display: block;
 height: 28px;
 width: auto;
 max-width: 140px;
 object-fit: contain;
 background: transparent;
 border: 0;
 box-shadow: none;
 vertical-align: middle;
}

.logo--footer {
 margin-bottom: 12px;
}

.logo--footer .logo-img {
 height: 26px;
 max-width: 130px;
}

/* Hex mark fallback (legacy) */
.logo-mark {
 width: 28px;
 height: 28px;
 display: flex;
 align-items: center;
 justify-content: center;
}

.logo-mark svg { width: 22px; height: 22px; }

.nav {
 display: flex;
 align-items: center;
 gap: 8px;
}

.nav-item-wrap {
 position: relative;
}

.nav-link {
 font-family: var(--mono);
 font-size: 10px;
 font-weight: 400;
 letter-spacing: 0.1em;
 text-transform: uppercase;
 text-decoration: none;
 color: var(--ink-muted);
 padding: 10px 12px;
 border-radius: 2px;
 transition: color 0.15s ease, background 0.15s ease;
}

.nav-link:hover { color: var(--ink); background: var(--violet-dim); }
.nav-link.nav-active { color: var(--violet); }

.nav-preview {
 position: absolute;
 top: calc(100% + 8px);
 left: 50%;
 transform: translateX(-50%) translateY(4px);
 min-width: 200px;
 max-width: min(260px, calc(100vw - 24px));
 box-sizing: border-box;
 padding: 10px 12px;
 background: var(--ink);
 color: rgba(255, 255, 255, 0.85);
 font-family: var(--mono);
 font-size: 9px;
 font-weight: 300;
 line-height: 1.5;
 letter-spacing: 0.04em;
 border-radius: 3px;
 opacity: 0;
 visibility: hidden;
 pointer-events: none;
 transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
 z-index: 50;
}

/* First product link: anchor preview to the left so it does not clip off the viewport edge */
.nav-item-wrap:first-of-type .nav-preview {
 left: 0;
 right: auto;
 transform: translateX(0) translateY(4px);
}

.nav-item-wrap:first-of-type:hover .nav-preview {
 transform: translateX(0) translateY(0);
}

/* Last product (MorphTech): anchor to the right */
.nav-item-wrap:last-of-type .nav-preview {
 left: auto;
 right: 0;
 transform: translateX(0) translateY(4px);
}

.nav-item-wrap:last-of-type:hover .nav-preview {
 transform: translateX(0) translateY(0);
}

.nav-item-wrap:hover .nav-preview {
 opacity: 1;
 visibility: visible;
}

/* Centre preview only for the middle product column */
.nav-item-wrap:not(:first-of-type):not(:last-of-type):hover .nav-preview {
 transform: translateX(-50%) translateY(0);
}

.nav-preview-dot {
 display: inline-block;
 width: 4px;
 height: 4px;
 border-radius: 50%;
 background: var(--violet);
 margin-right: 6px;
 vertical-align: middle;
}

.nav-cta {
 font-family: var(--mono);
 font-size: 10px;
 font-weight: 400;
 letter-spacing: 0.12em;
 text-transform: uppercase;
 text-decoration: none;
 color: var(--white);
 background: var(--ink);
 padding: 10px 18px;
 border-radius: 2px;
 margin-left: 8px;
 transition: background 0.15s ease;
}

.nav-cta:hover { background: var(--violet); }

.nav-burger {
 display: none;
 flex-direction: column;
 gap: 5px;
 background: none;
 border: none;
 padding: 8px;
 cursor: pointer;
}

.nav-burger span {
 display: block;
 width: 20px;
 height: 1.5px;
 background: var(--ink);
 transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-burger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-nav {
 display: none;
 position: fixed;
 top: var(--header-h);
 left: 0;
 right: 0;
 background: var(--white);
 border-bottom: 1px solid var(--border);
 flex-direction: column;
 padding: 16px 24px max(24px, env(safe-area-inset-bottom, 0px));
 max-height: calc(100dvh - var(--header-h) - 12px);
 overflow-y: auto;
 -webkit-overflow-scrolling: touch;
 overscroll-behavior: contain;
 z-index: 999;
 transform: translateY(-8px);
 opacity: 0;
 visibility: hidden;
 transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.mobile-nav.open {
 display: flex;
 opacity: 1;
 visibility: visible;
 transform: translateY(0);
}

.mob-link {
 font-family: var(--mono);
 font-size: 11px;
 letter-spacing: 0.08em;
 text-transform: uppercase;
 text-decoration: none;
 color: var(--ink);
 padding: 12px 0;
 border-bottom: 1px solid var(--border);
}

.mob-link:last-child { border-bottom: none; }
.mob-link-active {
 color: var(--violet) !important;
}

.mob-cta { color: var(--violet); font-weight: 500; }

@media (max-width: 900px) {
 .nav { display: none; }
 .nav-burger { display: flex; }
 .mobile-nav.open { display: flex; }
}

/* ── Footer ───────────────────────────────────────── */
#morphism-footer {
 background: var(--dark);
 color: rgba(255, 255, 255, 0.55);
 padding: 72px 0 32px;
}

.footer-inner { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.footer-top {
 display: grid;
 grid-template-columns: 1.4fr repeat(3, 1fr);
 gap: 48px;
 padding-bottom: 48px;
 border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-tagline {
 font-family: var(--mono);
 font-size: 11px;
 font-weight: 300;
 line-height: 1.75;
 letter-spacing: 0.04em;
 margin: 0;
 margin-top: 8px;
 color: rgba(255, 255, 255, 0.35);
}

.footer-col-title {
 font-family: var(--mono);
 font-size: 9px;
 font-weight: 400;
 letter-spacing: 0.2em;
 text-transform: uppercase;
 color: rgba(255, 255, 255, 0.35);
 margin-bottom: 16px;
}

.footer-link {
 display: block;
 font-family: var(--mono);
 font-size: 11px;
 font-weight: 300;
 color: rgba(255, 255, 255, 0.65);
 text-decoration: none;
 margin-bottom: 10px;
 letter-spacing: 0.04em;
 transition: color 0.15s ease;
}

.footer-link:hover { color: var(--white); }

.footer-metric {
 display: flex;
 justify-content: space-between;
 align-items: baseline;
 margin-bottom: 12px;
 font-family: var(--mono);
 font-size: 10px;
}

.fm-label { color: rgba(255, 255, 255, 0.35); letter-spacing: 0.06em; }
.fm-val { color: rgba(255, 255, 255, 0.85); font-weight: 400; }
.fm-val.pos { color: rgba(91, 61, 232, 0.9); }

.footer-bottom {
 display: flex;
 justify-content: space-between;
 align-items: center;
 padding-top: 24px;
 font-family: var(--mono);
 font-size: 9px;
 letter-spacing: 0.1em;
 color: rgba(255, 255, 255, 0.25);
}

@media (max-width: 900px) {
 .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
 .footer-top { grid-template-columns: 1fr; }
}

/* ── Type scale (cinematic.css overrides display / h2) ─ */
.body-lg {
 font-family: var(--sans);
 font-size: clamp(16px, 1.5vw, 19px);
 font-weight: 300;
 line-height: 1.65;
 color: var(--ink-muted);
 letter-spacing: -0.01em;
}

.body-text {
 font-family: var(--mono);
 font-size: 12px;
 font-weight: 300;
 line-height: 1.75;
 color: var(--ink-muted);
 letter-spacing: 0.02em;
}

.body-text-white { color: rgba(255, 255, 255, 0.55); }

.section { padding: 100px 0; background: var(--white); }
.section-dim { background: #fafafa; }

.two-col {
 display: grid;
 grid-template-columns: 1fr 1fr;
 gap: 64px;
 align-items: start;
}

@media (max-width: 900px) {
 .two-col { grid-template-columns: 1fr; }
}

/* ── Buttons ──────────────────────────────────────── */
.btn-group { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.btn {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 gap: 8px;
 font-family: var(--mono);
 font-size: 10px;
 font-weight: 400;
 letter-spacing: 0.14em;
 text-transform: uppercase;
 text-decoration: none;
 padding: 14px 24px;
 border-radius: 2px;
 border: 1px solid transparent;
 cursor: pointer;
 transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
 background: var(--ink);
 color: var(--white);
 border-color: var(--ink);
}
.btn-primary:hover { background: var(--violet); border-color: var(--violet); }

.btn-violet {
 background: var(--violet);
 color: var(--white);
 border-color: var(--violet);
}
.btn-violet:hover { filter: brightness(1.06); }

.btn-outline {
 background: transparent;
 color: var(--ink);
 border-color: var(--border);
}
.btn-outline:hover { border-color: var(--ink); background: #fafafa; }

.btn-outline-white {
 background: transparent;
 color: var(--white);
 border-color: rgba(255, 255, 255, 0.25);
}
.btn-outline-white:hover {
 border-color: rgba(255, 255, 255, 0.5);
 background: rgba(255, 255, 255, 0.06);
}

.btn-arrow::after {
 content: '→';
 margin-left: 4px;
 transition: transform 0.2s ease;
}
.btn-arrow:hover::after { transform: translateX(3px); }

/* ── Product badge ────────────────────────────────── */
.product-badge {
 display: inline-flex;
 align-items: center;
 gap: 8px;
 font-family: var(--mono);
 font-size: 9px;
 font-weight: 400;
 letter-spacing: 0.16em;
 text-transform: uppercase;
 color: var(--violet);
 background: var(--violet-dim);
 border: 1px solid var(--violet-border);
 padding: 8px 14px;
 border-radius: 2px;
 margin-bottom: 20px;
}

.product-badge-dot {
 width: 5px;
 height: 5px;
 border-radius: 50%;
 background: var(--violet);
}

/* ── Info box ─────────────────────────────────────── */
.info-box {
 border: 1px solid var(--border);
 border-radius: 3px;
 padding: 20px 22px;
 background: #fafbff;
}

.info-box-title {
 font-family: var(--mono);
 font-size: 10px;
 font-weight: 400;
 letter-spacing: 0.14em;
 text-transform: uppercase;
 color: var(--violet);
 margin-bottom: 10px;
}

.info-box-body {
 font-family: var(--mono);
 font-size: 11px;
 font-weight: 300;
 color: var(--ink-muted);
 line-height: 1.7;
}

/* ── Stat grid (inner pages) ──────────────────────── */
.stat-grid {
 display: grid;
 grid-template-columns: repeat(2, 1fr);
 gap: 1px;
 background: var(--border);
 border: 1px solid var(--border);
 border-radius: 3px;
 overflow: hidden;
}

.stat-grid .stat-card {
 background: var(--white);
 padding: 28px 22px;
}

.stat-grid .stat-value {
 font-family: var(--sans);
 font-size: clamp(36px, 4vw, 52px);
 font-weight: 700;
 letter-spacing: -0.04em;
 line-height: 1;
 margin-bottom: 8px;
 color: var(--ink);
}

.stat-grid .stat-label {
 font-family: var(--mono);
 font-size: 9px;
 font-weight: 300;
 letter-spacing: 0.1em;
 text-transform: uppercase;
 color: var(--ink-muted);
 line-height: 1.5;
}

/* ── CTA band ─────────────────────────────────────── */
.cta-section {
 position: relative;
 padding: 100px 0;
 background: var(--dark);
 overflow: hidden;
}

.heading-white,
h2.heading-white {
 color: #ffffff;
}

/* ── Ticker ───────────────────────────────────────── */
.ticker-wrap {
 overflow: hidden;
 background: var(--white);
}

.ticker-wrap-dark { background: var(--dark); }

.ticker-track {
 display: flex;
 width: max-content;
 gap: 48px;
 will-change: transform;
}

.ticker-item {
 font-family: var(--mono);
 font-size: 9px;
 font-weight: 400;
 letter-spacing: 0.2em;
 text-transform: uppercase;
 color: var(--ink-muted);
 white-space: nowrap;
}

.ticker-wrap-dark .ticker-item { color: rgba(255, 255, 255, 0.35); }

/* ── Canvas hero layer ────────────────────────────── */
.hero-canvas {
 position: absolute;
 inset: 0;
 width: 100%;
 height: 100%;
 pointer-events: none;
 z-index: 1;
}

/* ── Scroll reveal base (animations.js toggles .in-view) ─ */
[data-reveal] {
 opacity: 0;
 transform: translateY(16px);
 transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
 transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-reveal].in-view {
 opacity: 1;
 transform: translateY(0);
}

[data-reveal][data-dir="right"] {
 transform: translateY(16px);
}

[data-stagger] > * {
 opacity: 0;
 transform: translateY(12px);
 transition: opacity 0.45s ease, transform 0.45s ease;
}

[data-stagger].in-view > * {
 opacity: 1;
 transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
 [data-reveal],
 [data-stagger] > * {
 opacity: 1;
 transform: none;
 transition: none;
 }
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible {
 outline: 2px solid var(--violet);
 outline-offset: 2px;
}

/* ═══ Frontier layer - glass, canvas, depth ═══ */
:root {
 --canvas: #f6f4f1;
 --canvas-2: #eeebf7;
 --surface: #ffffff;
 --slate-950: #0a0b10;
 --slate-900: #12141c;
 --glow-violet: rgba(91, 61, 232, 0.45);
 --radius-sm: 6px;
 --radius-md: 12px;
 --radius-lg: 20px;
 --shadow-elevated: 0 4px 24px rgba(18, 20, 28, 0.06), 0 1px 0 rgba(255,255,255,0.8) inset;
 --shadow-float: 0 24px 80px rgba(91, 61, 232, 0.12);
}

body {
 font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
 background: var(--canvas);
 color: var(--ink);
}

#morphism-header {
 background: rgba(246, 244, 241, 0.72);
 -webkit-backdrop-filter: blur(16px) saturate(1.4);
 backdrop-filter: blur(16px) saturate(1.4);
 border-bottom: 1px solid rgba(18, 20, 28, 0.06);
}

#morphism-header.header-scrolled {
 background: rgba(255, 255, 255, 0.88);
 box-shadow: 0 1px 0 rgba(18, 20, 28, 0.04), 0 12px 40px rgba(18, 20, 28, 0.04);
}

.logo {
 font-family: var(--sans);
 font-size: 18px;
 font-weight: 700;
 letter-spacing: -0.03em;
 text-transform: none;
}

.nav-link {
 font-size: 11px;
 letter-spacing: 0.08em;
 border-radius: var(--radius-sm);
}

.nav-cta {
 border-radius: var(--radius-sm);
 box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset;
}

.btn {
 border-radius: var(--radius-md);
 box-shadow: var(--shadow-elevated);
}

.btn-primary:hover {
 box-shadow: 0 8px 32px rgba(91, 61, 232, 0.25);
}

.btn-violet:hover {
 box-shadow: 0 8px 32px rgba(91, 61, 232, 0.3);
}

#morphism-footer {
 background: linear-gradient(165deg, var(--slate-900) 0%, var(--slate-950) 55%, #050508 100%);
}

.cta-section {
 background: linear-gradient(165deg, var(--slate-900) 0%, var(--slate-950) 100%);
}

.container {
 max-width: 1180px;
}

@media (prefers-reduced-motion: reduce) {
 .mesh-blob,
 .hero-mesh,
 .hero-orbit,
 .bento-card::before {
 animation: none !important;
 }
}
