/* =========================================================
   Ressa Octavianty — personal site
   Modern, light stylesheet. No Bootstrap, no jQuery.
   ========================================================= */

:root {
    --bg:           #ffffff;
    --bg-alt:       #f7f5f2;
    --rule:         #e3dfd8;
    --ink:          #1a1a1a;
    --ink-soft:     #4a4a4a;
    --muted:        #6b6b6b;
    --accent:       #5a4a8a;
    --link:         #2a4d8f;
    --link-hover:   #16356b;
    --shadow-soft:  0 1px 3px rgba(0, 0, 0, 0.06);

    --page-width:   62rem;
    --gutter:       1.25rem;

    --serif:  'Lora', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
    --sans:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --mono:   'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace;
}

/* ---- Reset & base --------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg { max-width: 100%; height: auto; }

a {
    color: var(--link);
    text-decoration: none;
    border-bottom: 1px solid rgba(42, 77, 143, 0.25);
    transition: color .15s, border-color .15s;
}
a:hover { color: var(--link-hover); border-bottom-color: var(--link-hover); }
a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

::selection { background: var(--accent); color: #fff; }

/* Skip-to-content link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--ink);
    color: #fff;
    padding: .5rem 1rem;
    z-index: 100;
    border-bottom: none;
}
.skip-link:focus { top: 0; }

/* ---- Headings ------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--serif);
    font-weight: 600;
    line-height: 1.25;
    color: var(--ink);
    margin-top: 2rem;
    margin-bottom: .75rem;
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.6rem; border-bottom: 2px solid var(--accent); padding-bottom: .4rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem 0; }

ul, ol { padding-left: 1.4rem; }
li { margin-bottom: .25rem; }

blockquote {
    border-left: 4px solid var(--accent);
    margin: 1rem 0;
    padding: .25rem 1rem;
    color: var(--ink-soft);
    font-style: italic;
}

/* ---- Tables --------------------------------------------- */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    font-size: .96em;
    font-variant-numeric: tabular-nums lining-nums;
}
thead th {
    background: var(--bg-alt);
    text-align: left;
    font-family: var(--sans);
    font-weight: 600;
    color: var(--ink);
    border-bottom: 2px solid var(--accent);
    padding: .6rem .75rem;
}
tbody td {
    padding: .55rem .75rem;
    border-bottom: 1px solid var(--rule);
    vertical-align: top;
}
tbody tr:nth-child(even) td {
    background: rgba(247, 245, 242, 0.55);
}
tbody tr:last-child td { border-bottom: none; }

code {
    font-family: var(--mono);
    background: var(--bg-alt);
    padding: .1rem .35rem;
    border-radius: 3px;
    font-size: .92em;
}
pre {
    background: var(--bg-alt);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: .92em;
    line-height: 1.5;
}
pre code { background: transparent; padding: 0; }

hr {
    border: none;
    border-top: 1px solid var(--rule);
    margin: 2rem 0;
}

/* ---- Navigation ----------------------------------------- */
.site-nav {
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
}
.nav-inner {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: .75rem var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.nav-brand {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--ink);
    border-bottom: none;
}
.nav-brand:hover { color: var(--accent); }

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.nav-menu a {
    color: var(--ink-soft);
    border-bottom: none;
    font-size: .95rem;
    padding: .25rem 0;
    border-bottom: 2px solid transparent;
}
.nav-menu a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.nav-menu a.current,
.nav-menu a[aria-current="page"] {
    color: var(--ink);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: .4rem .55rem;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
    margin: 4px 0;
}

@media (max-width: 720px) {
    .nav-toggle { display: block; }
    .nav-menu {
        display: none;
        flex-basis: 100%;
        flex-direction: column;
        gap: .5rem;
        padding-top: .75rem;
    }
    .nav-menu.open { display: flex; }
}

/* ---- Page header (hero) --------------------------------- */
.page-header {
    background: var(--accent) center / cover no-repeat;
    color: #fff;
    text-align: center;
    padding: 5rem var(--gutter) 4rem;
    position: relative;
}
.page-header::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(20,20,30,0.45), rgba(20,20,30,0.55));
    pointer-events: none;
}
.page-header.page-header--plain {
    background-color: var(--bg-alt);
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='72' viewBox='0 0 160 72'><g fill='none' stroke='%235a4a8a' stroke-width='1'><path d='M 0 18 Q 40 2, 80 18 T 160 18' opacity='0.22'/><path d='M 0 36 Q 40 20, 80 36 T 160 36' opacity='0.17'/><path d='M 0 54 Q 40 38, 80 54 T 160 54' opacity='0.12'/></g></svg>"),
        linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
    color: var(--ink);
    border-bottom: 3px solid var(--accent);
    padding: 4rem var(--gutter) 2.25rem;
    text-align: left;
}
.page-header.page-header--plain::after { display: none; }
.page-header-inner {
    position: relative;
    max-width: var(--page-width);
    margin: 0 auto;
    z-index: 1;
}
.page-header h1 {
    margin: 0;
    font-size: 2.5rem;
    color: inherit;
    border: none;
    padding: 0;
}
.page-header.page-header--plain h1 { font-size: 2.25rem; }
.page-header .subtitle, .page-header .post-meta {
    margin: .5rem 0 0;
    font-size: 1rem;
    opacity: .85;
}

/* ---- Main content --------------------------------------- */
main {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

article.page,
article.note {
    max-width: 42rem;
    margin: 2.5rem auto;
    font-family: var(--serif);
    font-size: 1.05rem;
    line-height: 1.7;
}
article.page h2,
article.note h2 { margin-top: 2.5rem; }
article.page > p:first-of-type {
    font-size: 1.18em;
    line-height: 1.55;
    color: var(--ink);
    margin-bottom: 1.5rem;
}
article.page > p:first-of-type::first-letter {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 2.8em;
    line-height: 0.85;
    float: left;
    padding: 0.1em 0.12em 0 0;
    color: var(--accent);
}

/* ---- Empty-state block (notes index) -------------------- */
.empty-state {
    margin: 2rem 0;
    padding: 1.25rem 1.5rem;
    background: var(--bg-alt);
    border-left: 4px solid var(--accent);
    color: var(--ink-soft);
}
.empty-state p { margin: 0 0 .5rem; }
.empty-state p:last-child { margin: 0; }

/* ---- Homepage ------------------------------------------- */
.hero {
    text-align: center;
    padding: 3.5rem var(--gutter) 2rem;
    border-bottom: 1px solid var(--rule);
}
.hero-portrait {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-soft);
    border: 4px solid #fff;
}
.hero h1 {
    margin: 1rem 0 .25rem;
    font-size: 2.4rem;
}
.hero .tagline {
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 38rem;
    margin: 0 auto;
}

.home-section {
    max-width: 42rem;
    margin: 2.5rem auto;
    padding: 0 var(--gutter);
}
.home-section h2 {
    font-family: var(--serif);
    font-size: 1.4rem;
}

/* ---- Notes list ----------------------------------------- */
.notes-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}
.notes-list li {
    padding: .85rem 0;
    border-bottom: 1px solid var(--rule);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .75rem;
}
.note-link {
    font-family: var(--serif);
    font-size: 1.1rem;
    border-bottom: none;
}
.note-link:hover { border-bottom: 1px solid currentColor; }
.note-date {
    color: var(--muted);
    font-size: .9rem;
    font-variant-numeric: tabular-nums;
}

/* ---- Footer --------------------------------------------- */
.site-footer {
    max-width: var(--page-width);
    margin: 4rem auto 2rem;
    padding: 2rem var(--gutter) 0;
    border-top: 1px solid var(--rule);
    text-align: center;
    color: var(--muted);
    font-size: .9rem;
}
.profile-links {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.profile-links a {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: var(--ink-soft);
    border-bottom: none;
}
.profile-links a:hover { color: var(--accent); }
.profile-links svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}
.copyright { margin: 0; }

/* ---- Profile-link variant for the homepage bio ---------- */
.profile-links--bio {
    justify-content: flex-start;
    margin: 1rem 0 0;
}

/* ---- CV download button --------------------------------- */
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff !important;
    padding: .6rem 1.2rem;
    border-radius: 4px;
    border-bottom: none;
    font-weight: 600;
    transition: background .15s;
}
.btn:hover { background: var(--link-hover); }

/* ---- External-link indicator ---------------------------- */
article.page a[href^="http"]::after,
article.note a[href^="http"]::after {
    content: " \2197";              /* ↗ */
    font-size: 0.85em;
    color: var(--muted);
    margin-left: 0.05em;
}

/* ---- Heading anchor links ------------------------------- */
.heading-anchor {
    display: inline-block;
    margin-left: 0.5em;
    color: var(--accent) !important;
    opacity: 0;
    border-bottom: none !important;
    font-weight: 400;
    font-family: var(--mono);
    font-size: 0.78em;
    vertical-align: middle;
    transition: opacity .15s;
    text-decoration: none;
}
.heading-anchor::after { content: none !important; }   /* no external-link arrow */
h2:hover .heading-anchor,
h3:hover .heading-anchor,
.heading-anchor:focus-visible { opacity: 1; }

/* ---- Print --------------------------------------------- */
@media print {
    .site-nav, .site-footer, .skip-link, .heading-anchor { display: none; }

    .page-header.page-header--plain {
        background: none !important;
        background-image: none !important;
        background-color: transparent !important;
        border: none;
        padding: 0 0 1rem;
        text-align: left;
    }
    .page-header h1 { font-size: 22pt; color: #000; }

    body {
        font-size: 11pt;
        line-height: 1.45;
        color: #000;
        background: #fff;
    }
    article.page, article.note {
        max-width: 100%;
        margin: 0;
        font-size: 10.5pt;
        line-height: 1.5;
        color: #000;
    }

    h1, h2, h3, h4, h5, h6 { color: #000; page-break-after: avoid; }
    h2 { border-bottom: 1px solid #000; }

    a { color: #000; border-bottom: none; text-decoration: none; }
    article.page a[href^="http"]::after,
    article.note a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.82em;
        word-break: break-all;
        color: #555;
    }

    table { font-size: 10pt; page-break-inside: avoid; }
    thead th { background: #f0f0f0 !important; color: #000; border-bottom: 1px solid #000; }
    tbody td { border-bottom: 1px solid #ccc; }
    tbody tr:nth-child(even) td { background: transparent !important; }

    blockquote { border-left-color: #000; color: #000; }
    article.page > p:first-of-type { font-size: 1.05em; }
}

/* ---- Dark mode ----------------------------------------- */
@media (prefers-color-scheme: dark) {
    :root {
        --bg:           #14121b;
        --bg-alt:       #1f1d28;
        --rule:         #2f2c38;
        --ink:          #ece8e0;
        --ink-soft:     #b8b3a8;
        --muted:        #8a857a;
        --accent:       #b8a8e8;
        --link:         #8fb3e8;
        --link-hover:   #b3cdf0;
        --shadow-soft:  0 1px 3px rgba(0, 0, 0, 0.35);
    }
    a { border-bottom-color: rgba(143, 179, 232, 0.35); }

    .page-header.page-header--plain {
        background-color: var(--bg-alt);
        background-image:
            url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='72' viewBox='0 0 160 72'><g fill='none' stroke='%23b8a8e8' stroke-width='1'><path d='M 0 18 Q 40 2, 80 18 T 160 18' opacity='0.32'/><path d='M 0 36 Q 40 20, 80 36 T 160 36' opacity='0.24'/><path d='M 0 54 Q 40 38, 80 54 T 160 54' opacity='0.16'/></g></svg>"),
            linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
    }

    .hero-portrait { border-color: var(--bg-alt); }

    tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.03); }
    thead th { background: var(--bg-alt); }

    code, pre { background: var(--bg-alt); }
    .btn { color: var(--bg) !important; }

    ::selection { background: var(--accent); color: var(--bg); }
}
