/* Self-hosted, latin subset (see scripts/fonts.mjs). */
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 800; font-stretch: 125%; font-display: swap; src: url(/assets/fonts/archivo.woff2) format('woff2'); }
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/assets/fonts/bricolage.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400 500; font-display: swap; src: url(/assets/fonts/plex-sans.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/plex-mono-400.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/plex-mono-500.woff2) format('woff2'); }
/* brianlink.me — tokens first. Names come from the design mockup; keep them. */
:root {
  --ink: #101113;
  --panel: #1A1B1F;
  --line: #2A2B2F;
  --line-strong: #3A3B40;
  --text: #F3F0E9;
  --text-2: #D9D5CC;
  --text-3: #B5B1A9;
  --muted: #A9A6A0;
  --accent: #F0A43A;
  --teal: #7FC8B8;
  --violet: #B9A7F2;
  --font-name: 'Archivo', system-ui, sans-serif; /* used at font-stretch 125%, weight 800 */
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --gutter: 56px;
}
@media (max-width: 720px) { :root { --gutter: 20px; } }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--text); font-family: var(--font-body); }
html { color-scheme: dark; }
a { color: var(--text); }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
img { max-width: 100%; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 20; background: var(--accent); color: var(--ink); padding: 10px 16px; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; color: var(--ink); }

.mono { font-family: var(--font-mono); letter-spacing: .12em; text-transform: uppercase; font-size: 12px; }

/* Top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px var(--gutter); position: relative; z-index: 5; }
.logo { font-family: var(--font-name); font-stretch: 125%; font-weight: 800; font-size: 20px; letter-spacing: -.01em; text-decoration: none; }
.logo span { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 28px; font-size: 15px; }
.nav a { text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(243,240,233,.28); background: rgba(16,17,19,.5); color: var(--text); text-decoration: none; cursor: pointer; font: inherit; padding: 0; }
.icon-btn:hover { border-color: var(--accent); }
.menu-btn { display: none; }
.menu { display: none; }
@media (max-width: 760px) {
  .nav a:not(.icon-btn) { display: none; }
  .nav { gap: 10px; }
  .menu-btn { display: inline-flex; }
  .menu { position: fixed; inset: 0; z-index: 30; background: var(--ink); flex-direction: column; justify-content: center; gap: 6px; padding: 0 var(--gutter); }
  .menu[data-open="true"] { display: flex; }
  .menu a { font-family: var(--font-display); font-weight: 800; font-size: 44px; letter-spacing: -.03em; text-decoration: none; padding: 6px 0; }
  .menu a[aria-current="page"] { color: var(--accent); }
  .menu .close { position: absolute; top: 24px; right: var(--gutter); }
}

/* Footer */
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding: 22px var(--gutter); border-top: 1px solid #222327; font-size: 14px; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--accent); }
.footer div { display: flex; flex-wrap: wrap; gap: 22px; }
.footer .resume { text-decoration: underline; }
.footer .ai { flex-basis: 100%; font-size: 12px; color: #8C8984; margin: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 26px; border-radius: 999px; font-weight: 500; font-size: 16px; text-decoration: none; border: none; cursor: pointer; font-family: inherit; }
.btn-accent { background: var(--accent); color: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: 19px; min-height: 60px; padding: 0 30px; }
.btn-light { background: var(--text); color: var(--ink); }
.btn:hover { filter: brightness(1.06); color: var(--ink); }

/* Plate shown while a screenshot loads (and for missing ones) */
.plate { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.06) 0 2px, transparent 2px 24px); }

/* ---------- Intro ---------- */
.page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.hero { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 64px; padding: 16px var(--gutter) 40px; }
.hero-copy { flex: 999 1 560px; min-width: 0; max-width: 780px; display: flex; flex-direction: column; gap: 24px; }
.eyebrow { color: var(--muted); font-size: 13px; }
.hero h1 { margin: 0; font-family: var(--font-name); font-stretch: 125%; font-weight: 800; font-size: clamp(56px, 9vw, 100px); line-height: .92; letter-spacing: -.03em; text-transform: uppercase; }
.name-arrow { display: inline-block; margin-left: .18em; color: var(--accent); transition: transform .25s ease; }
.name-arrow svg { display: block; width: .82em; height: .7em; }
.name-arrow:hover { color: var(--accent); transform: translateX(.12em); }
.tagline { margin: 0; font-size: clamp(20px, 2.2vw, 26px); line-height: 1.35; color: var(--text-2); max-width: 640px; }
.bio { display: flex; flex-direction: column; gap: 12px; max-width: 640px; font-size: 17px; line-height: 1.6; color: var(--text-3); }
.bio p { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 20px; padding-top: 8px; border-top: 1px solid var(--line); }
.stat { display: flex; flex-direction: column; gap: 6px; padding-top: 18px; text-decoration: none; color: var(--text); }
.stat b { font-family: var(--font-display); font-weight: 600; font-size: 36px; letter-spacing: -.02em; }
.stat span { font-size: 13px; line-height: 1.4; color: var(--muted); }
a.stat:hover b { color: var(--accent); }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding-top: 4px; }
.cta small { font-size: 15px; color: var(--muted); }
.fan { flex: 1 1 380px; min-width: 0; position: relative; height: 580px; max-width: 540px; }
.fan .card { position: absolute; width: 340px; height: 440px; border-radius: 18px; background-size: cover; background-position: top left; overflow: hidden; border: 1px solid rgba(243,240,233,.3); box-shadow: 0 28px 56px rgba(0,0,0,.6), 0 0 0 1px rgba(0,0,0,.55); }
.fan .card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(16,17,19,0) 0%, rgba(16,17,19,0) 55%, rgba(16,17,19,.85) 100%); }
.fan .card span { position: absolute; left: 22px; bottom: 20px; z-index: 1; color: var(--text); }
.fan .c1 { left: 160px; top: -10px; transform: rotate(9deg); }
.fan .c2 { left: -10px; top: 60px; transform: rotate(-8deg); background-position: center top; }
.fan .c3 { left: 90px; top: 110px; width: 360px; height: 450px; border-color: rgba(243,240,233,.5); box-shadow: 0 34px 70px rgba(0,0,0,.7), 0 0 0 1px rgba(0,0,0,.6), 0 0 36px rgba(240,164,58,.12); text-decoration: none; color: var(--text); display: block; transition: transform .25s ease; }
.fan .c3:hover { transform: translateY(-4px); color: var(--text); }
.fan .c3::after { background: linear-gradient(180deg, rgba(16,17,19,.15) 0%, rgba(16,17,19,.55) 45%, rgba(16,17,19,.94) 100%); }
.fan .c3.art { background-position: center; }
.fan .c3.art::after { background: linear-gradient(180deg, rgba(16,17,19,0) 0%, rgba(16,17,19,0) 50%, rgba(16,17,19,.9) 100%); }
.fan .c3 > * { position: absolute; left: 22px; right: 22px; z-index: 1; }
.fan .c3 .txt { bottom: 22px; }
.fan .c3 .txt .mono { position: static; display: block; margin-bottom: 12px; color: var(--accent); }
.fan .c3 strong { font-family: var(--font-display); font-weight: 800; font-size: 44px; line-height: 1; letter-spacing: -.03em; display: block; margin-bottom: 10px; }
.fan .c3 p { margin: 0; font-size: 15px; line-height: 1.45; color: #D4D0C7; }
@media (max-width: 900px) { .fan { display: none; } }

/* ---------- Deck ---------- */
body.deck-page { overflow: hidden; }
.deck { position: relative; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; touch-action: pan-y; }
.bg { position: absolute; inset: 0; background-color: var(--ink); transition: background-color .45s ease; }
.bg img { position: absolute; top: 0; bottom: 0; left: var(--img-left, 30%); width: calc(100% - var(--img-left, 30%)); height: 100%; max-width: none; object-fit: cover; object-position: var(--img-pos, top center); opacity: 0; transition: opacity .45s ease; }
.bg img.on { opacity: 1; }
.scrim { position: absolute; inset: 0; --l: var(--img-left, 30%); background: linear-gradient(90deg, var(--ink) 0%, var(--ink) calc(var(--l) + 4%), rgba(16,17,19,.86) calc(var(--l) + 16%), rgba(16,17,19,.45) calc(var(--l) + 32%), rgba(16,17,19,.12) min(99%, calc(var(--l) + 55%)), rgba(16,17,19,0) 100%); }
.cover-art { position: absolute; z-index: 2; right: 11%; top: 50%; height: min(70vh, 660px); aspect-ratio: 2 / 3; transform: translateY(-50%) rotate(6deg); border-radius: 3px 7px 7px 3px; box-shadow: 0 50px 90px rgba(0,0,0,.7), 0 18px 30px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.1); opacity: 0; transition: opacity .45s ease; pointer-events: none; }
.cover-art.on { opacity: 1; }
.cover-art::before { content: ""; position: absolute; inset: -45%; z-index: -1; background: radial-gradient(closest-side, color-mix(in srgb, var(--glow, #2F63AE) 95%, transparent), color-mix(in srgb, var(--glow, #2F63AE) 45%, transparent) 50%, transparent 100%); }
.cover-art img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.cover-art::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, rgba(0,0,0,.28) 0, rgba(255,255,255,.12) 2.5%, rgba(0,0,0,.1) 5%, rgba(0,0,0,0) 12%, rgba(255,255,255,.05) 100%); }
@media (max-width: 1100px) { .cover-art { display: none; } }
.deck .topbar { background: linear-gradient(180deg, rgba(16,17,19,.96) 0%, rgba(16,17,19,.9) 55%, rgba(16,17,19,0) 100%); padding-bottom: 36px; }
.slide { position: relative; z-index: 2; flex: 1; display: flex; align-items: center; padding: 0 140px; }
.copy { display: flex; flex-direction: column; gap: 22px; max-width: 600px; transition: opacity .3s ease, transform .3s ease; }
.copy.out { opacity: 0; transform: translateX(-16px); }
.kicker { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; }
.kicker .cat { color: var(--accent); }
.kicker .sep { color: #8C8984; }
.kicker .count { color: var(--muted); }
.copy h1 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(44px, 7vw, 96px); line-height: .95; letter-spacing: -.04em; }
.hook { margin: 0; font-family: var(--font-display); font-size: clamp(20px, 2.2vw, 28px); line-height: 1.25; }
.blurb { margin: 0; font-size: 17px; line-height: 1.6; color: #D0CCC3; max-width: 540px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding-top: 8px; }
.status { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(243,240,233,.3); color: var(--text-2); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.arrow { position: absolute; z-index: 3; top: 50%; transform: translateY(-50%); width: 68px; height: 68px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.arrow.prev { left: 40px; border: 1px solid rgba(243,240,233,.35); background: rgba(16,17,19,.55); color: var(--text); }
.arrow.next { right: 40px; border: none; background: var(--accent); color: var(--ink); }
.arrow:hover { filter: brightness(1.1); }
.foot { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 10px; padding: 0 var(--gutter) 28px; }
.next-up { font-size: 14px; color: var(--muted); }
.next-up strong { color: var(--text); font-weight: 500; }
.ticks { display: flex; gap: 6px; }
.ticks button { flex: 1; height: 44px; padding: 0; border: none; background: transparent; cursor: pointer; position: relative; }
.ticks button::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; transform: translateY(-50%); background: rgba(243,240,233,.22); }
.ticks button.done::after { background: rgba(243,240,233,.6); }
.ticks button.on::after { background: var(--accent); height: 4px; }
.ticks button:hover::after { background: var(--text); }

@media (max-width: 760px) {
  body.deck-page { overflow: auto; }
  .deck { height: auto; min-height: 100dvh; overflow: visible; }
  .bg { bottom: auto; height: 46vh; }
  .bg img { left: 0; width: 100%; object-position: top center; }
  .scrim { --l: 0%; }
  .scrim { bottom: auto; height: 46vh; background: linear-gradient(180deg, rgba(16,17,19,.45) 0%, rgba(16,17,19,0) 30%, rgba(16,17,19,0) 60%, var(--ink) 100%); }
  .slide { padding: calc(46vh - 90px) var(--gutter) 24px; align-items: flex-start; }
  .cover-art { display: none; }
  .arrow { display: none; }
  .btn-light { width: 100%; justify-content: center; }
  .foot::before { content: "Swipe for the next project"; text-align: center; font-size: 12px; color: var(--muted); }
  .next-up { display: none; }
  .ticks { gap: 4px; }
  .actions { width: 100%; }
}

/* ---------- Grid + Writing ---------- */
.wrap { max-width: 1328px; margin: 0 auto; padding: 24px var(--gutter) 0; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.wrap h1, .about h1 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(40px, 6vw, 64px); letter-spacing: -.035em; line-height: 1; }
h2.section { margin: 0 0 24px; font-family: var(--font-display); font-weight: 800; font-size: 40px; letter-spacing: -.03em; }
.shown { font-size: 15px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; padding: 28px 0 32px; }
.chips button { min-height: 44px; padding: 0 18px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 15px; background: transparent; color: var(--text-2); border: 1px solid var(--line-strong); }
.chips button:hover { border-color: var(--text-3); }
.chips button[aria-pressed="true"] { background: var(--text); color: var(--ink); border-color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 24px; }
.grid .card { display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); text-decoration: none; color: var(--text); transition: transform .2s ease, border-color .2s ease; }
.grid .card[hidden] { display: none; }
.grid .card:hover { transform: translateY(-3px); border-color: #45464C; color: var(--text); }
.thumb { aspect-ratio: 16 / 10; width: 100%; height: auto; object-fit: cover; object-position: top; background-color: var(--panel); }
.card .body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 22px; }
.card .body .mono { font-size: 11px; color: var(--accent); }
.card .body strong { font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 1.15; letter-spacing: -.01em; }
.card .body p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-3); }
.writing { max-width: 1328px; margin: 0 auto; padding: 24px var(--gutter) 64px; }
.writing.after { padding-top: 72px; }
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 24px; margin-bottom: 24px; }
.book { display: flex; gap: 18px; align-items: center; padding: 20px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; color: var(--text); transition: border-color .2s ease; }
.book:hover { border-color: #45464C; color: var(--text); }
.cover { width: 72px; height: 108px; border-radius: 4px; flex: none; object-fit: cover; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.book strong { display: block; font-family: var(--font-display); font-weight: 600; font-size: 19px; line-height: 1.2; margin-bottom: 6px; }
.book span { font-size: 14px; color: var(--text-3); line-height: 1.45; }
.post { display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: 16px; border: 1px solid var(--line); text-decoration: none; color: var(--text); transition: border-color .2s ease; }
.post:hover { border-color: #45464C; color: var(--text); }
.post .mono { font-size: 11px; color: var(--muted); }
.post strong { font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.25; }
.post small { font-size: 13px; color: var(--muted); }

/* ---------- About ---------- */
.about { max-width: 1100px; margin: 0 auto; padding: 24px var(--gutter) 72px; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 64px; align-items: start; }
.about.no-photo { grid-template-columns: minmax(0, 760px); }
.about .lede { font-family: var(--font-display); font-size: clamp(22px, 2.6vw, 30px); line-height: 1.3; color: var(--text-2); margin: 20px 0 28px; }
.about p { font-size: 17px; line-height: 1.65; color: var(--text-3); margin: 0 0 16px; }
.about em { color: var(--text-2); }
.about h2 { margin: 48px 0 18px; font-size: 13px; color: var(--muted); font-weight: 400; }
.chapters { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: ch; }
.chapters li { counter-increment: ch; display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 18px 20px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.chapters li::before { content: counter(ch, decimal-leading-zero); font-family: var(--font-mono); color: var(--accent); font-size: 14px; padding-top: 3px; }
.chapters strong { display: block; font-family: var(--font-display); font-weight: 600; font-size: 20px; margin-bottom: 4px; }
.chapters span { font-size: 15px; line-height: 1.5; color: var(--text-3); }
.speaking { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.speaking li { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 14px; color: var(--text-2); }
.quiet { display: flex; gap: 28px; margin-top: 40px; font-size: 15px; }
.quiet a { color: var(--muted); }
.headshot { border-radius: 18px; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border: 1px solid var(--line); position: sticky; top: 24px; }
@media (max-width: 900px) { .about { grid-template-columns: 1fr; gap: 32px; } .headshot { order: -1; max-width: 320px; position: static; } }

/* ---------- Photography ---------- */
.collections { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; padding-top: 28px; }
.collection { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 16px; overflow: hidden; background: var(--panel); text-decoration: none; color: var(--text); }
.collection img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.collection:hover img { transform: scale(1.03); }
.collection span { position: absolute; left: 22px; bottom: 18px; font-family: var(--font-display); font-weight: 800; font-size: 34px; letter-spacing: -.03em; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.masonry { column-width: 300px; column-gap: 12px; padding: 24px var(--gutter) 64px; }
.masonry button { display: block; width: 100%; margin: 0 0 12px; padding: 0; border: 0; background: var(--panel); border-radius: 8px; overflow: hidden; cursor: zoom-in; break-inside: avoid; }
.masonry img { width: 100%; height: auto; }
.lightbox { position: fixed; inset: 0; z-index: 40; background: rgba(8,8,9,.96); display: none; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.lightbox[data-open="true"] { display: flex; }
.lightbox img { max-height: 80vh; max-width: 100%; object-fit: contain; }
.lightbox figcaption { margin-top: 14px; text-align: center; color: var(--text-3); font-size: 14px; }
.lightbox figcaption a { color: var(--accent); }
.lightbox .icon-btn { position: absolute; }
.lightbox .x { top: 20px; right: 20px; }
.lightbox .lp { left: 20px; top: 50%; }
.lightbox .ln { right: 20px; top: 50%; }
.empty { color: var(--muted); padding: 48px 0; font-size: 17px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
