/* Colours and fonts: change them here and the whole site follows. */
:root {
  --paper: #fef8ec;        /* page background */
  --ink: #3a2a21;          /* text and line colour */
  --ink-soft: #7a6a5c;     /* secondary text */
  --band: #584738;         /* the dark strips (mahogany) */
  --band-text: #f1eada;    /* text on the dark strips (vanilla) */
  --gold: #b59e7d;         /* button (tobacco) */
  --line: rgba(58, 42, 33, 0.18);
  --band-line: rgba(241, 234, 218, 0.2);

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "DM Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --pad: clamp(18px, 4vw, 56px);
  --max: 1280px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 300; margin: 0; letter-spacing: -0.012em; }
h1 em, h2 em { font-style: italic; }
p { margin: 0; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.caps { font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; }
.center { text-align: center; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---- Header ---- */
.site-header {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 26px var(--pad) 10px;
}
.site-header nav { display: flex; gap: 26px; }
.site-header .nav-right { justify-content: flex-end; }
.site-header nav a { padding: 6px 0; border-bottom: 1px solid transparent; }
.site-header nav a:hover { border-bottom-color: currentColor; }
.brand { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 28px; line-height: 1; white-space: nowrap; text-transform: none; letter-spacing: 0; }
.brand img { height: 46px; width: auto; }

/* ---- Section headings with the small ornament ---- */
.title { font-size: clamp(28px, 3vw, 36px); font-style: italic; text-align: center; }
.ornament { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 14px 0 0; }
.ornament::before, .ornament::after { content: ""; width: 34px; height: 1px; background: currentColor; opacity: 0.45; }
.ornament svg { width: 20px; height: 20px; }

/* ---- Hero ---- */
.hero { padding-bottom: clamp(56px, 7vw, 90px); text-align: center; }
.hero-art { max-width: 1240px; margin: 14px auto 0; padding: 0 var(--pad); }
.hero-art img { width: 100%; height: auto; max-height: 62vh; object-fit: contain; }
.hero .wrap > .caps { margin-top: clamp(14px, 2vw, 26px); }

/* slideshow of project drawings */
.slider-view { overflow: hidden; }
.slider-track { display: flex; transition: transform 0.9s cubic-bezier(0.45, 0, 0.2, 1); will-change: transform; }
.slide { flex: 0 0 100%; aspect-ratio: 2 / 1; max-height: 62vh; display: block; cursor: pointer; }
.hero-art .slide img { width: 100%; height: 100%; max-height: none; object-fit: contain; }
.slider-bar { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 14px; color: var(--ink-soft); }
.slider-caption { min-width: 22ch; white-space: pre; }
.slider-caption:hover { color: var(--ink); }
.slider-arrow { font: inherit; font-size: 15px; letter-spacing: 0; color: var(--ink); background: none; cursor: pointer; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; padding: 0 0 1px; transition: border-color .15s; }
.slider-arrow:hover { border-color: var(--ink); }
@keyframes flash { 0%, 55% { background: rgba(181, 158, 125, 0.28); } 100% { background: transparent; } }
.card.flash { animation: flash 2s ease-out; }
.hero h1 { font-size: clamp(32px, 4.2vw, 54px); line-height: 1.08; margin: 12px auto 0; max-width: 22ch; }
.hero-sub { margin: 12px auto 0; max-width: 60ch; }
.btn {
  display: inline-flex; align-items: center; gap: 14px; margin-top: 28px;
  padding: 7px 8px 7px 22px; border-radius: 999px;
  background: linear-gradient(180deg, #c3ad8c, #a48c69); border: 1px solid #8f7755;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 1px 2px rgba(58,42,33,.25);
  color: var(--ink); transition: filter .2s;
}
.btn:hover { filter: brightness(1.06); }
.btn .arrow { width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(58,42,33,.55); display: grid; place-items: center; font-size: 13px; letter-spacing: 0; }

/* ---- Dark bands (about, contact) ---- */
.band { background: var(--band); color: var(--band-text); text-align: center; padding: clamp(60px, 8vw, 100px) 0 0; }
.band-text { max-width: 68ch; margin: 34px auto 0; font-size: 15.5px; }
.band-text p + p { margin-top: 0.9em; }
.portrait { width: clamp(220px, 26vw, 330px); aspect-ratio: 10 / 13; border-radius: 50%; overflow: hidden; outline: 1px solid var(--band-line); outline-offset: 8px; margin: 8px; }
/* with a portrait: photo on the left, text on the right */
.about-split { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: clamp(36px, 7vw, 110px); max-width: 1120px; text-align: left; }
.about-split .title { text-align: left; font-size: clamp(34px, 3.8vw, 48px); }
.about-split .ornament { justify-content: flex-start; }
.about-split .ornament::before { display: none; }
.about-split .band-text { margin: 30px 0 0; max-width: 58ch; font-size: 17px; line-height: 1.65; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.highlights {
  display: flex; flex-wrap: wrap; justify-content: space-around; gap: 14px 40px;
  margin-top: clamp(44px, 6vw, 70px); padding: clamp(30px, 4vw, 48px) var(--pad);
  border-top: 1px solid var(--band-line);
  font-family: var(--serif); font-size: clamp(20px, 2.2vw, 27px);
}
.band-pad { padding-bottom: clamp(60px, 8vw, 100px); }

/* ---- Projects ---- */
.projects { padding: clamp(60px, 8vw, 100px) 0 clamp(50px, 7vw, 90px); }
.filters { margin-top: 38px; display: grid; gap: 12px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.filter-row h3 { font-family: var(--sans); font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); margin-right: 8px; }
.chip {
  font: inherit; font-size: 13px; color: var(--ink); cursor: pointer;
  background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.grid-clip { overflow: hidden; margin-top: clamp(30px, 4vw, 54px); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 -1px -1px; }
.card {
  display: flex; flex-direction: column;
  padding: 34px clamp(18px, 3vw, 42px) 38px;
  border-left: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.card[hidden] { display: none; }
.card-img { aspect-ratio: 2 / 1; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.card:hover .card-img img { transform: scale(1.03); }
.card-head { display: flex; align-items: center; gap: 16px; margin-top: 26px; }
.num { flex: none; width: 19px; height: 19px; border: 1px solid var(--ink); transform: rotate(45deg); display: grid; place-items: center; margin-left: 4px; }
.num span { transform: rotate(-45deg); font-size: 9.5px; font-weight: 500; }
.card h3 { font-size: clamp(22px, 2vw, 26px); line-height: 1.1; }
.card:hover h3 { font-style: italic; }
.card .desc { margin-top: 14px; }
.card-facts { margin-top: auto; padding-top: 26px; }
.card-facts p { padding: 10px 0; border-top: 1px solid var(--line); }
.empty { padding: 50px 0; text-align: center; color: var(--ink-soft); }

/* ---- Further projects list ---- */
.more-band { padding: clamp(46px, 6vw, 72px) 0 clamp(50px, 6vw, 76px); }
.more { max-width: 860px; margin: clamp(28px, 4vw, 40px) auto 0; text-align: left; }
.more-row { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 8px 24px; align-items: baseline; padding: 13px 0; border-top: 1px solid var(--band-line); }
.more-row:last-child { border-bottom: 1px solid var(--band-line); }
.more-title { font-family: var(--serif); font-size: 21px; font-weight: 300; }
.more-value { text-align: right; }

/* ---- Background (experience, education) ---- */
.background { padding: clamp(50px, 7vw, 90px) 0 clamp(60px, 8vw, 100px); }
.band + .background, .projects + .background { border-top: 0; }
.bg-col { padding: 30px clamp(18px, 3vw, 42px) 34px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.bg-col h3 { font-size: 25px; margin-bottom: 18px; }
.bg-item { padding: 11px 0; border-top: 1px solid var(--line); }
.bg-main { font-weight: 500; }
.bg-sub { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.bg-toggle { all: unset; box-sizing: border-box; display: flex; width: 100%; align-items: flex-start; gap: 14px; cursor: pointer; }
.bg-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.bg-text { flex: 1; min-width: 0; }
.has-details { position: relative; z-index: 0; }
.has-details::before { content: ""; position: absolute; z-index: -1; inset: 0 -12px; background: rgba(181, 158, 125, 0.16); opacity: 0; transition: opacity .2s; }
.has-details:hover::before, .has-details.open::before { opacity: 1; }
.has-details:hover .bg-main { text-decoration: underline; text-decoration-color: rgba(58, 42, 33, .35); text-underline-offset: 3px; }
.bg-plus { flex: none; position: relative; width: 11px; height: 11px; margin-top: 6px; opacity: .55; transition: transform .3s, opacity .2s; }
.bg-plus::before, .bg-plus::after { content: ""; position: absolute; background: currentColor; left: 0; right: 0; top: 5px; height: 1px; }
.bg-plus::after { transform: rotate(90deg); transition: transform .3s; }
.has-details:hover .bg-plus { opacity: 1; }
.open .bg-plus::after { transform: rotate(0deg); }
.bg-details { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s ease; }
.bg-details > div { overflow: hidden; }
.open .bg-details { grid-template-rows: 1fr; }
.bg-details ul { margin: 12px 0 2px; padding: 0 0 0 16px; font-size: 13.5px; line-height: 1.55; color: var(--ink); }
.bg-details li + li { margin-top: 6px; }
.bg-note { margin-top: 10px; color: var(--ink-soft); font-size: 12.5px; }

/* ---- Contact / footer ---- */
.contact .note { margin: 30px auto 0; max-width: 46ch; }
.contact .email { display: inline-block; margin-top: 26px; font-family: var(--serif); font-weight: 300; font-size: clamp(26px, 4vw, 50px); line-height: 1.15; border-bottom: 1px solid var(--band-line); overflow-wrap: anywhere; }
.contact .email:hover { border-bottom-color: var(--band-text); }
.contact .phone { display: inline-block; margin-top: 14px; font-family: var(--serif); font-weight: 300; font-size: clamp(18px, 2vw, 24px); }
.contact .phone:hover { text-decoration: underline; text-underline-offset: 4px; }
.contact-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 32px; margin-top: 28px; }
.contact-meta a { display: inline-flex; align-items: center; gap: 8px; }
.contact-meta a:hover span { text-decoration: underline; text-underline-offset: 4px; }
.link-icon { width: 16px; height: 16px; flex: none; opacity: .9; transition: opacity .2s, transform .2s; }
.contact-meta a:hover .link-icon { opacity: 1; transform: translateY(-1px); }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: clamp(54px, 7vw, 90px); padding: 20px 0 26px; border-top: 1px solid var(--band-line); opacity: 0.8; }

/* ---- Project page ---- */
.p-head { text-align: center; padding: clamp(30px, 5vw, 64px) 0 clamp(20px, 3vw, 36px); }
.p-head h1 { font-size: clamp(38px, 6vw, 76px); line-height: 1.02; margin-top: 12px; }
.p-head .lead { font-family: var(--serif); font-style: italic; font-size: clamp(19px, 2vw, 24px); line-height: 1.3; max-width: 44ch; margin: 16px auto 0; }
.p-cover img { width: 100%; height: auto; max-height: 76vh; object-fit: contain; }
.p-body { display: grid; grid-template-columns: 1fr 2fr; gap: clamp(28px, 5vw, 80px); padding: clamp(40px, 6vw, 80px) 0; border-top: 1px solid var(--line); margin-top: clamp(24px, 4vw, 50px); }
.facts { margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.facts div:first-child { border-top: 1px solid var(--line); }
.facts dt { color: var(--ink-soft); padding-top: 3px; }
.facts dd { margin: 0; text-align: right; }
.p-text p { max-width: 62ch; font-size: 16px; line-height: 1.65; }
.p-text p + p { margin-top: 1em; }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.gallery figure { margin: 0; }
.gallery figure:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
.gallery { align-items: start; }
.gallery .frame { background: #fff; border: 1px solid var(--line); cursor: zoom-in; overflow: hidden; }
.gallery img { width: 100%; height: auto; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.gallery .frame:hover img { transform: scale(1.02); }
/* enlarged image view */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(24, 18, 14, 0.96); color: var(--band-text); }
.lightbox[hidden] { display: none; }
.lb-stage { position: absolute; inset: 14px 14px 44px; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
.lb-stage img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; background: #fff; transform-origin: 0 0; cursor: zoom-in; user-select: none; -webkit-user-drag: none; }
.is-zoomed .lb-stage img { cursor: grab; }
.is-zoomed .lb-stage img:active { cursor: grabbing; }
.lb-cap { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; margin: 0; opacity: .85; }
.lb-hint { position: absolute; right: 22px; bottom: 14px; margin: 0; opacity: .45; }
.is-zoomed .lb-hint { opacity: 0; }
.lb-arrow, .lb-close { position: absolute; font: inherit; font-size: 20px; color: inherit; background: rgba(24, 18, 14, 0.7); border: 1px solid var(--band-line); border-radius: 50%; width: 44px; height: 44px; cursor: pointer; padding: 0 0 2px; z-index: 2; transition: border-color .15s, opacity .2s; }
.lb-arrow:hover, .lb-close:hover { border-color: var(--band-text); }
.lb-prev { left: 22px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 22px; top: 50%; transform: translateY(-50%); }
.lb-close { top: 22px; right: 22px; }
.is-zoomed .lb-arrow { opacity: 0; pointer-events: none; }
@media (max-width: 760px) {
  .lb-stage { inset: 56px 0 48px; }
  .lb-prev, .lb-next { top: auto; bottom: 6px; transform: none; width: 38px; height: 38px; }
  .lb-close { top: 8px; right: 8px; }
  .lb-hint { display: none; }
}
.gallery-head { grid-column: 1 / -1; font-size: clamp(26px, 2.8vw, 34px); font-style: italic; text-align: center; padding: clamp(28px, 4vw, 52px) 0 8px; border-top: 1px solid var(--line); margin-top: clamp(20px, 3vw, 36px); }
.gallery figcaption { font-size: 12.5px; color: var(--ink-soft); padding-top: 8px; }
.p-next { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin: clamp(50px, 7vw, 90px) 0; padding: 26px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.p-next a.next { text-align: right; }
.p-next .next span { display: block; font-family: var(--serif); font-weight: 300; font-size: clamp(30px, 4.6vw, 56px); line-height: 1.05; margin-top: 6px; }
.p-next a.next:hover span { font-style: italic; }
.p-next a.back:hover { text-decoration: underline; text-underline-offset: 4px; }
.notfound { padding: 110px 0; text-align: center; }
.notfound h1 { font-size: 48px; margin-bottom: 16px; }
.notfound a { text-decoration: underline; text-underline-offset: 4px; }

/* ---- Opening animation ---- */
.intro-on, .intro-on body { overflow: hidden; }
.intro { position: fixed; inset: 0; z-index: 100; background: var(--paper); display: grid; place-content: center; justify-items: center; gap: 22px; padding: 24px;
  transition: transform 1s cubic-bezier(.76, 0, .24, 1), opacity .5s ease .5s; }
.intro-art { width: min(1000px, 92vw); }
.intro-art svg { display: block; width: 100%; height: auto; }
.intro .mask-strokes path, .intro .sketch-lines path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.intro-draw .mask-strokes path, .intro-draw .sketch-lines path { animation: intro-pen var(--t, .5s) cubic-bezier(.45, .05, .35, 1) forwards; animation-delay: calc(var(--d, 0ms) + 150ms); }
@keyframes intro-pen { to { stroke-dashoffset: 0; } }
.intro .mask-fill { transition: fill 1.1s ease-in-out; }
.intro-settle .mask-fill { fill: #fff; }
.intro .intro-full { opacity: 0; transition: opacity 1.2s ease-in-out; }
.intro-settle .intro-full { opacity: 1; }
.intro .sketch-lines { transition: opacity 1.4s ease-in-out .2s; }
.intro-settle .sketch-lines { opacity: 0; }
.intro-name { margin: 0; font-family: var(--serif); font-style: italic; font-size: clamp(22px, 2.6vw, 32px); color: var(--ink); opacity: 0; transform: translateY(6px); transition: opacity .8s ease, transform .8s ease; }
.intro-draw .intro-name { opacity: 1; transform: none; transition-delay: .9s; }
.intro-leave { transform: translateY(-100%); opacity: 0; pointer-events: none; }

/* ---- Smaller screens ---- */
@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .site-header { grid-template-columns: auto 1fr; }
  .site-header .nav-left { display: none; }
  .site-header nav { gap: 16px; }
  .brand { font-size: 23px; }
  .p-body { grid-template-columns: 1fr; }
  .about-split { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 34px; }
  .about-split .title { text-align: center; }
  .about-split .ornament { justify-content: center; }
  .about-split .ornament::before { display: block; }
  .about-split .band-text { margin-left: auto; margin-right: auto; font-size: 15.5px; }
  .gallery { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .grid { grid-template-columns: 1fr; }
  .card, .bg-col { padding-left: 0; padding-right: 0; margin-left: 1px; border-left: 0; }
  .more-row { grid-template-columns: 1fr auto; }
  .more-row .caps:not(.more-value) { grid-column: 1 / -1; grid-row: 2; }
  .highlights { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card-img img { transition: none; }
}
