/* simulai.net — Dark, oceanic, editorial-flow journal */

:root {
    --deep-slate: #141e2a;
    --tidal-teal: #1a3a3e;
    --coastal-sand: #c8b8a4;
    --star-cyan: #5ab8b0;
    --moon-silver: #8a9aaa;
    --wave-crest: #3a6a68;
    --deep-current: #0a1018;
    --tide-divider: #1a2e3a;
}

.tide-divider path {
    /* fallback fill is set per-instance; this anchors the palette token */
    color: var(--tide-divider);
}

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

html, body {
    background: var(--deep-current);
    color: var(--coastal-sand);
    font-family: "Libre Baskerville", Georgia, serif;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.85;
    overflow-x: hidden;
    min-height: 100vh;
}

body {
    position: relative;
    background:
        radial-gradient(ellipse at 50% 100%, var(--tidal-teal) 0%, transparent 55%),
        linear-gradient(180deg, var(--deep-current) 0%, var(--deep-slate) 14%, var(--deep-slate) 100%);
    background-attachment: fixed;
    animation: bodyFade 700ms ease-out;
}

@keyframes bodyFade {
    from { background-color: #000; }
    to   { background-color: var(--deep-current); }
}

/* ---- Constellation overlay (full background) ---- */
.constellation-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.constellation-bg .star {
    opacity: 0;
    transform-origin: center;
    transform-box: fill-box;
    pointer-events: auto;
    cursor: pointer;
    transition: opacity 220ms ease, r 220ms ease;
    animation: starOn 700ms ease-out forwards;
}

@keyframes starOn {
    from { opacity: 0; }
    to   { opacity: 0.6; }
}

.constellation-bg .star:hover {
    opacity: 1;
}

.constellation-bg .constellation-lines line {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: lineDraw 1400ms ease-out 1100ms forwards;
}

@keyframes lineDraw {
    to { stroke-dashoffset: 0; }
}

.star-tooltip {
    position: fixed;
    pointer-events: none;
    z-index: 30;
    padding: 6px 10px;
    background: rgba(10, 16, 24, 0.92);
    border: 1px solid var(--wave-crest);
    color: var(--star-cyan);
    font-family: "Space Mono", monospace;
    font-size: 12px;
    border-radius: 4px;
    opacity: 0;
    transform: translate(-50%, -130%);
    transition: opacity 180ms ease;
    white-space: nowrap;
}

.star-tooltip.visible {
    opacity: 1;
}

/* ---- Hero ---- */
.hero {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: clamp(60px, 9vh, 120px) clamp(20px, 5vw, 60px);
    text-align: center;
}

.hero-meta {
    font-family: "Space Mono", "Menlo", monospace;
    font-size: 13px;
    color: var(--moon-silver);
    letter-spacing: 0.06em;
    margin-bottom: 28px;
    opacity: 0;
    animation: fadeIn 700ms 200ms ease-out forwards;
}

.hero-title {
    font-family: "DM Sans", "Helvetica Neue", sans-serif;
    font-weight: 700;
    font-size: clamp(40px, 8vw, 96px);
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--coastal-sand);
    margin-bottom: 20px;
    word-break: break-word;
}

.hero-name {
    color: var(--coastal-sand);
}

.hero-tld {
    font-family: "Space Mono", monospace;
    font-weight: 400;
    color: var(--star-cyan);
    font-size: 0.66em;
    letter-spacing: 0;
    margin-left: 4px;
}

.hero-sub {
    font-family: "Libre Baskerville", serif;
    font-style: italic;
    font-size: clamp(16px, 1.7vw, 22px);
    line-height: 1.6;
    color: var(--moon-silver);
    max-width: 620px;
    margin: 0 auto 48px;
    opacity: 0;
    animation: fadeIn 800ms 2200ms ease-out forwards;
}

.celestial-figure {
    width: min(640px, 92vw);
    margin: 0 auto;
    opacity: 0;
    animation: fadeIn 900ms 2400ms ease-out forwards;
}

.celestial-figure svg {
    width: 100%;
    height: auto;
    display: block;
}

.celestial-figure figcaption {
    text-align: center;
    color: var(--moon-silver);
    font-size: 12px;
    letter-spacing: 0.06em;
    margin-top: 10px;
    opacity: 0.85;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Tide dividers ---- */
.tide-divider {
    display: block;
    width: 100%;
    height: 60px;
    margin: 0;
    position: relative;
    z-index: 2;
}

/* ---- Sections ---- */
.section {
    position: relative;
    z-index: 2;
    padding: clamp(60px, 9vh, 110px) clamp(20px, 6vw, 80px);
    max-width: 1200px;
    margin: 0 auto;
}

.section-feature       { background: linear-gradient(180deg, var(--deep-slate), #162834); }
.section-data          { background: linear-gradient(180deg, #162834, var(--tidal-teal)); padding-left: clamp(20px, 6vw, 80px); padding-right: clamp(20px, 6vw, 80px); }
.section-comparison    { background: linear-gradient(180deg, var(--tidal-teal), var(--deep-slate)); }
.section-narrow        { background: linear-gradient(180deg, var(--deep-slate), #0e1620); }
.section-colophon      { background: linear-gradient(180deg, #0e1620, var(--deep-current)); padding-bottom: clamp(80px, 12vh, 140px); }

/* Pull-out the section background to full width while content stays centered */
.section {
    box-shadow: 0 0 0 100vmax currentColor;
    color: transparent;
    clip-path: inset(0 -100vmax);
}

.section-feature, .section-data, .section-comparison, .section-narrow, .section-colophon {
    color: var(--coastal-sand);
}

.section .section-head,
.section .grid-feature,
.section .grid-comparison,
.section .metrics-grid,
.section .narrow-text {
    color: var(--coastal-sand);
}

.section-head {
    margin-bottom: 36px;
    max-width: 760px;
}

.section-head-center {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.kicker {
    font-family: "Space Mono", monospace;
    font-size: 12px;
    color: var(--star-cyan);
    letter-spacing: 0.14em;
    margin-bottom: 14px;
}

.section-title {
    font-family: "DM Sans", sans-serif;
    font-weight: 700;
    font-size: clamp(28px, 4.5vw, 56px);
    letter-spacing: -0.015em;
    line-height: 1.1;
    color: var(--coastal-sand);
}

.section-sub {
    font-family: "Libre Baskerville", serif;
    font-style: italic;
    color: var(--moon-silver);
    font-size: clamp(15px, 1.5vw, 18px);
    margin-top: 14px;
    max-width: 620px;
}

/* ---- Feature grid (2/3 + 1/3) ---- */
.grid-feature {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

@media (max-width: 760px) {
    .grid-feature { grid-template-columns: 1fr; }
}

.feature-text p {
    margin-bottom: 18px;
    color: var(--coastal-sand);
}

.feature-text em {
    color: var(--star-cyan);
    font-style: italic;
}

.dropcap {
    float: left;
    font-family: "DM Sans", sans-serif;
    font-weight: 700;
    font-size: 4.2em;
    line-height: 0.92;
    padding: 6px 10px 0 0;
    color: var(--star-cyan);
}

.lede {
    font-size: clamp(16px, 1.65vw, 20px);
    line-height: 1.65;
}

.feature-aside {
    border-left: 3px solid var(--star-cyan);
    padding: 4px 0 4px 22px;
}

.pull-quote {
    font-family: "DM Sans", sans-serif;
    font-weight: 700;
    font-size: clamp(20px, 2.2vw, 26px);
    line-height: 1.32;
    color: var(--coastal-sand);
    margin-bottom: 10px;
}

.caption {
    color: var(--moon-silver);
    font-size: 12px;
    letter-spacing: 0.06em;
}

/* ---- Metrics ---- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.6rem 2rem;
    margin-top: 12px;
}

.metric {
    padding: 22px 22px 18px;
    border-top: 1px solid rgba(90, 184, 176, 0.25);
    border-left: 1px solid rgba(90, 184, 176, 0.08);
    background: rgba(10, 16, 24, 0.35);
}

.metric-label {
    font-family: "Space Mono", monospace;
    font-size: 12px;
    color: var(--moon-silver);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.metric-value {
    font-family: "Space Mono", monospace;
    font-size: clamp(36px, 5vw, 56px);
    line-height: 1;
    color: var(--coastal-sand);
    letter-spacing: -0.01em;
    margin-bottom: 10px;
}

.metric-unit {
    font-size: 0.45em;
    color: var(--star-cyan);
    margin-left: 4px;
    vertical-align: 0.45em;
}

.metric-foot {
    font-family: "Libre Baskerville", serif;
    font-style: italic;
    color: var(--moon-silver);
    font-size: 14px;
}

/* ---- Comparison (1/2 + 1/2) ---- */
.grid-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

@media (max-width: 760px) {
    .grid-comparison { grid-template-columns: 1fr; }
}

.comparison-col {
    padding: 24px 26px;
    background: rgba(26, 58, 62, 0.45);
    border-top: 1px solid var(--star-cyan);
}

.comparison-title {
    font-family: "DM Sans", sans-serif;
    font-weight: 500;
    font-size: clamp(20px, 2.2vw, 28px);
    color: var(--coastal-sand);
    margin-bottom: 12px;
}

.comparison-list {
    list-style: none;
    margin-top: 14px;
}

.comparison-list li {
    padding: 6px 0;
    color: var(--coastal-sand);
}

.dot-cyan {
    color: var(--star-cyan);
    margin-right: 8px;
    display: inline-block;
    width: 1.2em;
    text-align: center;
}

/* ---- Narrow text columns ---- */
.narrow-text {
    max-width: 640px;
    margin: 0 auto;
    color: var(--coastal-sand);
}

.narrow-text p {
    margin-bottom: 18px;
}

.narrow-text .signoff {
    color: var(--moon-silver);
    font-size: 13px;
    letter-spacing: 0.08em;
    margin-top: 14px;
}

.colophon-text { text-align: center; }

.colophon-meta {
    color: var(--moon-silver);
    font-size: 13px;
    letter-spacing: 0.08em;
    margin-top: 14px;
}

/* ---- Mono helper ---- */
.mono {
    font-family: "Space Mono", "Menlo", monospace;
    font-size: 0.92em;
    letter-spacing: 0.04em;
    color: var(--moon-silver);
}

/* ---- Reveal ---- */
.section .section-head,
.section .grid-feature,
.section .grid-comparison,
.section .metrics-grid,
.section .narrow-text {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 700ms ease, transform 800ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.section.in-view .section-head,
.section.in-view .grid-feature,
.section.in-view .grid-comparison,
.section.in-view .metrics-grid,
.section.in-view .narrow-text {
    opacity: 1;
    transform: translateY(0);
}

.section.in-view .grid-feature  { transition-delay: 80ms; }
.section.in-view .grid-comparison { transition-delay: 80ms; }
.section.in-view .metrics-grid    { transition-delay: 80ms; }
.section.in-view .narrow-text     { transition-delay: 80ms; }

@media (prefers-reduced-motion: reduce) {
    .section .section-head,
    .section .grid-feature,
    .section .grid-comparison,
    .section .metrics-grid,
    .section .narrow-text {
        opacity: 1; transform: none;
    }
    .constellation-bg .star { opacity: 0.6; animation: none; }
    .constellation-bg .constellation-lines line { stroke-dashoffset: 0; animation: none; }
}
