/* Tacet — the "night ink" palette.
   Night navy ground, paper ink, a single brass accent (brand moments only). */
:root {
    --night: #0B1220;          /* page ground */
    --night-alt: #0E1729;      /* alternating sections */
    --card: #14203A;          /* raised surfaces */

    --paper: #E9E4D8;         /* primary text (paper) */
    --mist: #97A1B4;           /* secondary text */
    --faint: #7D8698;         /* faint labels */

    --border-line: #1E2A40;
    --border-hover: #31435F;

    --brass: #C9A227;        /* brass — the only accent */

    --font-serif: 'Newsreader', Georgia, serif;
    --font-sans: 'Plus Jakarta Sans', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
    background-color: var(--night);
    color: var(--paper);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Header */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(11, 18, 32, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-line);
    padding: 1rem 0;
    transition: padding 0.25s ease, background-color 0.25s ease;
}

/* Nav tightens up on scroll — app.js manages the .scrolled class */
.top-nav.scrolled {
    padding: 0.55rem 0;
    background-color: rgba(11, 18, 32, 0.97);
}

/* Brass reading bar that fills as the page progresses */
#reading-bar {
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 100%;
    height: 2px;
    background: var(--brass);
    transform: scaleX(0);
    transform-origin: left;
}

.nav-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--paper);
}

.brand-hilal {
    flex-shrink: 0;
    display: block;
    transform-origin: center;
}

/* The spinning ensō — every waiting moment on the page turns the brand mark.
   The terminal simulation shows it while a command "runs". */
@keyframes enso-spin {
    to { transform: rotate(360deg); }
}

.enso-wait {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--mist);
    margin: 0.2rem 0;
}

.enso-wait svg {
    animation: enso-spin 1.2s linear infinite;
    transform-origin: center;
}

.brand-mark {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 500;
}

.version-tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--faint);
    background: var(--card);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    border: 1px solid var(--border-line);
}

.nav-links {
    display: flex;
    gap: 1.75rem;
}

.nav-links a {
    color: var(--mist);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--paper);
}

.nav-code-btn {
    background: var(--card);
    border: 1px solid var(--border-line);
    color: var(--paper);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
}

.nav-code-btn:hover {
    border-color: var(--brass);
}

/* Hero */
.hero-section {
    padding: 4rem 1.5rem 3rem;
    max-width: 960px;
    margin: 0 auto;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: 2rem;
}

.hero-title {
    font-size: 3rem;
    line-height: 1.18;
    font-weight: 600;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.serif-title {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    color: var(--mist);
}

.hero-subtitle {
    max-width: 680px;
    font-size: 1.05rem;
    color: var(--mist);
    margin-bottom: 2rem;
}

.hero-hint {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--faint);
}

.hint-arrow {
    display: inline-block;
    margin-left: 0.5rem;
    animation: dalis 2s ease-in-out infinite;
}

@keyframes dalis {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(4px); opacity: 1; }
}

/* Eclipse stage — the covering disc is driven by scroll (app.js) */
.eclipse-stage {
    overflow: hidden;
    max-width: 400px;
    justify-self: center;
}

/* Terminal Window */
.terminal-container {
    background: var(--night-alt);
    border: 1px solid var(--border-line);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 2.5rem;
}

.terminal-topbar {
    background: var(--night);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-line);
}

.window-buttons {
    display: flex;
    gap: 6px;
}

.w-btn {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #2C3B58;
}

.terminal-title-text {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--faint);
}

.terminal-screen {
    padding: 1.25rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.84rem;
    line-height: 1.6;
    min-height: 300px;
    color: var(--paper);
}

#demo-screen {
    transition: opacity 0.5s ease;
    min-height: 340px;
}

.demo-caption {
    color: var(--faint);
    font-size: 0.9rem;
    text-align: center;
    margin-top: 0.9rem;
}

/* The CLI banner inside the demo: the name and its brass full stop. */
.b-line {
    color: var(--paper);
    font-weight: 500;
    margin-bottom: 0.15rem;
}

.b-dot {
    color: var(--brass);
}

/* Tacet's replies — paper ink, a touch more room to breathe. */
.r-line {
    color: var(--paper);
    margin: 0.35rem 0 0.85rem;
    max-width: 62ch;
}

.p-line { color: var(--mist); margin-bottom: 0.4rem; }
.p-sym { color: var(--brass); font-weight: bold; margin-right: 0.4rem; }
.p-cmd { color: #F5F1E7; }

.o-line { color: var(--mist); margin-bottom: 0.35rem; }
.c-chip {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin: 0.2rem 0;
    background: var(--card);
    border: 1px solid var(--border-line);
    color: var(--paper);
}

.term-cursor {
    display: inline-block;
    width: 7px;
    height: 14px;
    background-color: var(--paper);
    vertical-align: middle;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Sections */
.section {
    padding: 5rem 1.5rem;
    border-top: 1px solid var(--border-line);
}

.alt-bg {
    background-color: var(--night-alt);
}

.section-container {
    max-width: 960px;
    margin: 0 auto;
}

.section-header {
    margin-bottom: 3rem;
}

.section-header.text-center {
    text-align: center;
}

.section-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: var(--brass);
    display: block;
    margin-bottom: 0.4rem;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--mist);
    font-size: 0.98rem;
}

/* Gates Grid */
.gates-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.gate-card {
    background: var(--card);
    border: 1px solid var(--border-line);
    padding: 1.5rem 1.25rem;
    border-radius: 6px;
    transition: border-color 0.25s;
}

.gate-card:hover {
    border-color: var(--border-hover);
}

.gate-num {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--brass);
    display: block;
    margin-bottom: 0.75rem;
}

.gate-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.gate-card p {
    font-size: 0.85rem;
    color: var(--mist);
}

/* Specs Grid */
.specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.spec-item {
    background: var(--night);
    border: 1px solid var(--border-line);
    padding: 1.75rem;
    border-radius: 6px;
    transition: border-color 0.25s;
}

.spec-item:hover {
    border-color: var(--border-hover);
}

.spec-item h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.spec-item p {
    color: var(--mist);
    font-size: 0.92rem;
}

code {
    color: var(--paper);
}

/* Benchmarks */
.bench-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.bench-card {
    background: var(--card);
    border: 1px solid var(--border-line);
    padding: 2rem 1.5rem;
    border-radius: 6px;
    text-align: center;
}

.bench-val {
    font-family: var(--font-mono);
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--brass);
    margin-bottom: 0.3rem;
    font-variant-numeric: tabular-nums;
}

.bench-lbl {
    font-size: 0.85rem;
    color: var(--mist);
}

/* Private-by-design cards */
.trust-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.trust-card {
    background: var(--night);
    border: 1px solid var(--border-line);
    padding: 1.75rem;
    border-radius: 6px;
    transition: border-color 0.25s;
}

.trust-card:hover {
    border-color: var(--border-hover);
}

.trust-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.trust-card p {
    color: var(--mist);
    font-size: 0.92rem;
}

/* Comparison table */
.vs-wrap {
    overflow-x: auto;
}

.vs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.vs-table th {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--mist);
    text-align: center;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border-line);
}

.vs-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-line);
    color: var(--paper);
}

.vs-table td:first-child {
    width: 55%;
}

.vs-table td.yes,
.vs-table td.no {
    text-align: center;
    font-weight: 600;
}

.vs-table td.yes {
    color: var(--brass);
}

.vs-table td.no {
    color: var(--faint);
}

.vs-note {
    color: var(--faint);
    font-size: 0.9rem;
    margin-top: 1.1rem;
    max-width: 62ch;
}

/* OS picker for the installer */
.os-tabs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.os-tab {
    background: transparent;
    border: 1px solid var(--border-line);
    color: var(--mist);
    padding: 0.45rem 1.15rem;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.88rem;
    transition: color 0.2s, border-color 0.2s;
}

.os-tab:hover {
    color: var(--paper);
    border-color: var(--border-hover);
}

.os-tab.active {
    color: var(--night);
    background: var(--brass);
    border-color: var(--brass);
    font-weight: 600;
}

.os-panel {
    display: none;
}

.os-panel.active {
    display: flex;
}

.install-alt {
    text-align: center;
    color: var(--faint);
    font-size: 0.9rem;
    margin-top: 0.6rem;
}

.install-alt code {
    color: var(--mist);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

/* Install Box */
.install-box {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.install-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--night);
    border: 1px solid var(--border-line);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.84rem;
}

.step-num {
    color: var(--brass);
    margin-right: 0.75rem;
}

.copy-code-btn {
    background: transparent;
    border: 1px solid var(--border-line);
    color: var(--mist);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.72rem;
}

.copy-code-btn:hover {
    color: var(--paper);
    border-color: var(--brass);
}

/* Footer */
.footer {
    padding: 3rem 1.5rem;
    border-top: 1px solid var(--border-line);
}

.footer-container {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.footer-left {
    max-width: 55%;
}

.footer-right {
    text-align: right;
    flex-shrink: 0;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-left p {
    color: var(--faint);
    font-size: 0.82rem;
    margin-top: 0.3rem;
}

.footer-right p {
    color: var(--faint);
    font-size: 0.82rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--paper);
    color: var(--night);
    padding: 0.6rem 1.1rem;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll reveal — app.js adds .reveal, IntersectionObserver adds .gorunur */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    transition-delay: var(--reveal-delay, 0s);
}

.reveal.gorunur {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .hint-arrow { animation: none; }
    .term-cursor { animation: none; }
    .enso-wait svg { animation: none; }
}

/* Responsive */
@media (max-width: 800px) {
    .hero-title { font-size: 2.2rem; }
    .hero-grid { grid-template-columns: 1fr; }
    .eclipse-stage { max-width: 240px; order: -1; }
    .gates-grid { grid-template-columns: repeat(2, 1fr); }
    .trust-grid { grid-template-columns: 1fr; }
    .specs-grid { grid-template-columns: 1fr; }
    .bench-grid { grid-template-columns: 1fr; }
    .nav-container { padding: 0 1rem; }
    .nav-code-btn { font-size: 0.75rem; padding: 0.3rem 0.5rem; }
}
