/* ============================================================================
   vibeic.ai — Dark theme, stable, trustworthy, professional
   Ref: hackathon.com.tw (dark), RY-UI-skill (left-align, Inter, rings)
   ============================================================================ */

:root {
    --bg: #ffffff;
    --bg-alt: #f4f5f7;
    --bg-card: #ffffff;
    --bg-elevated: #eef0f4;
    --border: rgba(15,23,42,0.10);
    --border-hover: rgba(15,23,42,0.20);
    --text: #0a0f1a;
    --text-secondary: #3b4259;
    --text-muted: #6b7280;
    --accent: #1e3a5f;
    --accent-hover: #264d7a;
    --green: #166534;
    --amber: #92400e;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'Geist Mono', 'Fira Code', 'SF Mono', monospace;
    --max-w: 1120px;
    --radius: 12px;
}

/* Semantic colors */
.color-green { color: #166534; }
.color-red { color: #991b1b; }
.color-navy { color: #1e3a5f; }
.color-amber { color: #92400e; }

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
}

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ---- Nav ---- */
nav {
    position: fixed; top: 0; width: 100%; z-index: 100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    max-width: var(--max-w); margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.logo {
    font-size: 20px; font-weight: 700; color: var(--text); text-decoration: none;
    letter-spacing: -0.5px; display: inline-flex; align-items: center; gap: 10px;
}
.logo-img { height: 32px; }
.logo-mark { flex-shrink: 0; }
.nav-links a { color: var(--text-secondary); }
.nav-links a:hover { color: var(--text); }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
    color: var(--text-muted); text-decoration: none; font-size: 14px; font-weight: 500;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.btn-nav {
    background: var(--accent) !important; color: #fff !important;
    padding: 7px 18px !important; border-radius: 4px; font-weight: 600 !important;
    font-size: 13px !important;
}
.btn-nav:hover { opacity: 0.9; }
.menu-toggle {
    display: none; background: none; border: none; color: var(--text); cursor: pointer;
}

/* ---- Language Switcher ---- */
.lang-switch { display: flex; gap: 2px; margin-left: 8px; }
.lang-btn {
    background: none; border: 1px solid var(--border); color: var(--text-muted);
    font-size: 12px; font-weight: 600; padding: 4px 10px; cursor: pointer;
    transition: all 0.2s;
}
.lang-btn:first-child { border-radius: 6px 0 0 6px; }
.lang-btn:last-child { border-radius: 0 6px 6px 0; }
.lang-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---- Hero ---- */
.hero {
    padding: 140px 0 100px;
    position: relative; overflow: hidden;
    border-bottom: 1px solid var(--border);
}
.hero-bg {
    position: absolute; inset: 0; z-index: 0;
    background: url('https://images.unsplash.com/photo-1555617981-dac3880eac6e?w=1600&q=80') center/cover no-repeat;
    filter: blur(2px) brightness(0.95) saturate(0.7);
    opacity: 0.18;
    transform: scale(1.05);
}
.hero-grid {
    display: grid; grid-template-columns: 3fr 2fr; gap: 64px; align-items: start;
}
.eyebrow {
    font-family: var(--mono); font-size: 12px; font-weight: 500;
    color: var(--accent); text-transform: uppercase; letter-spacing: 1.5px;
    margin-bottom: 16px;
}
.hero h1 {
    font-size: clamp(36px, 5vw, 56px); font-weight: 700;
    letter-spacing: -1.5px; line-height: 1.1; margin-bottom: 24px;
}
.hero-sub {
    color: var(--text-secondary); font-size: 16px; line-height: 1.8;
    max-width: 40ch; margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 12px; }
.btn-primary {
    display: inline-flex; align-items: center; justify-content: center;
    height: 40px; padding: 0 24px; border-radius: 4px;
    background: var(--accent); color: #fff;
    font-size: 14px; font-weight: 600; text-decoration: none;
    transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.88; }
.btn-lg { height: 48px; padding: 0 36px; font-size: 15px; }
.btn-ghost {
    display: inline-flex; align-items: center; justify-content: center;
    height: 40px; padding: 0 24px; border-radius: 4px;
    background: transparent; color: var(--text-secondary);
    font-size: 14px; font-weight: 500; text-decoration: none;
    border: 1px solid var(--border-hover);
    transition: border-color 0.2s, color 0.2s;
}
.btn-ghost:hover { border-color: var(--text-muted); color: var(--text); }

.metric-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
    background: var(--border); border-radius: var(--radius);
    overflow: hidden; ring: 1px;
    box-shadow: inset 0 0 0 1px var(--border);
}
.metric {
    background: var(--bg); padding: 28px 24px;
    display: flex; flex-direction: column;
}
.metric-val {
    font-size: 32px; font-weight: 700; letter-spacing: -1px;
    font-variant-numeric: tabular-nums; color: var(--accent);
}
.metric-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.grid-lines {
    position: absolute; inset: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(15,23,42,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15,23,42,0.04) 1px, transparent 1px);
    background-size: 80px 80px;
}

/* ---- Sections ---- */
section { padding: 96px 0; border-bottom: 1px solid var(--border); }
.section-alt { background: var(--bg-alt); }
.section-header { margin-bottom: 56px; }
.section-header h2 {
    font-size: clamp(24px, 3vw, 36px); font-weight: 700;
    letter-spacing: -0.8px; margin-bottom: 8px;
}
.section-header p {
    color: var(--text-secondary); font-size: 16px; max-width: 50ch;
}

/* ---- Phase Cards ---- */
.phase-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); }
.phase-card { background: var(--bg-card); padding: 32px; }
.phase-num { font-family: var(--mono); font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 16px; }
.phase-card h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.3px; margin-bottom: 4px; }
.phase-zh { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.phase-card ul { list-style: none; margin-bottom: 20px; }
.phase-card li {
    font-size: 14px; color: var(--text-secondary); padding: 5px 0; padding-left: 16px; position: relative;
}
.phase-card li::before { content: ''; position: absolute; left: 0; top: 13px; width: 5px; height: 5px; border-radius: 50%; background: var(--text-muted); }
.phase-gate {
    font-size: 12px; color: var(--text-muted); padding-top: 16px;
    border-top: 1px solid var(--border);
    font-family: var(--mono); letter-spacing: 0.3px;
}

/* ---- Result Cards ---- */
.result-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); margin-bottom: 64px; }
.result-card { background: var(--bg-card); padding: 28px; }
.result-val { display: block; font-size: 28px; font-weight: 700; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.result-key { display: block; font-size: 12px; color: #1e3a5f; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; margin: 4px 0 8px; }
.result-card p { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* ---- Comparison ---- */
.comparison-block { display: flex; gap: 0; border-radius: var(--radius); overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); }
.compare-side { flex: 1; padding: 32px; }
.compare-old { background: #f5f5f5; border-left: 3px solid #991b1b; }
.compare-new { background: #f5f5f5; border-left: 3px solid #166534; }
.compare-vs {
    display: flex; align-items: center; justify-content: center;
    width: 48px; background: var(--bg-alt); color: var(--text-muted);
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    border-left: 1px solid var(--border); border-right: 1px solid var(--border);
}
.compare-side h4 { font-size: 16px; font-weight: 600; margin-bottom: 16px; letter-spacing: -0.2px; }
.compare-side ul { list-style: none; }
.compare-side li { font-size: 14px; color: var(--text-secondary); padding: 6px 0; }
.compare-old li::before { content: '—  '; color: #991b1b; }
.compare-new li::before { content: '+  '; color: #166534; font-weight: 700; }

/* ---- Stack Grid ---- */
.stack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); }
.stack-item { background: var(--bg-card); padding: 28px; }
.stack-item h5 { font-size: 14px; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.2px; }
.stack-item p { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* ---- Skill Groups ---- */
.skill-groups { display: grid; gap: 24px; }
.skill-group {
    padding: 24px; border-radius: var(--radius);
    background: var(--bg-card); box-shadow: inset 0 0 0 1px var(--border);
}
.skill-group h5 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span {
    font-family: var(--mono); font-size: 12px; color: var(--text-secondary);
    padding: 4px 10px; border-radius: 6px;
    background: var(--bg-alt);
    box-shadow: inset 0 0 0 1px var(--border);
}

/* ---- Steps ---- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 56px; }
.step-card {
    padding: 24px; border-radius: var(--radius);
    background: var(--bg-card); box-shadow: inset 0 0 0 1px var(--border);
}
.step-num { font-family: var(--mono); font-size: 12px; color: var(--accent); font-weight: 600; display: block; margin-bottom: 12px; }
.step-card h5 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.step-card pre {
    background: #0f172a; border-radius: 8px; padding: 14px;
    overflow-x: auto; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.step-card code {
    font-family: var(--mono); font-size: 12.5px; color: #93c5fd;
    line-height: 1.7; white-space: pre;
}
.step-card h5 { color: var(--text); }

.cta-block { text-align: center; }
.cta-sub { color: var(--text-muted); font-size: 13px; margin-top: 12px; }

/* ---- Footer ---- */
footer { padding: 56px 0 32px; border-top: 1px solid var(--border); }
.footer-inner { display: flex; justify-content: space-between; margin-bottom: 40px; }
.footer-brand p { color: var(--text-muted); font-size: 13px; margin-top: 6px; }
.footer-cols { display: flex; gap: 64px; }
.footer-cols h6 {
    font-family: var(--mono); font-size: 11px; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px;
    margin-bottom: 12px;
}
.footer-cols a {
    display: block; color: var(--text-secondary); text-decoration: none;
    font-size: 14px; padding: 3px 0; transition: color 0.2s;
}
.footer-cols a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 24px; }
.footer-bottom p { font-size: 12px; color: var(--text-muted); }
.footer-bottom a { color: var(--text-muted); text-decoration: none; }
.footer-bottom a:hover { color: var(--text-secondary); }

/* Legal pages */
.legal-page { padding: 120px 0 80px; }
.legal-page h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.8px; margin-bottom: 8px; }
.legal-updated { color: var(--text-muted); font-size: 13px; margin-bottom: 40px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.legal-page h2 { font-size: 18px; font-weight: 600; margin: 32px 0 12px; letter-spacing: -0.2px; }
.legal-page p { color: var(--text-secondary); font-size: 15px; line-height: 1.8; margin-bottom: 12px; max-width: 70ch; }
.legal-page ul { margin: 8px 0 16px 20px; }
.legal-page li { color: var(--text-secondary); font-size: 15px; line-height: 1.8; margin-bottom: 4px; }
.legal-page a { color: var(--accent); text-decoration: none; }
.legal-page a:hover { text-decoration: underline; }
.legal-page strong { color: var(--text); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-links.open {
        display: flex; flex-direction: column; position: absolute;
        top: 64px; left: 0; right: 0; background: #fff;
        padding: 16px 24px 24px; border-bottom: 1px solid var(--border);
        gap: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    }
    .menu-toggle { display: block; }
    .hero { padding: 100px 0 64px; }
    .hero-grid { grid-template-columns: 1fr; gap: 40px; }
    .phase-cards, .result-cards, .stack-grid, .steps { grid-template-columns: 1fr; }
    .comparison-block { flex-direction: column; }
    .compare-vs { width: 100%; height: 36px; border-left: 0; border-right: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
    .footer-inner { flex-direction: column; gap: 32px; }
    .footer-cols { flex-wrap: wrap; gap: 32px; }
}
