/* ============================================================
   Starlark Technologies — shared stylesheet
   Used by index.html / hub.html / about.html / 418.html / Mili/compass.html
   ============================================================ */

:root {
    --brand: #295AA8;
    --brand-dark: #1E4582;
    --link: #4169E1;
    --text: rgba(0, 0, 0, 0.65);
    --muted: rgba(0, 0, 0, 0.45);
    --hover: rgba(0, 0, 0, 1);
    --line: rgba(0, 0, 0, 0.08);
    --max-width: 760px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background: #FFFFFF;
    color: var(--text);
    font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a,
button {
    transition: color .3s ease-in-out, background .3s ease-in-out, border-color .3s ease-in-out, opacity .3s ease-in-out;
    outline: none !important;
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    color: var(--hover);
}

/* ---------- layout ---------- */

.page-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px 80px;
}

.main-column {
    width: 100%;
    max-width: var(--max-width);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* ---------- header ---------- */

.site-header {
    margin-bottom: 10px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--brand);
    text-transform: uppercase;
}

.brand-logo {
    width: 40px;
    height: 40px;
    display: block;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    display: flex;
    gap: 28px;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.nav-links a {
    color: rgba(0, 0, 0, 0.55);
}

.nav-links a:hover,
.nav-links a.is-active {
    color: var(--hover);
}

/* ---------- typography ---------- */

.page-title {
    margin: 56px 0 10px;
    font-size: clamp(32px, 7vw, 52px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.06em;
    color: var(--brand);
    text-transform: uppercase;
}

.page-subtitle {
    margin: 0 0 46px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}

.lead {
    font-weight: 700;
    font-size: 18px;
    line-height: 1.7;
    letter-spacing: 0.04em;
    color: var(--brand);
    margin: 0 0 26px;
}

.lead a {
    color: #76B3B6;
}

.lead a:hover {
    color: #1D26A3;
}

.rule {
    width: 56px;
    height: 2px;
    margin: 34px auto;
    background: rgba(41, 90, 168, 0.18);
    border: 0;
}

/* ---------- hero / status ---------- */

.hero-visual {
    width: 100%;
    max-width: 420px;
    margin: 32px 0 20px;
}

.hero-logo {
    width: 100%;
    height: auto;
    display: block;
}

.status-block {
    position: relative;
    width: 100%;
    margin: 44px 0 8px;
}

.status-code {
    display: block;
    font-size: clamp(96px, 26vw, 190px);
    font-weight: 700;
    line-height: 0.9;
    letter-spacing: 0.02em;
    color: rgba(41, 90, 168, 0.13);
    user-select: none;
}

.status-kicker {
    margin: -18px 0 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--brand);
}

.copy {
    margin: 0 auto;
    max-width: 620px;
    font-size: 15px;
    line-height: 1.9;
    color: var(--text);
}

.copy p {
    margin: 0 0 16px;
}

.copy-zh {
    font-size: 14.5px;
    line-height: 2;
    color: rgba(0, 0, 0, 0.55);
}

.actions {
    margin-top: 34px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border: 1px solid rgba(41, 90, 168, 0.35);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand);
    background: transparent;
}

.btn:hover {
    color: #FFFFFF;
    background: var(--brand);
    border-color: var(--brand);
}

/* ---------- status pages (418 / under construction) ---------- */

.error-split {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    margin-top: 8px;
}

.error-split__visual,
.error-split__body {
    width: 100%;
    min-width: 0;
}

.error-split .hero-visual {
    max-width: 420px;
    margin: 32px auto 20px;
}

.error-split .copy {
    max-width: none;
}

@media (min-width: 880px) {
    .error-split {
        grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
        gap: 64px;
        margin-top: 28px;
    }

    .error-split__body {
        text-align: left;
    }

    .error-split .status-block {
        margin: 0 0 8px;
    }

    .error-split .status-code {
        font-size: clamp(88px, 13vw, 168px);
    }

    .error-split .status-kicker {
        margin: -14px 0 0;
    }

    .error-split .hero-visual {
        max-width: 100%;
        margin: 0;
    }

    .error-split .lead {
        margin: 0 0 22px;
    }

    .error-split .copy {
        margin: 0;
    }

    .error-split .rule {
        margin: 28px 0;
    }

    .error-split .actions {
        margin-top: 28px;
    }
}

/* ---------- hub list ---------- */

.project-list {
    width: 100%;
    margin-top: 8px;
}

.project-row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
    padding: 24px 4px;
    border-top: 1px solid var(--line);
    text-align: left;
}

.project-row:last-child {
    border-bottom: 1px solid var(--line);
}

.project-icon {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand);
}

.project-icon svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.project-body {
    flex: 1 1 auto;
    min-width: 0;
}

.project-body h3 {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--text);
}

.project-body p {
    margin: 0;
    font-size: 14.5px;
    line-height: 1.7;
    color: var(--muted);
}

.project-row a.project-link {
    color: inherit;
}

.project-row:hover .project-body h3,
.project-row:hover .project-icon {
    color: var(--brand);
}

.project-row .arrow {
    flex: 0 0 auto;
    align-self: center;
    font-size: 18px;
    color: rgba(0, 0, 0, 0.25);
    transition: transform .3s ease, color .3s ease;
}

.project-row:hover .arrow {
    color: var(--brand);
    transform: translateX(3px);
}

.project-row.is-placeholder {
    opacity: 0.55;
}

/* ---------- about card ---------- */

.id-card {
    width: 100%;
    max-width: 420px;
    margin: 6px auto 0;
    padding: 40px 28px 32px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #FFFFFF;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.05);
}

.avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    display: block;
    margin: 0 auto 20px;
    object-fit: cover;
}

.id-name {
    margin: 0 0 6px;
    font-size: 21px;
    font-weight: 700;
    color: var(--brand);
    line-height: 1.4;
}

.id-role {
    margin: 0 0 24px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.id-mail {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 20px;
    border: 1px solid rgba(41, 90, 168, 0.28);
    border-radius: 999px;
    font-size: 14px;
    color: var(--brand);
}

.id-mail svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.id-mail:hover {
    color: #FFFFFF;
    background: var(--brand);
    border-color: var(--brand);
}

/* ---------- credits ---------- */

details.credits {
    width: 100%;
    margin-top: 40px;
    border-top: 1px solid var(--line);
}

details.credits summary {
    list-style: none;
    cursor: pointer;
    padding: 18px 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--brand);
    text-align: center;
}

details.credits summary::-webkit-details-marker {
    display: none;
}

details.credits summary:hover {
    color: var(--hover);
}

details.credits .credits-body {
    padding: 4px 0 10px;
    font-size: 14px;
    line-height: 2;
    color: var(--muted);
    text-align: center;
}

/* ---------- footer ---------- */

.footer-card {
    margin-top: 56px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
    width: 100%;
}

.icp-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.55);
}

.icp-label svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.icp-label a {
    color: rgba(0, 0, 0, 0.55);
}

.icp-label a:hover {
    color: var(--hover);
}

/* ---------- back to top ---------- */

.scrollToTop {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease, background .3s ease;
}

.scrollToTop.visible {
    opacity: 1;
    pointer-events: auto;
}

.scrollToTop:hover {
    background: rgba(0, 0, 0, 0.5);
}

.scrollToTop svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2px;
}

/* ---------- Mili theme (compass.html) ----------
   Original palette: teal #76B3B6, deep blue #1D26A3, grey #CECECE
   --------------------------------------------------- */

body.theme-mili {
    --brand: #76B3B6;
    --brand-dark: #1D26A3;
    --link: #1D26A3;
    --muted: rgba(0, 0, 0, 0.45);
}

.mili-hero {
    width: 100%;
    background: linear-gradient(180deg, #76B3B6 0%, #1D26A3 100%);
    padding: 56px 20px 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
}

.mili-hero .brand {
    color: #FFFFFF;
}

.mili-hero .nav-links a {
    color: rgba(255, 255, 255, 0.7);
}

.mili-hero .nav-links a:hover,
.mili-hero .nav-links a.is-active {
    color: #FFFFFF;
}

.mili-project-title {
    margin: 46px 0 4px;
    font-size: clamp(38px, 9vw, 64px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: 0.01em;
    color: #FFFFFF;
    text-align: center;
}

.mili-project-title a {
    color: #FFFFFF;
}

.mili-feat-title {
    margin: 0 0 26px;
    font-size: clamp(26px, 6vw, 42px);
    font-weight: 700;
    font-style: italic;
    letter-spacing: 0.02em;
    color: #CECECE;
    text-align: center;
}

.mili-credits {
    margin: 0 auto 34px;
    max-width: 620px;
    font-size: 14.5px;
    line-height: 2;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

.mili-credits a {
    color: #FFFFFF;
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.mili-credits a:hover {
    color: #FFFFFF;
    border-bottom-color: #FFFFFF;
}

.mili-cover {
    width: 100%;
    max-width: 946px;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 10px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.mili-video-section {
    width: 100%;
    background: #1D26A3;
    padding: 64px 20px 72px;
    display: flex;
    justify-content: center;
}

.mili-video-grid {
    width: 100%;
    max-width: 1040px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 34px;
}

.mili-video-block h3 {
    margin: 0 0 14px;
    font-size: 22px;
    font-weight: 700;
    color: #CECECE;
    text-align: center;
}

.ratio {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.25);
}

.ratio iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.mili-disclaimer {
    width: 100%;
    padding: 40px 20px 0;
    font-size: 13.5px;
    line-height: 1.9;
    color: var(--muted);
    text-align: center;
}

body.theme-mili .footer-card {
    max-width: 760px;
    margin: 40px auto 0;
    padding-left: 20px;
    padding-right: 20px;
    text-align: center;
}

body.theme-mili .page-container {
    padding: 0 0 64px;
    align-items: stretch;
}

body.theme-mili .main-column {
    max-width: none;
    align-items: stretch;
}

/* ---------- responsive ---------- */

@media (min-width: 576px) {
    .page-container {
        padding-top: 80px;
        padding-bottom: 120px;
    }
    .lead {
        font-size: 20px;
    }
    .mili-hero {
        padding-top: 78px;
        padding-bottom: 78px;
    }
}

@media (min-width: 768px) {
    .mili-video-grid {
        grid-template-columns: 1fr 1fr;
    }
}
