/* ============================================================
   STYLE — change colours and fonts here.
   Direction: restrained, gallery-like (white / black, lots of space,
   full-bleed images, one clean sans-serif).
   ============================================================ */
:root {
  --paper: #ffffff;
  --paper-2: #f3f3f2;         /* image backgrounds, placeholders */
  --ink: #111111;
  --muted: #8b8b8b;
  --rule: #e7e7e5;
  /* Futura family: real Futura where installed (most Macs), otherwise Jost, a free Futura-style web font */
  --font: "Futura PT", "Futura", "Jost", "Century Gothic", sans-serif;
  --max: 1600px;
  --gutter: clamp(16px, 3.2vw, 56px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --head-h: 64px;
}
/* Always light: the site stays white even when a visitor's device is in dark mode. */
:root { color-scheme: light; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 15px/1.65 var(--font); letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  display: flex; flex-direction: column; min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
main { flex: 1; outline: none; }
h1, h2, h3 { font-weight: 400; margin: 0; letter-spacing: -0.02em; line-height: 1.08; }
::selection { background: var(--ink); color: var(--paper); }

.label { font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------------- Header ---------------- */
.site-header { position: sticky; top: 0; z-index: 30; background: var(--paper); transition: box-shadow .3s; }
.site-header.scrolled { box-shadow: 0 1px 0 var(--rule); }
.bar {
  max-width: var(--max); margin: 0 auto; padding: 20px var(--gutter) 16px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 32px;
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-logo { height: 40px; width: auto; margin: -4px 0 -4px -4px; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 15px; font-weight: 500; letter-spacing: .01em; }
.brand-title { font-size: 12px; color: var(--muted); margin-top: 1px; }

.nav { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; min-width: 0; }
.groups, .tabs { display: flex; gap: 26px; justify-content: flex-end; }
.groups a, .tabs a { position: relative; white-space: nowrap; transition: color .25s var(--ease); }
.groups a { font-size: 13px; font-weight: 500; color: var(--muted); }
.groups a:hover, .groups a[aria-selected="true"] { color: var(--ink); }
.groups a.ext::after { content: "↗"; margin-left: 3px; font-size: 11px; }
.tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; gap: 22px; }
.tabs::-webkit-scrollbar, .groups::-webkit-scrollbar { display: none; }
.tabs a { font-size: 12px; color: var(--muted); padding-bottom: 4px; }
.tabs a .n { font-variant-numeric: tabular-nums; margin-right: 6px; opacity: .6; }
.tabs a:hover { color: var(--ink); }
.tabs a::after, .groups a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.groups a.ext::after { content: "↗"; position: static; height: auto; background: none; transform: none; }
.tabs a[aria-selected="true"] { color: var(--ink); }
.tabs a[aria-selected="true"]::after, .groups a[aria-selected="true"]::after { transform: scaleX(1); }
.tabs:empty { display: none; }

@media (max-width: 760px) {
  .bar { flex-direction: column; gap: 14px; padding-top: 16px; padding-bottom: 12px; }
  .nav { align-items: stretch; width: 100%; }
  .groups { justify-content: flex-start; gap: 13px; overflow-x: auto; }
  .groups a { font-size: 12.5px; }
  .tabs { justify-content: flex-start; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
}

/* ---------------- Page transitions ---------------- */
.page { animation: pageIn .7s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
img.reveal { opacity: 0; transition: opacity .9s var(--ease); }
img.reveal.loaded { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .page { animation: none; } img.reveal { opacity: 1; transition: none; }
  * { transition-duration: 0s !important; }
}

/* ---------------- Placeholder for missing images ---------------- */
.ph {
  width: 100%; height: 100%; min-height: 200px; display: flex; align-items: flex-end; justify-content: flex-start;
  padding: 16px 18px; color: var(--muted); font-size: 12px; letter-spacing: .02em; background: var(--paper-2);
}
figure .ph { aspect-ratio: 3 / 2; min-height: 0; }

/* ---------------- Full-bleed hero (home + project) ---------------- */
.hero-img { position: relative; width: 100%; height: calc(100vh - var(--head-h) - 40px); min-height: 380px; max-height: 1100px; overflow: hidden; background: var(--paper-2); margin: 0; }
.hero-img img, .hero-img .ph { width: 100%; height: 100%; object-fit: cover; }
.hero-img img { transform: scale(1.03); transition: transform 2.4s var(--ease), opacity 1.2s var(--ease); }
.hero-img img.loaded { transform: none; }
.hero-img .hero-video { display: block; width: 100%; height: 100%; object-fit: cover; }
a.hero-img::after { content: ""; position: absolute; inset: auto 0 0 0; height: 140px; background: linear-gradient(transparent, rgba(0,0,0,.38)); pointer-events: none; }
.hero-cap {
  position: absolute; z-index: 1; left: var(--gutter); bottom: 22px; color: #fff; font-size: 13px;
  text-shadow: 0 1px 12px rgba(0,0,0,.35); display: flex; gap: 14px; align-items: baseline;
}
.hero-cap span { opacity: .8; }
@media (max-width: 760px) { .hero-img { height: 62vh; min-height: 300px; } }

/* ---------------- Home ---------------- */
.statement { display: grid; grid-template-columns: 1fr 2fr; gap: var(--gutter); padding: clamp(72px, 11vw, 180px) 0 clamp(64px, 9vw, 150px); }
.statement p { margin: 0; font-size: clamp(19px, 1.85vw, 27px); line-height: 1.38; font-weight: 300; letter-spacing: -0.01em; max-width: 36ch; }
/* Logo sits just left of the statement and matches the paragraph's height */
.statement .st-text { position: relative; }
.statement .st-logo { position: absolute; top: -26%; height: 150%; width: auto; right: calc(100% + clamp(14px, 1.6vw, 26px)); }
.statement .more { margin-top: 36px; display: flex; gap: 28px; font-size: 13px; }
.link-u { border-bottom: 1px solid currentColor; padding-bottom: 2px; transition: opacity .25s; }
.link-u:hover { opacity: .55; }
@media (max-width: 760px) {
  .statement { grid-template-columns: 1fr; gap: 16px; }
  .statement .st-logo { position: static; display: block; height: 72px; margin-bottom: 20px; }
}

.index-group { padding-bottom: clamp(64px, 8vw, 120px); }
.index-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--ink); padding-bottom: 14px; }
.index-head h2 { font-size: clamp(22px, 2vw, 28px); }
.view-toggle { display: flex; gap: 18px; font-size: 12px; }
.view-toggle button { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; }
.view-toggle button[aria-pressed="true"] { color: var(--ink); }

/* list view */
.plist { list-style: none; margin: 0; padding: 0; }
.plist a {
  display: grid; grid-template-columns: 56px minmax(0, 2.2fr) minmax(0, 1.6fr) minmax(0, 1.3fr) 70px;
  gap: 20px; align-items: baseline; padding: 20px 0; border-bottom: 1px solid var(--rule);
  transition: color .3s var(--ease), padding .4s var(--ease);
}
.plist .t { font-size: clamp(18px, 1.6vw, 24px); letter-spacing: -0.015em; }
.plist .n, .plist .c, .plist .y { font-size: 13px; color: var(--muted); }
.plist .y { text-align: right; font-variant-numeric: tabular-nums; }
.plist .thumb { display: none; }
.plist:hover a { color: var(--muted); }
.plist:hover a:hover { color: var(--ink); padding-left: 10px; }
@media (max-width: 760px) {
  .plist a { grid-template-columns: 96px minmax(0, 1fr); gap: 2px 16px; padding: 16px 0; align-items: start; grid-auto-rows: min-content; }
  .plist .t { line-height: 1.2; }
  .plist .thumb { display: block; grid-row: span 3; aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper-2); }
  .plist .thumb img, .plist .thumb .ph { width: 100%; height: 100%; object-fit: cover; min-height: 0; padding: 0; }
  .plist .n, .plist .loc { display: none; }
  .plist .y { text-align: left; }
}

/* floating preview that follows the cursor on list hover */
.preview {
  /* small circle — change width to make it bigger or smaller */
  position: fixed; z-index: 25; width: 140px; aspect-ratio: 1 / 1; border-radius: 50%; pointer-events: none; overflow: hidden;
  background: var(--paper-2); opacity: 0; transform: translate(20px, -50%) scale(.85);
  transition: opacity .3s var(--ease), transform .4s var(--ease);
}
.preview.on { opacity: 1; transform: translate(20px, -50%) scale(1); }
.preview img, .preview .ph { width: 100%; height: 100%; object-fit: cover; min-height: 0; }
@media (hover: none), (max-width: 760px) { .preview { display: none; } }

/* grid view */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: clamp(28px, 3vw, 48px) var(--gutter); padding-top: 32px; }
.pgrid .media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper-2); }
.pgrid .media img, .pgrid .media .ph { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.pgrid a:hover .media img { transform: scale(1.025); }
.pgrid .meta { display: flex; justify-content: space-between; gap: 16px; margin-top: 14px; font-size: 14px; }
.pgrid .meta span { color: var(--muted); }

/* ---------------- Project page ---------------- */
.p-intro { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--gutter); padding: clamp(48px, 7vw, 110px) 0 clamp(40px, 6vw, 90px); }
.p-intro h1 { font-size: clamp(38px, 5.4vw, 84px); font-weight: 400; letter-spacing: -0.035em; }
.p-intro .subtitle { color: var(--muted); font-size: clamp(16px, 1.3vw, 19px); margin: 18px 0 0; max-width: 46ch; }
.p-intro .draft { margin-top: 22px; }
.facts dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; border-top: 1px solid var(--ink); padding-top: 18px; }
.facts dt { margin-bottom: 4px; }
.facts dd { margin: 0; font-size: 14px; }
.p-summary { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--gutter); padding-bottom: clamp(48px, 7vw, 110px); }
.p-summary p { grid-column: 2; margin: 0; font-size: clamp(18px, 1.6vw, 23px); line-height: 1.45; font-weight: 300; letter-spacing: -0.012em; }
@media (max-width: 860px) {
  .p-intro, .p-summary { grid-template-columns: 1fr; }
  .p-summary p { grid-column: 1; }
}

.section { padding: clamp(40px, 6vw, 90px) 0 0; }
.section .txt-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--gutter); margin-bottom: clamp(28px, 4vw, 56px); }
.section .txt-row .label { padding-top: 6px; }
.section .txt p { margin: 0 0 14px; max-width: 58ch; }
/* Uniform gallery: every project image sits in the same 3:2 frame, two per row.
   Photos/renders fill the frame; drawings (class "contain") fit inside it uncropped.
   Click any image for the full, uncropped version. */
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 1.8vw, 28px); }
.gallery figure { margin: 0; min-width: 0; }
.gallery figure img, .gallery figure .ph { width: 100%; aspect-ratio: 3 / 2; height: auto; object-fit: cover; cursor: zoom-in; background: var(--paper-2); display: block; }
.gallery figure img.contain { object-fit: contain; background: #fff; padding: 2%; box-shadow: inset 0 0 0 1px var(--rule); }
/* embedded film (YouTube) — always 16:9, full content width */
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.gallery figcaption { font-size: 12px; color: var(--muted); margin-top: 10px; }
@media (max-width: 860px) { .section .txt-row { grid-template-columns: 1fr; gap: 10px; } }
@media (max-width: 560px) { .gallery { grid-template-columns: 1fr; } }

.next-proj { display: block; margin-top: clamp(80px, 10vw, 160px); border-top: 1px solid var(--rule); }
.next-proj .row { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 28px 0 22px; }
.next-proj .t { font-size: clamp(28px, 4vw, 60px); letter-spacing: -0.03em; transition: opacity .3s; }
.next-proj:hover .t { opacity: .55; }
.next-proj .img { height: clamp(200px, 32vw, 460px); overflow: hidden; background: var(--paper-2); }
.next-proj .img img, .next-proj .img .ph { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease); }
.next-proj:hover .img img { transform: scale(1.02); }

/* ---------------- Resume ---------------- */
.cv { padding: clamp(56px, 8vw, 130px) 0 40px; }
.cv-head { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--gutter); padding-bottom: clamp(40px, 5vw, 72px); }
.cv-head h1 { font-size: clamp(38px, 5.4vw, 84px); letter-spacing: -0.035em; }
.cv-head .contact { color: var(--muted); font-size: 14px; margin-top: 16px; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.cv-actions { display: flex; gap: 28px; align-items: flex-end; font-size: 13px; }
.cv-actions button { background: none; border: 0; border-bottom: 1px solid currentColor; padding: 0 0 2px; font: inherit; color: inherit; cursor: pointer; }
.cv-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--gutter); padding: 30px 0; border-top: 1px solid var(--rule); }
.cv-row > h2 { padding-top: 4px; }
.cv-item + .cv-item { margin-top: 26px; }
.cv-item h3 { font-size: 17px; letter-spacing: -0.01em; }
.cv-item .org, .cv-item .dates { color: var(--muted); font-size: 14px; }
.cv-item ul { margin: 10px 0 0; padding-left: 16px; }
.cv-item p { margin: 8px 0 0; }
.skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.skills h3 { font-size: 14px; margin-bottom: 4px; font-weight: 500; }
.skills p { margin: 0; color: var(--muted); font-size: 14px; }
@media (max-width: 860px) { .cv-head, .cv-row { grid-template-columns: 1fr; gap: 12px; } }

/* ---------------- Footer ---------------- */
.site-footer {
  max-width: var(--max); width: 100%; margin: clamp(60px, 8vw, 120px) auto 0; padding: 28px var(--gutter) 36px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 12px;
  border-top: 1px solid var(--rule);
}
.footer-links { display: flex; gap: 22px; }
.footer-links a:hover { color: var(--ink); }

/* ---------------- Lightbox ---------------- */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(8,8,8,.97); display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; animation: pageIn .35s var(--ease); }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 56px 0; }
.lightbox img { max-height: calc(100vh - 150px); width: auto; object-fit: contain; }
.lightbox figcaption { color: #9a9a9a; font-size: 12px; text-align: center; padding: 0 12px; }
.lightbox button { background: none; border: 0; color: #fff; font: 300 28px/1 var(--font); cursor: pointer; height: 100%; opacity: .7; }
.lightbox button:hover { opacity: 1; }
.lightbox .lb-close { position: absolute; top: 14px; right: 18px; height: auto; font-size: 30px; }
@media (max-width: 560px) { .lightbox { grid-template-columns: 36px 1fr 36px; } }

/* ---------------- Print (Save resume as PDF) ---------------- */
@media print {
  :root { --paper: #fff; --ink: #000; --muted: #555; --rule: #ddd; }
  .site-header, .site-footer, .no-print { display: none !important; }
  .cv { padding-top: 0; } .cv-row { break-inside: avoid; padding: 14px 0; }
  body { font-size: 10.5pt; }
}
