/* Base */
:root,
:root[data-theme="dark"] {
    color-scheme: dark;
    --theme-motion-duration: 280ms;
    --theme-motion-duration-fast: 180ms;
    --theme-crossfade-duration: 420ms;
    --theme-motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --accent: #3fb950;
    --accent-strong: #56d364;
    --accent-soft-bg: #0f2a1a;
    --accent-soft-border: #1f4d2e;
    --accent-soft-fg: #7ee094;
    --text: #e6edf3;
    --text-soft: #c9d1d9;
    --muted: #8b949e;
    --border: #30363d;
    --card-bg: #161b22;
    --surface-raised: #21262d;
    --bg: #0d1117;
    --track-bg: #21262d;
    --shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
    --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.3);
    --read-bg: #0f2a1a;
    --read-fg: #7ee094;
    --reading-bg: #0d1f3a;
    --reading-fg: #7eb6ff;
    --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

:root[data-theme="light"] {
    color-scheme: light;
    --accent: #1976d2;
    --accent-strong: #63a4ff;
    --accent-soft-bg: #f5f9ff;
    --accent-soft-border: #d6e5f5;
    --accent-soft-fg: #334455;
    --text: #1f2933;
    --text-soft: #3f4752;
    --muted: #5b6470;
    --border: #dde3ea;
    --card-bg: #ffffff;
    --surface-raised: #ffffff;
    --bg: #f6f8fb;
    --track-bg: #eef2f5;
    --shadow: 0 10px 24px rgba(25, 118, 210, 0.08);
    --shadow-soft: 0 10px 24px rgba(26, 26, 26, 0.08);
    --read-bg: #e6f4ea;
    --read-fg: #1e8e3e;
    --reading-bg: #e8f0fe;
    --reading-fg: #1976d2;
}

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

img {
    max-width: 100%;
    height: auto;
}

html {
    background-color: var(--bg);
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text);
    font-size: 1.03125rem;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
}

html,
body,
.entry-card,
.chart-card,
.book-card,
.book-cover,
.book-info,
.book-status,
.status-strip,
.status-item-primary,
.status-item,
.theme-toggle,
.horizontal-track,
.horizontal-fill,
.chart-bar,
.project-tags li,
.company-logo,
.company-logo-fallback,
.header-photo,
.header-note,
.contact-links a,
.resume-menu-button,
.resume-menu-list,
.resume-menu-list a,
.tab-bar,
.tab,
.tab-indicator,
.entry-link,
.project-links a,
.reading-intro a,
.project-card .project-image,
.horizontal-label,
.horizontal-value {
    transition:
        background-color var(--theme-motion-duration) var(--theme-motion-ease),
        border-color var(--theme-motion-duration) var(--theme-motion-ease),
        color var(--theme-motion-duration-fast) var(--theme-motion-ease),
        box-shadow var(--theme-motion-duration) var(--theme-motion-ease),
        fill var(--theme-motion-duration-fast) var(--theme-motion-ease),
        stroke var(--theme-motion-duration-fast) var(--theme-motion-ease);
}

.container {
    max-width: 54rem;
    margin: 0 auto;
    padding: 0 1.5rem 4.5rem;
}

h1,
h2,
h3,
.chart-title,
.book-title {
    text-wrap: balance;
}

p,
li,
dd {
    text-wrap: pretty;
}

/* Header */
.header {
    padding: 4rem 0 2.75rem;
}

.header-top {
    display: flex;
    align-items: flex-start;
    gap: 1.15rem;
    margin-bottom: 1.1rem;
}

.header-main {
    min-width: 0;
}

.name {
    font-size: clamp(2rem, 3.2vw, 2.5rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.08;
    margin-bottom: 0.4rem;
}

.tagline {
    font-size: 1.05rem;
    color: var(--muted);
    line-height: 1.5;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem 1rem;
}

.contact-links a,
.resume-menu-button,
.resume-menu-list a,
.entry-link,
.project-links a,
.reading-intro a {
    color: var(--accent);
    text-decoration: none;
}

.reading-intro a {
    display: inline-flex;
    align-items: center;
}

.contact-links a,
.resume-menu-button {
    font-size: 1rem;
    font-weight: 500;
}

.contact-links a:hover,
.resume-menu-button:hover,
.resume-menu-list a:hover,
.entry-link:hover,
.project-links a:hover,
.reading-intro a:hover {
    text-decoration: underline;
}

.resume-menu {
    position: relative;
    display: inline-flex;
}

.resume-menu-button {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: 0;
    background: transparent;
    font-family: inherit;
    line-height: inherit;
    cursor: pointer;
    padding: 0;
}

.resume-menu-button svg {
    width: 0.9rem;
    height: 0.9rem;
    transition: transform var(--theme-motion-duration-fast) var(--theme-motion-ease);
}

.resume-menu.open .resume-menu-button svg {
    transform: rotate(180deg);
}

.resume-menu-list {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    z-index: 20;
    display: grid;
    min-width: 13rem;
    padding: 0.35rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-raised);
    box-shadow: var(--shadow-soft);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.25rem);
    pointer-events: none;
    transition:
        opacity var(--theme-motion-duration-fast) var(--theme-motion-ease),
        visibility var(--theme-motion-duration-fast) var(--theme-motion-ease),
        transform var(--theme-motion-duration-fast) var(--theme-motion-ease),
        background-color var(--theme-motion-duration) var(--theme-motion-ease),
        border-color var(--theme-motion-duration) var(--theme-motion-ease),
        box-shadow var(--theme-motion-duration) var(--theme-motion-ease);
}

.resume-menu.open .resume-menu-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.resume-menu-list a {
    display: block;
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.35;
}

.resume-menu-list a:hover,
.resume-menu-list a:focus-visible {
    background: var(--accent-soft-bg);
    color: var(--accent-soft-fg);
    text-decoration: none;
    outline: none;
}

.header-note {
    max-width: 44rem;
    margin-top: 1.15rem;
    padding: 1rem 1.05rem;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    background-color: var(--card-bg);
    font-size: 1rem;
    color: var(--text-soft);
    line-height: 1.75;
}

.status-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.9rem;
    margin-top: 0.85rem;
    max-width: 100%;
    line-height: 1.45;
}

.status-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.status-item-primary {
    padding: 0.3rem 0.7rem;
    color: var(--text);
    background-color: var(--accent-soft-bg);
    border: 1px solid var(--accent-soft-border);
    border-radius: 999px;
}

.status-meta {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
    letter-spacing: -0.01em;
    max-width: 32rem;
}

.status-strip strong {
    color: var(--text);
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #22a06b;
    box-shadow: 0 0 0 3px rgba(34, 160, 107, 0.18);
    flex-shrink: 0;
}

.header-photo {
    width: 110px;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
    background-color: var(--surface-raised);
    padding: 0.2rem;
    box-shadow: var(--shadow-soft);
}

/* Tab bar */
.tab-bar {
    display: flex;
    border-bottom: 1px solid var(--border);
    position: relative;
    margin-bottom: 2.1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar {
    display: none;
}

.tab {
    background: none;
    border: none;
    padding: 0.85rem 1.15rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    font-size: 1rem;
    color: var(--muted);
    white-space: nowrap;
    transition: color 0.15s;
    flex-shrink: 0;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--text);
}

.tab-indicator {
    position: absolute;
    bottom: -1px;
    height: 2px;
    background-color: var(--accent);
    transition: left 0.2s ease, width 0.2s ease;
}

/* Tab content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Overview */
.overview-card {
    padding: 1.7rem 1.75rem;
}

.overview-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
    gap: 1rem;
    align-items: start;
    grid-template-areas:
        "copy projects"
        "proof teams";
}

.overview-copy {
    grid-area: copy;
    min-width: 0;
}

.overview-kicker,
.spotlight-label,
.showcase-label {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}

.overview-title,
.section-title,
.spotlight-title {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.35;
}

.overview-title {
    max-width: 36rem;
    font-size: clamp(1.6rem, 3vw, 2rem);
    font-weight: 650;
    line-height: 1.08;
    letter-spacing: -0.035em;
    margin-top: 0.65rem;
}

.overview-summary,
.section-copy {
    font-size: 1rem;
    color: var(--text-soft);
    line-height: 1.72;
}

.overview-summary {
    max-width: 36rem;
    margin-top: 0.9rem;
}

.proof-strip {
    grid-area: proof;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    max-width: 32rem;
    margin-top: 0;
}

.proof-item {
    display: flex;
    flex-direction: column;
    gap: 0.24rem;
    min-height: 5.4rem;
    padding: 0.95rem 1rem;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: var(--card-bg);
}

.proof-value {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.15;
}

.proof-label {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.4;
}

.showcase-panel {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: var(--surface-raised);
}

.showcase-panel-projects {
    grid-area: projects;
}

.showcase-panel-teams {
    grid-area: teams;
}

.showcase-projects {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.showcase-project {
    display: grid;
    grid-template-columns: 5.35rem minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: var(--card-bg);
    color: inherit;
    text-decoration: none;
}

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

.showcase-project-image {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 4.75rem;
    padding: 0.55rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: var(--surface-raised);
}

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

.showcase-project-copy {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    min-width: 0;
}

.showcase-project-copy strong {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text);
}

.showcase-project-copy > span {
    font-size: 0.93rem;
    color: var(--muted);
    line-height: 1.45;
}

.showcase-logo-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.showcase-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3.5rem;
    padding: 0.65rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: var(--card-bg);
}

.showcase-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

:root[data-theme="dark"] .showcase-logo {
    background-color: #1b222b;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        inset 0 -14px 24px rgba(0, 0, 0, 0.18);
}

:root[data-theme="dark"] .showcase-logo img {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.22));
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.95rem;
    margin-top: 0.95rem;
}

.section-lead {
    max-width: 42rem;
}

.section-copy {
    margin-top: 0.45rem;
}

.spotlight-card {
    padding: 1.35rem 1.45rem;
}

.spotlight-title {
    margin-top: 0.45rem;
}

.spotlight-list {
    margin-top: 0.8rem;
    padding-left: 1.15rem;
}

.compact-list {
    margin-top: 0.9rem;
}

.spotlight-list li {
    color: var(--text-soft);
    line-height: 1.68;
}

.spotlight-list li + li {
    margin-top: 0.55rem;
}

.overview-signal-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.9rem;
}

.overview-signal {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: var(--surface-raised);
}

.overview-signal strong {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text);
}

.overview-signal span {
    color: var(--text-soft);
    line-height: 1.58;
}

.overview-links {
    margin-top: 0.9rem;
}

/* Case study page */
.case-study-page {
    padding-top: 3rem;
}

.case-study-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.case-study-back {
    display: inline-flex;
    align-items: center;
    margin-bottom: 1.1rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.case-study-back:hover {
    text-decoration: underline;
}

.case-study-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(18rem, 1fr);
    gap: 1.4rem;
    align-items: center;
}

.case-study-title {
    font-size: clamp(2.2rem, 5vw, 3.1rem);
    font-weight: 650;
    line-height: 1.02;
    letter-spacing: -0.04em;
    margin-top: 0.55rem;
}

.case-study-subtitle {
    margin-top: 0.7rem;
    font-size: 1.1rem;
    color: var(--muted);
    line-height: 1.55;
}

.case-study-lede {
    margin-top: 0.95rem;
    font-size: 1rem;
    color: var(--text-soft);
    line-height: 1.78;
}

.case-study-hero-visual {
    min-width: 0;
}

.case-study-image-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 21rem;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: var(--surface-raised);
    box-shadow: var(--shadow-soft);
}

.case-study-image-shell img {
    width: 100%;
    height: 100%;
    max-height: 18rem;
    object-fit: contain;
    display: block;
}

.case-study-screenshot {
    margin-top: 1.5rem;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.case-study-screenshot img {
    width: 100%;
    display: block;
}

.case-study-proof {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    max-width: none;
    margin-top: 0;
}

.case-study-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.95rem;
    margin-top: 1rem;
}

.case-study-note {
    padding: 1rem 1.05rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: var(--surface-raised);
}

.case-study-note h3 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.case-study-note p {
    margin-top: 0.55rem;
    color: var(--text-soft);
    line-height: 1.72;
}

.case-study-list {
    margin-top: 0.95rem;
    padding-left: 1.2rem;
}

.case-study-list li {
    color: var(--text-soft);
    line-height: 1.75;
}

.case-study-list li + li {
    margin-top: 0.65rem;
}

.case-study-callout {
    margin-top: 1rem;
    padding: 1rem 1.05rem;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    background-color: var(--surface-raised);
}

.case-study-callout p {
    color: var(--text-soft);
    line-height: 1.75;
}

/* Entry cards */
.entry-card,
.chart-card,
.book-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.entry-card {
    padding: 1.5rem 1.65rem;
    margin-bottom: 0.95rem;
}

.entry-header {
    display: flex;
    align-items: flex-start;
    gap: 0.95rem;
}

.company-logo {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    border: 1px solid var(--border);
    object-fit: contain;
    background-color: #fff;
    flex-shrink: 0;
    padding: 3px;
}

.company-logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: system-ui, sans-serif;
    color: var(--accent);
    background-color: var(--accent-soft-bg);
}

.entry-header-text {
    flex: 1;
    min-width: 0;
}

.entry-company {
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.28;
    margin-bottom: 0.25rem;
}

.entry-role {
    font-size: 1rem;
    color: var(--muted);
    font-style: italic;
    line-height: 1.5;
}

.entry-title {
    font-size: 1rem;
    color: var(--text-soft);
    font-weight: 600;
    letter-spacing: 0.03em;
    line-height: 1.45;
}

.entry-summary {
    font-size: 1rem;
    color: var(--muted);
    font-style: italic;
    line-height: 1.5;
}

.entry-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    flex-shrink: 0;
}

.entry-dates {
    font-size: 1rem;
    color: var(--muted);
    white-space: nowrap;
    line-height: 1.45;
}

.entry-link {
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
}

.entry-bullets {
    margin-top: 0.95rem;
    padding-left: 1.2rem;
}

.entry-bullets li {
    font-size: 0.98rem;
    color: var(--text-soft);
    margin-bottom: 0.55rem;
    line-height: 1.72;
}

.coursework-item {
    list-style: disc;
}

.awards-item {
    margin-top: 0.95rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
}

.course-groups {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 0.65rem;
}

.course-group {
    display: grid;
    grid-template-columns: minmax(0, 10.75rem) minmax(0, 1fr);
    gap: 0.35rem 1rem;
    align-items: start;
}

.course-group + .course-group {
    padding-top: 0.8rem;
    border-top: 1px solid var(--border);
}

.course-group dt,
.course-group dd {
    margin: 0;
}

.course-group dt {
    font-size: 0.96rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--text);
    line-height: 1.45;
}

.course-group dd {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-soft);
}

/* Project card extras */
.project-category {
    margin: 1.8rem 0 0.8rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
}

.project-category:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.project-category-kicker {
    margin: 0 0 0.25rem;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.project-category-title {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--text);
}

.project-card .project-image {
    margin: 1rem -1.5rem;
    height: 230px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.25rem;
    box-sizing: border-box;
    overflow: hidden;
    background: var(--surface-raised);
}

.project-card .project-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.03);
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.project-links {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}
.project-links a {
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
}

.project-card-featured {
    border-left: 3px solid var(--accent);
    box-shadow: var(--shadow);
}

.project-summary {
    margin-top: 0.9rem;
    font-size: 1rem;
    color: var(--text-soft);
    line-height: 1.72;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    list-style: none;
    margin-top: 0.9rem;
    padding: 0;
}

.project-tags li {
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--accent-soft-border);
    border-radius: 999px;
    background-color: var(--accent-soft-bg);
    color: var(--accent-soft-fg);
    font-size: 0.92rem;
    line-height: 1.2;
}

.skills-tags {
    margin-top: 0;
}

.skills-group + .skills-group {
    margin-top: 1.4rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.skills-category {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.7rem;
}

/* Reading section intro link */
.reading-intro {
    font-size: 1rem;
    margin-bottom: 1.1rem;
}

/* Reading stats */
.reading-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.4rem 2rem;
    margin-bottom: 1.75rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1;
}

.stat-label {
    font-size: 0.96rem;
    color: var(--muted);
    line-height: 1.45;
}

/* Reading charts */
.reading-charts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.chart-card {
    padding: 1.1rem;
    min-width: 0;
}

.chart-card-wide {
    grid-column: 1 / -1;
}

.chart-title {
    font-size: 0.98rem;
    color: var(--muted);
    margin-bottom: 0.7rem;
    line-height: 1.4;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.35rem;
    height: 94px;
}

.chart-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 0.15rem;
}

.chart-bar-wrap {
    width: 100%;
    height: 68px;
    display: flex;
    align-items: flex-end;
}

.chart-bar {
    width: 100%;
    background-color: var(--accent);
    border-radius: 2px 2px 0 0;
    min-height: 0;
    transition: height 0.3s ease;
}

.chart-future .chart-bar {
    background-color: var(--border);
}

.chart-count {
    font-size: 0.84rem;
    color: var(--muted);
    height: 0.8rem;
    line-height: 1;
}

.chart-month {
    font-size: 0.84rem;
    color: var(--muted);
}

.horizontal-bars {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.horizontal-row {
    display: grid;
    grid-template-columns: minmax(0, 4.25rem) minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: center;
}

.horizontal-row.book-row {
    grid-template-columns: minmax(0, 12rem) minmax(0, 1fr) auto;
}

.horizontal-row-link {
    text-decoration: none;
    color: inherit;
    border-radius: 4px;
    transition: transform 0.15s ease;
    min-height: 44px;
}

.horizontal-row-link:hover,
.horizontal-row-link:focus-visible {
    transform: translateX(2px);
}

.horizontal-row-link:hover .horizontal-label,
.horizontal-row-link:focus-visible .horizontal-label {
    color: var(--accent);
}

.horizontal-row-link:hover .horizontal-track,
.horizontal-row-link:focus-visible .horizontal-track {
    background-color: var(--accent-soft-bg);
}

.horizontal-row-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.horizontal-label {
    font-size: 0.94rem;
    color: var(--text);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.horizontal-track {
    width: 100%;
    height: 0.8rem;
    background-color: var(--track-bg);
    border-radius: 999px;
    overflow: hidden;
}

.horizontal-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-strong) 100%);
}

.horizontal-value {
    font-size: 0.92rem;
    color: var(--muted);
    white-space: nowrap;
}

.chart-empty {
    font-size: 0.94rem;
    color: var(--muted);
}

.reading-loading,
.reading-error {
    font-size: 0.94rem;
    color: var(--muted);
}

.reading-error a {
    color: var(--accent);
    text-decoration: none;
}

.reading-error a:hover {
    text-decoration: underline;
}

/* Books grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.book-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s ease;
}

.book-card:hover {
    transform: translateY(-3px);
}

.book-cover {
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background-color: var(--surface-raised);
}

.book-card:hover .book-cover img {
    transform: scale(1.05);
}

.book-info {
    padding: 0.8rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
}

.book-status {
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    align-self: flex-start;
}

.book-status.reading {
    background-color: var(--reading-bg);
    color: var(--reading-fg);
}

.book-status.read {
    background-color: var(--read-bg);
    color: var(--read-fg);
}

.book-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.book-author {
    font-size: 0.94rem;
    color: var(--muted);
    font-style: italic;
    line-height: 1.45;
}

/* Footer */
.footer {
    text-align: center;
    color: var(--muted);
    font-size: 0.96rem;
    margin-top: 3.25rem;
}

/* Theme toggle */
.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 50;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background-color: var(--card-bg);
    color: var(--text-soft);
    cursor: pointer;
    overflow: hidden;
    transition:
        background-color var(--theme-motion-duration-fast) var(--theme-motion-ease),
        color var(--theme-motion-duration-fast) var(--theme-motion-ease),
        border-color var(--theme-motion-duration-fast) var(--theme-motion-ease),
        transform var(--theme-motion-duration-fast) var(--theme-motion-ease),
        box-shadow var(--theme-motion-duration-fast) var(--theme-motion-ease);
    box-shadow: var(--shadow-soft);
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.theme-toggle svg {
    position: absolute;
    width: 18px;
    height: 18px;
    transition:
        opacity var(--theme-motion-duration-fast) var(--theme-motion-ease),
        transform var(--theme-motion-duration-fast) var(--theme-motion-ease);
}

.theme-toggle .theme-icon-sun {
    opacity: 0;
    transform: rotate(-22deg) scale(0.82);
}

.theme-toggle .theme-icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

:root[data-theme="dark"] .theme-toggle .theme-icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

:root[data-theme="dark"] .theme-toggle .theme-icon-moon {
    opacity: 0;
    transform: rotate(18deg) scale(0.82);
}

@media (prefers-reduced-motion: no-preference) {
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation-duration: var(--theme-crossfade-duration);
        animation-timing-function: var(--theme-motion-ease);
    }

    ::view-transition-old(root) {
        animation-name: theme-fade-out;
    }

    ::view-transition-new(root) {
        animation-name: theme-fade-in;
    }
}

@media (prefers-reduced-motion: reduce) {
    html,
    body,
    .entry-card,
    .chart-card,
    .book-card,
    .book-cover,
    .book-info,
    .book-status,
    .status-strip,
    .status-item-primary,
    .status-item,
    .theme-toggle,
    .theme-toggle svg,
    .horizontal-track,
    .horizontal-fill,
    .chart-bar,
    .project-tags li,
    .company-logo,
    .company-logo-fallback,
    .header-photo,
    .header-note,
    .contact-links a,
    .tab-bar,
    .tab,
    .tab-indicator,
    .entry-link,
    .project-links a,
    .reading-intro a,
    .project-card .project-image,
    .horizontal-label,
    .horizontal-value {
        transition: none;
    }
}

@keyframes theme-fade-in {
    from {
        opacity: 0;
        filter: saturate(0.96) brightness(0.985);
    }

    to {
        opacity: 1;
        filter: none;
    }
}

@keyframes theme-fade-out {
    from {
        opacity: 1;
        filter: none;
    }

    to {
        opacity: 0;
        filter: saturate(1.02) brightness(1.015);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem 3.5rem;
    }

    .overview-hero {
        grid-template-columns: 1fr;
        grid-template-areas:
            "copy"
            "proof"
            "projects"
            "teams";
    }

    .header {
        padding: 2.5rem 0 2rem;
    }

    .header-top {
        column-gap: 0.85rem;
        row-gap: 0.15rem;
    }

    .status-strip {
        margin-top: 0.65rem;
        gap: 0.4rem 0.75rem;
    }

    .proof-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: none;
    }

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

    .showcase-project {
        grid-template-columns: 4.75rem minmax(0, 1fr);
        gap: 0.7rem;
    }

    .case-study-hero,
    .case-study-grid,
    .case-study-proof {
        grid-template-columns: 1fr;
    }

    .case-study-image-shell {
        min-height: 16rem;
    }

    .header-photo {
        width: 84px;
    }

    .contact-links {
        gap: 0.75rem;
    }

    .contact-links a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 0.55rem 0.85rem;
        font-size: 1rem;
        line-height: 1.3;
    }

    .header-note,
    .tagline,
    .overview-summary,
    .section-copy,
    .spotlight-copy,
    .entry-role,
    .entry-title,
    .entry-summary,
    .entry-dates,
    .entry-link,
    .entry-bullets li,
    .course-group dt,
    .course-group dd,
    .project-summary,
    .project-links a,
    .project-tags li,
    .reading-intro,
    .stat-label,
    .book-title,
    .book-author {
        font-size: 1rem;
    }

    .reading-intro a {
        min-height: 44px;
    }

    .entry-company {
        font-size: clamp(1.05rem, 2.3vw, 1.15rem);
    }

    .project-links a,
    .entry-link {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        line-height: 1.35;
        white-space: normal;
    }

    .project-links {
        flex-wrap: wrap;
        gap: 0.55rem 0.85rem;
        width: 100%;
    }

    .tab-bar {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.5rem;
        border-bottom: none;
        overflow: visible;
        margin-bottom: 1.5rem;
    }

    .tab {
        min-height: 44px;
        padding: 0.75rem 0.65rem;
        border: 1px solid var(--border);
        border-radius: 6px;
        background-color: var(--card-bg);
        color: var(--text);
        font-size: 1rem;
        line-height: 1.3;
        text-align: center;
        white-space: normal;
    }

    .tab.active {
        border-color: var(--accent);
        background-color: var(--accent-soft-bg);
    }

    .tab-indicator {
        display: none;
    }

    .entry-card {
        padding: 1.2rem 1.25rem;
    }

    .reading-charts {
        grid-template-columns: 1fr;
    }

    .chart-card-wide {
        grid-column: auto;
    }

    .horizontal-row.book-row {
        grid-template-columns: minmax(0, 8rem) minmax(0, 1fr) auto;
    }

    .books-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .entry-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .entry-meta {
        align-items: flex-start;
        gap: 0.4rem;
    }

    .project-card .entry-header {
        flex-direction: column;
    }

    .course-group {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }

    .course-group + .course-group {
        padding-top: 0.5rem;
    }

    .project-card .project-image {
        margin: 1rem -1.25rem;
        height: clamp(180px, 38vw, 220px);
        padding: 0.85rem 1rem;
    }

    .horizontal-row {
        grid-template-columns: minmax(0, 5rem) minmax(0, 1fr) auto;
        gap: 0.55rem;
    }

    .horizontal-row.book-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "label value"
            "track track";
        gap: 0.4rem 0.75rem;
        align-items: start;
    }

    .horizontal-row.book-row .horizontal-label {
        grid-area: label;
        white-space: normal;
        overflow: visible;
        text-overflow: initial;
    }

    .horizontal-row.book-row .horizontal-track {
        grid-area: track;
    }

    .horizontal-row.book-row .horizontal-value {
        grid-area: value;
        align-self: center;
    }

    .chart-title,
    .horizontal-label,
    .horizontal-value,
    .book-status,
    .chart-count,
    .chart-month {
        font-size: 0.95rem;
    }

    .book-info {
        padding: 0.8rem 0.85rem;
    }

    .reading-stats {
        gap: 1.25rem;
    }
}

@media (max-width: 480px) {
    .theme-toggle {
        top: 0.85rem;
        right: 0.85rem;
        width: 38px;
        height: 38px;
    }

    .container {
        padding: 0 1rem 3rem;
    }

    .header-top {
        column-gap: 0.75rem;
    }

    .status-strip {
        margin-top: 0.5rem;
        gap: 0.35rem 0.6rem;
    }

    .status-item {
        font-size: 0.9rem;
    }

    .status-meta {
        font-size: 0.9rem;
    }

    .overview-card,
    .spotlight-card {
        padding: 1.2rem 1.15rem;
    }

    .overview-title {
        font-size: 1.22rem;
    }

    .section-title,
    .spotlight-title {
        font-size: 1.02rem;
    }

    .showcase-project {
        grid-template-columns: 1fr;
    }

    .showcase-project-image {
        min-height: 5.75rem;
    }

    .case-study-title {
        font-size: 1.95rem;
    }

    .case-study-subtitle,
    .case-study-lede,
    .case-study-note p,
    .case-study-list li,
    .case-study-callout p {
        font-size: 0.98rem;
    }

    .proof-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .proof-item {
        min-height: 4.8rem;
        padding: 0.8rem 0.85rem;
    }

    .proof-value {
        font-size: 1.05rem;
    }

    .proof-label {
        font-size: 0.82rem;
    }

    .header-photo {
        width: 72px;
    }

    .contact-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tab-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .horizontal-row {
        grid-template-columns: minmax(0, 4.25rem) minmax(0, 1fr) auto;
    }

    .books-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .header {
        padding: 2rem 0 1.5rem;
    }

    .name {
        font-size: clamp(1.45rem, 6vw, 1.7rem);
    }

    .entry-card {
        padding: 1rem 1rem 1.1rem;
    }

    .project-card .project-image {
        margin: 0.9rem -1rem;
        height: clamp(160px, 48vw, 190px);
    }

    .reading-stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }

    .chart-bars {
        gap: 0.15rem;
    }

    .chart-count,
    .chart-month {
        font-size: 0.65rem;
    }
}
