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

html {
    scroll-behavior: smooth;
}

:root {
    --bg: #fff;
    --text: #111;
    --muted: #666;
    --link: #444;
    --border: #ddd;
    --last-edited: #999;
    --accent: #fd73a9;
    --accent-soft: #ff9ac4;
    --accent-deep: #d94b87;
    --star-empty: #222;
}

[data-theme='dark'] {
    --bg: #111;
    --text: #ccc;
    --muted: #777;
    --link: #999;
    --border: #2e2e2e;
    --last-edited: #555;
    --accent: #fd73a9;
    --accent-soft: #ffa8cd;
    --accent-deep: #d94b87;
    --star-empty: #f1eded;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    padding: 60px 20px;
    border-top: 3px solid var(--accent, transparent);
    transition:
        background 0.2s,
        color 0.2s;
}

.container {
    max-width: 820px;
    margin: 0 auto;
}

.page-layout {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 60px;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: 40px;
}

.profile-photo {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    margin-bottom: 14px;
    background: var(--border);
}

.sidebar-list {
    list-style: none;
    padding: 0;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.8;
}

.sidebar-list li::before {
    content: '· ';
}

@media (max-width: 640px) {
    .page-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        display: flex;
        align-items: flex-start;
        gap: 16px;
    }

    .profile-photo {
        width: 150px;
        height: 150px;
        flex-shrink: 0;
    }

    .project-card {
        gap: 12px;
    }

    .project-thumb {
        width: 104px;
        height: 78px;
    }
}

@media (max-width: 460px) {
    .project-card {
        flex-direction: column;
    }

    .project-thumb {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .project-guide p {
        font-size: 16px;
        text-align: left;
        transform: none;
    }

    .project-guide-arrows {
        height: 58px;
        margin-top: 2px;
    }
}

nav {
    display: flex;
    align-items: center;
    margin-bottom: 50px;
}

nav a {
    color: var(--text);
    text-decoration: none;
    margin-right: 20px;
    transition: color 0.2s;
}

nav a:hover {
    text-decoration: underline;
    color: var(--accent, var(--text));
}

nav a.name {
    font-weight: 600;
    margin-right: 40px;
    transition: color 0.2s;
}

nav a.name:hover {
    color: var(--accent, var(--text));
    text-decoration: none;
}

.theme-toggle {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon-sun,
.icon-moon {
    color: var(--muted);
    flex-shrink: 0;
    transition: 0.2s;
}

[data-theme='light'] .icon-sun,
:root:not([data-theme='dark']) .icon-sun {
    color: var(--text);
}
[data-theme='dark'] .icon-moon {
    color: var(--text);
}

.toggle-track {
    width: 30px;
    height: 17px;
    background: #ccc;
    border-radius: 999px;
    position: relative;
    transition: 0.2s;
    flex-shrink: 0;
}

.toggle-thumb {
    width: 13px;
    height: 13px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme='dark'] .toggle-track {
    background: var(--accent);
}

[data-theme='dark'] .toggle-thumb {
    transform: translateX(13px);
}

p {
    margin-bottom: 16px;
}

a {
    color: var(--link);
    text-decoration: underline;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent, var(--text));
}

.links {
    margin-bottom: 30px;
}

.links a {
    margin-right: 8px;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 30px 0;
}

h1 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

h2 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
}

.main-col h2 {
    color: var(--accent);
}

.subtext {
    font-weight: 400;
    font-size: 14px;
    color: var(--muted);
}

.subtext a {
    color: var(--link);
}

/* experience */

.experience-item {
    margin-bottom: 20px;
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.experience-date {
    color: var(--muted);
    font-size: 13px;
}

.experience-org {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 4px;
}

.experience-item ul {
    margin-top: 4px;
    padding-left: 20px;
}

.experience-item li {
    margin-bottom: 4px;
}

.experience-desc {
    margin-top: 4px;
}

/* projects */

.project-item {
    margin-bottom: 16px;
}

.project-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.project-links {
    color: var(--muted);
    font-size: 13px;
}

.project-links a {
    color: var(--link);
}

.project-thumb {
    width: 132px;
    height: 92px;
    flex-shrink: 0;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--border);
}

.project-content {
    min-width: 0;
}

.project-content p {
    margin: 3px 0 7px;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.project-tech span {
    display: inline-flex;
    align-items: center;
    min-height: 21px;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 7px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

.project-tech--detail {
    margin: 8px 0 24px;
}

.project-guide {
    position: relative;
    max-width: 620px;
    margin: 18px 0 4px;
    color: var(--text);
}

.project-guide p {
    max-width: 430px;
    margin: 0 auto;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
    text-align: center;
}

.project-guide-arrows {
    display: block;
    width: 100%;
    height: 76px;
    margin-top: -4px;
    overflow: visible;
}

.guide-arrow {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    marker-end: url(#guide-arrowhead);
}

.project-guide marker path {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.project-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 620px;
    margin: 0 0 24px;
    border-bottom: 1px solid var(--border);
    overflow-anchor: none;
}

.project-tab {
    font-family: inherit;
    font-size: 13px;
    color: var(--muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 7px 0 8px;
    cursor: pointer;
    text-align: center;
    transition: color 0.2s, border-color 0.2s;
}

.project-tab:hover,
.project-tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.tab-panel[hidden] {
    display: none;
}

.tab-panel {
    overflow-anchor: none;
}

.project-detail-list {
    padding-left: 20px;
    margin-bottom: 4px;
    line-height: 1.8;
}

.project-detail-list li {
    margin-bottom: 4px;
}

.collection-item {
    cursor: pointer;
    color: var(--link);
    text-decoration: underline;
    transition: color 0.2s;
}

.collection-item:hover {
    color: var(--accent);
}

/* collections */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 4px;
}

.card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px 20px;
    cursor: pointer;
    transition: border-color 0.2s;
}

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

.card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.card-list {
    list-style: none;
    padding: 0;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.8;
}

.card-list li::before {
    content: '· ';
}

/* currently listening */

.currently-listening {
    margin-top: 5px;
    padding-top: 16px;
    /* border-top: 1px solid var(--border); */
}

.listening-icon {
    font-size: 15px;
    margin-bottom: 6px;
    letter-spacing: -1px;
}

.listening-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 3px;
}

.listening-title {
    font-size: 12px;
    color: var(--text);
    /* font-style: italic; */
    line-height: 1.4;
    position: relative;
    cursor: pointer;
    transition: color 0.2s;
}

a.listening-title:hover {
    /* color: #c0392b; */
    color: #d42c1a;
}

.splatter-dot {
    position: fixed;
    border-radius: 50%;
    background: #d42c1a;
    pointer-events: none;
    z-index: 9999;
}

.yarn-strand {
    position: fixed;
    border-radius: 999px;
    pointer-events: none;
    z-index: 9999;
}

.listening-sub {
    font-size: 11px;
    color: var(--muted);
    margin-top: 1px;
}

/* modal */

@keyframes modal-overlay-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modal-overlay-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes modal-out {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open {
    display: flex;
    animation: modal-overlay-in 0.2s ease;
}

.modal-overlay.open .modal {
    animation: modal-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.closing {
    display: flex;
    animation: modal-overlay-out 0.2s ease forwards;
    pointer-events: none;
}

.modal-overlay.closing .modal {
    animation: modal-out 0.2s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

.modal {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px 32px;
    max-width: 620px;
    width: 92%;
    max-height: 75vh;
    overflow-y: auto;
    position: relative;
}

.modal--wide .modal {
    max-width: 900px;
}

.modal-project {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.modal-project:first-child {
    padding-top: 0;
}

.modal-project:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.modal-project-img {
    width: 130px;
    height: 130px;
    border-radius: 8px;
    background: var(--border);
    flex-shrink: 0;
    object-fit: cover;
}

.modal-body--grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.modal-body--grid .modal-project,
.modal-body--grid .modal-project:first-child,
.modal-body--grid .modal-project:last-child {
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
}

.modal-body--grid .carousel-wrap {
    width: 100%;
}

.modal-body--grid .modal-project-img {
    width: 100%;
    height: 260px;
    border-radius: 0;
    flex-shrink: 0;
}

.modal-body--grid .modal-project-info {
    padding: 12px 14px;
}

.apple-img {
    width: 200px;
    height: 200px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    background: var(--border);
}

.modal-project-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 5px;
}

.modal-project-desc {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}

.modal-project-date {
    font-size: 11px;
    color: var(--muted);
    margin-top: 5px;
}

.carousel-wrap {
    position: relative;
    flex-shrink: 0;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 34px;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 1;
}

.carousel-wrap:hover .carousel-btn {
    opacity: 1;
}

.carousel-prev {
    left: 4px;
}
.carousel-next {
    right: 4px;
}

.carousel-dots {
    position: absolute;
    bottom: 7px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
}

.carousel-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    transition: background 0.2s;
}

.carousel-dot.active {
    background: #fff;
}

.collection-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.collection-table th {
    text-align: left;
    color: var(--muted);
    font-weight: 600;
    padding: 0 14px 10px 0;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.collection-table td {
    padding: 9px 14px 9px 0;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.collection-table tbody tr:last-child td {
    border-bottom: none;
}

.td-comment {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
}

.star-f {
    color: #f5c518;
}
.star-e {
    color: var(--star-empty);
}

.star-hw {
    position: relative;
    display: inline-block;
}

.star-he {
    color: var(--star-empty);
}

.star-hf {
    position: absolute;
    left: 0;
    top: 0;
    color: #f5c518;
    clip-path: inset(0 50% 0 0);
}

.modal-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 14px;
    padding-right: 24px;
}

.modal-search {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 13px;
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
    margin-bottom: 12px;
    outline: none;
    transition: border-color 0.2s;
}

.modal-search:focus {
    border-color: var(--accent);
}

.modal-sort {
    display: none;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.sort-label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-right: 2px;
}

.sort-btn {
    font-size: 11px;
    font-family: inherit;
    padding: 3px 9px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: none;
    color: var(--muted);
    cursor: pointer;
    transition:
        border-color 0.2s,
        color 0.2s,
        background 0.2s;
}

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

.sort-btn.active {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

/* lightbox */

@keyframes lightbox-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 20000;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.lightbox.open {
    display: flex;
    animation: lightbox-in 0.18s ease;
}

.lightbox-img {
    max-width: 88vw;
    max-height: 88vh;
    border-radius: 10px;
    object-fit: contain;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    cursor: default;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 14px;
    line-height: 1;
    transition: color 0.2s;
}

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

.modal-list {
    list-style: none;
    padding: 0;
    font-size: 13px;
    color: var(--muted);
    line-height: 2;
}

.modal-list li::before {
    content: '· ';
}

/* project log */

.todo-list {
    list-style: none;
    padding: 0;
    margin-bottom: 4px;
}

.todo-list li {
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.todo-list li:last-child {
    border-bottom: none;
}

.todo-list li::before {
    content: '☐';
    color: var(--muted);
    font-size: 13px;
    flex-shrink: 0;
}

.todo-list li.done {
    color: var(--muted);
    text-decoration: line-through;
}

.todo-list li.done::before {
    content: '☑';
    color: var(--accent);
}

.log-timeline {
    position: sticky;
    top: 0;
    z-index: 5;
    margin-bottom: 28px;
    padding: 8px 34px 10px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.log-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    margin: 2px 0 0;
    padding: 14px 0 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.log-nav::-webkit-scrollbar {
    display: none;
}

.log-nav-item {
    position: relative;
    flex: 0 0 126px;
    font-size: 12px;
    color: var(--muted);
    text-decoration: none;
    border: none;
    padding: 14px 18px 0 0;
    white-space: nowrap;
    transition: border-color 0.2s, color 0.2s;
}

.log-nav-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    border-top: 1px solid var(--border);
    transform: translateY(4.5px);
}

.log-nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 7px;
    height: 7px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    transition: background 0.2s, border-color 0.2s;
    background: var(--bg);
    z-index: 1;
}

.log-nav-item:hover {
    color: var(--text);
}

.log-nav-item:hover::before {
    background: var(--accent);
}

.log-nav-item.is-milestone {
    color: var(--text);
}

.log-nav-icon {
    color: var(--accent);
    font-size: 11px;
}

.log-nav-item.is-active {
    color: var(--text);
}

.log-nav-item.is-active::before {
    background: var(--accent);
}

.log-timeline-label {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.log-scroll-btn {
    position: absolute;
    top: 38px;
    width: 26px;
    height: 26px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg);
    color: var(--muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    line-height: 1;
    transition: border-color 0.2s, color 0.2s;
}

.log-scroll-prev {
    left: 0;
}

.log-scroll-next {
    right: 0;
}

.log-scroll-btn:hover {
    border-color: var(--accent);
    color: var(--text);
}

.log-milestones {
    margin-bottom: 30px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.log-milestones-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.log-milestone-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.log-milestone-list li {
    display: flex;
    align-items: baseline;
    gap: 8px;
    line-height: 1.5;
}

.log-milestone-icon {
    flex-shrink: 0;
    color: var(--accent);
    font-size: 12px;
}

.log-milestone-date {
    margin-right: 6px;
    font-weight: 600;
    white-space: nowrap;
}

.log-milestone-date a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.log-milestone-date a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.log-milestone-note {
    color: var(--muted);
}

.log-milestone-note a {
    color: var(--accent);
    text-decoration: underline;
}

.log-entry {
    content-visibility: auto;
    contain-intrinsic-size: auto 720px;
    padding-bottom: 28px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border);
    scroll-margin-top: 150px;
}

.log-entry:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.log-date {
    font-size: 15px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
}

.log-date--milestone {
    color: var(--text);
}

.log-date-icon {
    color: var(--accent);
    display: inline-block;
    font-size: 15px;
    letter-spacing: 0;
    margin-right: 6px;
    vertical-align: 1px;
}

.log-body a {
    color: var(--accent);
    text-decoration: underline;
}

.log-body a:hover {
    opacity: 0.75;
}

.log-body a[target="_blank"]::after {
    content: ' ↗';
    font-size: 0.8em;
    vertical-align: super;
}

.log-body p {
    margin-bottom: 12px;
    line-height: 1.7;
}

.log-body p:last-child {
    margin-bottom: 0;
}

.log-subheading {
    margin: 18px 0 8px;
    color: var(--text);
    line-height: 1.4;
}

.log-subheading--h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-soft);
}

.log-subheading--h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.log-empty {
    color: var(--muted);
}

.log-body ul,
.log-body ol {
    padding-left: 20px;
    margin-top: 4px;
    margin-bottom: 12px;
    line-height: 1.8;
}

.log-table-wrap {
    overflow-x: auto;
    margin: 14px 0 18px;
}

.log-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    font-size: 13px;
}

.log-table th,
.log-table td {
    padding: 11px 18px 11px 0;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
    white-space: normal;
    overflow-wrap: anywhere;
}

.log-table th {
    color: var(--text);
    font-weight: 600;
}

.log-table tbody tr:last-child td {
    border-bottom: none;
}

.log-code {
    margin: 10px 0 12px;
    padding: 12px 14px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: rgba(127, 127, 127, 0.08);
    font-size: 12px;
    line-height: 1.6;
}

.log-code code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.log-inline-code {
    padding: 1px 5px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: rgba(127, 127, 127, 0.08);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9em;
}

.log-body mjx-container[display='true'] {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 0;
}

.log-media {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 12px;
}

.log-media-link {
    display: block;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.2s;
}

.log-media-link:hover {
    opacity: 0.82;
    transform: translateY(-1px);
}

.log-media img,
.log-media video {
    height: 280px;
    border-radius: 8px;
    border: 1px solid var(--border);
    object-fit: cover;
    background: var(--border);
}

.log-media video {
    width: auto;
    max-width: 100%;
}

.log-media video.is-portrait {
    height: min(460px, 70vh);
}

.project-demo {
    margin: 18px 0 0;
}

.project-demo-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.project-demo-row video {
    flex: 1 1 0;
    min-width: 0;
}

.project-demo video {
    width: 100%;
    max-height: min(520px, 70vh);
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--border);
}

@media (max-width: 640px) {
    .project-demo-row {
        flex-wrap: wrap;
    }

    .project-demo-row video {
        flex: 1 1 100%;
    }
}

.project-demo figcaption {
    color: var(--muted);
    font-size: 13px;
    margin-top: 6px;
}

.log-pdf {
    width: 100%;
}

.log-pdf iframe {
    width: 100%;
    height: min(680px, 78vh);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--border);
}

.log-pdf a {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
}

/* footer */

.last-edited {
    margin-top: 60px;
    color: var(--last-edited);
    font-size: 12px;
}

.back-to-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--muted);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, border-color 0.2s, color 0.2s;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.back-to-top:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.project-cad-panel {
    margin-top: 18px;
}

.project-cad-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.project-cad-row .project-cad {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
}

.project-cad-note {
    color: var(--muted);
    font-size: 13px;
    margin-top: 10px;
    margin-bottom: 0;
}

.project-cad {
    margin: 18px 0 0;
}

.project-cad model-viewer {
    width: 100%;
    height: min(560px, 72vh);
    background: transparent;
    --poster-color: transparent;
}

.project-cad figcaption {
    color: var(--muted);
    font-size: 13px;
    margin-top: 6px;
}

@media (max-width: 720px) {
    .project-cad-row {
        flex-wrap: wrap;
    }

    .project-cad-row .project-cad {
        flex: 1 1 100%;
    }
}

.project-spec-heading {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 18px 0 6px;
}

.section-jump {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.section-jump a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 15px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    background: var(--bg);
    font-size: 13px;
    font-weight: 500;
    margin-right: 0;
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.section-jump a:hover {
    background: #000;
    border-color: #fff;
    color: #fff;
    text-decoration: none;
}

.section-jump .section-jump-primary {
    border-color: transparent;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

.section-jump .section-jump-primary:hover {
    background: var(--accent-deep);
    border-color: transparent;
    color: #fff;
}

.section-jump-play,
.play-glyph {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 4.5px 0 4.5px 7px;
    border-color: transparent transparent transparent #fff;
    margin-left: 1px;
}

.tab-panel h2[id] {
    scroll-margin-top: 16px;
}

.spec-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 14px 0 4px;
}

.spec-shot {
    margin: 0;
    min-width: 0;
}

.spec-shot a {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    background: var(--border);
}

.spec-shot img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.spec-shot a:hover img {
    transform: scale(1.03);
    opacity: 0.92;
}

.spec-shot figcaption {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
    margin-top: 6px;
}

@media (max-width: 720px) {
    .spec-gallery {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 460px) {
    .spec-gallery {
        grid-template-columns: 1fr;
    }
}

.project-thumb-link {
    display: block;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
}

.project-card--featured .project-thumb {
    width: 260px;
    height: 180px;
    border-radius: 0;
    transition: transform 0.2s ease;
}

.project-card--featured .project-thumb-link:hover .project-thumb {
    transform: scale(1.04);
}

.project-card--featured .project-content strong a {
    transition: color 0.2s ease;
}

.project-card--featured .project-content strong a:hover {
    color: var(--accent);
}

@media (max-width: 760px) {
    .project-card--featured .project-thumb {
        width: 180px;
        height: 125px;
    }
}

@media (max-width: 460px) {
    .project-thumb-link {
        width: 100%;
    }

    .project-card--featured .project-thumb {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
}

.demo-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
    padding: 7px 15px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.demo-button:hover {
    background: var(--accent-deep);
    color: #fff;
    text-decoration: none;
}
