/* ==========================================================================
   salmanhijazi.com: page CSS on top of the tasteskill kit (public/assets).
   The kit owns tokens, grid, type, buttons, nav, sections, footer and motion.
   This file only adds what sits inside a visual, the evening grade, and the
   long-form pages (blog, posts, work pages). No build step.
   ========================================================================== */

/* ---------- Evening grade (dark), by click or by the system ---------- */

html[data-theme="dark"] {
    --p-bg: #0f0d0b; --p-surface: #1a1714; --p-ink: #f3efe8; --p-muted: #a39c93;
    --p-accent: #f5a524; --p-accent-ink: #1a1206; --p-action: #f5a524; --p-action-ink: #1a1206;
    --p-inv-bg: #070605; --p-inv-surface: #15120f; --p-inv-ink: #f3efe8; --p-inv-muted: #a39c93;
    --p-inv-accent: #f5a524; --p-inv-accent-ink: #1a1206; --p-inv-action: #f5a524; --p-inv-action-ink: #1a1206;
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) {
        --p-bg: #0f0d0b; --p-surface: #1a1714; --p-ink: #f3efe8; --p-muted: #a39c93;
        --p-accent: #f5a524; --p-accent-ink: #1a1206; --p-action: #f5a524; --p-action-ink: #1a1206;
        --p-inv-bg: #070605; --p-inv-surface: #15120f; --p-inv-ink: #f3efe8; --p-inv-muted: #a39c93;
        --p-inv-accent: #f5a524; --p-inv-accent-ink: #1a1206; --p-inv-action: #f5a524; --p-inv-action-ink: #1a1206;
        color-scheme: dark;
    }
}

body { background: var(--bg); color: var(--ink); }

/* heatmap ramp, from the ground to the accent */
:root { --l0: #ece6dc; --l1: #f3d9a8; --l2: #e9b35a; --l3: #cf7f1a; --l4: #a85305; }
html[data-theme="dark"] { --l0: #221e1a; --l1: #4a3316; --l2: #7f5217; --l3: #c57d16; --l4: #f5a524; }
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) { --l0: #221e1a; --l1: #4a3316; --l2: #7f5217; --l3: #c57d16; --l4: #f5a524; }
}

/* ---------- Nav: the two small controls beside the main button ---------- */

.nav__icon {
    display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line);
    border-radius: var(--r-btn); background: transparent; color: var(--ink); cursor: pointer;
    transition: background-color var(--dur, .2s) var(--ease, ease), border-color var(--dur, .2s) var(--ease, ease);
}
.nav__icon:hover { background: var(--surface); border-color: var(--line-strong); }
.nav__icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav__icon .icon-sun { display: none; }
html[data-theme="dark"] .nav__icon .icon-sun { display: block; }
html[data-theme="dark"] .nav__icon .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .nav__icon .icon-sun { display: block; }
    html:not([data-theme="light"]) .nav__icon .icon-moon { display: none; }
}
@media (max-width: 1023px) { .nav__icon[data-palette-open] { display: none; } }
.menu-col a span { display: block; }

/* ---------- Hero: the words left, the portrait right, the terminal across the full width under both ---------- */

.hero--intro > .wrap { display: block; }
.hero-intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s-7); }
.hero--intro .hero__text { max-width: 640px; }
.hero-photo { position: relative; margin: 0; width: clamp(220px, 24vw, 340px); }
.hero-photo > img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; background: var(--surface); }
.hero-term { position: relative; margin-top: var(--s-8); }
.hero-term .term { width: 100%; }
@media (max-width: 1023px) {
    .hero-intro { gap: var(--s-6); }
    .hero-photo { width: clamp(180px, 28vw, 260px); }
}
@media (max-width: 639px) {
    .hero-intro { grid-template-columns: minmax(0, 1fr); }
    .hero-photo { order: -1; width: 160px; }
    .hero-term { display: none; }
}


/* ---------- Tall screens: a "screen" stops at 900px, so the next section shows sooner ---------- */

:root { --screen: min(100svh, 900px); }
/* a narrower content column than the kit's 1280px: big screens get more margin, not longer lines */
:root { --container: 1120px; }
@media (min-width: 640px) {
    main > :is(.hero, .section--hero) { height: auto; min-height: 0; }
}
@media (min-width: 1280px) {
    main > :is(section, .section):not(.hero, .section--hero), html:not(.is-inner) footer.closing { height: calc(var(--h, 1) * var(--screen)); }
}
@media (min-width: 640px) and (max-width: 1279px) {
    main > :is(section, .section):not(.hero, .section--hero), html:not(.is-inner) footer.closing { min-height: calc(var(--h, 1) * var(--screen)); }
}

/* ---------- Activity heatmap: tabs and stats on top, the board, then the split and the legend ---------- */

.activity { position: relative; padding: var(--s-6); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.activity__top { display: flex; align-items: center; gap: var(--s-5) var(--s-7); margin-bottom: var(--s-6); flex-wrap: wrap; }
.act-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-btn); background: var(--bg); border: 1px solid var(--line); }
.act-tabs button { min-height: 40px; padding: 0 var(--s-4); border: 0; border-radius: calc(var(--r-btn) - 2px); background: transparent; color: var(--muted); font: 500 13px "DM Mono", ui-monospace, monospace; cursor: pointer; }
.act-tabs button:hover { color: var(--ink); }
.act-tabs button[aria-selected="true"], .act-tabs button[aria-selected="true"]:hover { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.act-stats { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-7); margin: 0; }
.act-stats div { display: flex; flex-direction: column-reverse; }
.act-stats dt { font: 12px "DM Mono", ui-monospace, monospace; color: var(--muted); }
.act-stats dd { margin: 0; font: 600 22px/1.2 var(--font-display, inherit); color: var(--ink); font-variant-numeric: tabular-nums; }

.activity__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); margin-top: var(--s-5); flex-wrap: wrap; font: 13px "DM Mono", ui-monospace, monospace; color: var(--muted); }
.activity__split { display: flex; gap: var(--s-5); margin: 0; }
.activity__split b { margin-left: 6px; color: var(--ink); font-weight: 500; }
.activity__legend { display: flex; align-items: center; gap: 4px; margin: 0; }
.activity__legend i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; background: var(--l0); }

.heatmap-scroll { overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
.heatmap { --gap: 3px; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 6px; min-width: 720px; }
@media (min-width: 1024px) { .heatmap-scroll { overflow: visible; } .heatmap { min-width: 0; } }
@media (min-width: 1280px) { .heatmap { --gap: 4px; } }
.heatmap-months { grid-column: 2; display: grid; grid-template-columns: repeat(var(--weeks), minmax(0, 1fr)); column-gap: var(--gap); font-size: 12px; color: var(--muted); }
.heatmap-months span { white-space: nowrap; }
.heatmap-days { grid-row: 2; display: grid; grid-template-rows: repeat(7, minmax(0, 1fr)); row-gap: var(--gap); font-size: 11px; line-height: 1; color: var(--muted); align-items: center; contain: size; } /* contain: the cells set the height, the labels split the same seven rows */
.heatmap-grid { grid-column: 2; grid-row: 2; display: grid; grid-template-columns: repeat(var(--weeks), minmax(0, 1fr)); column-gap: var(--gap); align-items: start; }
.heatmap-week { display: grid; grid-template-rows: repeat(7, auto); row-gap: var(--gap); }
.heatmap-grid i { display: block; width: 100%; aspect-ratio: 1; border-radius: 3px; background: var(--l0); cursor: pointer; box-shadow: 0 0 0 0 transparent; transition: box-shadow .12s; }
.heatmap-grid i:hover { box-shadow: 0 0 0 1.5px var(--ink); }
.heatmap-grid i.l1, .activity__legend i.l1 { background: var(--l1); }
.heatmap-grid i.l2, .activity__legend i.l2 { background: var(--l2); }
.heatmap-grid i.l3, .activity__legend i.l3 { background: var(--l3); }
.heatmap-grid i.l4, .activity__legend i.l4 { background: var(--l4); }
.activity > .tooltip {
    position: absolute; transform: translate(-50%, calc(-100% - 10px)); padding: 8px 12px; border-radius: var(--r-sm);
    background: var(--ink); color: var(--bg); font-size: 13px; white-space: nowrap; pointer-events: none; z-index: 5;
}
.activity > .tooltip[hidden] { display: none; }
.tooltip .dim { opacity: .7; }

/* ---------- Laravel: community counts, then photos from events ---------- */

#laravel, #open-source { height: auto !important; min-height: var(--screen, 100svh); }
/* the counts: one panel split into equal cells by hairlines, each with an icon, the number and what it counts */
.lv-stats { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); margin: var(--s-7) 0 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: color-mix(in oklab, var(--surface) 70%, transparent); overflow: hidden; }
.lv-stat { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-6); border-left: 1px solid var(--line); }
.lv-stat:first-child { border-left: 0; }
.lv-stat__icon { order: 0; width: 40px; height: 40px; padding: 9px; margin-bottom: var(--s-4); border-radius: 50%; background: color-mix(in oklab, var(--accent) 14%, transparent); fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lv-stat dd { order: 1; margin: 0; font: 500 clamp(40px, 4.4vw, 60px)/1 var(--font-display, inherit); letter-spacing: -0.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.lv-stat dt { order: 2; font-size: var(--t-small); color: var(--muted); }
@media (max-width: 1023px) {
    .lv-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lv-stat:nth-child(odd) { border-left: 0; }
    .lv-stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
.lv-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter, 24px); margin-top: var(--s-7); }
.lv-photo { position: relative; margin: 0; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.lv-photo a, .lv-photo img { display: block; width: 100%; height: 100%; }
.lv-photo img { object-fit: cover; transition: transform .4s var(--ease, ease); }
.lv-photo a:hover img { transform: scale(1.03); }
.lv-photo__slot { display: grid; place-items: center; height: 100%; padding: var(--s-5); text-align: center; font: 12px "DM Mono", ui-monospace, monospace; color: var(--muted); border: 1px dashed var(--line-strong, var(--line)); border-radius: inherit; }
.lv-photo__label { position: absolute; left: var(--s-4); bottom: var(--s-4); padding: 6px 12px; border-radius: 999px; background: var(--bg); color: var(--ink); font-size: var(--t-small); font-weight: 500; border: 1px solid var(--line); pointer-events: none; }
@media (max-width: 1023px) { .lv-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) { .lv-photos { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Open source: cards like the projects; Orbit wide, with one screenshot of the theme ---------- */

.pkgs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter, 24px); margin-top: var(--s-7); }
.pkgs__more { display: flex; justify-content: center; margin: var(--s-7) 0 0; }
.pkg .project__title a { color: inherit; text-decoration: none; }
.pkg .project__title a:hover { color: var(--accent); }
.pkg .project__body { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pkg__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.pkg__stats { display: flex; gap: var(--s-4); margin: 0; font-size: var(--t-small); color: var(--muted); }
.pkg__stats b { color: var(--ink); font-weight: 600; }
.pkg__view { min-height: 36px; padding-inline: var(--s-4); }
.pkg__main { display: flex; flex-direction: column; gap: var(--s-3); flex: 1; }
.pkg__shot { display: block; overflow: hidden; border-radius: var(--r-md); border: 1px solid var(--line); background: #1a1a1a; aspect-ratio: 1718 / 1303; align-self: center; }
.pkg__shot img { display: block; width: 100%; height: 100%; object-fit: contain; transition: transform .4s var(--ease, ease); }
.pkg--premium:hover .pkg__shot img { transform: scale(1.02); }
.project.pkg--premium { grid-column: 1 / -1; gap: var(--s-5); }
@media (min-width: 1024px) {
    .project.pkg--premium { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: var(--s-7); }
    .pkg--premium .pkg__main { justify-content: center; }
    .pkg--premium .project__title { font-size: clamp(28px, 2.6vw, 36px); }
    .pkg--premium .project__body { -webkit-line-clamp: 5; font-size: var(--t-body); flex: 0 1 auto; }
}
@media (max-width: 1023px) { .pkgs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) { .pkgs { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Work: one row per company ---------- */

.jobs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.jobs li { border-bottom: 1px solid var(--line); }
.job {
    display: grid; grid-template-columns: 2fr 3fr 5fr 2fr; align-items: baseline; gap: var(--s-2) var(--gutter);
    padding: var(--s-5) 0; color: inherit; text-decoration: none; position: relative;
}
.job__period { font-size: var(--t-small); color: var(--muted); font-variant-numeric: tabular-nums; }
.job__name { font: var(--display-weight) var(--t-h3)/1.15 var(--font-display); letter-spacing: var(--display-tracking); }
.job__role { color: var(--ink); }
.job__place { color: var(--muted); font-size: var(--t-small); }
.job__go { grid-column: 1 / -1; display: none; }
@media (min-width: 1024px) {
    .job { grid-template-columns: 2fr 3fr 4fr 2fr 2fr; }
    .job__go { grid-column: auto; display: inline-flex; justify-content: end; align-items: center; gap: var(--s-2); font-weight: 500; font-size: var(--t-small); opacity: .55; transition: opacity .2s, color .2s; }
    .job:hover .job__go, .job:focus-visible .job__go { opacity: 1; color: var(--action); }
}
.job:hover .job__name { color: var(--action); }
@media (max-width: 1023px) {
    .job { grid-template-columns: 1fr auto; }
    .job__name { grid-column: 1; grid-row: 1; }
    .job__period { grid-column: 2; grid-row: 1; }
    .job__role, .job__place { grid-column: 1 / -1; }
}

/* ---------- Now: three cards and the tools they are built with ---------- */

.now { row-gap: var(--card-gap); }
.projects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter, 24px); }
.project { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-6); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: inherit; text-decoration: none; transition: border-color .2s var(--ease, ease), transform .2s var(--ease, ease); }
.project:hover { border-color: color-mix(in oklab, var(--accent) 55%, var(--line)); transform: translateY(-2px); }
.project__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-4); }
.project__tag { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-small); color: var(--muted); }
.project__tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.project__arrow { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease, ease), stroke .2s; }
.project:hover .project__arrow { stroke: var(--accent); transform: translate(2px, -2px); }
.project__title { margin: 0; font: 500 clamp(24px, 2.2vw, 30px)/1.15 var(--font-display, inherit); letter-spacing: -0.015em; }
.project__body { flex: 1; margin: 0; color: var(--muted); font-size: var(--t-small); line-height: 1.6; }
.project__url { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--line); font: 13px "DM Mono", ui-monospace, monospace; color: var(--ink); }
@media (max-width: 1023px) { .projects { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1023px) { .now > .span-4 { grid-column: 1 / -1; } }
.tools { margin-top: var(--s-8); display: grid; gap: var(--s-4); }
.tools__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s-5) var(--gutter); }
.tools__list li { display: flex; align-items: center; gap: var(--s-3); font-size: var(--t-small); min-width: 0; }
.tools__list img { width: 28px; height: 28px; object-fit: contain; flex: none; }
html[data-theme="dark"] .tools__list img[src*="github"] { filter: invert(1); }
@media (max-width: 1023px) { .tools__list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 639px) { .tools__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Posts ---------- */

.post-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.post-list li { border-bottom: 1px solid var(--line); }
.post-row { display: grid; grid-template-columns: 2fr 8fr 2fr; gap: var(--s-2) var(--gutter); align-items: baseline; padding: var(--s-5) 0; color: inherit; text-decoration: none; }
.post-row time, .post-row-meta { font-size: var(--t-small); color: var(--muted); font-variant-numeric: tabular-nums; }
.post-row-meta { text-align: right; }
.post-row-title { font: var(--display-weight) var(--t-h3)/1.2 var(--font-display); letter-spacing: var(--display-tracking); }
.post-row:hover .post-row-title { color: var(--action); }
@media (max-width: 639px) {
    .post-row { grid-template-columns: 1fr auto; }
    .post-row-title { grid-column: 1 / -1; grid-row: 1; }
}
.draft { display: inline-block; margin-left: var(--s-2); padding: 2px 8px; border-radius: 99px; font: 500 12px var(--font-text); vertical-align: middle; background: var(--accent); color: var(--accent-ink); letter-spacing: 0; }

/* ---------- The footer: buttons that read as links, the served line ---------- */

.footer__btn { min-height: 44px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.footer__btn:hover { color: var(--action); }
.footer__served { color: var(--muted); }
html.is-inner footer.closing { height: auto; min-height: 0; }
html.is-inner footer.closing > .wrap { height: auto; }

/* ==========================================================================
   Inner pages: blog, posts, work pages. Long-form, so they grow with their
   content instead of keeping to whole screens.
   ========================================================================== */

.page { padding: calc(var(--nav) + var(--s-9)) 0 var(--s-10); }
.page-head { display: grid; gap: var(--s-5); max-width: 860px; margin-bottom: var(--s-8); }
.page-head h1 { font-size: var(--t-h1); }
.page-head .t-lead { max-width: 60ch; }
.crumb { font-size: var(--t-small); color: var(--muted); }
.crumb a { color: inherit; }
.crumb a:hover { color: var(--action); }

.year-group { display: grid; grid-template-columns: 2fr 10fr; gap: var(--gutter); margin-top: var(--s-8); }
.year-group:first-of-type { margin-top: 0; }
.year { font: var(--display-weight) var(--t-h3)/1.2 var(--font-display); }
@media (max-width: 639px) { .year-group { grid-template-columns: 1fr; } }

/* prose */
.prose { max-width: 70ch; font-size: 18px; line-height: 1.7; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: clamp(26px, 1.5vw + 18px, 36px); line-height: 1.15; margin-top: 2em; }
.prose h3 { font-size: var(--t-card); font-weight: 500; font-family: var(--font-text); letter-spacing: 0; margin-top: 1.8em; }
.prose h2 + *, .prose h3 + * { margin-top: .6em; }
.prose a { color: var(--action); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose .heading-permalink { display: none; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: .4em; }
.prose blockquote { margin-left: 0; padding-left: var(--s-5); border-left: 2px solid var(--accent); font-style: italic; }
.prose code { font: .88em var(--font-mono); padding: .1em .35em; border-radius: 4px; background: var(--surface); }
.prose pre { padding: var(--s-5); border-radius: var(--r-md); background: #15120f; color: #e9e3da; overflow-x: auto; font-size: 14px; line-height: 1.6; }
.prose pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
.prose img { max-width: 100%; height: auto; border-radius: var(--r-md); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose figure { margin-left: 0; margin-right: 0; }

/* a post */
.post-meta { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); font-size: var(--t-small); color: var(--muted); }
.post-foot { max-width: 70ch; margin-top: var(--s-9); display: grid; gap: var(--s-7); }
.via { color: var(--muted); }
.via a { color: var(--ink); }
.author { display: flex; align-items: center; gap: var(--s-4); padding-top: var(--s-6); border-top: 1px solid var(--line); }
.author img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.author span { color: var(--muted); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); }
.post-nav a { display: grid; gap: var(--s-1); padding: var(--s-5); border: 1px solid var(--line); border-radius: var(--r-lg); color: inherit; text-decoration: none; font-weight: 500; transition: border-color .2s, transform .2s; }
.post-nav a:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.post-nav a span { font-weight: 400; font-size: var(--t-small); color: var(--muted); }
.post-nav .next { text-align: right; grid-column: 2; }
@media (max-width: 639px) { .post-nav { grid-template-columns: 1fr; } .post-nav .next { grid-column: 1; text-align: left; } }

/* a work page */
.work-title { display: flex; align-items: center; gap: var(--s-5); }
.work-logo { width: 56px; height: 56px; border-radius: var(--r-md); object-fit: contain; background: var(--surface); border: 1px solid var(--line); padding: 6px; }
.work-company { font-size: var(--t-small); color: var(--muted); }
.work-meta { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-8); margin: 0; padding-top: var(--s-5); border-top: 1px solid var(--line); }
.work-meta div { display: grid; gap: 2px; }
.work-meta dt { font-size: var(--t-label); font-weight: 500; color: var(--muted); }
.work-meta dd { margin: 0; font-weight: 500; }
.work-meta a { color: var(--action); }
.work-cover { margin: 0 0 var(--s-8); }
.work-cover a { display: block; overflow: hidden; border-radius: var(--r-lg); }
.work-cover img { width: 100%; max-height: 560px; object-fit: cover; display: block; transition: transform .4s var(--ease, ease); }
.work-cover a:hover img { transform: scale(1.02); }
.work-layout { display: grid; gap: var(--s-8); align-items: start; }
@media (min-width: 1024px) { .work-layout.has-roles { grid-template-columns: 3fr 9fr; gap: var(--gutter); } }
.work-roles-title { font-size: var(--t-label); font-weight: 500; color: var(--muted); margin-bottom: var(--s-4); }
.work-roles ol { list-style: none; margin: 0; padding: 0 0 0 var(--s-5); border-left: 1px solid var(--line-strong); display: grid; gap: var(--s-6); }
.work-roles li { position: relative; display: grid; gap: 2px; }
.work-roles li::before { content: ""; position: absolute; left: calc(-1 * var(--s-5) - 6px); top: 6px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.work-roles li:last-child::before { background: var(--accent); }
.work-role-period, .work-role-place { font-size: var(--t-small); color: var(--muted); }
.work-role-title { font-weight: 500; }
.work-role-summary { margin-top: var(--s-2); }
.work-nav { margin-top: var(--s-9); max-width: none; }

/* media blocks in Markdown (app/Support/Markdown/MediaBlockRenderer.php) */
.prose .gallery { display: grid; gap: var(--s-3); margin: 1.8em 0; }
.gallery-2, .gallery-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .gallery-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.gallery figure { margin: 0; min-width: 0; }
.gallery figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gallery a { display: block; overflow: hidden; border-radius: var(--r-md); cursor: zoom-in; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; border-radius: 0; transition: transform .4s var(--ease, ease); }
.gallery-1 img { aspect-ratio: auto; max-height: 560px; }
.gallery a:hover img { transform: scale(1.025); }

.media-missing { margin: 0; min-width: 0; }
.media-missing > span {
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; aspect-ratio: 4 / 3; padding: var(--s-3);
    border-radius: var(--r-md); text-align: center; border: 1.5px dashed color-mix(in oklab, var(--accent) 50%, var(--line));
    background: color-mix(in oklab, var(--accent) 7%, var(--bg)); font: 12px var(--font-mono); color: var(--muted); word-break: break-all;
}
.media-missing-video > span { aspect-ratio: 16 / 9; }
.prose .media-missing code { background: none; padding: 0; }
.media-missing figcaption { display: none; }

.prose .video { margin: 1.8em 0; }
.video figcaption { display: none; }
.video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; background: #000; }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.prose .quote { margin: 2em 0; padding: var(--s-6); border-radius: var(--r-lg); background: var(--surface); }
.prose .quote blockquote { border: 0; padding: 0; margin: 0; font-style: normal; font: var(--display-weight) 22px/1.45 var(--font-display); letter-spacing: -0.01em; }
.prose .quote blockquote p + p { margin-top: .8em; }
.prose .quote figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--s-3); margin-top: var(--s-5); font-size: var(--t-small); font-style: italic; }
.prose .quote figcaption strong { font-style: normal; font-weight: 500; }
.quote-rating { color: var(--accent); letter-spacing: 2px; width: 100%; font-style: normal; }
.quote-source { color: var(--muted); margin-left: auto; }

.prose .stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s-5) var(--gutter); margin: 2em 0; padding: var(--s-6) 0; border-block: 1px solid var(--line); }
.stat-row div { display: flex; flex-direction: column-reverse; gap: var(--s-2); }
.stat-row dd { margin: 0; font: var(--display-weight) clamp(28px, 1vw + 22px, 38px)/1.05 var(--font-display); letter-spacing: var(--display-tracking); }
.stat-row dt { font-size: var(--t-small); color: var(--muted); line-height: 1.4; }

.note-local { margin: 1.5em 0; padding: var(--s-4) var(--s-5); border-radius: var(--r-md); border: 1.5px dashed var(--accent); font-size: 15px; }
.note-local strong { display: block; font-size: var(--t-label); font-weight: 500; color: var(--action); margin-bottom: 4px; }
.note-local p + p { margin-top: .4em; }

/* lightbox */
.lightbox { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(8, 7, 6, .92); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox figure { margin: 0; display: flex; justify-content: center; padding: 64px 16px 24px; max-height: 100vh; }
.lightbox img { max-width: min(1400px, 92vw); max-height: calc(100vh - 120px); border-radius: var(--r-md); object-fit: contain; }
.lightbox figcaption { display: none; }
.lightbox button { position: fixed; border: 0; background: rgba(255, 255, 255, .1); color: #fff; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font-size: 18px; display: grid; place-items: center; }
.lightbox button:hover { background: rgba(255, 255, 255, .2); }
.lightbox [data-close] { top: 16px; right: 16px; }
.lightbox [data-prev] { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox [data-next] { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox [hidden] { display: none; }
.lightbox-count { position: fixed; top: 28px; left: 50%; transform: translateX(-50%); font-size: 13px; color: #b9b0a5; }

/* 404 */
.not-found code { font: 14px var(--font-mono); padding: 2px 6px; border-radius: 4px; background: var(--surface); }

/* ==========================================================================
   The command palette (press / anywhere) and the konami confetti
   ========================================================================== */

.palette {
    width: min(620px, calc(100vw - 32px)); max-height: min(520px, 80vh); padding: 0; overflow: hidden; border: 1px solid #2a241e; border-radius: var(--r-lg);
    background: #14110e; color: #e9e3da; font: 14px var(--font-mono); margin-top: 12vh;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6);
}
.palette::backdrop { background: rgba(10, 8, 6, .5); }
.palette-inner { display: flex; flex-direction: column; max-height: min(520px, 80vh); }
.palette-bar { display: flex; align-items: center; gap: var(--s-4); padding: 12px 16px; border-bottom: 1px solid #2a241e; }
.palette-bar .ui-dots { display: inline-flex; gap: 6px; }
.palette-bar .ui-dots i { width: 10px; height: 10px; border-radius: 50%; background: #3a322a; }
.palette-bar em { font-style: normal; font-size: 12px; color: #8f867b; }
.palette-log { flex: 0 1 auto; min-height: 0; overflow-y: auto; padding: 10px 18px 0; line-height: 1.7; scrollbar-width: thin; scrollbar-color: #3a322a transparent; }
.palette-log:empty { display: none; }
.palette-log p { white-space: pre-wrap; word-break: break-word; margin: 0; }
.palette-log .echo { color: #8f867b; }
.palette-log .ok { color: #7bd88f; }
.palette-log .warn { color: #f5a524; }
.palette-log .err { color: #f28b82; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 18px; color: #f5a524; }
.palette-input input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: #e9e3da; font: inherit; caret-color: #f5a524; }
.palette-input input::placeholder { color: #6b6259; }
.palette-suggest { flex: 1 1 auto; min-height: 0; list-style: none; margin: 0; padding: 0 8px 10px; overflow-y: auto; border-top: 1px solid #2a241e; scrollbar-width: thin; scrollbar-color: #3a322a transparent; }
.palette-suggest:empty { display: none; }
.palette-suggest li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: var(--r-sm); cursor: pointer; margin-top: 4px; }
.palette-suggest li span:last-child { color: #8f867b; font-size: 12.5px; text-align: right; }
.palette-suggest li[aria-selected="true"] { background: rgba(255, 255, 255, .06); }
.palette-suggest li[aria-selected="true"] span:first-child { color: #f5a524; }

.confetti { position: fixed; top: -20px; width: 10px; height: 10px; border-radius: 2px; z-index: 50; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--dx, 0), 110vh) rotate(var(--rot, 540deg)); } }

@media (prefers-reduced-motion: reduce) {
    .confetti { display: none; }
}

/* ---------- Additions after the first look ---------- */

.latest { margin-top: var(--s-8); }
.latest__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-4); }
.latest__head h3 { font-size: var(--t-card); font-weight: 500; font-family: var(--font-text); letter-spacing: 0; }
.latest .post-row { padding: var(--s-4) 0; }
.latest .post-row-title { font-size: var(--t-card); }
#work .tools { margin-top: var(--s-7); }

/* ---------- Checker fixes: rules, tabs, grid-aligned tools, package meta ---------- */

.jobs, .post-list { border-top: 0; }
.jobs li:first-child .job, .post-list li:first-child .post-row { padding-top: 0; }
.job { padding: var(--s-4) 0; }
.tools__list.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-5) var(--gutter); }
@media (max-width: 1023px) { .tools__list.grid > .span-2 { grid-column: auto / span 4; } }
@media (max-width: 639px) { .tools__list.grid > .span-2 { grid-column: auto / span 6; } }
.tools__list img { width: 32px; height: 32px; }
.btn--secondary { box-shadow: inset 0 0 0 1px var(--line-strong); }

/* ---------- Tablet and phone: rows that stack, sections that take two screens ---------- */

@media (max-width: 1279px) {
    .job { grid-template-columns: minmax(0, 1fr) auto; row-gap: var(--s-1); }
    .job__name { grid-column: 1; grid-row: 1; }
    .job__period { grid-column: 2; grid-row: 1; }
    .job__role { grid-column: 1 / -1; grid-row: 2; }
    .job__place { grid-column: 1 / -1; grid-row: 3; }
    .job__go { display: none !important; }
}
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li::marker { color: var(--muted); }

/* ---------- Logo mark: "sh" in a small rounded square, as in the favicon ---------- */

.logo-mark {
    display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; margin-right: 10px; border-radius: 8px;
    background: var(--accent); color: var(--accent-ink, #1a1206);
    font: 700 13px/1 "DM Mono", ui-monospace, Menlo, Consolas, monospace; letter-spacing: -0.02em;
}
.nav__logo .logo-mark:only-child { margin-right: 0; }

/* ---------- Hero: the location as a pin on the portrait ---------- */

.hero-pin {
    position: absolute; left: 50%; bottom: calc(-1 * var(--s-3)); transform: translateX(-50%);
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px 7px 11px; white-space: nowrap;
    border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
    font-size: var(--t-small); font-weight: 500; box-shadow: 0 8px 24px -12px rgb(0 0 0 / .45);
}
.hero-pin svg { width: 15px; height: 15px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; }

/* ---------- Section splits and a little texture on the ground ----------
   Each numbered section opens with a hairline across the column, its number and name sitting on it, a
   small tick at each end. Behind every section, barely there: a fine grid that fades out from one
   corner and a faint saffron glow in the same corner, alternating left and right down the page. */

main > .section[data-index] { isolation: isolate; }
main > .section[data-index]::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(38% 42% at var(--glow-x, 0%) 45%, color-mix(in oklab, var(--accent) 7%, transparent), transparent 70%),
        linear-gradient(to right, color-mix(in oklab, var(--ink) 4.5%, transparent) 1px, transparent 1px) 0 0 / 64px 64px,
        linear-gradient(to bottom, color-mix(in oklab, var(--ink) 4.5%, transparent) 1px, transparent 1px) 0 0 / 64px 64px;
    -webkit-mask-image: radial-gradient(55% 60% at var(--glow-x, 0%) 45%, #000, transparent 72%);
    mask-image: radial-gradient(55% 60% at var(--glow-x, 0%) 45%, #000, transparent 72%);
}
main > .section[data-index]:nth-of-type(odd) { --glow-x: 100%; }

main > .section[data-index] > .wrap::before {
    content: ""; position: absolute; left: 0; right: 0; top: calc(-0.5 * var(--padt, 120px)); height: 1px;
    background: linear-gradient(to right, var(--line) 0 100%);
    -webkit-mask-image: linear-gradient(to right, #000 0 calc(100% - 120px), transparent);
}
main > .section[data-index]::after {
    content: attr(data-index) "  /  " attr(data-label); z-index: 2; pointer-events: none;
    position: absolute; left: max(var(--gut, 24px), (100% - var(--container, 1120px)) / 2); top: calc(0.5 * var(--padt, 120px)); transform: translateY(-50%);
    padding-right: 14px; background: var(--bg);
    font: 12px/1 "DM Mono", ui-monospace, monospace; letter-spacing: .04em; color: var(--muted); white-space: pre;
}

/* ---------- Small screens: fixes from the responsive pass ---------- */

.nav__logo { min-width: 44px; min-height: 44px; }
@media (min-width: 640px) and (max-width: 1023px) {
    /* three photos in two columns: the odd one out takes the full row */
    .lv-photo:last-child:nth-child(odd) { grid-column: 1 / -1; aspect-ratio: 16 / 7; }
}
@media (max-width: 639px) {
    .pkg--premium .project__body { -webkit-line-clamp: 6; }
}
