/* Andy Budiman. Black, white and grey; the only colour is the work's. */
:root {
  --ink: #111111;
  --graphite: #595959;
  --stone: #8c8c8c;
  --link-on: #a3a3a3; /* hover and current-page colour for every text link */
  --line: #d8d8d8;
  --mist: #f4f4f4;
  --paper: #ffffff;

  --serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --sans: Inter, Arial, Helvetica, sans-serif;

  --gutter: 24px;
  --margin: 24px;
}
@media (min-width: 640px) { :root { --margin: 40px; } }
@media (min-width: 1024px) { :root { --margin: 64px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
main { flex: 1; display: flex; flex-direction: column; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; height: auto; }

.container { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 var(--margin); }

/* Links: never underlined. Ink at rest; light grey (--link-on) on hover and for the current page. */
a { color: inherit; text-decoration: none; }
.link { text-decoration: none; }
.link:hover { color: var(--link-on); }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper); padding: 10px 16px; z-index: 10; }
.skip:focus { left: 0; }

/* Type */
.display { font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; line-height: 1.05; }
.h1 { font-size: clamp(2.75rem, 1.4rem + 5vw, 5rem); line-height: 1; letter-spacing: -0.025em; }
.h2 { font-size: clamp(2rem, 1.4rem + 2vw, 2.75rem); }
.muted { color: var(--graphite); }
.lede { font-family: var(--serif); font-style: italic; font-size: clamp(1.4rem, 1rem + 1.2vw, 1.875rem); line-height: 1.25; letter-spacing: -0.01em; color: var(--graphite); max-width: 32rem; }
.measure { max-width: 38rem; }
.meta-year { font-size: 13px; line-height: 2; color: var(--graphite); font-variant-numeric: tabular-nums; }
.meta-context { font-size: 13px; line-height: 1.6; color: var(--graphite); }

/* Header: the monogram and two links */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 96px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.brand img { width: 52px; height: auto; }
@media (min-width: 640px) { .site-header { min-height: 120px; } .brand img { width: 64px; } }
.nav { display: flex; gap: 32px; font-family: var(--serif); font-size: 1.375rem; line-height: 1; }
.nav a { padding: 6px 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--link-on); }

/* Buttons (used on the not-found page) */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-block; border: 1px solid var(--ink); padding: 11px 20px; font-size: 14px; font-weight: 500; line-height: 1.5; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--paper); color: var(--ink); }

/* Home: one screen */
main.is-home .container { flex: 1; }
.home { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 56px 64px; padding-top: 64px; padding-bottom: 64px; }
.home-text { flex: 1 1 460px; min-width: 0; }
.home-title { font-size: clamp(3.25rem, 1rem + 8vw, 7.25rem); line-height: 0.98; letter-spacing: -0.03em; }
.home-title em { font-style: italic; }
.home-lead { margin-top: 32px; max-width: 34rem; font-family: var(--serif); font-size: clamp(1.35rem, 1rem + 1vw, 1.75rem); line-height: 1.4; color: #2e2e2e; }
.doors { flex: 0 1 520px; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); }
.door { display: flex; flex-direction: column; gap: 24px; padding: 28px; min-height: 200px; }
.door + .door { border-left: 1px solid var(--line); }
.door:hover { background: var(--mist); }
.door-title { display: flex; align-items: center; justify-content: space-between; font-family: var(--serif); font-size: 1.75rem; line-height: 1.1; }
.door-text { font-size: 15px; line-height: 1.55; color: var(--graphite); }
@media (max-width: 600px) {
  .doors { grid-template-columns: minmax(0, 1fr); flex-basis: 100%; }
  .door { min-height: 0; }
  .door + .door { border-left: 0; border-top: 1px solid var(--line); }
}

/* Inner pages */
.page-head { padding: 64px 0 48px; display: flex; flex-direction: column; gap: 20px; }

/* Portfolio grid: hairlines do the structuring */
.work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }
.work-cell { border: 1px solid var(--line); min-width: 0; }
.work-cell-lead { grid-column: 1 / -1; }
@media (max-width: 720px) { .work-grid { grid-template-columns: minmax(0, 1fr); } }
.cover-link { display: block; }
.cover { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.work-cell-lead .cover { aspect-ratio: 16 / 7; }
.cover-scroll { position: relative; --sbw: 0px; }
.cover-scroller { aspect-ratio: 16 / 10; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--ink) var(--mist); }
.work-cell-lead .cover-scroller { aspect-ratio: 16 / 7; }
@media (max-width: 720px) { .work-cell-lead .cover-scroller { aspect-ratio: 1 / 1; } }
.cover-scroller::-webkit-scrollbar { width: 12px; }
.cover-scroller::-webkit-scrollbar-track { background: var(--mist); border-left: 1px solid var(--line); }
.cover-scroller::-webkit-scrollbar-thumb { background: var(--ink); border: 3px solid var(--mist); }
.cover-scroller:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.cover-full { display: block; width: 100%; height: auto; }
.cover-scroll::before, .cover-scroll::after { content: ""; position: absolute; z-index: 1; left: 0; right: var(--sbw); height: 120px; pointer-events: none; opacity: 0; transition: opacity 0.2s; }
.cover-scroll::before { top: 0; background: linear-gradient(to bottom, rgba(255,255,255,0.95), rgba(255,255,255,0)); }
.cover-scroll::after { bottom: 0; background: linear-gradient(to top, rgba(255,255,255,0.95), rgba(255,255,255,0)); }
.cover-scroll.can-up::before, .cover-scroll.can-down::after { opacity: 1; }
.cue { display: none; position: absolute; z-index: 2; left: 0; right: var(--sbw); justify-content: center; align-items: center; gap: 10px; height: 48px; padding: 0 16px; background: var(--ink); border: 0; color: var(--paper); font: inherit; font-size: 15px; cursor: pointer; }
.cue:hover { color: var(--link-on); }
.cue-up { top: 0; }
.cue-down { bottom: 0; }
.cover-scroll.is-ready.can-up .cue-up, .cover-scroll.is-ready.can-down .cue-down { display: inline-flex; }
.gallery-bar { display: flex; justify-content: space-between; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.5; color: var(--graphite); }
.gallery-count { font-variant-numeric: tabular-nums; }
.gallery-thumbs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.gallery-thumbs li + li { border-left: 1px solid var(--line); }
.gallery-thumb { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; opacity: 0.55; }
.gallery-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.gallery-thumb:hover, .gallery-thumb[aria-current="true"] { opacity: 1; }
.gallery-thumb[aria-current="true"]::after { content: ""; position: absolute; inset: 0; border: 2px solid var(--ink); pointer-events: none; }
@media (max-width: 720px) {
  .gallery-thumbs { display: flex; overflow-x: auto; }
  .gallery-thumbs li { flex: 0 0 96px; }
}
.cover-empty { background: var(--mist); display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--graphite); }
.work-meta { display: flex; flex-wrap: wrap; gap: 12px 24px; padding: 20px 24px 48px; border-top: 1px solid var(--line); }
.work-meta .meta-year { flex: 0 0 96px; }
.work-text { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.work-title { font-size: 1.75rem; font-weight: 500; letter-spacing: -0.01em; }
.work-cell-lead .work-title { font-size: 2rem; }
.work-actions { margin-top: 16px; }
.btn-visit { display: inline-flex; align-items: center; gap: 10px; }
.work-note { margin-top: 8px; max-width: 38rem; font-size: 1rem; }

/* Thoughts */
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; }
.row { border: 1px solid var(--line); }
.row-link { display: block; padding: 28px; }
.row-link:hover { background: var(--mist); }
.row-text { flex: 1 1 320px; min-width: 0; max-width: 38rem; display: flex; flex-direction: column; gap: 6px; }
.row-title { font-size: 1.5rem; font-weight: 500; line-height: 1.25; }
.empty { border-top: 1px solid var(--line); padding-top: 32px; display: flex; flex-direction: column; gap: 12px; }
.empty-title { font-size: 2rem; }

/* Case study */
.case { display: flex; flex-wrap: wrap; gap: 24px; padding: 48px 0 0; }
@media (min-width: 1024px) {
  .case { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
  .case-rail { grid-column: 1 / span 3; padding-top: 14px; }
  .case-main { grid-column: 5 / span 8; }
  .case-main.prose { grid-column: 4 / span 9; }
}
.case-rail, .case-main { min-width: 0; }
.case-main { flex: 1 1 100%; }
.back { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--graphite); }
.back:hover { color: var(--link-on); }
.subtitle { margin-top: 16px; font-family: var(--serif); font-style: italic; font-size: clamp(1.4rem, 1rem + 1.2vw, 1.875rem); line-height: 1.2; letter-spacing: -0.01em; color: var(--graphite); max-width: 30rem; }
.intro { margin-top: 40px; border-top: 1px solid var(--ink); padding-top: 32px; }
.intro p { max-width: 38rem; }
.block { margin-top: 56px; display: flex; flex-direction: column; }
.case-main .block { border-top: 1px solid var(--line); padding-top: 36px; }
.case-main .block > * + * { margin-top: 16px; }
.case-main .h2 { font-size: 2rem; }
.statement { font-size: 1.6rem; letter-spacing: -0.01em; }
.case-main .statement + .measure { margin-top: 12px; }

.swatches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; margin-top: 32px; }
@media (min-width: 768px) { .swatches { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.swatch { height: 64px; border: 1px solid var(--line); }
.swatch-name { font-size: 12px; margin-top: 10px; line-height: 1.5; }
.swatch-hex { font-size: 11px; color: var(--graphite); line-height: 1.5; font-variant-numeric: tabular-nums; }
.swatch-role { font-family: var(--serif); font-style: italic; font-size: 0.95rem; color: var(--graphite); line-height: 1.4; margin-top: 2px; }

.principle-list { margin-top: 32px; border-top: 1px solid var(--line); }
.principle { display: grid; grid-template-columns: 36px minmax(0, 1fr); padding: 32px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 1024px) { .principle { grid-template-columns: 112px minmax(0, 1fr); padding: 40px 0; } }
.num { display: block; font-size: 12px; line-height: 1.6; color: var(--graphite); font-variant-numeric: tabular-nums; }
.principle-name { display: none; padding-right: 16px; }
@media (min-width: 1024px) { .principle-name { display: block; } }
.principle-body { max-width: 36rem; min-width: 0; }
.principle-body h3 { font-size: 1.5rem; font-weight: 500; line-height: 1.15; }
@media (min-width: 1024px) { .principle-body h3 { font-size: 1.75rem; } }
.principle-body p:not(.pull) { margin-top: 12px; font-size: 1rem; color: #2e2e2e; }
.pull { margin-top: 16px; padding-left: 16px; border-left: 1px solid var(--ink); font-family: var(--serif); font-style: italic; font-size: 1.15rem; line-height: 1.5; color: var(--graphite); }

/* Footer: email, LinkedIn, copyright */
.site-footer { margin-top: 96px; border-top: 1px solid var(--line); }
main.is-home + .site-footer { margin-top: 0; }
.footer-inner { padding-top: 40px; padding-bottom: 32px; display: flex; flex-direction: column; gap: 40px; }
.footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 32px; }
@media (max-width: 600px) { .footer-links { grid-template-columns: minmax(0, 1fr); } }
.footer-label { font-size: 12px; line-height: 1.5; color: var(--graphite); }
.footer-value { margin-top: 6px; font-family: var(--serif); font-size: clamp(1.25rem, 1rem + 0.8vw, 1.625rem); line-height: 1.2; overflow-wrap: anywhere; }
.foot-link { text-decoration: none; }
.foot-link:hover { color: var(--link-on); }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 20px; font-size: 12px; color: var(--graphite); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .nav, .skip, .actions { display: none; } a { text-decoration: none; } }

/* Articles */
.prose .h1 { max-width: 18ch; }
.prose-body { margin-top: 40px; padding-top: 36px; border-top: 1px solid var(--line); }
.prose-body > :not(.figures) { max-width: 48rem; }
.prose-body > * + * { margin-top: 1.25em; }
.prose-body p { font-size: 1.25rem; line-height: 1.65; }
.prose-body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; padding: 0.1em 0.35em; background: var(--mist); border: 1px solid var(--line); }
.prose-body .h2 { font-size: 1.75rem; margin-top: 2em; }
.prose-body ul { padding-left: 1.2em; list-style: disc; font-size: 1.25rem; line-height: 1.65; }
.figures { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .figures-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .figures-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.figure { margin: 0; min-width: 0; }
.figure-link { display: block; }
.figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.figure figcaption { margin-top: 10px; font-size: 13px; line-height: 1.5; color: var(--graphite); }
.prose-body > .figures, .prose-body > .figures + * { margin-top: 2em; }
.prose-body .figures-1 .figure { max-width: 20rem; }
.case-shots { margin-top: 24px; display: flex; flex-direction: column; gap: 32px; }
.figure-plain img { border: 0; }
