/* ============================================================
   Srinivas Ravishankar — personal site
   Palette: near-black ground, warm ivory type, muted gold accent
   ============================================================ */

:root {
    --bg: #0a0a0a;
    --bg-alt: #111110;
    --ink: #eae6dd;
    --ink-muted: #a29c8f;
    --ink-faint: #6f6a5f;
    --gold: #c8a862;
    --gold-soft: rgba(200, 168, 98, 0.35);
    --hairline: rgba(234, 230, 221, 0.1);
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --nav-h: 76px;
    --max: 860px;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 500;
    color: var(--ink);
    margin: 0;
}

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

img { max-width: 100%; display: block; }

::selection {
    background: var(--gold-soft);
    color: var(--ink);
}

/* ---------- Nav ---------- */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    z-index: 100;
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color .4s ease, background .4s ease;
}

.nav.is-scrolled {
    background: rgba(10, 10, 10, 0.92);
    border-bottom-color: var(--hairline);
}

.nav__inner {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav__links {
    list-style: none;
    display: flex;
    gap: 40px;
    margin: 0;
    padding: 0;
}

.nav__links a {
    color: var(--ink-muted);
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transition: color .25s ease;
    position: relative;
    padding-bottom: 4px;
}

.nav__links a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 100%;
    bottom: 0;
    height: 1px;
    background: var(--gold);
    transition: right .3s ease;
}

.nav__links a:hover,
.nav__links a.is-active {
    color: var(--ink);
}

.nav__links a:hover::after,
.nav__links a.is-active::after {
    right: 0;
}

.nav__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav__toggle span {
    display: block;
    height: 1px;
    background: var(--ink);
    transition: transform .3s ease, opacity .3s ease;
}

/* ---------- Hero ---------- */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(var(--nav-h) + 40px) 24px 80px;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(200, 168, 98, 0.08), transparent 55%),
        var(--bg);
}

.hero__inner {
    max-width: 640px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero__avatar {
    width: 148px;
    height: 148px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--gold-soft);
    padding: 6px;
    margin-bottom: 32px;
}

.hero__signature {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 3vw, 1.7rem);
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--gold);
}

.hero__rule {
    width: 60px;
    height: 1px;
    background: var(--gold-soft);
    margin: 28px 0;
}

.hero__tagline {
    color: var(--ink-muted);
    font-size: clamp(1.2rem, 2.6vw, 1.55rem);
    line-height: 1.65;
    font-weight: 300;
    max-width: 660px;
}

.hero__tagline a {
    color: var(--ink);
    border-bottom: 1px solid var(--gold-soft);
    transition: border-color .25s ease, color .25s ease;
}

.hero__tagline a:hover {
    color: var(--gold);
    border-color: var(--gold);
}

.hero__note {
    margin-top: 26px;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.05rem;
    color: var(--ink-faint);
}

.hero__note a {
    color: var(--gold);
    border-bottom: 1px solid transparent;
    transition: border-color .25s ease;
}

.hero__note a:hover { border-color: var(--gold); }

.hero__cta {
    margin-top: 44px;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-muted);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color .25s ease;
}

.hero__cta span {
    display: inline-block;
    color: var(--gold);
    animation: bob 2.2s ease-in-out infinite;
}

.hero__cta:hover { color: var(--ink); }

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* ---------- Sections ---------- */

.section {
    padding: 120px 24px;
    background: var(--bg);
}

.section--alt { background: var(--bg-alt); }

.section__inner {
    max-width: 1000px;
    margin: 0 auto;
}

.section__inner--narrow { max-width: var(--max); }

.section__heading {
    text-align: center;
    font-size: clamp(1.9rem, 3.4vw, 2.4rem);
    letter-spacing: 0.02em;
}

.section__rule {
    width: 46px;
    height: 1px;
    background: var(--gold);
    margin: 26px auto 64px;
}

/* ---------- Resume ---------- */

.resume-lede {
    text-align: center;
    color: var(--ink-muted);
    font-size: 1.05rem;
    margin: 0 0 40px;
}

.btn-outline {
    display: block;
    width: fit-content;
    margin: 0 auto;
    padding: 12px 30px;
    border: 1px solid var(--gold-soft);
    color: var(--ink);
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    transition: border-color .25s ease, background .25s ease;
}

.btn-outline:hover {
    border-color: var(--gold);
    background: rgba(200, 168, 98, 0.08);
}

/* ---------- Publications ---------- */

.pub-group-heading {
    max-width: var(--max);
    margin: 0 auto 18px;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold);
}

.pub-group-heading--secondary {
    margin-top: 72px;
    color: var(--ink-faint);
}

.pub-list {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: var(--max);
    border-top: 1px solid var(--hairline);
}

.pub-list--compact .pub-list__item { padding: 22px 4px; }

.pub-list--compact .pub-list__title {
    font-size: 1.02rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.pub-list--compact .pub-list__meta {
    font-size: 0.86rem;
    margin-bottom: 8px;
    color: var(--ink-faint);
}

.pub-list--compact .pub-list__link {
    font-size: 0.72rem;
    margin-right: 18px;
}

.pub-list__item {
    padding: 34px 4px;
    border-bottom: 1px solid var(--hairline);
    transition: padding-left .3s ease;
}

.pub-list__item:hover {
    padding-left: 12px;
    border-bottom-color: var(--gold-soft);
}

.pub-list__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.35rem;
    color: var(--ink);
    margin: 0 0 12px;
    line-height: 1.45;
}

.pub-list__meta {
    color: #bab5a8;
    font-size: 0.96rem;
    font-weight: 300;
    margin: 0 0 12px;
    line-height: 1.85;
    letter-spacing: 0.01em;
}

.pub-list__meta strong {
    color: var(--ink);
    font-weight: 500;
}

.pub-list__link {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
    border-bottom: 1px solid transparent;
    transition: border-color .25s ease;
}

.pub-list__link:hover { border-color: var(--gold); }

/* ---------- Contact ---------- */

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    max-width: 640px;
    margin: 0 auto;
}

.contact-card {
    border: 1px solid var(--hairline);
    padding: 36px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color .25s ease, transform .25s ease;
}

.contact-card:hover {
    border-color: var(--gold-soft);
    transform: translateY(-3px);
}

.contact-card__label {
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.contact-card__value {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--ink);
}

/* ---------- Footer ---------- */

.footer {
    text-align: center;
    padding: 40px 24px;
    color: var(--ink-faint);
    font-size: 0.8rem;
    border-top: 1px solid var(--hairline);
    background: var(--bg);
}

/* ---------- Back to top ---------- */

.to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 44px;
    height: 44px;
    border: 1px solid var(--hairline);
    background: rgba(10, 10, 10, 0.85);
    color: var(--gold);
    font-size: 1rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .3s ease, transform .3s ease, border-color .25s ease;
    z-index: 90;
}

.to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.to-top:hover { border-color: var(--gold-soft); }

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
    .nav__toggle { display: flex; }

    .nav__links {
        position: fixed;
        top: var(--nav-h);
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: rgba(10, 10, 10, 0.98);
        border-bottom: 1px solid var(--hairline);
        max-height: 0;
        overflow: hidden;
        transition: max-height .35s ease;
    }

    .nav__links.is-open { max-height: 320px; }

    .nav__links li { width: 100%; }

    .nav__links a {
        display: block;
        padding: 18px 32px;
    }

    .nav__links a::after { display: none; }

    .nav__toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    .nav__toggle.is-open span:nth-child(2) { opacity: 0; }
    .nav__toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

    .section { padding: 90px 20px; }
    .section__rule { margin-bottom: 48px; }
    .resume-frame__pdf { height: 65vh; }
}
