/* mitchart.net — shared styles for index.html and live.html (cv.html has its own print sheet).
   Look: poster gothic. Zen Kaku Gothic Antique on warm paper, one cobalt field,
   numbered index rows. Motion (js/site.js): smooth scroll, reveals, animated
   category rows, cursor-following media previews, page transitions. */

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

:root {
    --paper: #e9e6dd;
    --ink: #121212;
    --muted: #6c6a64;
    --hair: rgba(18, 18, 18, 0.16);
    --blue: #2b3fd0;
    --font: 'Zen Kaku Gothic Antique', 'Hiragino Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

@view-transition {
    navigation: auto;
}

::view-transition-old(root) {
    animation: 0.28s ease both vt-out;
}

::view-transition-new(root) {
    animation: 0.42s var(--ease) both vt-in;
}

@keyframes vt-out {
    to { opacity: 0; transform: translateY(-10px); }
}

@keyframes vt-in {
    from { opacity: 0; transform: translateY(14px); }
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.65;
    background: var(--paper);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

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

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

::selection {
    background: var(--blue);
    color: #fff;
}

.wrap {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 clamp(18px, 3vw, 44px);
}

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

.u {
    background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
    transition: background-size 0.35s var(--ease);
}

.u:hover {
    background-size: 0 1px;
    background-position: 100% 100%;
}

/* ---------- top bar ---------- */

.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 0;
}

.home img {
    width: auto;
    height: clamp(42px, 4.6vw, 58px);
    transition: transform 0.4s var(--ease);
}

.home:hover img {
    transform: rotate(-6deg) scale(1.06);
}

.nav {
    display: flex;
    gap: clamp(14px, 2vw, 26px);
    font-weight: 500;
}

.nav a {
    position: relative;
}

.nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: var(--blue);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.35s var(--ease);
}

.nav a:hover::after,
.nav a[aria-current="page"]::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ---------- hero ---------- */

.hero {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 28px clamp(24px, 4vw, 64px);
    align-items: end;
    padding: clamp(40px, 7vw, 96px) 0 clamp(40px, 6vw, 80px);
}

.hero h1 {
    font-weight: 900;
    font-size: clamp(60px, 10.5vw, 168px);
    line-height: 0.92;
    letter-spacing: -0.04em;
}

/* Each line sits in a clip so words can slide up into place. */
.line {
    display: block;
    overflow: hidden;
    padding-bottom: 0.04em;
}

.line > span {
    display: block;
}

.blue {
    position: relative;
    padding: clamp(22px, 2.4vw, 32px);
    background: var(--blue);
    color: #fff;
}

.blue .pitch {
    max-width: 34ch;
    font-size: clamp(16px, 1.45vw, 19px);
    font-weight: 500;
    line-height: 1.55;
}

.blue .handle-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    margin-top: 18px;
    font-size: clamp(24px, 2.6vw, 36px);
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.blue .status {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-top: 16px;
    font-size: 13.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.78);
}

.dot::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 8px;
    border-radius: 50%;
    background: #6df0a0;
    vertical-align: 1px;
    animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
    50% { box-shadow: 0 0 0 5px rgba(109, 240, 160, 0.18); }
}

.copy-handle {
    position: relative;
    cursor: pointer;
}

.copy-handle::after {
    content: "copy";
    margin-left: 10px;
    padding: 2px 8px;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    vertical-align: middle;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.copy-handle:hover::after {
    opacity: 1;
}

.copy-handle.copied::after {
    content: "copied ✓";
    opacity: 1;
}

/* Patreon call to action, in the hero and contact blocks. */
.support {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    max-width: 420px;
    margin-top: 22px;
    padding: 14px 20px;
    background: #fff;
    color: var(--blue);
    font-size: clamp(16px, 1.5vw, 19px);
    font-weight: 900;
    letter-spacing: -0.01em;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.support:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25);
}

.support .arr {
    transition: transform 0.25s var(--ease);
}

.support:hover .arr {
    transform: translate(3px, -3px);
}

/* ---------- index ---------- */

.index {
    border-top: 2px solid var(--ink);
}

.cat {
    border-bottom: 1px solid var(--hair);
}

.cat summary {
    display: grid;
    grid-template-columns: 64px 1fr 1fr 56px 32px;
    gap: 16px;
    align-items: center;
    padding: clamp(16px, 2vw, 26px) 0;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.cat summary::-webkit-details-marker {
    display: none;
}

.cat .n {
    font-weight: 900;
    color: var(--blue);
}

.cat-name {
    font-size: clamp(26px, 3.2vw, 46px);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.025em;
    transition: transform 0.45s var(--ease);
}

.cat summary:hover .cat-name {
    transform: translateX(8px);
}

.cat-count {
    text-align: right;
}

.cat-toggle {
    position: relative;
    justify-self: end;
    width: 16px;
    height: 16px;
}

.cat-toggle::before,
.cat-toggle::after {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    width: 16px;
    height: 2px;
    background: var(--ink);
    transition: transform 0.45s var(--ease);
}

.cat-toggle::after {
    transform: rotate(90deg);
}

.cat[open]:not(.closing) .cat-toggle::after {
    transform: rotate(0deg);
}

.rows {
    overflow: hidden;
    list-style: none;
}

.rows-inner {
    padding-bottom: clamp(14px, 2vw, 24px);
}

.row-link {
    display: grid;
    grid-template-columns: 64px 1fr 1fr 1fr 112px;
    gap: 16px;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid var(--hair);
}

.row-link .rn {
    color: var(--muted);
    font-weight: 500;
}

.row-link .r-name {
    font-size: clamp(18px, 1.6vw, 22px);
    font-weight: 900;
    letter-spacing: -0.01em;
    transition: transform 0.45s var(--ease), color 0.2s ease;
}

.row-link .r-meta {
    color: var(--muted);
}

.row-link .thumb {
    justify-self: end;
    width: 112px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg, #d9d5ca);
}

.row-link .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease);
}

.row-link .thumb img.contain {
    object-fit: contain;
    padding: 8%;
}

.row-link:hover .r-name {
    transform: translateX(8px);
    color: var(--blue);
}

.row-link:hover .thumb img {
    transform: scale(1.08);
}

/* Floating media that follows the cursor over a row. */
.preview {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 30;
    width: clamp(280px, 26vw, 420px);
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #111;
    pointer-events: none;
    opacity: 0;
    transform-origin: center;
    will-change: transform, opacity;
}

.preview img,
.preview video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview img.contain {
    object-fit: contain;
    padding: 10%;
}

/* ---------- live media ---------- */

.case {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 22px clamp(22px, 4vw, 64px);
    padding: clamp(28px, 4vw, 48px) 0;
    border-top: 1px solid var(--hair);
}

.case:first-of-type {
    border-top: 0;
}

.case .n {
    font-weight: 900;
    color: var(--blue);
}

.case h3 {
    margin-top: 6px;
    font-size: clamp(26px, 2.8vw, 40px);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.025em;
}

.case .meta {
    margin-top: 10px;
    color: var(--muted);
    font-weight: 500;
}

.case p {
    max-width: 46ch;
}

.case .body {
    margin-top: 18px;
}

.case .credit {
    margin-top: 12px;
    font-size: 13.5px;
    color: var(--muted);
}

.media {
    position: relative;
    overflow: hidden;
    background: #111;
}

.media video,
.media > img {
    width: 100%;
    height: auto;
}

.media-cap {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    font-size: 13.5px;
    color: var(--muted);
}

.media-cap a {
    color: var(--ink);
}

.vod {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    cursor: pointer;
}

.vod img,
.vod iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
    transition: transform 0.7s var(--ease);
}

.vod:hover img {
    transform: scale(1.04);
}

.vod .play {
    position: absolute;
    left: 18px;
    bottom: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #fff;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    transition: background 0.25s ease, color 0.25s ease;
}

.vod:hover .play,
.vod:focus-visible .play {
    background: var(--blue);
    color: #fff;
}

/* ---------- columns ---------- */

.section {
    padding: clamp(48px, 7vw, 96px) 0 0;
}

.section-head {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 16px;
    align-items: baseline;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--ink);
}

.section-head .n {
    font-weight: 900;
    color: var(--blue);
}

.section-head h2 {
    font-size: clamp(26px, 3.2vw, 46px);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.025em;
}

.cols {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 28px 22px;
    padding-top: 22px;
    list-style: none;
}

.cols b {
    display: block;
    margin-bottom: 6px;
    font-size: 19px;
    font-weight: 900;
}

.cols .n {
    display: block;
    font-weight: 900;
    color: var(--blue);
}

/* ---------- contact ---------- */

.contact {
    margin-top: clamp(56px, 8vw, 110px);
    background: var(--blue);
    color: #fff;
}

.contact .wrap {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 16px;
    padding-top: clamp(48px, 7vw, 96px);
    padding-bottom: clamp(48px, 7vw, 96px);
}

.contact .n {
    font-weight: 900;
}

.contact .label {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

.contact .big {
    margin-top: 10px;
    font-size: clamp(38px, 7vw, 112px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.04em;
}

.contact .big .copy-handle::after {
    font-size: 13px;
    letter-spacing: 0.08em;
    vertical-align: 0.7em;
}

.contact .note {
    max-width: 52ch;
    margin-top: 18px;
    color: rgba(255, 255, 255, 0.78);
}

/* ---------- footer ---------- */

.foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px 24px;
    padding: 20px 0 34px;
    font-weight: 500;
}

.foot .links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
}

/* ---------- reveal (js adds .in) ---------- */

.js [data-reveal] {
    opacity: 0;
    transform: translateY(26px);
}

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
    .cols {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .row-link {
        grid-template-columns: 48px 1fr 1fr 96px;
    }

    .row-link .r-meta {
        display: none;
    }

    .row-link .thumb {
        width: 96px;
    }
}

@media (max-width: 820px) {
    .hero,
    .case {
        grid-template-columns: 1fr;
    }

    .cat summary {
        grid-template-columns: 40px 1fr 40px 24px;
    }

    .cat-desc {
        display: none;
    }

    .row-link {
        grid-template-columns: 40px 1fr 88px;
        grid-template-areas:
            "rn name thumb"
            "rn desc thumb";
        gap: 2px 12px;
    }

    .row-link .rn { grid-area: rn; align-self: start; }
    .row-link .r-name { grid-area: name; }
    .row-link .r-desc { grid-area: desc; font-size: 13.5px; }
    .row-link .thumb { grid-area: thumb; width: 88px; }

    .section-head,
    .contact .wrap {
        grid-template-columns: 40px 1fr auto;
    }

    .contact .wrap {
        grid-template-columns: 1fr;
    }

    .preview {
        display: none;
    }
}

@media (max-width: 520px) {
    .cols {
        grid-template-columns: 1fr;
    }

    .nav {
        gap: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation: none !important;
        transition: none !important;
    }

    .js [data-reveal] {
        opacity: 1;
        transform: none;
    }
}

/* ---------- press and keyboard feedback ---------- */

.row-link,
.cat summary,
.support,
.vod {
    -webkit-tap-highlight-color: transparent;
}

.row-link {
    position: relative;
    isolation: isolate;
}

.row-link::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(43, 63, 208, 0.06);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.4s var(--ease);
}

.row-link:hover::before {
    transform: scaleY(1);
}

.row-link:active .r-name,
.cat summary:active .cat-name {
    transform: translateX(8px) scale(0.97);
    transition-duration: 0.1s;
}

.support:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
    transition-duration: 0.08s;
}

.copy-handle:active {
    opacity: 0.7;
}

.copy-handle.copied::after {
    animation: copied-pop 0.45s cubic-bezier(0.3, 1.6, 0.4, 1);
}

@keyframes copied-pop {
    from { transform: scale(0.7); }
}
