/* ===== Design Tokens ===== */
:root {
    --paper: #FAF9F6;        /* page background */
    --surface: #FFFFFF;      /* cards */
    --ink: #1C1B1A;          /* headings, primary text */
    --ink-soft: #6B6862;     /* secondary text */
    --line: #E7E4DD;         /* hairline borders */
    --accent: #B31B1B;       /* Cornell carnelian — the one accent */
    --accent-deep: #8E1515;  /* hover states */

    --font-head: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', 'SF Mono', Menlo, Consolas, monospace;

    --radius: 4px;
    --hover-shadow: 0 2px 10px rgba(28, 27, 26, 0.06);
    --transition: all 0.2s ease;
}

/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    color: var(--ink);
    background-color: var(--paper);
}

strong {
    font-weight: 600;
}

h1, h2, h3, h4 {
    font-family: var(--font-head);
    font-weight: 700;
    color: var(--ink);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 80px 0;
}

.kicker {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 10px;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 45px;
    text-align: left;
    color: var(--ink);
}

.section-title::after {
    content: '';
    display: block;
    width: 32px;
    height: 2px;
    background: var(--accent);
    margin: 14px 0 0;
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
}

.nav-brand {
    font-family: var(--font-head);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink);
}

.nav-brand a {
    color: var(--ink);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 28px;
}

.nav-menu a {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--ink-soft);
    transition: var(--transition);
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--accent);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 2px;
    background: var(--ink);
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ===== Hero Section ===== */
.hero {
    min-height: 88vh;
    display: flex;
    align-items: center;
    background: var(--paper);
    padding-top: 80px;
}

.hero-content {
    text-align: center;
}

.hero-headshot {
    width: 172px;
    height: 172px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--line);
    display: block;
    margin: 0 auto 28px;
}

.hero h1 {
    font-size: 3.4rem;
    margin-bottom: 14px;
    letter-spacing: -0.02em;
}

.hero h2 {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--ink-soft);
    margin-bottom: 36px;
}

.highlight {
    color: var(--accent);
}

.hero-buttons {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin-bottom: 40px;
}

/* ===== Buttons — exactly two variants ===== */
.btn {
    padding: 11px 24px;
    border-radius: var(--radius);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    display: inline-block;
}

.btn-primary {
    background: var(--ink);
    color: var(--paper);
    border: 1px solid var(--ink);
}

.btn-primary:hover {
    background: var(--accent-deep);
    border-color: var(--accent-deep);
    color: var(--paper);
}

.btn-secondary {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.social-links {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.social-links a {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    font-size: 1.1rem;
    transition: var(--transition);
}

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

/* ===== About Section ===== */
.about {
    background: var(--paper);
}

.about-content {
    max-width: 800px;
}

.about-text p {
    font-size: 1.05rem;
    margin-bottom: 20px;
    color: var(--ink);
    line-height: 1.8;
}

.education {
    margin-top: 40px;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
}

.education h3 {
    color: var(--ink);
    margin-bottom: 18px;
    font-size: 1.2rem;
}

.education-item h4 {
    font-size: 1.05rem;
    margin-bottom: 5px;
}

.education-item p {
    color: var(--ink-soft);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.education-item .date {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--ink-soft);
}

/* ===== Experience Section ===== */
.experience {
    background: var(--paper);
}

.timeline {
    max-width: 800px;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--line);
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 28px;
}

.timeline-marker {
    position: absolute;
    left: 15px;
    top: 26px;
    width: 11px;
    height: 11px;
    border-radius: 2px;
    background: var(--accent);
    border: 2px solid var(--paper);
}

.timeline-content {
    background: var(--surface);
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: var(--transition);
}

.timeline-content:hover {
    border-color: var(--ink-soft);
}

.timeline-content h3 {
    color: var(--ink);
    margin-bottom: 4px;
    font-size: 1.1rem;
    font-weight: 600;
}

.timeline-content h4 {
    color: var(--ink);
    margin-bottom: 8px;
    font-size: 0.95rem;
    font-weight: 600;
}

.timeline-content .date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--ink-soft);
    margin-bottom: 12px;
    display: block;
}

.timeline-content ul {
    list-style-position: inside;
    color: var(--ink-soft);
}

.timeline-content li {
    margin-bottom: 8px;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* ===== Projects Section ===== */
.projects {
    background: var(--paper);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.project-card:hover {
    border-color: var(--ink-soft);
    box-shadow: var(--hover-shadow);
}

.project-image {
    position: relative;
    height: 200px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-image-contain img {
    object-fit: contain;
}

.monogram-mark {
    font-family: var(--font-head);
    font-size: 3rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0.02em;
    text-align: center;
}

.monogram-mark::after {
    content: '';
    display: block;
    width: 32px;
    height: 2px;
    background: var(--accent);
    margin: 8px auto 0;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(28, 27, 26, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-link {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    transition: var(--transition);
}

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

.project-info {
    padding: 24px;
}

.project-info h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
    font-weight: 600;
}

.project-info p {
    color: var(--ink-soft);
    margin-bottom: 16px;
    line-height: 1.65;
    font-size: 0.95rem;
}

/* ===== Tag chips — one neutral style everywhere ===== */
.project-tags,
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag,
.skill-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    padding: 5px 10px;
    background: var(--paper);
    color: var(--ink-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

/* ===== Stats ===== */
.featured-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin: 30px 0;
}

.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}

.stat-number {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.9rem;
    font-weight: 600;
    color: var(--accent);
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

/* ===== Repo Cards (agents.html) ===== */
.featured-repos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
    margin-bottom: 30px;
}

.repo-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.repo-card:hover {
    border-color: var(--ink-soft);
    box-shadow: var(--hover-shadow);
}

.repo-card-contrast {
    border: 1px dashed var(--ink-soft);
}

.repo-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.repo-card-header h4 {
    font-size: 1.15rem;
    font-weight: 600;
}

.repo-card-header h4 a {
    color: var(--ink);
    text-decoration: none;
    transition: var(--transition);
}

.repo-card-header h4 a:hover {
    color: var(--accent);
}

.repo-version {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    padding: 4px 8px;
    background: var(--paper);
    color: var(--ink-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.repo-role {
    color: var(--accent);
    font-weight: 500;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    margin-bottom: 10px;
}

.repo-card > p:not(.repo-role) {
    color: var(--ink-soft);
    line-height: 1.65;
    margin-bottom: 16px;
    font-size: 0.95rem;
    flex-grow: 1;
}

.repo-card code,
.tl-copy code {
    font-family: var(--font-mono);
    background: var(--paper);
    border: 1px solid var(--line);
    padding: 1px 5px;
    border-radius: var(--radius);
    font-size: 0.85em;
}

.repo-card .project-tags {
    margin-bottom: 16px;
}

.repo-link {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--ink);
    text-decoration: none;
    transition: var(--transition);
}

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

/* ===== On-Chain Proof (agents.html) ===== */
.featured-proof {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 30px;
}

.featured-proof h4 {
    color: var(--ink);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.featured-proof h4 i {
    color: var(--accent);
    margin-right: 8px;
}

.featured-proof > p {
    color: var(--ink-soft);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.proof-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.proof-phase {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    padding: 5px 10px;
    background: var(--paper);
    color: var(--ink-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.proof-txs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tx-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    transition: var(--transition);
}

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

.tx-type {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
}

.proof-note {
    color: var(--ink-soft);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: 12px;
}

/* ===== Project Card Actions ===== */
.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.project-actions .btn i {
    margin-right: 6px;
}

/* ===== Project Detail Pages ===== */
.project-hero {
    background: var(--paper);
    padding: 150px 0 70px;
}

.project-hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.back-link {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--ink-soft);
    text-decoration: none;
    margin-bottom: 20px;
    transition: var(--transition);
}

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

.back-link i {
    margin-right: 6px;
}

.project-hero h1 {
    font-size: 2.7rem;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.project-hero-tagline {
    font-size: 1.1rem;
    color: var(--ink-soft);
    line-height: 1.7;
    margin-bottom: 22px;
}

.project-hero .project-tags {
    margin-bottom: 25px;
}

.project-hero-media img {
    width: 100%;
    display: block;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.project-hero-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 340px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.project-hero-mark .monogram-mark {
    font-size: 4.2rem;
}

.tl-stats {
    padding: 50px 0;
    background: var(--paper);
}

.tl-stats .featured-stats {
    margin: 0;
}

.tl-section {
    background: var(--paper);
}

.tl-section-alt {
    background: var(--paper);
    border-top: 1px solid var(--line);
}

.media-frame {
    display: flex;
    justify-content: center;
}

.media-frame video,
.media-frame img {
    max-width: 100%;
    max-height: 600px;
    display: block;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.media-frame video {
    background: var(--ink);
}

.screenshot-pair {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 28px;
    margin-bottom: 40px;
}

.headline-media {
    max-width: 850px;
    margin: 0 auto 40px;
}

.tl-copy {
    max-width: 800px;
    margin: 0 auto;
}

.tl-copy p {
    font-size: 1.05rem;
    color: var(--ink);
    line-height: 1.8;
    margin-bottom: 20px;
}

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

.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
}

.feature-copy p {
    font-size: 1.05rem;
    color: var(--ink);
    line-height: 1.8;
    margin-bottom: 20px;
}

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

.pullquote-card,
.limitations-card {
    max-width: 800px;
    margin: 35px auto 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 28px;
}

.limitations-card {
    margin: 0 auto;
}

.pullquote-card p {
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.75;
    margin: 0;
}

.limitations-card p {
    color: var(--ink-soft);
    line-height: 1.7;
    margin-bottom: 14px;
    font-size: 0.95rem;
}

.limitations-card p:last-child {
    margin-bottom: 0;
}

.findings-list {
    max-width: 800px;
    margin: 25px auto;
    list-style: none;
    padding: 0;
}

.findings-list li {
    position: relative;
    padding-left: 26px;
    margin-bottom: 16px;
    color: var(--ink);
    line-height: 1.75;
    font-size: 1rem;
}

.findings-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 9px;
    height: 9px;
    border-radius: 2px;
    background: var(--accent);
}

.tl-afterword {
    margin-top: 30px;
}

.links-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 35px;
}

.links-row .btn {
    text-align: center;
    max-width: 100%;
}

.links-row .btn i {
    margin-right: 8px;
}

/* ===== Skills Section ===== */
.skills {
    background: var(--paper);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
}

.skill-category {
    background: var(--surface);
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: var(--transition);
}

.skill-category:hover {
    border-color: var(--ink-soft);
}

.skill-category h3 {
    color: var(--ink);
    margin-bottom: 18px;
    font-size: 1.1rem;
    font-weight: 600;
}

.skill-category i {
    color: var(--accent);
    margin-right: 10px;
}

/* ===== Contact Section ===== */
.contact {
    background: var(--paper);
}

.contact-description {
    font-size: 1.1rem;
    color: var(--ink-soft);
    max-width: 600px;
    margin: 0 0 45px;
}

.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 28px;
    margin-bottom: 40px;
}

.contact-card {
    background: var(--surface);
    padding: 36px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-align: center;
    text-decoration: none;
    color: var(--ink);
    transition: var(--transition);
}

.contact-card:hover {
    border-color: var(--accent);
    box-shadow: var(--hover-shadow);
}

.contact-card i {
    font-size: 1.8rem;
    margin-bottom: 14px;
    color: var(--accent);
}

.contact-card h3 {
    margin-bottom: 8px;
    font-size: 1.1rem;
    font-weight: 600;
}

.contact-card p {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--ink-soft);
}

/* ===== Footer ===== */
.footer {
    background: var(--paper);
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    padding: 28px 0;
}

.footer p {
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links {
    display: flex;
    gap: 18px;
}

.footer-links a {
    color: var(--ink-soft);
    font-size: 1.2rem;
    transition: var(--transition);
}

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

/* ===== Responsive Design ===== */
@media (max-width: 1000px) and (min-width: 769px) {
    .nav-menu {
        gap: 16px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 61px;
        left: -100%;
        flex-direction: column;
        background: var(--paper);
        border-bottom: 1px solid var(--line);
        width: 100%;
        padding: 20px;
        transition: var(--transition);
    }

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

    .hero h1 {
        font-size: 2.4rem;
    }

    .hero h2 {
        font-size: 0.95rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .section-title {
        font-size: 1.7rem;
    }

    .timeline::before {
        left: 10px;
    }

    .timeline-marker {
        left: 5px;
    }

    .timeline-item {
        padding-left: 45px;
    }

    .footer .container {
        flex-direction: column;
        text-align: center;
    }

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

    .project-hero {
        padding: 130px 0 50px;
    }

    .project-hero-grid,
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .feature-grid-reverse .feature-copy {
        order: 2;
    }

    .project-hero h1 {
        font-size: 2rem;
    }

    .project-hero-mark {
        min-height: 220px;
    }

    .project-hero-mark .monogram-mark {
        font-size: 3rem;
    }

    .pullquote-card,
    .limitations-card {
        padding: 22px;
    }

    .proof-group {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.5rem;
    }
}
