/* ==========================================================================
   online·365  ·  AETHER OS
   AR-augmented liquid glass + HUD editorial design system
   ========================================================================== */

/* === Webfonts ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Manrope:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500;600&family=Noto+Sans+SC:wght@300;400;500;600;700&display=swap');

/* === Design Tokens ======================================================= */
:root {
    /* Surfaces — deep ink */
    --ink-0: #050506;
    --ink-1: #0a0a0c;
    --ink-2: #111115;
    --ink-3: #1a1a21;
    --ink-4: #25252e;

    /* Paper — warm off-white text */
    --paper-0: #f6f2ea;
    --paper-1: #d8d3c8;
    --paper-2: #a8a39a;
    --paper-3: #6e6a62;
    --paper-4: #3a3833;

    /* Chrome — neutral highlight */
    --chrome: #b8b8bc;
    --chrome-soft: rgba(184, 184, 188, 0.18);

    /* Accent — plasma amber (single, locked) */
    --amber: #ff7a3d;
    --amber-warm: #ffaa66;
    --amber-soft: rgba(255, 122, 61, 0.10);
    --amber-line: rgba(255, 122, 61, 0.32);
    --amber-glow: rgba(255, 122, 61, 0.35);

    /* Functional */
    --status-ok: #6fffb0;
    --status-warn: #ffd166;

    /* Glass */
    --glass-bg: rgba(20, 20, 26, 0.45);
    --glass-bg-soft: rgba(20, 20, 26, 0.32);
    --glass-border: rgba(255, 255, 255, 0.07);
    --glass-border-bright: rgba(255, 255, 255, 0.14);
    --glass-hi: rgba(255, 255, 255, 0.06);

    /* Type */
    --font-display: "Space Grotesk", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    --font-body: "Manrope", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
    --font-cn: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;

    /* Rhythm */
    --r-1: 4px;
    --r-2: 8px;
    --r-3: 14px;
    --r-4: 20px;
    --r-5: 28px;
    --r-pill: 999px;

    /* Motion */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* === Reset =============================================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 15px;
    line-height: 1.6;
    color: var(--paper-1);
    background: var(--ink-0);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    font-feature-settings: "ss01", "cv11";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }

/* === Ambient background composition ====================================== */
body::before {
    /* Faint technical grid */
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(184, 184, 188, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(184, 184, 188, 0.025) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

body::after {
    /* Amber light leak + vignette */
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 700px 500px at 12% 8%, rgba(255, 122, 61, 0.07), transparent 60%),
        radial-gradient(ellipse 900px 600px at 90% 90%, rgba(255, 122, 61, 0.04), transparent 60%),
        radial-gradient(ellipse 100% 100% at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
    pointer-events: none;
    z-index: 1;
}

.grain {
    /* Subtle film grain */
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    opacity: 0.05;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.7'/></svg>");
}

/* === Typography utilities ================================================ */
.t-display {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.05;
}

.t-mono {
    font-family: var(--font-mono);
    font-weight: 400;
    letter-spacing: 0.02em;
}

.t-cn {
    font-family: var(--font-cn);
    font-feature-settings: "palt";
}

.mono-label {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--paper-3);
}

.mono-label--amber { color: var(--amber); }
.mono-label--dim { color: var(--paper-4); }

/* === SVG filters (refraction) =========================================== */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

/* === HUD components ====================================================== */

/* Corner brackets — frame any element */
.hud-frame {
    position: relative;
}

.hud-frame::before,
.hud-frame::after,
.hud-frame > .hud-frame__br,
.hud-frame > .hud-frame__bl {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border-color: var(--paper-3);
    border-style: solid;
    border-width: 0;
    pointer-events: none;
    transition: border-color 0.4s var(--ease-out);
}

.hud-frame::before {
    top: 0;
    left: 0;
    border-top-width: 1px;
    border-left-width: 1px;
}

.hud-frame::after {
    top: 0;
    right: 0;
    border-top-width: 1px;
    border-right-width: 1px;
}

.hud-frame__bl {
    bottom: 0;
    left: 0;
    border-bottom-width: 1px;
    border-left-width: 1px;
}

.hud-frame__br {
    bottom: 0;
    right: 0;
    border-bottom-width: 1px;
    border-right-width: 1px;
}

.hud-frame--amber::before,
.hud-frame--amber::after,
.hud-frame--amber > .hud-frame__br,
.hud-frame--amber > .hud-frame__bl {
    border-color: var(--amber-line);
}

/* LED indicator */
.led {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--status-ok);
    box-shadow: 0 0 8px var(--status-ok);
    vertical-align: middle;
    animation: led-pulse 2.4s ease-in-out infinite;
}

.led--amber {
    background: var(--amber);
    box-shadow: 0 0 8px var(--amber-glow);
}

.led--dim {
    background: var(--paper-3);
    box-shadow: none;
    animation: none;
}

@keyframes led-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Scan line */
.scan-line {
    position: relative;
    overflow: hidden;
}

.scan-line::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--amber) 50%, transparent);
    animation: scan-x 5s linear infinite;
    pointer-events: none;
}

@keyframes scan-x {
    0% { left: -60%; }
    100% { left: 130%; }
}

/* Telemetry readout */
.telemetry {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--paper-3);
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    white-space: nowrap;
}

.telemetry__dot {
    width: 3px;
    height: 3px;
    background: var(--paper-4);
    border-radius: 50%;
}

/* === Liquid glass components ============================================ */

/* Base glass — backdrop blur + borders + inner highlight */
.glass {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(32px) saturate(160%) brightness(1.04);
    -webkit-backdrop-filter: blur(32px) saturate(160%) brightness(1.04);
    border: 1px solid var(--glass-border);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.45),
        0 1px 0 rgba(255, 255, 255, 0.05) inset,
        0 -1px 0 rgba(0, 0, 0, 0.35) inset;
    isolation: isolate;
}

.glass::before {
    /* Top edge highlight */
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.18) 0%,
        rgba(255, 255, 255, 0) 30%,
        rgba(255, 255, 255, 0) 70%,
        rgba(255, 255, 255, 0.06) 100%
    );
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 1;
}

/* Heavy glass — for cards/panels */
.glass-heavy {
    background: linear-gradient(
        135deg,
        rgba(40, 40, 50, 0.55) 0%,
        rgba(20, 20, 26, 0.65) 100%
    );
    backdrop-filter: blur(40px) saturate(180%) brightness(1.05);
    -webkit-backdrop-filter: blur(40px) saturate(180%) brightness(1.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.55),
        0 1px 0 rgba(255, 255, 255, 0.07) inset,
        0 -1px 0 rgba(0, 0, 0, 0.4) inset;
}

/* Real refraction — apply to hero/featured only */
.glass-refract {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.02) 50%,
        rgba(255, 122, 61, 0.04) 100%
    );
    backdrop-filter: blur(28px) saturate(180%) brightness(1.08);
    -webkit-backdrop-filter: blur(28px) saturate(180%) brightness(1.08);
    filter: url(#liquid-refract);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(0, 0, 0, 0.4);
    position: relative;
}

/* === Page chrome ========================================================= */
.main-content {
    max-width: 1440px;
    margin: 0 auto;
    padding: 160px 2.5rem 4rem;
    position: relative;
    z-index: 3;
}

/* === Top status bar (HUD) ================================================ */
.hud-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 400;
    color: var(--paper-3);
    background: rgba(5, 5, 6, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    letter-spacing: 0.06em;
}

.hud-topbar__group {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.hud-topbar__item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-transform: uppercase;
}

.hud-topbar__item strong {
    color: var(--paper-1);
    font-weight: 500;
}

.hud-topbar__pulse {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--amber);
    box-shadow: 0 0 6px var(--amber);
    animation: led-pulse 1.6s ease-in-out infinite;
}

/* === Header ============================================================== */
.glass-header {
    position: fixed;
    top: 28px;
    left: 0;
    right: 0;
    z-index: 50;
    background: linear-gradient(180deg, rgba(10, 10, 12, 0.75) 0%, rgba(10, 10, 12, 0.55) 100%);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.3),
        0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.header-content {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 2.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

/* Logo */
.logo {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--paper-0);
    display: inline-flex;
    align-items: baseline;
    gap: 0.4ch;
    line-height: 1;
}

.logo__dot {
    color: var(--amber);
    text-shadow: 0 0 12px var(--amber-glow);
}

.logo__sub {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 400;
    color: var(--paper-3);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-left: 0.8em;
    padding-left: 0.8em;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.logo__hash {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--paper-4);
    margin-left: 0.4em;
    font-weight: 400;
}

/* Nav */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.nav-link {
    position: relative;
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--paper-2);
    padding: 8px 14px;
    border-radius: 8px;
    letter-spacing: 0.01em;
    transition: all 0.25s var(--ease-out);
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
}

.nav-link__num {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--paper-4);
    font-weight: 400;
    transition: color 0.25s var(--ease-out);
}

.nav-link:hover {
    color: var(--paper-0);
    background: rgba(255, 255, 255, 0.04);
}

.nav-link:hover .nav-link__num { color: var(--amber); }

.nav-link.is-active {
    color: var(--amber);
    background: var(--amber-soft);
}

.nav-link.is-active .nav-link__num { color: var(--amber); }

/* User area */
.user-area {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.user-area__user {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 6px 12px 6px 8px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--paper-1);
}

.user-area__avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--amber), var(--amber-warm));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--ink-0);
    text-transform: uppercase;
}

/* Buttons */
.btn-glass {
    --btn-h: 38px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6em;
    height: var(--btn-h);
    padding: 0 1.2rem;
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--paper-1);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    overflow: hidden;
    isolation: isolate;
}

.btn-glass::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent);
    opacity: 0.6;
    pointer-events: none;
}

.btn-glass:hover {
    color: var(--paper-0);
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.btn-glass:active {
    transform: translateY(0);
}

.btn-glass--primary {
    color: var(--ink-0);
    background: var(--amber);
    border-color: var(--amber);
    box-shadow:
        0 8px 24px rgba(255, 122, 61, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.btn-glass--primary::before {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.25), transparent);
    opacity: 1;
}

.btn-glass--primary:hover {
    background: var(--amber-warm);
    color: var(--ink-0);
    box-shadow:
        0 12px 32px rgba(255, 122, 61, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-glass--block { width: 100%; }
.btn-glass--sm { --btn-h: 32px; padding: 0 0.9rem; font-size: 10.5px; }

/* === Page hero =========================================================== */
.page-hero {
    position: relative;
    padding: 2.5rem 0 4rem;
    margin-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.page-hero__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 4rem;
    align-items: end;
}

.page-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1.4rem;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--amber);
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.page-hero__eyebrow::before {
    content: "";
    width: 24px;
    height: 1px;
    background: var(--amber);
}

.page-hero__title {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 4.8vw, 4.2rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--paper-0);
    margin-bottom: 1.2rem;
}

.page-hero__title em {
    font-style: normal;
    color: var(--amber);
    font-family: var(--font-display);
    font-weight: 500;
}

.page-hero__sub {
    font-family: var(--font-cn);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.65;
    color: var(--paper-2);
    max-width: 50ch;
}

.page-hero__meta {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    align-items: flex-end;
    text-align: right;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--paper-3);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-hero__meta-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 4px;
}

.page-hero__meta-row strong {
    color: var(--paper-1);
    font-weight: 500;
}

/* === Home: API cards (asymmetric grid) =================================== */
.home-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 280px;
    gap: 1.2rem;
}

.api-card {
    position: relative;
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    padding: 1.8rem;
    background: linear-gradient(
        160deg,
        rgba(30, 30, 40, 0.55) 0%,
        rgba(15, 15, 22, 0.6) 100%
    );
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--r-3);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out), border-color 0.5s var(--ease-out);
    isolation: isolate;
    text-decoration: none;
    color: inherit;
    transform: perspective(900px) rotateX(var(--ty, 0deg)) rotateY(var(--tx, 0deg));
    transform-style: preserve-3d;
    will-change: transform;
}

.api-card::before {
    /* Top edge highlight */
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 5%, rgba(255, 255, 255, 0.18) 50%, transparent 95%);
}

.api-card::after {
    /* Subtle inner glow on hover */
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 60% 80% at 30% 0%,
        rgba(255, 122, 61, 0.08),
        transparent 60%
    );
    opacity: 0;
    transition: opacity 0.5s var(--ease-out);
    pointer-events: none;
    z-index: 0;
}

.api-card:hover {
    --lift-y: -3px;
    border-color: rgba(255, 122, 61, 0.25);
    box-shadow:
        0 30px 70px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 122, 61, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.api-card:hover::after { opacity: 1; }

.api-card__corner {
    position: absolute;
    width: 10px;
    height: 10px;
    border: 1px solid var(--paper-4);
    pointer-events: none;
    transition: border-color 0.4s var(--ease-out);
}

.api-card__corner--tl { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.api-card__corner--tr { top: 10px; right: 10px; border-left: 0; border-bottom: 0; }
.api-card__corner--bl { bottom: 10px; left: 10px; border-right: 0; border-top: 0; }
.api-card__corner--br { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }

.api-card:hover .api-card__corner { border-color: var(--amber); }

.api-card__index {
    position: absolute;
    top: 14px;
    right: 18px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 500;
    color: var(--paper-3);
    letter-spacing: 0.1em;
    z-index: 2;
}

.api-card__icon {
    width: 44px;
    height: 44px;
    margin-bottom: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--amber);
    position: relative;
    z-index: 2;
}

.api-card__icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 8px rgba(255, 122, 61, 0.3));
    transition: transform 0.5s var(--ease-out);
}

.api-card:hover .api-card__icon svg { transform: rotate(-4deg) scale(1.05); }

.api-card__title {
    font-family: var(--font-cn);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--paper-0);
    margin-bottom: 0.4rem;
    position: relative;
    z-index: 2;
}

.api-card__title-en {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 400;
    color: var(--paper-4);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 0.9rem;
    display: block;
    position: relative;
    z-index: 2;
}

.api-card__desc {
    font-family: var(--font-cn);
    font-size: 13.5px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--paper-3);
    margin-bottom: 1.4rem;
    position: relative;
    z-index: 2;
    max-width: 38ch;
}

.api-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--paper-3);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    position: relative;
    z-index: 2;
}

.api-card__foot-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.api-card__arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    color: var(--amber);
    transition: gap 0.3s var(--ease-out);
}

.api-card__arrow svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
}

.api-card:hover .api-card__arrow { gap: 0.7em; }

/* Featured card — wider, taller, with refraction */
.api-card--featured {
    grid-column: span 4;
    grid-row: span 2;
    padding: 2.4rem;
    background: linear-gradient(
        135deg,
        rgba(40, 36, 30, 0.6) 0%,
        rgba(20, 20, 26, 0.7) 100%
    );
    filter: url(#liquid-refract);
    border-color: rgba(255, 122, 61, 0.18);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.api-card--featured .api-card__icon {
    width: 64px;
    height: 64px;
}

.api-card--featured .api-card__title {
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.api-card--featured .api-card__desc {
    font-size: 15px;
    max-width: 46ch;
    color: var(--paper-2);
}

.api-card--featured::after {
    background: radial-gradient(
        ellipse 50% 70% at 80% 100%,
        rgba(255, 122, 61, 0.18),
        transparent 60%
    );
    opacity: 1;
}

/* Card index sweep on featured */
.api-card__sweep {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        100deg,
        transparent 30%,
        rgba(255, 122, 61, 0.06) 50%,
        transparent 70%
    );
    transform: translateX(-100%);
    transition: transform 0.9s var(--ease-out);
    pointer-events: none;
    z-index: 1;
}

.api-card:hover .api-card__sweep { transform: translateX(100%); }

/* Asymmetric: last two cards span 3 cols to fill the grid exactly */
.api-card:nth-child(4),
.api-card:nth-child(5) {
    grid-column: span 3;
}

.api-card:nth-child(4) .api-card__title,
.api-card:nth-child(5) .api-card__title {
    font-size: 22px;
}

/* === Glass card (generic) =============================================== */
.glass-card {
    position: relative;
    background: linear-gradient(
        160deg,
        rgba(30, 30, 40, 0.5) 0%,
        rgba(15, 15, 22, 0.6) 100%
    );
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--r-4);
    padding: 2.4rem;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    overflow: hidden;
    isolation: isolate;
    --tx: 0deg;
    --ty: 0deg;
    transform: perspective(1000px) rotateX(var(--ty)) rotateY(var(--tx));
    transform-style: preserve-3d;
    will-change: transform;
}

.glass-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 5%, rgba(255, 255, 255, 0.18) 50%, transparent 95%);
}

.glass-card--narrow {
    max-width: 460px;
    margin: 0 auto;
    padding: 2.6rem 2.4rem;
}

.glass-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.8rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-card__title {
    font-family: var(--font-cn);
    font-size: 18px;
    font-weight: 600;
    color: var(--paper-0);
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.glass-card__title em {
    font-style: normal;
    color: var(--amber);
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

/* === Forms =============================================================== */
.form-group {
    margin-bottom: 1.3rem;
}

.form-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--paper-3);
}

.form-label__hint {
    font-family: var(--font-mono);
    font-size: 9.5px;
    color: var(--paper-4);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.form-input {
    width: 100%;
    height: 46px;
    padding: 0 1rem;
    background: rgba(5, 5, 8, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--paper-0);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.02em;
    outline: none;
    transition: all 0.3s var(--ease-out);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.form-input::placeholder {
    color: var(--paper-4);
    font-weight: 300;
}

.form-input:hover {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(5, 5, 8, 0.6);
}

.form-input:focus {
    border-color: var(--amber);
    background: rgba(5, 5, 8, 0.7);
    box-shadow:
        0 0 0 3px rgba(255, 122, 61, 0.12),
        inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.form-foot {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-family: var(--font-cn);
    font-size: 13px;
    color: var(--paper-3);
}

.form-foot a {
    color: var(--amber);
    font-weight: 500;
    transition: color 0.2s var(--ease-out);
}

.form-foot a:hover { color: var(--amber-warm); }

/* === Alerts ============================================================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.9rem 1.1rem;
    margin-bottom: 1.4rem;
    border-radius: 8px;
    font-family: var(--font-cn);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

.alert::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 7px;
}

.alert--success {
    color: #b3f5d4;
    background: rgba(111, 255, 176, 0.06);
    border: 1px solid rgba(111, 255, 176, 0.18);
}

.alert--success::before { background: var(--status-ok); box-shadow: 0 0 6px var(--status-ok); }

.alert--error {
    color: #ffb5b5;
    background: rgba(255, 90, 90, 0.06);
    border: 1px solid rgba(255, 90, 90, 0.18);
}

.alert--error::before { background: #ff5a5a; box-shadow: 0 0 6px rgba(255, 90, 90, 0.5); }

/* === Content list ======================================================== */
.content-list {
    display: flex;
    flex-direction: column;
}

.content-item {
    position: relative;
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 1.5rem;
    align-items: start;
    padding: 1.4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.3s var(--ease-out);
}

.content-item::before {
    content: "";
    position: absolute;
    left: -1.2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--amber);
    transition: height 0.3s var(--ease-out);
}

.content-item:hover::before { height: 60%; }

.content-item__index {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--paper-4);
    letter-spacing: 0.1em;
    padding-top: 4px;
}

.content-item__body {
    min-width: 0;
}

.content-item__title {
    font-family: var(--font-cn);
    font-size: 15.5px;
    font-weight: 500;
    line-height: 1.55;
    color: var(--paper-1);
    transition: color 0.3s var(--ease-out);
    margin-bottom: 0.5rem;
}

.content-item:hover .content-item__title { color: var(--paper-0); }

.content-item__source {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 400;
    color: var(--paper-4);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.content-item__source::before {
    content: "";
    width: 4px;
    height: 4px;
    background: var(--amber);
    border-radius: 50%;
}

.content-item__meta {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--paper-4);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding-top: 4px;
    text-align: right;
    white-space: nowrap;
}

/* === Loading ============================================================= */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    gap: 1.4rem;
    color: var(--paper-3);
}

/* === Reveal on scroll =================================================== */
[data-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

[data-reveal].is-revealed {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

.loading__pulse {
    width: 56px;
    height: 56px;
    position: relative;
}

.loading__pulse::before,
.loading__pulse::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid var(--amber);
    border-radius: 50%;
    animation: pulse-ring 2s ease-out infinite;
    opacity: 0;
}

.loading__pulse::after { animation-delay: 1s; }

@keyframes pulse-ring {
    0% { transform: scale(0.4); opacity: 0.8; }
    100% { transform: scale(1.2); opacity: 0; }
}

.loading__label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--paper-3);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

/* === Footer ============================================================== */
.hud-footer {
    margin-top: 6rem;
    padding: 2.5rem 2.5rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    position: relative;
    z-index: 3;
}

.hud-footer__inner {
    max-width: 1440px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    align-items: end;
}

.hud-footer__brand {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--paper-2);
    letter-spacing: -0.01em;
}

.hud-footer__brand .logo__dot { color: var(--amber); }

.hud-footer__tag {
    font-family: var(--font-cn);
    font-size: 12.5px;
    color: var(--paper-4);
    line-height: 1.6;
    max-width: 36ch;
}

.hud-footer__meta {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--paper-4);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.hud-footer__meta strong { color: var(--paper-2); font-weight: 500; }

/* === Auth layout ========================================================= */
.auth-layout {
    max-width: 460px;
    margin: 0 auto;
    position: relative;
}

.auth-layout .page-hero { padding: 2.5rem 0 2rem; margin-bottom: 1.5rem; }
.auth-layout .page-hero__title { font-size: 2.4rem; }

/* === Mobile menu toggle ================================================== */
.menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--paper-1);
}

.menu-toggle svg { width: 18px; height: 18px; }

/* === Responsive ========================================================== */
@media (max-width: 1200px) {
    .home-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: 260px;
    }
    .api-card,
    .api-card:nth-child(4),
    .api-card:nth-child(5) { grid-column: span 2; }
    .api-card--featured { grid-column: span 4; grid-row: span 2; }
    .api-card:nth-child(4) .api-card__title,
    .api-card:nth-child(5) .api-card__title { font-size: 20px; }
}

@media (max-width: 900px) {
    .header-content { padding: 0 1.5rem; }
    .main-content { padding: 130px 1.5rem 3rem; }
    .page-hero__grid { grid-template-columns: 1fr; gap: 2rem; }
    .page-hero__meta { align-items: flex-start; text-align: left; }
    .home-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 240px; }
    .api-card,
    .api-card:nth-child(4),
    .api-card:nth-child(5) { grid-column: span 1; }
    .api-card--featured { grid-column: span 2; grid-row: span 1; }
    .hud-topbar { padding: 0 1rem; font-size: 9.5px; }
    .hud-topbar__group { gap: 0.8rem; }
    .hud-footer__inner { grid-template-columns: 1fr; text-align: left; }
    .hud-footer__meta { text-align: left; }
}

@media (max-width: 720px) {
    .nav-menu {
        position: fixed;
        top: 92px;
        left: 1rem;
        right: 1rem;
        flex-direction: column;
        align-items: stretch;
        background: rgba(10, 10, 12, 0.95);
        backdrop-filter: blur(28px);
        -webkit-backdrop-filter: blur(28px);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: var(--r-3);
        padding: 0.8rem;
        gap: 0.2rem;
        z-index: 49;
        transform: translateY(-10px);
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s var(--ease-out);
    }
    .nav-menu.is-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
    .nav-link { padding: 12px 14px; font-size: 14px; }
    .menu-toggle { display: inline-flex; }
    .user-area__user { padding: 4px 8px; font-size: 10.5px; }
    .hud-topbar__item:not(.hud-topbar__item--always) { display: none; }
    .home-grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
    .api-card,
    .api-card--featured,
    .api-card:nth-child(4),
    .api-card:nth-child(5) { grid-column: span 1; grid-row: auto; min-height: 200px; }
    .api-card--featured .api-card__title { font-size: 24px; }
    .page-hero__title { font-size: 2rem; }
    .content-item { grid-template-columns: 40px 1fr; gap: 1rem; }
    .content-item__meta { grid-column: 2; text-align: left; padding-top: 0; }
    .glass-card { padding: 1.6rem; border-radius: var(--r-3); }
    .hud-footer { padding: 2rem 1.5rem; }
}

@media (max-width: 480px) {
    .main-content { padding: 110px 1rem 2rem; }
    .header-content { padding: 0 1rem; }
    .page-hero__title { font-size: 1.75rem; }
    .hud-topbar { display: none; }
    .glass-header { top: 0; }
}

/* === Reduced motion ====================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .scan-line::after { display: none; }
}

/* === Reduced transparency (a11y) ======================================== */
@media (prefers-reduced-transparency: reduce) {
    .glass,
    .glass-heavy,
    .glass-refract,
    .glass-card,
    .glass-header,
    .api-card,
    .api-card--featured,
    .hud-topbar,
    .form-input,
    .btn-glass {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--ink-2);
    }
}

/* === Print =============================================================== */
@media print {
    .hud-topbar, .glass-header, .hud-footer, .menu-toggle { display: none; }
    body { background: white; color: black; }
}
