:root {
  color-scheme: dark;
  --paper: #13111a;
  --panel: #1c1924;
  --ink: #eeeaf0;
  --muted: #b0a9b6;
  --line: #393340;
  --accent: #c69bc0;
  --accent-soft: #2a202c;
  --mono: "Cascadia Code", Consolas, "SFMono-Regular", ui-monospace, monospace;
  --content-width: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.site-header,
.site-main,
.site-footer {
  width: min(var(--content-width), calc(100% - 64px));
  margin-inline: auto;
}

.site-header { border-bottom: 1px solid var(--line); }
.header-inner { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand-name { font-size: 20px; font-weight: 620; line-height: 1.15; }
.brand-name small { display: block; margin-top: 5px; color: var(--muted); font-family: var(--mono); font-size: 9px; font-weight: 500; letter-spacing: .1em; }
.site-nav { display: flex; align-items: center; gap: clamp(20px, 3vw, 38px); }
.site-nav a,
.site-footer a { color: var(--muted); font-size: 13px; text-decoration: none; }
.site-nav a:hover,
.site-footer a:hover { color: var(--accent); }
.site-nav a:last-child span { color: var(--accent); }

.site-main { min-height: calc(100vh - 160px); }
.portfolio-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; align-items: start; gap: clamp(38px, 6vw, 82px); padding: 42px 0 72px; }
.portfolio-main { min-width: 0; }
.intro { max-width: 660px; padding: 4px 0 39px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-family: var(--mono); font-size: 10px; font-weight: 650; letter-spacing: .075em; line-height: 1.5; text-transform: uppercase; }
.eyebrow span { padding-inline: 3px; color: #877a88; }
h1, h2, h3, p { margin-top: 0; }
.intro h1,
.project-header h1 { margin-bottom: 12px; font-size: clamp(36px, 4.2vw, 50px); font-weight: 570; letter-spacing: -.045em; line-height: 1.1; }
.intro-copy { max-width: 520px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }

.section-heading { padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.section-heading .eyebrow { margin-bottom: 4px; }
.section-heading h2 { margin: 0; font-size: 29px; font-weight: 520; letter-spacing: -.035em; line-height: 1.25; }
.work-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 27px 20px; padding-top: 20px; }
.work-card { min-width: 0; }
.work-cover { position: relative; display: block; overflow: hidden; aspect-ratio: 1.62; background: #211e29; }
.work-cover img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; transition: transform .24s ease, filter .24s ease; }
.work-cover:hover img { transform: scale(1.025); filter: brightness(1.06); }
.cover-index { position: absolute; top: 10px; left: 10px; padding: 3px 7px; background: rgb(19 17 26 / 84%); color: #eee5ed; font-family: var(--mono); font-size: 9px; letter-spacing: .04em; }
.work-card-copy { padding-top: 12px; }
.work-kind { margin: 0 0 4px; color: var(--accent); font-family: var(--mono); font-size: 9px; font-weight: 600; letter-spacing: .045em; }
.work-card h3 { margin: 0 0 5px; font-size: 19px; font-weight: 570; letter-spacing: -.025em; line-height: 1.3; }
.work-card h3 a { text-decoration: none; text-underline-offset: 4px; }
.work-card h3 a:hover { color: var(--accent); text-decoration: underline; }
.work-card-copy > p:not(.work-kind):not(.work-tools) { max-width: 500px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.work-tools { margin: 8px 0 0; color: #ded6df; font-family: var(--mono); font-size: 9px; }
.work-tools span { padding-inline: 3px; color: #8f7b91; }

.sidebar { padding-top: 7px; }
.sidebar-section { padding: 18px 0 20px; border-top: 2px solid #745b78; }
.sidebar-section + .sidebar-section { margin-top: 20px; }
.sidebar-section .eyebrow { margin-bottom: 6px; }
.sidebar-section h2 { margin: 0 0 10px; font-size: 18px; font-weight: 570; letter-spacing: -.02em; line-height: 1.35; }
.sidebar-section > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.sidebar-section strong { color: var(--ink); font-size: 11px; font-weight: 620; }
.sidebar-section > p.sidebar-detail { margin-top: 9px !important; }
.sidebar-section .tool-list { color: var(--ink) !important; font-size: 11px !important; line-height: 1.9 !important; }
.tool-list span { padding-inline: 3px; color: var(--accent); }
.sidebar-links { padding-block: 14px; }
.sidebar-links a { color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: underline; text-decoration-color: #806d85; text-underline-offset: 5px; }
.sidebar-links a span { margin-left: 4px; color: var(--accent); }
.sidebar-links a:hover { color: var(--accent); }

.site-footer { display: flex; justify-content: space-between; gap: 24px; padding: 18px 0 26px; border-top: 1px solid var(--line); }
.site-footer p { margin: 0; color: var(--muted); font-size: 11px; }
.site-footer p span { padding-inline: 3px; color: var(--accent); }

.project-page { max-width: 960px; margin-inline: auto; padding: 30px 0 clamp(64px, 9vw, 92px); }
.back-link { display: inline-block; margin-bottom: clamp(32px, 5vw, 52px); color: var(--muted); font-size: 12px; text-decoration: none; }
.back-link:hover { color: var(--accent); }
.back-link span { margin-right: 5px; color: var(--accent); }
.project-header { max-width: 790px; margin-bottom: 30px; }
.project-header .eyebrow { margin-bottom: 8px; }
.project-header h1 { font-size: clamp(35px, 5vw, 52px); }
.project-lead { max-width: 700px; margin-bottom: 18px; color: var(--muted); font-size: 16px; line-height: 1.65; }
.project-meta { display: flex; flex-wrap: wrap; gap: 7px; color: var(--muted); font-family: var(--mono); font-size: 9px; }
.project-meta span { padding: 4px 7px; border: 1px solid var(--line); background: var(--panel); }
.media-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; margin: 30px 0 36px; }
.media-gallery--single { grid-template-columns: minmax(0, 1fr); }
.media-gallery--stories { grid-template-columns: minmax(0, 1fr); gap: 30px; }
.media-entry { min-width: 0; }
.media-gallery--stories .media-entry { max-width: 780px; }
.media-figure { min-width: 0; margin: 0; }
.media-image { display: block; overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.media-image img { display: block; width: 100%; max-height: 580px; object-fit: contain; }
.media-image--cover img { height: clamp(240px, 48vw, 520px); max-height: none; object-fit: cover; object-position: center top; }
.media-image:hover img { filter: brightness(.96); }
.media-video { display: block; width: 100%; max-height: 580px; border: 1px solid var(--line); background: var(--panel); }
.video-frame { position: relative; overflow: hidden; width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--line); background: var(--panel); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media-figure figcaption { padding-top: 8px; color: var(--muted); font-size: 11px; }
.media-description { max-width: 720px; margin-top: 10px; }
.media-description p { margin: 0 0 10px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.media-description p:last-child { margin-bottom: 0; }
.project-copy { max-width: 720px; }
.project-copy h2 { margin: 32px 0 9px; font-size: 18px; font-weight: 620; letter-spacing: -.015em; line-height: 1.35; }
.project-copy h3 { margin: 22px 0 7px; font-size: 15px; font-weight: 620; }
.project-copy p,
.project-copy li { color: var(--muted); font-size: 14px; }
.project-copy ul { padding-left: 20px; }
.project-copy li { padding-left: 3px; margin: 6px 0; }
.project-copy a { color: var(--accent); text-underline-offset: 3px; }
.project-copy code { padding: .12em .35em; border: 1px solid #504158; background: #211b28; color: #d7b4d5; font-family: var(--mono); font-size: .9em; }
.project-external { margin-top: 28px; }

@media (max-width: 900px) {
  .site-header, .site-main, .site-footer { width: min(var(--content-width), calc(100% - 48px)); }
  .portfolio-layout { grid-template-columns: minmax(0, 1fr) 220px; gap: 32px; }
  .work-list { gap: 24px 16px; }
}

@media (max-width: 820px) {
  .site-header, .site-main, .site-footer { width: min(var(--content-width), calc(100% - 36px)); }
  .header-inner { min-height: 72px; gap: 16px; }
  .brand-name { font-size: 16px; }
  .brand-name small { font-size: 8px; }
  .site-nav { gap: 16px; }
  .site-nav a { font-size: 11px; }
  .portfolio-layout { grid-template-columns: 1fr; gap: 42px; padding-top: 34px; }
  .intro { padding-bottom: 30px; }
  .sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
  .sidebar-section + .sidebar-section { margin-top: 0; }
  .sidebar-links { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .site-header, .site-main, .site-footer { width: calc(100% - 32px); }
  .header-inner { min-height: 66px; }
  .brand { gap: 9px; }
  .brand-name { font-size: 15px; }
  .brand-name small { display: none; }
  .site-nav { gap: 13px; }
  .site-nav a { font-size: 10px; }
  .portfolio-layout { padding-top: 28px; }
  .intro h1 { font-size: 38px; }
  .section-heading h2 { font-size: 26px; }
  .work-list { grid-template-columns: 1fr; gap: 25px; }
  .work-cover { aspect-ratio: 1.7; }
  .sidebar { grid-template-columns: 1fr; }
  .sidebar-links { grid-column: auto; }
  .media-gallery { grid-template-columns: 1fr; gap: 14px; }
  .site-footer { flex-direction: column; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
