/* ================================================================
   sangrey.io
   ================================================================ */

/* ---- Tokens -------------------------------------------------------- */
:root {
    --bg:       #F7F4EF;
    --ink:      #1C2B3A;
    --teal:     #2A7B8C;
    --coral:    #C45C3A;
    --muted:    #7A8B99;
    --border:   #DDD8CF;
    --nav-bg:   #1C2B3A;
    --nav-ink:  #F7F4EF;
    --serif:    'Fraunces', Georgia, serif;
    --sans:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --width:    680px;
    --gap:      24px;
}

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

html { font-size: 16px; }

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

/* ---- Navigation ---------------------------------------------------- */
.site-header {
    background: var(--nav-bg);
    padding: 0 var(--gap);
}

.site-nav {
    max-width: var(--width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 3.25rem;
}

.nav-brand {
    font-family: var(--serif);
    font-weight: 300;
    font-size: 1.05rem;
    color: var(--nav-ink);
    text-decoration: none;
    letter-spacing: -0.01em;
    opacity: 0.95;
}

.nav-brand:hover { color: #fff; opacity: 1; }

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(247, 244, 239, 0.55);
    text-decoration: none;
    transition: color 0.12s ease;
}

.nav-links a:hover,
.nav-links a.active { color: var(--nav-ink); }

/* ---- Main layout --------------------------------------------------- */
.site-main {
    padding: 5rem var(--gap) 7rem;
}

.content-wrap {
    max-width: var(--width);
    margin: 0 auto;
}

/* ---- Shared typography --------------------------------------------- */
p {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.65;
}

p:last-child { margin-bottom: 0; }

a {
    color: var(--teal);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ---- Home page ----------------------------------------------------- */
.home-name {
    font-family: var(--serif);
    font-weight: 300;
    font-size: 3.25rem;
    line-height: 1.05;
    letter-spacing: -0.035em;
    color: var(--ink);
    margin-bottom: 0.5rem;
}

.home-tagline {
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--coral);
    margin-bottom: 2.75rem;
    line-height: 1.5;
}

.home-bio p {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--ink);
    margin-bottom: 1.25rem;
}

.home-bio p:last-child { margin-bottom: 0; }

/* ---- Research page ------------------------------------------------- */
.papers {
    margin-top: 0.5rem;
}

.paper {
    padding: 2.25rem 0;
    border-top: 1px solid var(--border);
}

.paper:last-child {
    border-bottom: 1px solid var(--border);
}

.paper-title {
    font-family: var(--serif);
    font-weight: 300;
    font-size: 1.25rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
}

.paper-title a {
    color: var(--ink);
}

.paper-title a:hover {
    color: var(--teal);
    text-decoration: none;
}

.paper-meta {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.paper-meta em { font-style: italic; }

.paper-meta a { color: var(--muted); }
.paper-meta a:hover { color: var(--teal); text-decoration: none; }

.paper-abstract {
    font-size: 0.9375rem;
    line-height: 1.65;
    border-left: 2px solid var(--teal);
    padding-left: 1.1rem;
    color: var(--ink);
    opacity: 0.9;
    margin: 0;
}

/* Page-level h1 (Research, Links) */
.page-content > h1,
.post-list > h1 {
    font-family: var(--serif);
    font-weight: 300;
    font-size: 2.5rem;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 2rem;
    color: var(--ink);
}

/* ---- Links page ---------------------------------------------------- */
.link-section {
    margin-bottom: 2.5rem;
}

.link-label {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 0.625rem;
}

.link-list {
    list-style: none;
    border-top: 1px solid var(--border);
}

.link-list li {
    border-bottom: 1px solid var(--border);
    padding: 0.625rem 0;
}

.link-list a {
    font-size: 0.9375rem;
    color: var(--ink);
    font-weight: 400;
}

.link-list a:hover {
    color: var(--teal);
    text-decoration: none;
}

.link-desc {
    font-size: 0.8125rem;
    color: var(--muted);
    margin-top: 0.15rem;
    line-height: 1.5;
}

.link-desc a { color: var(--muted); }
.link-desc a:hover { color: var(--teal); text-decoration: none; }

/* ---- Footer -------------------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.75rem var(--gap);
    text-align: center;
    font-size: 0.8125rem;
    color: var(--muted);
}

.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--teal); }

/* ---- Blog post ----------------------------------------------------- */
.post-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.post-title {
    font-family: var(--serif);
    font-weight: 300;
    font-size: 2.5rem;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--ink);
    margin-bottom: 0.5rem;
}

.post-date {
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.post-body h2 {
    font-family: var(--sans);
    font-weight: 500;
    font-size: 1.0625rem;
    color: var(--ink);
    margin: 2.25rem 0 0.5rem;
    letter-spacing: -0.01em;
}

.post-body h3 {
    font-family: var(--sans);
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--ink);
    margin: 1.75rem 0 0.35rem;
}

.post-body ul,
.post-body ol {
    margin: 0 0 1rem 1.25rem;
}

.post-body li { margin-bottom: 0.25rem; }

.post-body blockquote {
    border-left: 2px solid var(--teal);
    padding-left: 1.1rem;
    color: var(--ink);
    opacity: 0.85;
    margin: 1.5rem 0;
}

/* ---- Blog index ---------------------------------------------------- */
.post-summary {
    padding: 1.75rem 0;
    border-top: 1px solid var(--border);
}

.post-summary:last-child {
    border-bottom: 1px solid var(--border);
}

.post-summary-title {
    font-family: var(--serif);
    font-weight: 300;
    font-size: 1.25rem;
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin-bottom: 0.2rem;
}

.post-summary-title a {
    color: var(--ink);
}

.post-summary-title a:hover {
    color: var(--teal);
    text-decoration: none;
}

.post-summary-desc {
    font-size: 0.9rem;
    color: var(--muted);
    margin-top: 0.35rem;
}

/* ---- Responsive ---------------------------------------------------- */
@media (max-width: 600px) {
    .site-main { padding-top: 3rem; padding-bottom: 5rem; }

    .home-name { font-size: 2.5rem; }

    .post-title { font-size: 2rem; }

    .page-content > h1 { font-size: 2rem; }

    .site-nav { flex-wrap: wrap; height: auto; padding: 0.75rem 0; gap: 0.5rem; }

    .nav-links { gap: 1.25rem; }
}
