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


:root {
    --accent: #b08d6a;
    --accent-dim: #b08d6a33;
    --bg: #0a0a0a;
    --text: #d4d4d4;
    --text-muted: #8a8a8a;
    --text-faint: #636363;
    --text-ghost: #3d3d3d;
    --border: #1a1a1a;
    --surface: #111;
    --white: #f5f5f5;
}

/* High contrast mode */
body.high-contrast {
    --text: #ececec;
    --text-muted: #b0b0b0;
    --text-faint: #888;
    --text-ghost: #555;
    --border: #2a2a2a;
}

/* Accessibility panel */
.a11y-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 91;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-faint);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 12px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.05em;
}

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

.a11y-btn .tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 11px;
    padding: 6px 10px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.a11y-btn:hover .tooltip {
    opacity: 1;
}

.a11y-panel {
    position: fixed;
    bottom: 60px;
    right: 24px;
    z-index: 90;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 20px;
    width: 220px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.3s, transform 0.3s;
}

.a11y-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.a11y-panel .panel-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-ghost);
    margin-bottom: 16px;
}

.a11y-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.a11y-option:last-child {
    border-bottom: none;
}

.a11y-option .opt-label {
    font-size: 13px;
    color: var(--text-muted);
}

.a11y-option .opt-toggle {
    width: 32px;
    height: 18px;
    background: var(--border);
    border: none;
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
    padding: 0;
}

.a11y-option .opt-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 12px;
    height: 12px;
    background: var(--text-faint);
    transition: transform 0.2s, background 0.2s;
}

.a11y-option .opt-toggle.on {
    background: var(--accent-dim);
}

.a11y-option .opt-toggle.on::after {
    transform: translateX(14px);
    background: var(--accent);
}

/* Accessibility states */
body.high-contrast {
    --text: #ececec;
    --text-muted: #b0b0b0;
    --text-faint: #888;
    --text-ghost: #555;
    --border: #2a2a2a;
}

body.large-text {
    font-size: 17px;
}

body.large-text .post-body {
    font-size: 17px;
    line-height: 2;
}

body.large-text .case-study .case-section p,
body.large-text .about-section p,
body.large-text .post-list .post-excerpt {
    font-size: 16px;
}

body.reduce-motion * {
    animation: none !important;
    transition: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--accent-dim);
}

a {
    color: inherit;
    text-decoration: none;
}

/* ── Layout ── */
.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 100px 24px 120px;
}

/* ── Navigation ── */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 40px;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

nav .nav-left a {
    font-size: 14px;
    font-weight: 500;
    color: var(--white);
    letter-spacing: 0.01em;
}

nav .nav-right {
    display: flex;
    gap: 24px;
}

nav .nav-right a {
    color: var(--text-faint);
    font-size: 14px;
    transition: color 0.2s;
}

nav .nav-right a:hover {
    color: var(--accent);
}

nav .nav-right a.active {
    color: var(--white);
}

/* ── Sections ── */
section {
    margin-bottom: 64px;
}

section h2 {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-ghost);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 16px;
}

/* ── Horizontal rule ── */
hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 48px 0;
}

/* ── Hero (homepage) ── */
.hero h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.hero .tagline {
    color: var(--text-faint);
    font-size: 14px;
    margin-bottom: 24px;
    font-style: italic;
}

.hero .bio {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.8;
}

/* ── Bullet list ── */
ul.items {
    list-style: none;
    padding: 0;
}

ul.items li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 14px;
}

ul.items li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
}

/* ── Experience ── */
.experience-item {
    margin-bottom: 24px;
}

.experience-item .role {
    color: #e5e5e5;
    font-weight: 500;
    font-size: 14px;
}

.experience-item .company {
    color: var(--text-muted);
    font-size: 14px;
}

.experience-item .detail {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
    line-height: 1.7;
}

/* ── Portfolio ── */
.portfolio-grid {
    display: grid;
    gap: 0;
}

.portfolio-card {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 32px 0;
    border-bottom: 1px solid var(--border);
    transition: border-color 0.4s;
}


.portfolio-card:last-child {
    border-bottom: none;
}

.portfolio-card:hover {
    border-color: var(--accent-dim);
}

.portfolio-card .title {
    color: var(--white);
    font-weight: 500;
    font-size: 15px;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
    transition: color 0.3s;
}

.portfolio-card:hover .title {
    color: var(--accent);
}

.portfolio-card:hover .tag {
    border-color: var(--accent-dim);
    color: var(--text-muted);
}

.portfolio-card .desc {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.7;
    max-width: 520px;
}

.portfolio-card .tags {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.portfolio-card .tag {
    border: 1px solid var(--border);
    color: var(--text-faint);
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: border-color 0.4s, color 0.4s;
    padding: 3px 10px;
    border-radius: 0;
}

/* ── Education ── */
.edu-item {
    margin-bottom: 16px;
}

.edu-item .degree {
    color: #e5e5e5;
    font-weight: 500;
    font-size: 14px;
}

.edu-item .school {
    color: var(--text-muted);
    font-size: 14px;
}

.edu-item .note {
    color: var(--text-faint);
    font-size: 13px;
}

/* ── Skills ── */
.skills-group {
    margin-bottom: 16px;
}

.skills-group .label {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 4px;
}

.skills-group .value {
    color: var(--text-muted);
    font-size: 14px;
}

/* ── Contact links ── */
.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.contact-links a {
    color: var(--text-muted);
    font-size: 14px;
    border-bottom: 1px solid var(--text-ghost);
    padding-bottom: 1px;
    transition: color 0.2s, border-color 0.2s;
}

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

/* ── Posts list ── */
.posts-header {
    margin-bottom: 48px;
}

.posts-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--white);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.posts-header p {
    color: var(--text-faint);
    font-size: 14px;
}

.post-list {
    list-style: none;
    padding: 0;
}

.post-list li {
    border-top: 1px solid var(--border);
}

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

.post-list a {
    display: block;
    padding: 24px 0;
}

.post-list a:hover .post-title {
    color: var(--accent);
}

.post-list .post-meta {
    font-size: 12px;
    color: var(--text-faint);
    margin-bottom: 4px;
}

.post-list .post-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
    transition: color 0.2s;
}

.post-list .post-excerpt {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Shared content page styles (posts, case studies, about) ── */
.back-link {
    display: inline-block;
    color: var(--text-faint);
    font-size: 13px;
    margin-bottom: 48px;
    transition: color 0.2s;
}

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

/* ── Individual post / article ── */
.post-page .post-heading {
    font-size: 20px;
    font-weight: 600;
    color: var(--white);
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-bottom: 8px;
}

.post-page .post-meta {
    font-size: 13px;
    color: var(--text-faint);
    margin-bottom: 48px;
}

.post-page .post-body {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.8;
}

.post-body p {
    margin-bottom: 12px;
}

.post-body h2 {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-ghost);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-top: 40px;
    margin-bottom: 12px;
}

.post-body h3 {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-ghost);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-top: 32px;
    margin-bottom: 12px;
}

.post-body blockquote {
    border-left: 2px solid var(--accent);
    padding-left: 16px;
    margin: 24px 0;
    color: var(--text-muted);
    font-style: italic;
}

.post-body ul, .post-body ol {
    list-style: none;
    padding: 0;
    margin: 16px 0 24px;
}

.post-body li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
}

.post-body li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
}

.post-body a {
    color: var(--accent);
    border-bottom: 1px solid var(--accent-dim);
    transition: border-color 0.2s;
}

.post-body a:hover {
    border-color: var(--accent);
}

.post-body strong {
    color: #e5e5e5;
    font-weight: 500;
}

.post-body em {
    color: #b5b5b5;
}

.post-body code {
    background: #171717;
    border: 1px solid #262626;
    padding: 2px 6px;
    border-radius: 0;
    font-size: 13px;
    color: var(--text-muted);
}

/* ── About page ── */
.about-hero {
    margin-bottom: 48px;
}

.about-hero h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--white);
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.about-hero .intro {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.85;
}

.about-section {
    margin-bottom: 40px;
}

.about-section h2 {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-ghost);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 12px;
}

.about-section p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 12px;
}

/* ── Case study page ── */
.case-study .case-header {
    margin-bottom: 48px;
}

.case-study .case-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--white);
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-bottom: 12px;
}

.case-study .case-header .case-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.case-study .case-header .case-tags span {
    background: var(--border);
    color: var(--text-faint);
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 0;
}

.case-study .case-header .case-summary {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.8;
}

.case-study .case-section {
    margin-bottom: 40px;
}

.case-study .case-section h2 {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-ghost);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 12px;
}

.case-study .case-section p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 12px;
}

.case-study .case-section ul {
    list-style: none;
    padding: 0;
}

.case-study .case-section ul li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
}

.case-study .case-section ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
}

.case-study .case-divider {
    width: 40px;
    height: 2px;
    background: var(--accent);
    margin: 48px 0;
}

.case-nav {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    margin-top: 48px;
    border-top: 1px solid var(--border);
}

.case-nav a {
    display: block;
    flex: 1;
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}

.case-nav a:hover {
    color: var(--accent);
}

.case-nav .next {
    text-align: right;
    border-left: 1px solid var(--border);
    padding-left: 24px;
}

.case-nav .prev {
    padding-right: 24px;
}

.case-nav .label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-ghost);
    margin-bottom: 4px;
    transition: color 0.2s;
}

.case-nav a:hover .label {
    color: var(--accent);
}

/* ── Custom cursor ── */
body.has-cursor { cursor: none; }
body.has-cursor a, body.has-cursor button { cursor: none; }

.cursor {
    position: fixed;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: width 0.2s ease, height 0.2s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.15s ease;
    transform: translate(-50%, -50%);
    opacity: 0;
}

.cursor.visible { opacity: 1; }

.cursor.hovering {
    width: 40px;
    height: 40px;
    background: var(--accent-dim);
}

.cursor-dot {
    position: fixed;
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.cursor-dot.visible { opacity: 1; }

@media (max-width: 768px) {
    .cursor, .cursor-dot { display: none; }
    body.has-cursor { cursor: auto; }
    body.has-cursor a, body.has-cursor button { cursor: auto; }
}

/* ── Footer ── */
footer {
    color: #1a1a1a;
    font-size: 12px;
    margin-top: 64px;
}

footer .easter-egg {
    color: #1a1a1a;
    text-decoration: none;
    margin-left: 8px;
    border: none;
    transition: color 0.3s;
}

footer .easter-egg:hover {
    color: var(--accent);
}

/* ── Mobile hamburger (inner pages) ── */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 101;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 1.5px;
    background: var(--white);
    margin: 5px 0;
    transition: transform 0.3s, opacity 0.3s;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 5px);
}

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

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -5px);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .container {
        padding: 48px 20px 80px;
    }

    .menu-toggle { display: block; }

    nav {
        padding: 20px 24px;
    }

    nav .nav-right {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: var(--bg);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 32px;
        transition: right 0.4s cubic-bezier(0.22, 1, 0.36, 1);
        z-index: 100;
    }

    nav .nav-right.open {
        right: 0;
    }

    nav .nav-right a {
        font-size: 24px;
        color: var(--text-muted);
    }

    /* Posts */
    .post-page .post-heading {
        font-size: 18px;
    }

    /* Portfolio */
    .portfolio-card {
        padding: 24px 0;
    }

    .portfolio-card .title {
        font-size: 14px;
    }

    .portfolio-card .desc {
        font-size: 12px;
    }

    /* Case studies */
    .case-study .case-header h1 {
        font-size: 18px;
    }

    .case-study .case-section p,
    .post-body {
        font-size: 13px;
    }

    .case-nav {
        flex-direction: column;
        gap: 24px;
        align-items: stretch;
    }

    .case-nav .next {
        text-align: left;
    }

    /* About */
    .about-hero h1 {
        font-size: 18px;
    }

    .about-section p {
        font-size: 13px;
    }

    /* Posts header */
    .posts-header h1 {
        font-size: 18px;
    }

    /* Contact links */
    .contact-links {
        flex-direction: column;
        gap: 12px;
    }

    /* Section headings */
    section h2 {
        font-size: 11px;
    }

    /* Meta tag for mobile browser bar */
}
