/* ============================================================
   alvinrivelino.id — site stylesheet (light, editorial)
   ============================================================ */

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

:root {
    --paper: #faf9f6;
    --paper-2: #f2f0eb;
    --white: #ffffff;
    --ink: #1c1c21;
    --ink-2: #4b4b54;
    --ink-3: #80808a;
    --rule: #e3e0d8;
    --rule-strong: #cfcbc1;
    --accent: #1f3f6b;
    --accent-soft: #e9eef5;
    --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
    --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --nav-h: 64px;
    --radius: 6px;
}

html { scroll-behavior: smooth; font-size: 16px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    font-family: var(--sans);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 {
    font-family: var(--serif);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--ink);
}

strong { font-weight: 600; color: var(--ink); }

.container { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* ── Nav ── */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-h);
    background: rgba(250, 249, 246, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--rule);
}
.nav-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 28px;
}
.nav-brand {
    font-family: var(--serif);
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--ink);
    margin-right: auto;
}
.nav-brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 24px; list-style: none; }
.nav-links a { font-size: 0.9rem; color: var(--ink-2); }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--ink); text-decoration: none; }
.nav-links a[aria-current] { font-weight: 600; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 6px;
}
.nav-toggle span { display: block; width: 22px; height: 1.5px; background: var(--ink); }

.mobile-menu {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    z-index: 99;
}
.mobile-menu.open { display: block; }
.mobile-menu ul { list-style: none; padding: 12px 24px 20px; }
.mobile-menu a { display: block; padding: 12px 0; color: var(--ink); font-size: 1.05rem; border-bottom: 1px solid var(--rule); }
.mobile-menu li:last-child a { border-bottom: 0; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    font-size: 0.92rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid var(--ink);
    background: var(--ink);
    color: var(--paper);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.btn:hover { background: var(--accent); border-color: var(--accent); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn-ghost:hover { background: var(--white); color: var(--ink); border-color: var(--ink); }

/* ── Sections ── */
.section { padding: 88px 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section-alt { background: var(--paper-2); }

.section-head {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 32px;
    margin-bottom: 44px;
    align-items: baseline;
}
.section-label {
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-3);
}
.section-title { font-size: clamp(1.7rem, 3vw, 2.2rem); }
.section-title em { font-style: italic; color: var(--accent); }

/* ── Hero ── */
.hero { padding: 96px 0 72px; }
.hero-eyebrow {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ink-3);
    letter-spacing: 0.04em;
    margin-bottom: 20px;
}
.hero h1 {
    font-size: clamp(2.8rem, 7vw, 4.8rem);
    font-weight: 400;
    letter-spacing: -0.025em;
    line-height: 1.02;
    margin-bottom: 20px;
}
.hero-lede {
    font-family: var(--serif);
    font-size: clamp(1.25rem, 2.4vw, 1.6rem);
    line-height: 1.4;
    color: var(--ink-2);
    max-width: 720px;
    margin-bottom: 20px;
}
.hero-lede em { font-style: italic; color: var(--accent); }
.hero-text { font-size: 1.02rem; color: var(--ink-2); max-width: 640px; margin-bottom: 36px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 64px; }

.facts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}
.fact { padding: 20px 20px 20px 0; border-right: 1px solid var(--rule); }
.fact + .fact { padding-left: 20px; }
.fact:last-child { border-right: 0; }
.fact-num {
    display: block;
    font-family: var(--serif);
    font-size: 2rem;
    line-height: 1;
    color: var(--ink);
    margin-bottom: 6px;
}
.fact-label { font-size: 0.82rem; color: var(--ink-3); }

/* ── Feature (AI) ── */
.feature {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 56px;
    align-items: start;
}
.feature-copy p { color: var(--ink-2); margin-bottom: 16px; font-size: 1.02rem; }
.feature-copy p:last-child { margin-bottom: 0; }

.feature-list { list-style: none; border-top: 1px solid var(--rule-strong); }
.feature-list li {
    padding: 18px 0;
    border-bottom: 1px solid var(--rule);
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 14px;
}
.feature-list .n {
    font-family: var(--serif);
    font-size: 0.95rem;
    color: var(--ink-3);
    padding-top: 2px;
}
.feature-list h3 { font-family: var(--sans); font-size: 0.98rem; font-weight: 600; margin-bottom: 4px; }
.feature-list p { font-size: 0.9rem; color: var(--ink-2); }

/* ── Experience ── */
.jobs { border-top: 1px solid var(--rule-strong); }
.job {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 32px;
    padding: 36px 0;
    border-bottom: 1px solid var(--rule);
}
.job-when { font-size: 0.88rem; color: var(--ink-3); line-height: 1.5; }
.job-when b { display: block; font-weight: 500; color: var(--ink-2); }
.job h3 { font-size: 1.35rem; margin-bottom: 4px; }
.job-org { font-size: 0.92rem; color: var(--ink-2); margin-bottom: 14px; }
.job-org a { color: var(--ink-2); border-bottom: 1px solid var(--rule-strong); }
.job-org a:hover { color: var(--accent); text-decoration: none; border-color: var(--accent); }
.job-intro { color: var(--ink-2); margin-bottom: 14px; font-size: 0.98rem; }
.job ul { list-style: none; display: grid; gap: 8px; }
.job li { position: relative; padding-left: 18px; font-size: 0.93rem; color: var(--ink-2); }
.job li::before { content: ''; position: absolute; left: 0; top: 0.62em; width: 7px; height: 1px; background: var(--ink-3); }
.job li strong { font-weight: 600; }

/* ── Projects ── */
.projects {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--rule);
    border: 1px solid var(--rule);
}
.project {
    background: var(--paper);
    padding: 28px 26px 26px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 240px;
}
.section-alt .project { background: var(--paper-2); }
.project:hover { background: var(--white); }
.project-kind { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.project h3 { font-size: 1.25rem; }
.project p { font-size: 0.92rem; color: var(--ink-2); flex: 1; }
.project-meta { font-size: 0.82rem; color: var(--ink-3); border-top: 1px solid var(--rule); padding-top: 12px; margin-top: 4px; }
.project-meta b { color: var(--ink); font-weight: 600; }

/* ── Skills ── */
.skills { border-top: 1px solid var(--rule-strong); }
.skill-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    padding: 18px 0;
    border-bottom: 1px solid var(--rule);
}
.skill-row h3 { font-family: var(--sans); font-size: 0.92rem; font-weight: 600; }
.skill-row p { font-size: 0.95rem; color: var(--ink-2); }

/* ── Contact ── */
.contact-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start; }
.contact-grid p { color: var(--ink-2); font-size: 1.02rem; margin-bottom: 24px; }
.contact-list { list-style: none; border-top: 1px solid var(--rule-strong); }
.contact-list li {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--rule);
    font-size: 0.95rem;
}
.contact-list span { color: var(--ink-3); font-size: 0.85rem; padding-top: 2px; }

/* ── Footer ── */
.footer { border-top: 1px solid var(--rule); padding: 28px 0; font-size: 0.85rem; color: var(--ink-3); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer a { color: var(--ink-2); }

/* ============================================================
   CV page
   ============================================================ */
body.cv-body { background: var(--paper-2); }

.cv-bar {
    max-width: 860px;
    margin: 0 auto;
    padding: 20px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.9rem;
}
.cv-bar .actions { display: flex; gap: 10px; }
.cv-bar .btn { padding: 8px 14px; font-size: 0.85rem; }

.cv {
    max-width: 860px;
    margin: 20px auto 56px;
    background: var(--white);
    border: 1px solid var(--rule);
    padding: 56px 64px;
    color: var(--ink);
}

.cv-header { border-bottom: 2px solid var(--ink); padding-bottom: 20px; margin-bottom: 28px; }
.cv-header h1 { font-size: 2.5rem; font-weight: 500; letter-spacing: -0.02em; margin-bottom: 6px; }
.cv-headline { font-size: 1rem; font-weight: 500; color: var(--accent); margin-bottom: 10px; }
.cv-contact { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.86rem; color: var(--ink-2); }
.cv-contact a { color: var(--ink-2); }
.cv-contact a:hover { color: var(--accent); }

.cv-section { margin-bottom: 28px; }
.cv-section h2 {
    font-family: var(--sans);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    border-bottom: 1px solid var(--rule-strong);
    padding-bottom: 6px;
    margin-bottom: 14px;
}
.cv p { font-size: 0.93rem; color: var(--ink-2); line-height: 1.6; }

.cv-skills { list-style: none; display: grid; gap: 6px; }
.cv-skills li { font-size: 0.92rem; color: var(--ink-2); }
.cv-skills b { color: var(--ink); font-weight: 600; }

.cv-job { margin-bottom: 20px; }
.cv-job:last-child { margin-bottom: 0; }
.cv-job-head { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; flex-wrap: wrap; }
.cv-job-head h3 { font-family: var(--sans); font-size: 1rem; font-weight: 600; }
.cv-job-head .when { font-size: 0.86rem; color: var(--ink-3); white-space: nowrap; }
.cv-job-org { font-size: 0.88rem; color: var(--ink-3); margin-bottom: 6px; }
.cv-job > p { margin-bottom: 6px; }
.cv ul.bullets { list-style: none; display: grid; gap: 5px; margin-top: 4px; }
.cv ul.bullets li { position: relative; padding-left: 16px; font-size: 0.92rem; color: var(--ink-2); line-height: 1.5; }
.cv ul.bullets li::before { content: ''; position: absolute; left: 0; top: 0.68em; width: 6px; height: 1px; background: var(--ink-3); }
.cv ul.bullets b { color: var(--ink); font-weight: 600; }

.cv-edu { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 0.93rem; color: var(--ink-2); }
.cv-edu b { color: var(--ink); font-weight: 600; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .projects { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
    .nav-links { display: none; }
    .nav-toggle { display: flex; }
    .section { padding: 64px 0; }
    .hero { padding: 64px 0 48px; }
    .hero-actions { margin-bottom: 44px; }
    .section-head, .job, .skill-row, .feature, .contact-grid { grid-template-columns: 1fr; gap: 12px; }
    .feature, .contact-grid { gap: 32px; }
    .section-head { margin-bottom: 32px; }
    .facts { grid-template-columns: 1fr 1fr; }
    .fact { padding: 16px 16px 16px 0; }
    .fact:nth-child(2n) { border-right: 0; padding-left: 16px; }
    .fact:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
    .fact:nth-child(3) { padding-left: 0; }
    .projects { grid-template-columns: 1fr; }
    .project { min-height: 0; }
    .cv { padding: 36px 24px; margin: 16px auto 40px; }
    .cv-header h1 { font-size: 2rem; }
}

@media (max-width: 420px) {
    .facts { grid-template-columns: 1fr; }
    .fact { border-right: 0 !important; padding-left: 0 !important; border-bottom: 1px solid var(--rule); }
    .fact:last-child { border-bottom: 0; }
}

/* ── Print (CV) ── */
@page { size: A4; margin: 14mm 15mm; }
@media print {
    body.cv-body { background: #fff; }
    .cv-bar, .nav, .mobile-menu { display: none !important; }
    .cv { max-width: none; margin: 0; border: 0; padding: 0; }
    .cv-section, .cv-job { break-inside: auto; }
    .cv-section h2, .cv-job-head, .cv-job-org { break-after: avoid; }
    .cv ul.bullets li { break-inside: avoid; }
    .cv-section { margin-bottom: 20px; }
    .cv-job { margin-bottom: 14px; }
    a { color: inherit; }
    .cv p, .cv ul.bullets li, .cv-skills li { font-size: 10.5pt; }
    .cv-header h1 { font-size: 24pt; }
}
