/* xanadu.science -- Living Knowledge Network
   Generative-art background, layered-depth layout, frutiger-clean typography. */

:root {
    --c-deep: #080C14;
    --c-panel: #0D1520;
    --c-network: #1A2840;
    --c-bright: #64C8FF;
    --c-ice: #E8F4FD;
    --c-soft: #A8D8EA;
    --c-body: #B8C8D8;
    --c-steel: #6890A8;
    --c-signal: #FF6B6B;

    --panel-bg: rgba(8, 12, 20, 0.85);
    --panel-border: rgba(100, 200, 255, 0.2);
    --panel-glow: 0 0 20px rgba(100, 200, 255, 0.1);
    --panel-glow-hover: 0 0 32px rgba(100, 200, 255, 0.18);

    --font-head: 'Barlow', 'Inter', sans-serif;
    --font-body: 'IBM Plex Sans', 'Inter', sans-serif;
    --font-mono: 'IBM Plex Mono', 'Space Mono', monospace;

    --nav-h: 40px;
}

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

html, body {
    background: var(--c-deep);
    color: var(--c-body);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.7;
    min-height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
    cursor: crosshair;
}

/* ----- Generative canvas ----- */
#generative-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    display: block;
    background: radial-gradient(ellipse at 50% 30%, #0D1520 0%, #080C14 70%);
}

/* ----- Top navigation ----- */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    z-index: 50;
    background: rgba(8, 12, 20, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(100, 200, 255, 0.08);
}

.nav-inner {
    height: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.nav-brand {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.06em;
    color: var(--c-ice);
    text-transform: lowercase;
}

.nav-dot {
    color: var(--c-bright);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 28px;
}

.nav-link {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: lowercase;
    color: var(--c-steel);
    text-decoration: none;
    padding: 4px 0;
    position: relative;
    transition: color 320ms ease;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 1px;
    background: var(--c-bright);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 320ms ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--c-ice);
}

.nav-link.active::after,
.nav-link:hover::after {
    transform: scaleX(1);
}

.nav-coords {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--c-steel);
}

/* ----- Content stack ----- */
.content-stack {
    position: relative;
    z-index: 10;
    max-width: 1320px;
    margin: 0 auto;
    padding: calc(var(--nav-h) + 60px) 32px 80px;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

/* ----- Panel base ----- */
.panel {
    position: relative;
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    padding: 36px 40px 40px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 600ms ease, transform 600ms ease,
                box-shadow 320ms ease, border-color 320ms ease;
}

.panel.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.panel:hover {
    box-shadow: var(--panel-glow-hover);
    border-color: rgba(100, 200, 255, 0.35);
}

.panel::before {
    content: "";
    position: absolute;
    top: 14px;
    left: 14px;
    width: 6px;
    height: 6px;
    background: var(--c-bright);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(100, 200, 255, 0.6);
    opacity: 0.7;
}

.panel-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.03em;
    color: var(--c-steel);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(100, 200, 255, 0.12);
}

.meta-tag {
    color: var(--c-bright);
}

.panel-title {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 28px;
    line-height: 1.18;
    color: var(--c-ice);
    letter-spacing: 0.01em;
    margin-bottom: 14px;
}

.panel-body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.7;
    color: var(--c-body);
}

.panel-body + .panel-list,
.panel-body + .topology-row,
.panel-body + .code-block {
    margin-top: 18px;
}

.panel-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.panel-list li {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--c-body);
    display: flex;
    gap: 10px;
    align-items: baseline;
}

.list-marker {
    color: var(--c-signal);
    font-size: 10px;
    transform: translateY(-1px);
}

/* ----- Hero panel ----- */
.panel-hero {
    padding: 56px 56px 52px;
}

.hero-title {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 48px;
    line-height: 1.08;
    letter-spacing: 0.01em;
    color: var(--c-ice);
    margin-bottom: 24px;
}

.hero-accent {
    color: var(--c-soft);
    font-weight: 400;
}

.hero-sub {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.75;
    color: var(--c-body);
    max-width: 680px;
    margin-bottom: 32px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    padding: 22px 0;
    border-top: 1px solid rgba(100, 200, 255, 0.1);
    border-bottom: 1px solid rgba(100, 200, 255, 0.1);
    margin-bottom: 28px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 28px;
    color: var(--c-bright);
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: lowercase;
    color: var(--c-steel);
}

.hero-cta-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cta-note {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--c-steel);
}

/* ----- Ghost button ----- */
.ghost-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: lowercase;
    color: var(--c-bright);
    background: transparent;
    border: 1px solid rgba(100, 200, 255, 0.35);
    padding: 12px 22px;
    cursor: pointer;
    text-decoration: none;
    transition: background 320ms ease, color 320ms ease, border-color 320ms ease, box-shadow 320ms ease;
}

.ghost-btn:hover {
    background: rgba(100, 200, 255, 0.08);
    border-color: var(--c-bright);
    color: var(--c-ice);
    box-shadow: 0 0 18px rgba(100, 200, 255, 0.18);
}

/* ----- Panel grid ----- */
.panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(220px, auto);
    gap: 28px;
}

.panel-tall {
    grid-row: span 2;
}

.panel-wide {
    grid-column: span 2;
}

/* ----- Research / method ----- */
.panel-research,
.panel-method {
    padding: 30px 32px 32px;
}

.code-block {
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.7;
    color: var(--c-soft);
    background: rgba(13, 21, 32, 0.7);
    border: 1px solid rgba(100, 200, 255, 0.1);
    border-radius: 3px;
    padding: 14px 16px;
    overflow-x: auto;
    white-space: pre;
}

.code-comment {
    color: var(--c-steel);
}

.code-op {
    color: var(--c-bright);
}

/* ----- Topology row ----- */
.topology-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.topo-item {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--c-soft);
    background: rgba(26, 40, 64, 0.55);
    border: 1px solid rgba(100, 200, 255, 0.12);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 320ms ease, color 320ms ease;
}

.topo-item:hover {
    border-color: rgba(100, 200, 255, 0.4);
    color: var(--c-ice);
}

.topo-num {
    color: var(--c-bright);
    font-size: 14px;
}

/* ----- Archive ----- */
.panel-archive {
    padding: 36px 40px 40px;
}

.archive-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 10px;
}

.archive-row {
    display: grid;
    grid-template-columns: 80px 110px 1fr 100px;
    gap: 18px;
    align-items: baseline;
    padding: 14px 4px;
    border-bottom: 1px solid rgba(100, 200, 255, 0.06);
    transition: background 320ms ease, padding 320ms ease;
}

.archive-row:hover {
    background: rgba(100, 200, 255, 0.04);
    padding-left: 14px;
}

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

.archive-id {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--c-signal);
}

.archive-date {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--c-steel);
}

.archive-title {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--c-body);
}

.archive-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--c-soft);
    text-align: right;
    text-transform: lowercase;
}

/* ----- Contact ----- */
.panel-contact {
    padding: 40px 44px 44px;
}

.contact-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 24px;
    margin-top: 22px;
    align-items: start;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-wide {
    grid-column: 1 / -1;
}

.field-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: lowercase;
    color: var(--c-steel);
}

.field-input {
    background: rgba(8, 12, 20, 0.55);
    border: 1px solid rgba(100, 200, 255, 0.16);
    color: var(--c-ice);
    font-family: var(--font-body);
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 3px;
    transition: border-color 240ms ease, background 240ms ease;
    width: 100%;
}

.field-input::placeholder {
    color: rgba(104, 144, 168, 0.7);
    font-family: var(--font-mono);
    font-size: 12px;
}

.field-input:hover {
    border-color: rgba(100, 200, 255, 0.3);
}

.field-textarea {
    resize: vertical;
    min-height: 92px;
    font-family: var(--font-body);
}

.submit-btn {
    grid-column: 1 / 2;
    justify-self: start;
    margin-top: 4px;
}

.btn-arrow {
    transition: transform 320ms ease;
}

.submit-btn:hover .btn-arrow {
    transform: translateX(4px);
}

.form-status {
    grid-column: 2 / 3;
    align-self: center;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--c-soft);
    margin-top: 4px;
    min-height: 1em;
}

/* ----- Footer ----- */
.site-footer {
    border-top: 1px solid rgba(100, 200, 255, 0.08);
    padding-top: 28px;
    margin-top: 8px;
}

.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--c-steel);
}

.footer-brand {
    color: var(--c-soft);
    font-family: var(--font-head);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.04em;
}

/* ----- Cursor readout ----- */
.cursor-readout {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 40;
    background: rgba(8, 12, 20, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(100, 200, 255, 0.15);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--c-soft);
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 480ms ease, transform 480ms ease;
}

.cursor-readout.is-active {
    opacity: 1;
    transform: translateY(0);
}

.readout-label {
    color: var(--c-steel);
    text-transform: lowercase;
}

.readout-value {
    color: var(--c-ice);
}

/* ----- Responsive ----- */
@media (max-width: 900px) {
    .nav-coords { display: none; }
    .nav-links { gap: 18px; }
    .content-stack { padding: calc(var(--nav-h) + 32px) 18px 60px; gap: 36px; }
    .panel-hero { padding: 36px 26px 32px; }
    .hero-title { font-size: 34px; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 18px; }
    .panel-grid { grid-template-columns: 1fr; }
    .panel-tall, .panel-wide { grid-row: auto; grid-column: auto; }
    .archive-row { grid-template-columns: 70px 1fr; gap: 6px 14px; }
    .archive-date { grid-column: 2; }
    .archive-title { grid-column: 1 / -1; }
    .archive-tag { grid-column: 1 / -1; text-align: left; }
    .contact-form { grid-template-columns: 1fr; }
    .submit-btn, .form-status { grid-column: 1 / -1; }
    .topology-row { grid-template-columns: repeat(2, 1fr); }
    .cursor-readout { display: none; }
}
