/* tomlikesrobots — light, cinematic. Design language borrowed from the
   "World Ends on Tuesday" pitch: pale walls, ink, LCD red, mincho serif. */

:root {
    --wall: #eef1f2;
    --wall-deep: #e2e8eb;
    --paper: #f8f9f9;
    --ink: #26323b;
    --ink-soft: #5d7184;
    --line: #c8d2d8;
    --clock: #e8432e;
    --font: var(--gh-font-body, 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    --font-heading: var(--gh-font-heading, 'Shippori Mincho', Georgia, serif);
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
    --w-wide: 1100px;
    --w-narrow: 700px;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--wall);
    color: var(--ink);
    font-family: var(--font);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3, h4, h5, h6 { font-family: var(--font); }
.serif { font-family: var(--font-heading); font-weight: 600; }
.mono { font-family: var(--font-mono); }

.inner {
    max-width: var(--w-wide);
    margin: 0 auto;
    padding: 0 24px;
}

.inner-narrow {
    max-width: var(--w-narrow);
    margin-left: auto;
    margin-right: auto;
    padding: 0 24px;
}

/* ---------- shared: eyebrow labels ---------- */

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin: 0 0 10px;
}

.eyebrow-link { color: var(--clock); text-decoration: none; }
.eyebrow-link:hover { text-decoration: underline; }

/* ---------- header ---------- */

.site-header {
    border-bottom: 1px solid var(--line);
    background: var(--wall);
}

.site-header .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 24px;
    padding-top: 18px;
    padding-bottom: 18px;
}

.site-brand {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.01em;
    text-decoration: none;
}

.site-nav ul,
.footer-social ul,
.hero-links ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 22px;
}

.site-nav a {
    text-decoration: none;
    color: var(--ink-soft);
    font-size: 0.92rem;
    font-weight: 500;
}

.site-nav a:hover,
.site-nav .nav-current a {
    color: var(--clock);
}

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

.hero {
    padding: 92px 0 72px;
    background:
        radial-gradient(ellipse 900px 480px at 78% -10%, rgba(245, 239, 225, 0.9), rgba(245, 239, 225, 0) 70%),
        var(--wall);
    border-bottom: 1px solid var(--line);
}

.hero-avatar {
    display: block;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    box-shadow: 0 0 0 3px var(--wall), 0 0 0 4px var(--line), 0 10px 24px -12px rgba(38, 50, 59, 0.45);
}

.hero-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(2.6rem, 7vw, 4.6rem);
    letter-spacing: -0.01em;
    line-height: 1.05;
    margin: 0 0 22px;
}

.hero-bio {
    font-size: 1.15rem;
    color: var(--ink-soft);
    max-width: 42em;
    margin: 0 0 28px;
    line-height: 1.6;
}

.hero-bio em { color: var(--ink); font-style: italic; }

.hero-links a {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--clock);
    background: #1d2125;
    text-decoration: none;
    padding: 0.45em 0.9em;
    border-radius: 4px;
    text-shadow: 0 0 9px rgba(232, 67, 46, 0.55);
}

.hero-links a:hover { color: #fff; text-shadow: none; }

.chip-count {
    margin-left: 0.6em;
    padding-left: 0.6em;
    border-left: 1px solid rgba(238, 241, 242, 0.25);
    color: #eef1f2;
    text-shadow: none;
    font-weight: 500;
}

/* ---------- home sections ---------- */

.home-section { padding: 56px 0 26px; }
.home-section:last-of-type { padding-bottom: 72px; }

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 30px;
}

.section-header h2 {
    margin: 0;
    font-size: 1.9rem;
    letter-spacing: -0.01em;
    line-height: 1.1;
}

.section-header .eyebrow { margin-bottom: 6px; }

.section-more {
    color: var(--ink-soft);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    padding-bottom: 4px;
}

.section-more:hover { color: var(--clock); }

/* ---------- project cards (big, image-led) ---------- */

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 36px 28px;
}

.project-card-link { display: block; text-decoration: none; }

.project-card-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
    background: var(--wall-deep);
    box-shadow: 0 1px 2px rgba(38, 50, 59, 0.12), 0 12px 32px -16px rgba(38, 50, 59, 0.35);
}

.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

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

.project-card-body { padding: 18px 4px 0; }

.project-card-title {
    margin: 2px 0 8px;
    font-size: 1.55rem;
    line-height: 1.15;
}

.project-card-link:hover .project-card-title { color: var(--clock); }

.project-card-excerpt {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.98rem;
    max-width: 38em;
}

/* ---------- film cards (poster-style) ---------- */

.film-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 32px 24px;
}

.film-card-link { display: block; text-decoration: none; }

.film-card-image,
.film-card-poster {
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(38, 50, 59, 0.12), 0 12px 32px -16px rgba(38, 50, 59, 0.4);
}

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

/* typographic poster when no still is set */
.film-card-poster {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    background: linear-gradient(165deg, #2c3942 0%, #1d2125 70%);
}

.film-card-year {
    align-self: flex-start;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    color: var(--clock);
    text-shadow: 0 0 9px rgba(232, 67, 46, 0.55);
}

.film-card-poster-title {
    color: #eef1f2;
    font-size: clamp(1.4rem, 2vw, 1.8rem);
    line-height: 1.18;
    text-wrap: balance;
}

.film-card-body { padding: 14px 4px 0; }

.film-card-title { margin: 0 0 4px; font-size: 1.15rem; line-height: 1.2; }

.film-card-link:hover .film-card-title { color: var(--clock); }

.film-card-role {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.88rem;
}

/* ---------- tool cards ---------- */

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.tool-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-decoration: none;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 22px 22px 18px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tool-card:hover {
    border-color: var(--ink-soft);
    box-shadow: 0 10px 28px -18px rgba(38, 50, 59, 0.45);
}

.tool-glyph {
    font-size: 1.3rem;
    color: var(--clock);
    line-height: 1;
    margin-bottom: 6px;
}

.tool-name { font-size: 1.2rem; }

.tool-desc { color: var(--ink-soft); font-size: 0.92rem; flex-grow: 1; }

.tool-go {
    margin-top: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.tool-card:hover .tool-go { color: var(--clock); }

/* ---------- post list (writing) ---------- */

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

.post-list-item { border-bottom: 1px solid var(--line); }

.post-list-item > a {
    display: flex;
    align-items: center;
    gap: 20px;
    text-decoration: none;
    padding: 18px 4px;
}

.post-list-thumb {
    flex-shrink: 0;
    width: 92px;
    aspect-ratio: 3 / 2;
    border-radius: 5px;
    overflow: hidden;
    background: var(--wall-deep);
}

.post-list-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.post-list-text { flex-grow: 1; min-width: 0; }

.post-list-title {
    display: block;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.15rem;
    line-height: 1.3;
}

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

.post-list-excerpt {
    display: block;
    color: var(--ink-soft);
    font-size: 0.92rem;
    margin-top: 2px;
}

.post-list-date {
    flex-shrink: 0;
    color: var(--ink-soft);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ---------- archives ---------- */

.archive { padding: 64px 0 80px; }

.archive-header { margin-bottom: 44px; }

.archive-title {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    letter-spacing: -0.01em;
    margin: 0 0 10px;
    line-height: 1.05;
}

.archive-description {
    color: var(--ink-soft);
    margin: 0;
    font-size: 1.1rem;
}

.error-page { text-align: center; padding: 48px 0; }

/* card grid fallback (tags etc.) */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 36px 28px;
}

.post-card-link { text-decoration: none; display: block; }

.post-card-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
    background: var(--wall-deep);
    margin-bottom: 14px;
    box-shadow: 0 1px 2px rgba(38, 50, 59, 0.12), 0 12px 32px -16px rgba(38, 50, 59, 0.35);
}

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

.post-card-title {
    margin: 0 0 6px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.25rem;
    line-height: 1.25;
}

.post-card-link:hover .post-card-title { color: var(--clock); }

.post-card-excerpt { margin: 0 0 8px; color: var(--ink-soft); font-size: 0.92rem; }

.post-card-date {
    font-family: var(--font-mono);
    color: var(--ink-soft);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ---------- pagination ---------- */

.pagination {
    display: flex;
    justify-content: space-between;
    margin-top: 48px;
    font-size: 0.9rem;
    font-family: var(--font-mono);
}

.pagination a { color: var(--clock); text-decoration: none; }

.page-number { color: var(--ink-soft); }

/* ---------- article ---------- */

.article { padding: 64px 0 80px; }

.article-kicker {
    font-family: var(--font-mono);
    color: var(--clock);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.28em;
    text-decoration: none;
}

.article-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(2.1rem, 5vw, 3rem);
    letter-spacing: -0.01em;
    line-height: 1.1;
    margin: 12px 0 14px;
}

.article-excerpt {
    font-size: 1.25rem;
    color: var(--ink-soft);
    margin: 0 0 18px;
    line-height: 1.45;
}

.article-meta {
    font-family: var(--font-mono);
    color: var(--ink-soft);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.meta-sep { margin: 0 6px; }

.article-feature-image {
    max-width: 920px;
    margin: 44px auto 0;
    padding: 0 24px;
}

.article-feature-image img {
    width: 100%;
    border-radius: 8px;
    display: block;
    box-shadow: 0 1px 2px rgba(38, 50, 59, 0.12), 0 18px 44px -20px rgba(38, 50, 59, 0.4);
}

.article-feature-image figcaption,
.gh-content figcaption {
    text-align: center;
    color: var(--ink-soft);
    font-size: 0.85rem;
    margin-top: 10px;
}

.article-content { margin-top: 44px; }

/* ---------- Ghost content (Koenig cards) ---------- */

.gh-content > * + * { margin-top: 1.4em; margin-bottom: 0; }

.gh-content h2, .gh-content h3 { font-family: var(--font-heading); font-weight: 600; }
.gh-content h2 { font-size: 1.6rem; margin-top: 2em; }
.gh-content h3 { font-size: 1.25rem; margin-top: 1.8em; }

.gh-content a { color: var(--clock); }

.gh-content blockquote {
    margin-left: 0;
    margin-right: 0;
    padding-left: 20px;
    border-left: 3px solid var(--clock);
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--ink-soft);
}

.gh-content pre {
    background: #1d2125;
    color: #dfe5e8;
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.5;
}

.gh-content code {
    font-family: var(--font-mono);
    background: var(--wall-deep);
    border-radius: 3px;
    padding: 0.1em 0.35em;
    font-size: 0.85em;
}

.gh-content pre code { background: none; padding: 0; }

.gh-content hr {
    border: none;
    border-top: 1px solid var(--line);
    margin-top: 2.4em;
}

.gh-content img { border-radius: 6px; }

.kg-width-wide {
    position: relative;
    width: 85vw;
    max-width: 1060px;
    margin-left: 50%;
    transform: translateX(-50%);
}

.kg-width-full {
    position: relative;
    width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
}

.kg-width-full img { border-radius: 0; }

.kg-embed-card { display: flex; flex-direction: column; align-items: center; }

.kg-embed-card iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    border-radius: 8px;
}

.kg-video-card video { width: 100%; border-radius: 8px; }

.kg-gallery-container { display: flex; flex-direction: column; gap: 8px; }
.kg-gallery-row { display: flex; gap: 8px; }
.kg-gallery-image { flex: 1; }
.kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

.kg-bookmark-card { width: 100%; }

.kg-bookmark-container {
    display: flex;
    text-decoration: none;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    color: inherit;
}

.kg-bookmark-container:hover { border-color: var(--ink-soft); }

.kg-bookmark-content {
    flex-grow: 1;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.kg-bookmark-title { font-weight: 600; font-size: 0.95rem; }

.kg-bookmark-description {
    color: var(--ink-soft);
    font-size: 0.85rem;
    margin-top: 4px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.kg-bookmark-metadata {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--ink-soft);
}

.kg-bookmark-icon { width: 18px; height: 18px; }

.kg-bookmark-thumbnail { flex-shrink: 0; width: 200px; position: relative; }

.kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    border-radius: 0;
}

.kg-button-card { display: flex; justify-content: center; }

.kg-btn {
    display: inline-block;
    background: var(--clock);
    color: #fff;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
}

.kg-btn:hover { opacity: 0.9; }

.kg-callout-card {
    display: flex;
    gap: 12px;
    padding: 18px 20px;
    border-radius: 8px;
    background: var(--wall-deep);
}

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

.site-footer {
    border-top: 1px solid var(--line);
    margin-top: 40px;
    background: var(--wall-deep);
}

.site-footer .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 24px;
    padding-top: 30px;
    padding-bottom: 38px;
}

.footer-left { display: flex; align-items: baseline; gap: 28px; flex-wrap: wrap; }

.footer-brand { font-size: 1rem; }

.footer-social a {
    color: var(--ink-soft);
    font-size: 0.88rem;
    text-decoration: none;
}

.footer-social a:hover { color: var(--clock); }

.footer-copy {
    color: var(--ink-soft);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    margin: 0;
}

/* ---------- mobile ---------- */

@media (max-width: 700px) {
    .hero { padding: 60px 0 48px; }
    .project-grid { grid-template-columns: 1fr; }
    .film-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px 14px; }
    .film-card-poster { padding: 14px; }
    .post-list-thumb { width: 68px; }
    .post-list-date { display: none; }
    .section-header { flex-direction: column; align-items: flex-start; gap: 6px; }
    .kg-width-wide { width: 100%; max-width: 100%; margin-left: 0; transform: none; }
    .kg-bookmark-thumbnail { display: none; }
}
