/* luminary.dev -- terminal aesthetic, layered-depth, translucent-frost, sharp-angles */

:root {
    --void: #0A0D10;
    --void-deep: #06080B;
    --frost-fill: rgba(180, 200, 220, 0.08);
    --frost-fill-strong: rgba(180, 200, 220, 0.12);
    --frost-edge: rgba(180, 200, 220, 0.18);
    --frost-edge-bright: rgba(180, 200, 220, 0.32);
    --cyan: #7BD3F7;
    --cyan-soft: rgba(123, 211, 247, 0.55);
    --cyan-faint: rgba(123, 211, 247, 0.18);
    --pale: #E6F1FA;
    --steel: #6F7C8A;
    --hairline: #3A4450;
    --grid-whisper: #1A1F25;
    --amber: #F0B86E;

    --font-condensed: "Barlow Condensed", "Inter", system-ui, sans-serif;
    --font-body: "Inter", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", "Menlo", monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background: var(--void);
}

body {
    background: var(--void);
    color: var(--pale);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(13px, 0.95vw, 16px);
    line-height: 1.65;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    cursor: crosshair;
}

/* Scan-line grid underlay */
.grid-underlay {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, var(--grid-whisper) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-whisper) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.6;
    mask-image: radial-gradient(ellipse at center, black 30%, rgba(0,0,0,0.2) 100%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, rgba(0,0,0,0.2) 100%);
}

/* Subtle vignette */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.55) 100%);
}

/* Cursor trail container */
.cursor-trail-container {
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
}

.cursor-trail-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--cyan);
    box-shadow: 0 0 8px var(--cyan-soft), 0 0 16px var(--cyan-faint);
    transform: translate(-50%, -50%) rotate(45deg);
    pointer-events: none;
    animation: trail-fade 600ms linear forwards;
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

@keyframes trail-fade {
    0% { opacity: 0.9; transform: translate(-50%, -50%) rotate(45deg) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) rotate(45deg) scale(0.2); }
}

/* Common typography */
.mono {
    font-family: var(--font-mono);
    font-weight: 400;
    letter-spacing: 0.01em;
    font-size: 0.85em;
}
.mono.small { font-size: 0.78em; }
.mono.mono-large { font-size: 1.15em; font-weight: 500; }
.dim { color: var(--steel); }
.accent { color: var(--cyan); }

/* Topbar */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 48px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(16px, 3vw, 36px);
    background: rgba(10, 13, 16, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--hairline);
}

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

.topbar-nav {
    display: flex;
    gap: clamp(12px, 2.4vw, 28px);
}

.topbar-nav a {
    color: var(--steel);
    text-decoration: none;
    transition: color 180ms ease;
    font-size: 0.78em;
}

.topbar-nav a:hover {
    color: var(--cyan);
}

.topbar-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--cyan);
    box-shadow: 0 0 6px var(--cyan-soft);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    animation: status-pulse 1800ms ease-in-out infinite;
}

@keyframes status-pulse {
    0%, 100% { opacity: 0.5; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1); }
}

/* Frost panels base */
.frost-panel {
    position: relative;
    background: var(--frost-fill);
    backdrop-filter: blur(14px) saturate(120%);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    border: 1px solid var(--frost-edge);
    color: var(--pale);
    transition: background 280ms ease, border-color 280ms ease;
}

.frost-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,0.045) 0%, transparent 50%);
    z-index: 1;
}

.frost-panel:hover {
    background: var(--frost-fill-strong);
    border-color: var(--frost-edge-bright);
}

.panel-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--hairline);
    color: var(--steel);
    font-size: 0.78em;
    position: relative;
    z-index: 2;
}

.panel-body {
    padding: 16px;
    position: relative;
    z-index: 2;
}

/* Hero section */
.hero {
    position: relative;
    min-height: 100vh;
    padding: 96px clamp(20px, 5vw, 80px) 60px;
    overflow: hidden;
}

.hairline-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.hairline {
    stroke: var(--hairline);
    stroke-width: 1;
    fill: none;
    stroke-dasharray: 4 6;
    opacity: 0.6;
    animation: hairline-drift 18s linear infinite;
}

@keyframes hairline-drift {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 100; }
}

.panel-back, .panel-mid, .panel-front {
    position: absolute;
    will-change: transform;
}

.panel-back {
    top: 12%;
    right: 4%;
    width: clamp(280px, 40vw, 540px);
    height: clamp(320px, 50vh, 480px);
    z-index: 2;
    background: rgba(180, 200, 220, 0.04);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    clip-path: polygon(24px 0, 100% 0, 100% calc(100% - 24px), calc(100% - 24px) 100%, 0 100%, 0 24px);
    transform: rotate(-1deg);
}

.panel-back .panel-grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(123,211,247,0.06) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(123,211,247,0.06) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

.panel-mid {
    top: 22%;
    right: 14%;
    width: clamp(260px, 36vw, 460px);
    z-index: 3;
    background: rgba(180, 200, 220, 0.07);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 28px 100%, 0 calc(100% - 28px));
    transform: rotate(0.6deg);
}

.panel-front {
    top: 30%;
    left: 6%;
    width: clamp(320px, 56vw, 720px);
    z-index: 5;
    background: rgba(180, 200, 220, 0.10);
    backdrop-filter: blur(18px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
    border: 1px solid var(--frost-edge-bright);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 32px), calc(100% - 32px) 100%, 0 100%);
    padding-bottom: 24px;
    transform: rotate(-0.4deg);
}

.wordmark {
    font-family: var(--font-condensed);
    font-weight: 600;
    font-size: clamp(40px, 8.5vw, 124px);
    line-height: 0.95;
    letter-spacing: -0.015em;
    padding: 28px 28px 8px;
    color: var(--pale);
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
}

.wm-char {
    display: inline-block;
    transition: transform 220ms ease, color 220ms ease;
    opacity: 0;
    transform: translateY(8px);
    animation: wm-in 480ms ease forwards;
}

.wordmark .wm-char:nth-child(1) { animation-delay: 80ms; }
.wordmark .wm-char:nth-child(2) { animation-delay: 140ms; }
.wordmark .wm-char:nth-child(3) { animation-delay: 200ms; }
.wordmark .wm-char:nth-child(4) { animation-delay: 260ms; }
.wordmark .wm-char:nth-child(5) { animation-delay: 320ms; }
.wordmark .wm-char:nth-child(6) { animation-delay: 380ms; }
.wordmark .wm-char:nth-child(7) { animation-delay: 440ms; }
.wordmark .wm-char:nth-child(8) { animation-delay: 500ms; }
.wm-dot { color: var(--cyan); animation-delay: 560ms; opacity: 0; transform: translateY(8px); animation: wm-in 480ms ease forwards; display: inline-block; }
.wordmark .wm-char:nth-child(10) { animation-delay: 620ms; }
.wordmark .wm-char:nth-child(11) { animation-delay: 680ms; }
.wordmark .wm-char:nth-child(12) { animation-delay: 740ms; }

@keyframes wm-in {
    to { opacity: 1; transform: translateY(0); }
}

.cursor-block {
    color: var(--cyan);
    font-size: 0.85em;
    margin-left: 0.08em;
    animation: cursor-blink 530ms steps(2, end) infinite;
    display: inline-block;
    transform-origin: center;
    will-change: transform;
}

@keyframes cursor-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0.1; }
}

.hero-tagline {
    font-family: var(--font-condensed);
    font-weight: 400;
    font-size: clamp(15px, 1.6vw, 22px);
    color: var(--steel);
    padding: 0 28px;
    max-width: 540px;
    line-height: 1.45;
    letter-spacing: 0.01em;
    position: relative;
    z-index: 2;
}

.hero-actions {
    display: flex;
    gap: 14px;
    padding: 24px 28px 0;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.btn-ghost, .btn-line {
    display: inline-block;
    padding: 12px 22px;
    text-decoration: none;
    border: 1px solid var(--frost-edge);
    color: var(--pale);
    background: transparent;
    transition: all 220ms ease;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
    font-size: 0.85em;
    letter-spacing: 0.04em;
    cursor: pointer;
}

.btn-ghost {
    background: var(--cyan-faint);
    border-color: var(--cyan-soft);
    color: var(--cyan);
}

.btn-ghost:hover {
    background: rgba(123, 211, 247, 0.22);
    color: var(--pale);
}

.btn-line:hover {
    border-color: var(--amber);
    color: var(--amber);
}

.mid-meta-body {
    padding: 12px 16px 18px;
}

/* Notch divider */
.notch {
    position: relative;
    width: 100vw;
    height: 80px;
    margin-left: calc(50% - 50vw);
    background: linear-gradient(180deg, transparent 0%, rgba(123,211,247,0.04) 50%, transparent 100%);
    overflow: hidden;
}

.notch::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--void-deep);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 32px));
    border-bottom: 1px solid var(--hairline);
}

.notch.reverse::before {
    clip-path: polygon(0 32px, 100% 0, 100% 100%, 0 100%);
    border-bottom: none;
    border-top: 1px solid var(--hairline);
}

/* Section header */
.section-header {
    padding: 60px clamp(20px, 5vw, 80px) 28px;
    max-width: 920px;
}

.section-title {
    font-family: var(--font-condensed);
    font-weight: 600;
    font-size: clamp(36px, 5.5vw, 76px);
    line-height: 1;
    letter-spacing: -0.01em;
    color: var(--pale);
    margin: 6px 0 12px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 64px;
    height: 2px;
    background: var(--cyan);
}

.section-lede {
    font-family: var(--font-condensed);
    font-weight: 400;
    font-size: clamp(15px, 1.4vw, 20px);
    color: var(--steel);
    line-height: 1.5;
    margin-top: 18px;
    max-width: 600px;
}

/* Manifest section */
.manifest {
    position: relative;
    padding-bottom: 80px;
}

.manifest-collage {
    position: relative;
    padding: 0 clamp(20px, 5vw, 80px);
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 14px;
    min-height: 540px;
}

.collage {
    position: relative;
}

.hairline-thread {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.hairline-path {
    fill: none;
    stroke: var(--hairline);
    stroke-width: 1;
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 1800ms ease;
}

.collage.in-view .hairline-path {
    stroke-dashoffset: 0;
}

.collage-panel {
    padding: 22px 24px;
    z-index: 2;
    transition: transform 280ms ease, background 280ms ease, border-color 280ms ease;
}

.collage-panel h3 {
    font-family: var(--font-condensed);
    font-weight: 600;
    font-size: clamp(22px, 2.4vw, 36px);
    line-height: 1.05;
    margin: 8px 0 10px;
    color: var(--pale);
    letter-spacing: -0.005em;
}

.collage-panel p {
    color: var(--steel);
    font-size: 0.95em;
}

.collage-panel:hover {
    transform: translateY(-3px) rotate(0deg);
    border-color: var(--cyan-soft);
}

.rot-neg { transform: rotate(-1deg); }
.rot-pos { transform: rotate(0.8deg); }

.shape-a {
    grid-column: 1 / span 6;
    grid-row: 1;
    margin-top: 0;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%);
}

.shape-b {
    grid-column: 7 / span 6;
    grid-row: 1;
    margin-top: 30px;
    clip-path: polygon(22px 0, 100% 0, 100% 100%, 0 100%, 0 22px);
}

.shape-c {
    grid-column: 2 / span 5;
    grid-row: 2;
    margin-top: -40px;
    clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
}

.shape-d {
    grid-column: 7 / span 6;
    grid-row: 2;
    margin-top: -10px;
    margin-left: 30px;
    clip-path: polygon(0 22px, 22px 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%);
}

/* Trace section */
.trace {
    position: relative;
    padding-bottom: 80px;
}

.trace-grid {
    padding: 0 clamp(20px, 5vw, 80px);
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
}

.trace-panel {
    grid-column: span 6;
    padding: 0 0 18px;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
}

.trace-panel-wide {
    grid-column: span 12;
}

.trace-readout {
    padding: 22px 28px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 28px;
}

.readout-row {
    display: flex;
    align-items: baseline;
    gap: 14px;
}

.readout-row .mono-large {
    color: var(--cyan);
    font-feature-settings: "tnum" 1;
}

.velocity-canvas-wrap {
    padding: 18px 22px 6px;
}

#velocity-canvas {
    width: 100%;
    height: 180px;
    display: block;
    background: rgba(10, 13, 16, 0.4);
    border: 1px solid var(--hairline);
}

.velocity-canvas-wrap p {
    padding: 8px 0 0;
}

.matrix-readout {
    padding: 20px 28px;
    display: grid;
    gap: 10px;
}

.matrix-row {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--hairline);
}

.matrix-row:last-child { border-bottom: none; }

.matrix-row span:last-child {
    color: var(--cyan);
    font-feature-settings: "tnum" 1;
}

/* Index section */
.index-section {
    padding-bottom: 80px;
}

.index-collage {
    padding: 0 clamp(20px, 5vw, 80px);
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(160px, auto);
    gap: 14px;
}

.index-card {
    padding: 22px 26px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 240ms ease, border-color 240ms ease;
}

.index-card h3 {
    font-family: var(--font-condensed);
    font-weight: 600;
    font-size: clamp(20px, 2.2vw, 30px);
    line-height: 1.05;
    color: var(--pale);
    letter-spacing: -0.005em;
}

.index-card p {
    color: var(--steel);
    font-size: 0.92em;
}

.index-card:hover {
    transform: translateY(-3px);
    border-color: var(--cyan-soft);
}

.card-foot {
    margin-top: auto;
    padding-top: 14px;
    display: flex;
    justify-content: space-between;
    border-top: 1px dashed var(--hairline);
}

.shape-e { grid-column: span 7; grid-row: span 2; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 24px), calc(100% - 24px) 100%, 0 100%); }
.shape-f { grid-column: span 5; grid-row: span 1; clip-path: polygon(24px 0, 100% 0, 100% 100%, 0 100%, 0 24px); }
.shape-g { grid-column: span 5; grid-row: span 1; clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%); }
.shape-h { grid-column: span 4; grid-row: span 1; clip-path: polygon(0 18px, 18px 0, 100% 0, 100% 100%, 0 100%); }
.shape-i { grid-column: span 4; grid-row: span 2; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%); }
.shape-j { grid-column: span 4; grid-row: span 1; clip-path: polygon(0 0, 100% 0, 100% 100%, 18px 100%, 0 calc(100% - 18px)); }

.mini-log {
    list-style: none;
    margin-top: 6px;
    display: grid;
    gap: 4px;
}

.mini-log li {
    color: var(--steel);
}

.ok { color: var(--cyan); margin-right: 8px; }

/* Terminal log section */
.terminal-log {
    padding-bottom: 80px;
}

.terminal-frame {
    margin: 0 clamp(20px, 5vw, 80px);
    padding: 0;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 24px), calc(100% - 24px) 100%, 0 100%);
    background: rgba(6, 8, 11, 0.7);
}

.terminal-head {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--hairline);
    background: rgba(180, 200, 220, 0.04);
}

.terminal-cursor-blink {
    color: var(--cyan);
    margin-left: auto;
    animation: cursor-blink 530ms steps(2, end) infinite;
}

.terminal-stream {
    padding: 22px 24px;
    min-height: 320px;
    max-height: 420px;
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 0.82em;
    line-height: 1.7;
    position: relative;
}

.terminal-stream::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 64px;
    background: linear-gradient(180deg, transparent 0%, rgba(6,8,11,0.9) 100%);
    pointer-events: none;
}

.log-line {
    color: var(--steel);
    white-space: nowrap;
    overflow: hidden;
}

.log-line .tag-ok { color: var(--cyan); }
.log-line .tag-warn { color: var(--amber); }
.log-line .tag-info { color: var(--pale); }
.log-line .blink-tail {
    color: var(--cyan);
    animation: cursor-blink 530ms steps(2, end) infinite;
}

/* Footer */
.footer {
    border-top: 1px solid var(--hairline);
    padding: 32px clamp(20px, 5vw, 80px);
    background: rgba(6, 8, 11, 0.6);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-left {
    display: flex;
    gap: 14px;
    align-items: baseline;
    font-family: var(--font-mono);
}

.footer-right {
    display: flex;
    gap: 22px;
}

.footer-right span span {
    color: var(--cyan);
    font-feature-settings: "tnum" 1;
}

/* Reveal animations triggered by JS */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 600ms ease, transform 600ms ease;
}

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

/* Responsive */
@media (max-width: 920px) {
    .topbar-nav { gap: 14px; }
    .panel-back, .panel-mid, .panel-front {
        position: relative;
        top: auto; left: auto; right: auto;
        width: 100%;
        margin-bottom: 18px;
        transform: none !important;
    }
    .hero { padding-top: 84px; }
    .manifest-collage,
    .index-collage,
    .trace-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .shape-a, .shape-b, .shape-c, .shape-d,
    .shape-e, .shape-f, .shape-g, .shape-h, .shape-i, .shape-j {
        grid-column: span 2;
        grid-row: auto;
        margin: 0;
        transform: none !important;
    }
    .trace-panel, .trace-panel-wide { grid-column: span 2; }
}

@media (max-width: 560px) {
    .topbar-nav { display: none; }
    .manifest-collage,
    .index-collage,
    .trace-grid {
        grid-template-columns: 1fr;
    }
    .shape-a, .shape-b, .shape-c, .shape-d,
    .shape-e, .shape-f, .shape-g, .shape-h, .shape-i, .shape-j {
        grid-column: span 1;
    }
    .trace-panel, .trace-panel-wide { grid-column: span 1; }
    .trace-readout { grid-template-columns: 1fr; }
    .hero-actions { flex-direction: column; align-items: stretch; }
}
