/* =========================================================
   Ryan Lin — personal site
   Design system: warm paper background, one rust accent,
   Fraunces (display) + IBM Plex Sans (body) + IBM Plex Mono (labels).
   No gradients, no glassmorphism, no particle/tilt/glow effects —
   layout and type do the work.
   ========================================================= */

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

:root {
    /* Surface */
    --paper: #f5f1ea;
    --paper-dim: #ece6db;

    /* Ink */
    --ink: #201d18;
    --ink-soft: #55504a;
    --ink-faint: #8f8779;

    /* One accent, used sparingly */
    --accent: #b8461f;
    --accent-tint: #e9dccd;

    /* Structure */
    --rule: rgba(32, 29, 24, 0.14);
    --rule-strong: rgba(32, 29, 24, 0.3);

    /* Type */
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Menlo, monospace;

    /* Rhythm */
    --content-width: 720px;
    --page-width: 1100px;
    --gutter: 2rem;

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--paper);
    font-size: 16px;
    line-height: 1.6;
}

a {
    color: inherit;
}

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

/* =========================================================
   HEADER
   ========================================================= */
header {
    position: sticky;
    top: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    z-index: 100;
}

.nav-container {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 1.25rem var(--gutter);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    font-style: italic;
    text-decoration: none;
    color: var(--ink);
}

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

.nav-menu a {
    font-family: var(--font-mono);
    text-decoration: none;
    font-size: 0.85rem;
    color: var(--ink-soft);
    letter-spacing: 0.02em;
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
}

.nav-menu a:hover {
    color: var(--ink);
}

.nav-menu a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
}

.menu-toggle span {
    width: 22px;
    height: 1.5px;
    background: var(--ink);
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 5rem var(--gutter) 4rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3rem;
    align-items: start;
}

.hero-meta {
    justify-self: end;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-left: 1.75rem;
    padding-top: 0.3rem;
    border-left: 1px solid var(--rule);
}

.hero-meta .meta-item {
    text-align: right;
}

.hero-meta .meta-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.3rem;
}

.hero-meta .meta-value {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--ink);
    white-space: nowrap;
}

.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    letter-spacing: 0.04em;
    margin-bottom: 1.25rem;
}

.hero h1 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    letter-spacing: -0.01em;
    max-width: 14ch;
    margin-bottom: 1.75rem;
}

.hero .lede {
    max-width: var(--content-width);
    font-size: 1.15rem;
    color: var(--ink-soft);
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

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

.cta-row {
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.text-link {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--ink);
    border-bottom: 1px solid var(--rule-strong);
    padding-bottom: 3px;
    transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.text-link:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.text-link.muted {
    color: var(--ink-soft);
}

/* =========================================================
   SECTION SCAFFOLDING
   ========================================================= */
section {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 4.5rem var(--gutter);
}

.rule-top {
    border-top: 1px solid var(--rule);
}

.section-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--ink-faint);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

/* =========================================================
   ABOUT
   ========================================================= */
.about-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 3.5rem;
}

.about-grid img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border: 1px solid var(--rule);
}

.about-copy p {
    max-width: var(--content-width);
    font-size: 1.05rem;
    color: var(--ink-soft);
    margin-bottom: 1.25rem;
    line-height: 1.8;
}

.about-copy p:last-child {
    margin-bottom: 0;
}

/* =========================================================
   WORK LIST (index teaser + projects page)
   ========================================================= */
.work-list {
    display: flex;
    flex-direction: column;
}

.work-row {
    display: grid;
    grid-template-columns: 3rem 1fr auto;
    gap: 1.5rem;
    align-items: baseline;
    padding: 2rem 0;
    border-top: 1px solid var(--rule);
    text-decoration: none;
    color: inherit;
}

.work-list a.work-row {
    transition: opacity 0.15s var(--ease);
}

.work-list a.work-row:hover {
    opacity: 0.6;
}

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

.work-index {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--ink-faint);
}

.work-body h3 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.work-body p {
    color: var(--ink-soft);
    max-width: 56ch;
    line-height: 1.7;
}

.work-meta {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--ink-faint);
    text-align: right;
    white-space: nowrap;
    align-self: start;
}

/* Full case-study block on projects.html */
.case-study {
    padding: 3rem 0;
    border-top: 1px solid var(--rule);
}

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

.case-study-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.case-study h3 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 500;
}

.status {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-faint);
    border: 1px solid var(--rule-strong);
    padding: 0.25rem 0.6rem;
    white-space: nowrap;
}

.case-study p {
    max-width: var(--content-width);
    color: var(--ink-soft);
    line-height: 1.8;
    margin-bottom: 1rem;
    font-size: 1.02rem;
}

.stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.stack span {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--ink-soft);
    border: 1px solid var(--rule);
    padding: 0.3rem 0.6rem;
}

/* =========================================================
   SKILLS
   ========================================================= */
.skills-list {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 1.25rem 2rem;
    max-width: 760px;
}

.skills-list dt {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-top: 0.35rem;
}

.skills-list dd {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--ink);
    border: 1px solid var(--rule);
    padding: 0.3rem 0.7rem;
}

/* =========================================================
   CONTACT
   ========================================================= */
.contact-block {
    max-width: var(--content-width);
}

.contact-block p {
    font-size: 1.05rem;
    color: var(--ink-soft);
    line-height: 1.8;
    margin-bottom: 2rem;
}

.contact-links {
    list-style: none;
    display: flex;
    flex-direction: column;
}

.contact-links li {
    border-top: 1px solid var(--rule);
}

.contact-links li:last-child {
    border-bottom: 1px solid var(--rule);
}

.contact-links a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 0;
    text-decoration: none;
    font-size: 1.05rem;
}

.contact-links a:hover {
    color: var(--accent);
}

.contact-links .arrow {
    font-family: var(--font-mono);
    color: var(--ink-faint);
}

/* =========================================================
   FOOTER
   ========================================================= */
footer {
    border-top: 1px solid var(--rule);
    margin-top: 3rem;
}

.footer-inner {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 2rem var(--gutter);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--ink-faint);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.footer-links a {
    text-decoration: none;
    color: var(--ink-faint);
}

.footer-links a:hover {
    color: var(--accent);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 800px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-meta {
        justify-self: start;
        border-left: none;
        border-top: 1px solid var(--rule);
        padding-left: 0;
        padding-top: 1.25rem;
        flex-direction: row;
        gap: 2rem;
    }

    .hero-meta .meta-item {
        text-align: left;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-grid img {
        max-width: 240px;
        aspect-ratio: 3 / 4;
    }

    .skills-list {
        grid-template-columns: 1fr;
    }

    .skills-list dt {
        padding-top: 0;
    }
}

@media (max-width: 640px) {
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 280px;
        height: 100vh;
        background: var(--paper);
        border-left: 1px solid var(--rule);
        flex-direction: column;
        gap: 0.25rem;
        padding: 5rem 1.75rem 2rem;
        transition: right 0.25s var(--ease);
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu a {
        display: block;
        padding: 0.85rem 0;
        border-bottom: 1px solid var(--rule);
    }

    .menu-toggle {
        display: flex;
    }

    .work-row {
        grid-template-columns: 2rem 1fr;
    }

    .work-meta {
        grid-column: 2;
        text-align: left;
    }

    .case-study-head {
        flex-direction: column;
        align-items: flex-start;
    }
}
