/* SPDX-License-Identifier: Apache-2.0 */
/* eshine-os project site stylesheet (v10).
 * Warm parchment & coral identity evolved into a modern infrastructure landing page.
 */

:root {
    --bg: #F0EDE3;
    --bg-soft: #E8E3D5;
    --surface: #FFFFFF;
    --surface-tint: #FAF8F2;
    --ink: #33290A;
    --ink-head: #241902;
    --muted: #6C634C;
    --border: #DCD6C6;
    --border-strong: #C8C0AB;
    --accent: #D9705F;
    --accent-ink: #A63B2D;
    --accent-hover: #8E2F23;
    --accent-soft: #FBE9E3;
    --gold: #A7821A;
    --green-bg: #E7F5EC;
    --green-ink: #1D6838;
    --green-border: #B4DEC2;
    --amber-bg: #FEF3E2;
    --amber-ink: #9A5204;
    --amber-border: #F5D09D;
    --blue-bg: #EBF1FE;
    --blue-ink: #1D4ED8;
    --term-bg: #1A1714;
    --term-bar: #27221D;
    --term-ink: #EDE7DA;
    --shadow-sm: 0 1px 3px rgba(51, 41, 10, 0.06);
    --shadow-md: 0 8px 24px rgba(51, 41, 10, 0.08);
    --radius: 12px;
}

@font-face {
    font-family: 'oswald';
    src: url('assets/fonts/oswald-regular-webfont.v2.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'oxygen';
    src: url('assets/fonts/oxygen-regular-webfont.v2.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: oxygen, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.62;
    font-size: 16px;
}

h1, h2, h3, .brand-title {
    font-family: oswald, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--ink-head);
    font-weight: normal;
    line-height: 1.22;
    margin-top: 0;
}

:lang(zh-CN) h1,
:lang(zh-CN) h2,
:lang(zh-CN) h3,
:lang(zh-CN) .metric-val {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
    font-weight: 700;
    letter-spacing: -0.01em;
}

:lang(zh-CN) .hero h1 {
    font-size: clamp(1.68rem, 3.15vw, 2.34rem);
    line-height: 1.28;
}

a {
    color: var(--accent-ink);
    text-decoration: none;
    transition: color 0.18s ease;
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
.metric-link:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

code, pre {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: -60px;
    left: 16px;
    z-index: 200;
    background: var(--accent-ink);
    color: #FFFFFF;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: var(--shadow-md);
    transition: top 0.14s ease;
}

.skip-link:focus {
    top: 12px;
    color: #FFFFFF;
    text-decoration: none;
}

.container {
    width: 100%;
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 20px;
}

section[id] {
    scroll-margin-top: 82px;
}

/* ---------- Sticky Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 62px;
    padding: 8px 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink-head);
    text-decoration: none;
    flex-shrink: 0;
}

.brand:hover {
    text-decoration: none;
}

.brand img {
    width: 34px;
    height: 38px;
    display: block;
}

.brand-title {
    font-size: 1.45rem;
    letter-spacing: 0.02em;
    margin: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 18px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    font-size: 0.93rem;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--accent-ink);
    text-decoration: none;
}

.lang-pill {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: var(--surface-tint);
    color: var(--ink) !important;
    font-size: 0.84rem !important;
}

.lang-pill:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-ink) !important;
}

/* ---------- Hero ---------- */
.hero {
    padding: 46px 0 28px;
}

.hero-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 36px 36px 30px;
    box-shadow: var(--shadow-md);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 14px;
}

.hero h1 {
    font-size: clamp(2rem, 4vw, 2.85rem);
    margin-bottom: 14px;
    letter-spacing: 0.01em;
    text-wrap: balance;
}

.hero-lead {
    font-size: 1.12rem;
    color: var(--ink);
    max-width: 780px;
    margin: 0 0 10px;
}

.hero-tagline {
    font-size: 0.96rem;
    color: var(--muted);
    font-style: italic;
    margin: 0 0 24px;
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.96rem;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none !important;
    transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}

.btn-primary {
    background: var(--accent-ink);
    color: #FFFFFF;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #FFFFFF;
}

.btn-secondary {
    background: var(--surface-tint);
    color: var(--ink-head);
    border-color: var(--border-strong);
}

.btn-secondary:hover {
    border-color: var(--accent-ink);
    background: var(--accent-soft);
    color: var(--accent-ink);
}

.btn-text {
    background: transparent;
    color: var(--muted);
    padding: 10px 10px;
    font-weight: 600;
}

.btn-text:hover {
    color: var(--accent-ink);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.metric-card {
    background: var(--surface-tint);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
}

.metric-card.metric-green {
    background: var(--green-bg);
    border-color: var(--green-border);
}

a.metric-card.metric-link {
    display: block;
    color: inherit;
    text-decoration: none !important;
    transition: border-color 0.16s ease, transform 0.14s ease, box-shadow 0.16s ease;
}

a.metric-card.metric-link:hover {
    border-color: var(--green-ink);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    text-decoration: none !important;
}

.metric-val {
    font-family: oswald, sans-serif;
    font-size: 1.32rem;
    color: var(--ink-head);
    margin-bottom: 3px;
}

.metric-green .metric-val {
    color: var(--green-ink);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
}

.metric-val-arrow {
    font-size: 0.95rem;
    font-weight: 700;
    opacity: 0.78;
}

.metric-lbl {
    font-size: 0.84rem;
    color: var(--muted);
    line-height: 1.38;
}

/* ---------- Sections ---------- */
.section {
    padding: 14px 0 22px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 32px;
    box-shadow: var(--shadow-sm);
}

.section-head {
    margin-bottom: 18px;
}

.section-head h2 {
    font-size: 1.75rem;
    margin-bottom: 6px;
}

.section-sub {
    color: var(--muted);
    margin: 0;
    font-size: 0.97rem;
}

/* ---------- Demo & Quick Start ---------- */
.demo-wrap {
    background: var(--term-bg);
    border: 1px solid #3A3229;
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-md);
}

.demo-wrap img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
}

.demo-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 0.88rem;
    color: #C7BFA9;
    padding: 10px 8px 4px;
    margin: 0;
}

.demo-caption-text {
    flex: 1 1 320px;
}

.qs-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.code-panel {
    background: var(--surface-tint);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.code-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 46px;
    padding: 10px 14px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--ink-head);
}

.copy-btn {
    appearance: none;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--ink);
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}

.copy-btn:hover {
    border-color: var(--accent-ink);
    color: var(--accent-ink);
}

.code-panel pre {
    margin: 0;
    padding: 14px 16px;
    background: var(--term-bg);
    color: var(--term-ink);
    font-size: 0.84rem;
    line-height: 1.55;
    overflow-x: auto;
    flex: 1;
}

.code-panel-foot {
    padding: 9px 14px;
    font-size: 0.83rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

/* ---------- Architecture ---------- */
.arch-figure {
    margin: 0 0 22px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
}

.arch-figure img {
    display: block;
    width: 100%;
    max-width: 820px;
    height: auto;
    margin: 0 auto;
    border-radius: 6px;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 16px;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
}

table.data-table th,
table.data-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

table.data-table th {
    background: var(--surface-tint);
    color: var(--ink-head);
    font-weight: 700;
    white-space: nowrap;
}

.pill {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.77rem;
    font-weight: 700;
    white-space: nowrap;
}

.pill-green {
    background: var(--green-bg);
    color: var(--green-ink);
    border: 1px solid var(--green-border);
}

.pill-amber {
    background: var(--amber-bg);
    color: var(--amber-ink);
    border: 1px solid var(--amber-border);
}

.pill-muted {
    background: var(--bg-soft);
    color: var(--muted);
    border: 1px solid var(--border-strong);
}

.pill-coral {
    background: var(--accent-soft);
    color: var(--accent-ink);
    border: 1px solid #EBB9AE;
}

.pill-blue {
    background: var(--blue-bg);
    color: var(--blue-ink);
    border: 1px solid #C6D6FB;
}

.callout {
    background: var(--surface-tint);
    border-left: 4px solid var(--gold);
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.9rem;
    color: var(--ink);
}

/* ---------- Engineering Discipline Grid ---------- */
.three-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.feature-card {
    background: var(--surface-tint);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
}

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.feature-card p {
    margin: 0 0 12px;
    font-size: 0.92rem;
    color: var(--ink);
    flex: 1;
}

.feature-link {
    font-size: 0.87rem;
    font-weight: 700;
}

/* ---------- Roadmap ---------- */
.roadmap-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.roadmap-item {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 13px 16px;
    background: var(--surface-tint);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.roadmap-status {
    padding-top: 2px;
}

.roadmap-title {
    font-weight: 700;
    color: var(--ink-head);
    display: block;
    margin-bottom: 2px;
}

.roadmap-desc {
    font-size: 0.92rem;
    color: var(--muted);
}

/* ---------- Releases & Sources ---------- */
.two-col {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 20px;
    align-items: start;
}

.sub-title {
    font-size: 1.15rem;
    margin-bottom: 10px;
}

/* ---------- Footer ---------- */
.site-footer {
    padding: 24px 0 46px;
    color: var(--muted);
    font-size: 0.9rem;
}

.footer-card {
    background: var(--surface-tint);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin: 12px 0;
    font-weight: 600;
}

.footer-tagline {
    color: var(--ink);
    font-weight: 600;
    margin: 8px 0 4px;
}

/* ---------- Fullscreen Lightbox & Zoomable Media ---------- */
.zoomable-media {
    cursor: zoom-in;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.zoomable-media:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(51, 41, 10, 0.14);
}

.zoomable-media:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.zoom-hint-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.3;
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: #F4A899;
    background: rgba(217, 112, 95, 0.16);
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.zoom-hint-btn:hover {
    background: var(--accent-ink);
    border-color: var(--accent);
    color: #FFFFFF;
}

.arch-caption {
    margin: 10px 0 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
}

.arch-caption .zoom-hint-btn {
    border-color: #EBB9AE;
    color: var(--accent-ink);
    background: var(--accent-soft);
}

.arch-caption .zoom-hint-btn:hover {
    background: var(--accent-ink);
    border-color: var(--accent-ink);
    color: #FFFFFF;
}

.lightbox[hidden] {
    display: none !important;
}

.lightbox {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    z-index: 1000;
    background: rgba(18, 15, 12, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px 16px;
}

.lightbox-bar {
    width: 100%;
    max-width: 1280px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
    z-index: 1002;
}

.lightbox-zoom-group,
.lightbox-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lightbox-btn {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(39, 34, 29, 0.92);
    color: #FAF6EE;
    border-radius: 999px;
    height: 38px;
    padding: 0 14px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.14s ease, border-color 0.14s ease, opacity 0.14s ease;
}

.lightbox-btn:hover:not(:disabled) {
    background: var(--accent-ink);
    border-color: var(--accent);
}

.lightbox-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.lightbox-icon-btn {
    width: 38px;
    padding: 0;
    font-size: 1.15rem;
    line-height: 1;
}

.lightbox-close {
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 1.5rem;
    line-height: 1;
}

.lightbox-stage {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
}

.lightbox-stage.is-zoomed {
    align-items: flex-start;
    justify-content: flex-start;
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: auto;
    flex-shrink: 0;
    touch-action: pinch-zoom pan-x pan-y;
    cursor: zoom-in;
    border-radius: 8px;
    box-shadow: 0 14px 48px rgba(0, 0, 0, 0.65);
}

.lightbox-img.is-svg {
    height: min(78dvh, 780px);
    max-width: 100%;
    max-height: 100%;
    width: auto;
    aspect-ratio: 780 / 560;
    background: transparent;
}

.lightbox-img.is-zoomed,
.lightbox-img.is-svg.is-zoomed {
    max-width: none;
    max-height: none;
    cursor: zoom-out;
}

.lightbox-caption {
    margin: 0;
    color: #DED7C8;
    font-size: 0.88rem;
    text-align: center;
    max-width: 92vw;
    flex-shrink: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .qs-grid,
    .three-grid,
    .two-col {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 14px;
    }

    section[id] {
        scroll-margin-top: 16px;
    }

    .site-header {
        position: static;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        min-height: 0;
        gap: 6px;
        padding: 8px 0;
    }

    .site-header nav {
        width: 100%;
    }

    .nav-links {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 14px;
        padding: 2px 0;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .hero {
        padding: 18px 0 14px;
    }

    .hero-card,
    .card,
    .footer-card {
        padding: 20px 16px;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .metric-card {
        padding: 12px;
    }

    .metric-val {
        font-size: 1.15rem;
    }

    .roadmap-item {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .table-scroll {
        overflow-x: auto;
    }

    .arch-table thead {
        display: none;
    }

    .arch-table,
    .arch-table tbody,
    .arch-table tr,
    .arch-table td {
        display: block;
        width: 100%;
    }

    .arch-table tr {
        background: var(--surface-tint);
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 12px 14px;
        margin-bottom: 10px;
    }

    .arch-table tr:last-child {
        margin-bottom: 0;
    }

    .arch-table td {
        padding: 3px 0;
        border-bottom: 0;
        font-size: 0.9rem;
    }

    .arch-table td:first-child {
        font-size: 1rem;
        margin-bottom: 4px;
    }

    .arch-table td[data-label] {
        display: flex;
        align-items: baseline;
        gap: 8px;
    }

    .arch-table td[data-label]::before {
        content: attr(data-label);
        font-size: 0.78rem;
        font-weight: 700;
        color: var(--muted);
        flex-shrink: 0;
        min-width: 96px;
    }

    .arch-table td[data-label]:last-child {
        flex-direction: column;
        gap: 2px;
        margin-top: 4px;
    }

    .lightbox {
        padding: 10px 10px 12px;
    }

    .lightbox-btn {
        height: 36px;
        padding: 0 11px;
        font-size: 0.84rem;
    }

    .lightbox-icon-btn {
        width: 36px;
        padding: 0;
    }

    .lightbox-img.is-svg {
        height: auto;
        width: 100%;
        aspect-ratio: 780 / 560;
    }
}

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