/* Liam Cloete — portfolio. Blueprint system carried over from v2 (Jul–Aug 2026):
   blueprint paper #2c5182 + paper texture + drafting grid, brass accent, Satoshi + IBM Plex Mono
   (v2 also named Cabinet Grotesk, but its Fontshare link never served it, so the live site always rendered Satoshi). */
:root {
  --paper: #2c5182;
  --paper-deep: #22436f;
  --surface: rgba(53, 89, 138, 0.72);
  --ink: #f4f7fb;
  --muted: #d5e0ee;
  --blueprint: #cfdcec;
  --brass: #f0d493;
  --online: #62dc9b;
  --border: rgba(244, 247, 251, 0.26);
  --border-strong: rgba(244, 247, 251, 0.62);
  --display: "Satoshi", ui-sans-serif, system-ui, sans-serif;
  --sans: "Satoshi", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
  --gutter: clamp(16px, 3.2vw, 40px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 24px 48px -32px rgba(10, 26, 48, 0.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.015em; }
ul { padding: 0; list-style: none; }
::selection { background: var(--brass); color: var(--paper); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

/* Paper + drafting grid (fixed behind everything) */
.paper, .grid-lines { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.paper { background: url("paper.webp") center / cover; opacity: 0.9; mix-blend-mode: multiply; }
.grid-lines {
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.5;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 0%, transparent 85%);
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 0%, transparent 85%);
}
main, .bar, .foot { position: relative; z-index: 1; }
.bar { position: sticky; }

.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter); }
.meta {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.6;
  color: var(--blueprint);
}
.kicker { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brass); }
.dot { color: var(--brass); }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; z-index: 99; }
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* ---- Top bar ---- */
.bar {
  top: 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
}
.bar.scrolled { background: rgba(44, 81, 130, 0.92); border-bottom-color: var(--border); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 1px 24px -18px rgba(10, 26, 48, 0.6); }
.bar-inner { display: flex; align-items: center; gap: 1rem; min-height: 4rem; }
.bar-name { font-family: var(--display); font-weight: 700; font-size: 1.05rem; letter-spacing: -0.02em; text-decoration: none; white-space: nowrap; padding: 0.7rem 0; }
.bar-links { margin-left: auto; display: flex; align-items: center; }
.bar-links a {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; padding: 0.85rem 0.6rem;
  background: linear-gradient(currentColor, currentColor) no-repeat 0.6rem calc(100% - 0.6rem) / 0 1px;
  transition: color 0.3s, background-size 0.4s var(--ease);
}
.bar-links a:hover { color: var(--ink); background-size: calc(100% - 1.2rem) 1px; }
.bar-social { display: flex; gap: 0.5rem; margin-left: 0.6rem; }
.social { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); color: var(--muted); transition: color 0.3s, border-color 0.3s, transform 0.3s; }
.social:hover { color: var(--brass); border-color: var(--brass); transform: translateY(-2px); }
.social svg { width: 16px; height: 16px; }
@media (max-width: 760px) {
  .bar-social { display: none; }
  .bar-links a { padding: 0.9rem 0.45rem; letter-spacing: 0.08em; }
}

/* ---- Hero ---- */
.hero { padding-top: clamp(2rem, 6vw, 5.5rem); padding-bottom: clamp(2rem, 4vw, 3.25rem); }
.title-block { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.4rem 1.5rem; padding-bottom: 0.9rem; border-bottom: 1px solid var(--border); }
.title-block .live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--online); margin-right: 0.55rem; vertical-align: 0.1em; animation: ping 1.8s ease-out infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(98, 220, 155, 0.6); } 70%, 100% { box-shadow: 0 0 0 7px rgba(98, 220, 155, 0); } }
@media (max-width: 560px) { .title-block span:nth-child(2) { display: none; } }
.hero .kicker { display: block; margin-top: clamp(2rem, 5vw, 3.5rem); }
.hero-row { display: grid; gap: 1.75rem; }
.name {
  margin-top: 1.1rem;
  margin-left: -0.05em;
  font-family: var(--sans);
  font-weight: 900;
  font-size: clamp(3.5rem, 18vw, 11.5rem);
  line-height: 0.82;
  letter-spacing: -0.045em;
}
.name > span { display: block; }
.intro { max-width: 36rem; font-size: clamp(1.02rem, 1.3vw, 1.15rem); line-height: 1.7; color: var(--muted); }
@media (min-width: 1000px) {
  .hero-row { grid-template-columns: 1fr minmax(18rem, 25rem); align-items: end; }
  .intro { padding-bottom: 0.9rem; }
}

/* ---- Material ledger (signature) ---- */
.ledger-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-bottom: 0.8rem; }
.hint-touch { display: none; }
.ledger {
  display: flex;
  height: clamp(420px, 66vh, 720px);
  gap: 2px;
  margin: 0 auto;
  max-width: 1280px;
  padding: 0 var(--gutter);
}
.band {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  background: var(--paper-deep);
  color: #fff;
  text-decoration: none;
  transition: flex-grow 0.7s var(--ease);
  animation: rise 0.9s var(--ease) both;
  animation-delay: calc(var(--i) * 60ms + 150ms);
}
.band img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease), filter 0.6s; filter: saturate(0.85) brightness(0.92); }
.band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 40, 70, 0) 45%, rgba(20, 40, 70, 0.8)); pointer-events: none; }
.band-num { position: absolute; z-index: 2; top: 0.6rem; left: 0.6rem; font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.1em; color: var(--brass); background: rgba(34, 67, 111, 0.85); border: 1px solid var(--border); padding: 0.12rem 0.35rem 0.06rem; }
.band-mat {
  position: absolute; z-index: 2; left: 0.7rem; bottom: 0.8rem;
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase;
  white-space: nowrap; transition: opacity 0.3s;
}
.band-proj { position: absolute; z-index: 2; left: 1.1rem; right: 1.1rem; bottom: 1.1rem; display: grid; gap: 0.25rem; opacity: 0; transform: translateY(8px); transition: opacity 0.35s, transform 0.5s var(--ease); }
.band-proj b { font-family: var(--display); font-size: clamp(1.5rem, 2.3vw, 2.2rem); line-height: 1; font-weight: 800; letter-spacing: -0.02em; }
.band-proj span { font-size: 0.92rem; color: var(--muted); }

@media (hover: hover) and (min-width: 761px) {
  .ledger:hover .band, .ledger:focus-within .band { flex-grow: 0.7; }
  .ledger .band:hover, .ledger .band:focus-visible { flex-grow: 5.5; }
  .band:hover img, .band:focus-visible img { transform: scale(1.03); filter: none; }
  .band:hover .band-mat, .band:focus-visible .band-mat { opacity: 0; }
  .band:hover .band-proj, .band:focus-visible .band-proj { opacity: 1; transform: none; transition-delay: 0.18s; }
  .band:focus-visible { outline: 2px solid var(--brass); outline-offset: -2px; }
}
.ledger-dots { display: none; }
@media (hover: none), (max-width: 760px) {
  .hint-fine { display: none; }
  .hint-touch { display: inline; }
  .ledger {
    height: auto; gap: 10px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-left: var(--gutter);
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .ledger::-webkit-scrollbar { display: none; }
  .ledger::after { content: ""; flex: 0 0 1px; }
  .band { flex: 0 0 min(74vw, 330px); aspect-ratio: 3 / 4; scroll-snap-align: start; animation: none; }
  .band-mat { writing-mode: horizontal-tb; transform: none; top: 0.6rem; bottom: auto; left: auto; right: 0.6rem; background: rgba(34, 67, 111, 0.85); border: 1px solid var(--border); padding: 0.12rem 0.4rem 0.06rem; font-size: 0.6rem; }
  .band-proj { opacity: 1; transform: none; }
  .ledger-dots { display: flex; gap: 6px; justify-content: center; padding-top: 1rem; }
  .ledger-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--border-strong); transition: background 0.3s, width 0.3s; }
  .ledger-dots i.on { background: var(--brass); width: 18px; }
}
@keyframes rise { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ---- Section heads (drawing-sheet sections) ---- */
.sec-head { padding-top: clamp(4.5rem, 9vw, 7.5rem); margin-bottom: 2rem; }
.sec-line { display: flex; align-items: center; gap: 1.1rem; }
.sec-num { font-family: var(--mono); font-size: 0.875rem; color: var(--brass); }
.sec-head h2 { font-size: clamp(1.05rem, 1.6vw, 1.25rem); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.sec-rule { height: 1px; flex: 1; background: var(--border); }
.sec-head p { margin-top: 1rem; color: var(--muted); max-width: 34rem; font-size: 0.97rem; }

/* ---- Work grid ---- */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(2.25rem, 3.5vw, 3rem) clamp(1rem, 2vw, 1.75rem); }
.card { grid-column: span 12; text-decoration: none; display: grid; gap: 1rem; align-content: start; }
@media (min-width: 761px) {
  .c-4 { grid-column: span 4; } .c-5 { grid-column: span 5; } .c-7 { grid-column: span 7; } .c-8 { grid-column: span 8; }
  .c-4, .c-5 { padding-top: clamp(2rem, 6vw, 5rem); }
}
.card-img { position: relative; overflow: hidden; background: var(--paper-deep); aspect-ratio: 4 / 3; border: 1px solid var(--border); transition: box-shadow 0.5s, border-color 0.5s; }
.c-4 .card-img, .c-5 .card-img { aspect-ratio: 4 / 5; }
@media (max-width: 760px) { .c-4 .card-img, .c-5 .card-img { aspect-ratio: 4 / 3; } }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.card:hover .card-img { box-shadow: var(--shadow); border-color: var(--border-strong); }
.card:hover .card-img img { transform: scale(1.025); }
.card-txt { display: grid; gap: 0.45rem; max-width: 36rem; }
.card-txt .meta { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; align-items: center; }
.card-txt h3 { font-size: clamp(1.6rem, 2.6vw, 2.4rem); line-height: 1.02; font-weight: 800; }
.card-txt h3 { text-decoration: underline 2px transparent; text-underline-offset: 0.14em; transition: text-decoration-color 0.3s; }
.card:hover h3 { text-decoration-color: var(--brass); }
.card-txt p:last-child { color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--online); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--online); }

.kind {
  position: absolute; z-index: 2; top: 0.6rem; left: 0.6rem;
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase;
  background: rgba(34, 67, 111, 0.85); color: var(--ink); border: 1px solid var(--border); padding: 0.18rem 0.45rem 0.12rem;
}

/* ---- Other work ---- */
.other { display: grid; grid-template-columns: minmax(110px, 0.6fr) 2fr; gap: clamp(1rem, 2.5vw, 2.25rem); padding: 1.4rem 0; border-bottom: 1px solid var(--border); align-items: start; }
.other-list .other:first-child { border-top: 1px solid var(--border); }
.o-img { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper-deep); border: 1px solid var(--border); }
.o-img img { width: 100%; height: 100%; object-fit: cover; }
.o-img .kind { top: 0.35rem; left: 0.35rem; }
.o-none { background: none; border: 0; aspect-ratio: auto; }
.other h3 { font-size: clamp(1.25rem, 1.9vw, 1.6rem); font-weight: 800; margin: 0.25rem 0 0.4rem; }
.other h3 span { font-family: var(--sans); font-weight: 400; color: var(--muted); font-size: 0.66em; margin-left: 0.35rem; letter-spacing: 0; }
.other p:last-child { max-width: 44rem; color: var(--muted); font-size: 0.97rem; }
@media (min-width: 900px) { .other { grid-template-columns: 220px 1fr; } }
@media (max-width: 899px) { .o-none { display: none; } .other:has(.o-none) { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
  .other { grid-template-columns: 1fr; gap: 0.8rem; }
  .o-img { aspect-ratio: 16 / 9; }
}

/* ---- About ---- */
.about-grid { display: grid; gap: 2.5rem; }
.about-lead p { font-size: clamp(1.12rem, 1.6vw, 1.35rem); line-height: 1.55; max-width: 38rem; }
.about-lead p + p { margin-top: 1.1rem; color: var(--muted); font-size: clamp(1rem, 1.3vw, 1.1rem); }
.col-h { padding-bottom: 0.6rem; border-bottom: 1px solid var(--border-strong); }
.col-h + .rows { margin-bottom: 2.2rem; }
.rows li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.rows .meta { padding-top: 0.2rem; }
.rows h3 { font-size: 1.08rem; font-weight: 700; }
.rows .org { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brass); margin-top: 0.2rem; }
.rows p:not(.org) { font-size: 0.93rem; margin-top: 0.4rem; color: var(--muted); }
@media (max-width: 480px) { .rows li { grid-template-columns: 1fr; gap: 0.3rem; } }
@media (min-width: 1000px) { .about-grid { grid-template-columns: 1fr 1fr; gap: 4rem; } }
.skills { display: grid; gap: 1px; margin-top: 3rem; border: 1px solid var(--border); background: var(--border); border-radius: 0.375rem; overflow: hidden; }
.skills > div { background: var(--paper); padding: 1.6rem; }
.skills h3 { color: var(--brass); padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.skills li { display: flex; gap: 0.6rem; align-items: baseline; padding: 0.6rem 0; border-bottom: 1px solid rgba(244, 247, 251, 0.12); font-size: 0.93rem; }
.skills li:last-child { border-bottom: 0; }
.skills li::before { content: "\25C6"; font-size: 0.45rem; color: var(--brass); transform: translateY(-0.15em); }
@media (min-width: 761px) { .skills { grid-template-columns: repeat(3, 1fr); } }

/* ---- Footer ---- */
.foot { margin-top: clamp(5rem, 10vw, 8rem); border-top: 1px solid var(--border); background: rgba(26, 52, 88, 0.55); padding-top: clamp(3rem, 7vw, 5.5rem); }
.foot-grid > * { min-width: 0; }
.foot-grid { display: grid; gap: 2.5rem; padding-bottom: clamp(3rem, 6vw, 4.5rem); }
.foot-cta { font-family: var(--sans); font-weight: 900; font-size: clamp(3rem, 14vw, 8.5rem); line-height: 0.86; letter-spacing: -0.045em; }
.foot-links li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; padding: 0.9rem 0; border-bottom: 1px solid var(--border); }
.foot-links li:first-child { border-top: 1px solid var(--border); }
.foot-links .meta { padding-top: 0.3rem; }
.foot-links a { text-decoration: none; font-size: clamp(1rem, 1.5vw, 1.2rem); display: inline-block; padding: 0.55rem 0; margin: -0.55rem 0; }
.foot-links a:hover { color: var(--brass); }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; padding-top: 1.1rem; padding-bottom: 1.5rem; border-top: 1px solid var(--border); }
@media (min-width: 1000px) { .foot-grid { grid-template-columns: 1.2fr 1fr; align-items: end; gap: 4rem; } }

/* ---- Project page ---- */
.p-head { padding-top: clamp(1.5rem, 4vw, 3rem); padding-bottom: clamp(1.5rem, 3vw, 2.5rem); display: grid; gap: 0.7rem; }
.p-head > * { min-width: 0; }
.back { text-decoration: none; width: max-content; padding: 0.8rem 0; margin-bottom: clamp(0.5rem, 3vw, 2rem); }
.back:hover { color: var(--brass); }
.p-title { font-family: var(--sans); font-weight: 900; font-size: clamp(2.3rem, 13vw, 8.5rem); line-height: 0.88; letter-spacing: -0.045em; hyphens: manual; }
.p-kicker { font-size: clamp(1.1rem, 1.9vw, 1.45rem); color: var(--muted); margin-top: 0.5rem; }
.p-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1px; margin-top: 1.25rem; border: 1px solid var(--border); background: var(--border); border-radius: 0.375rem; overflow: hidden; }
.p-meta div { background: var(--paper); padding: 0.85rem 1rem; }
.p-meta dd { font-size: 0.95rem; font-weight: 500; margin-top: 0.3rem; }
.p-meta .live { color: var(--online); }
.p-meta div:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 640px) { .p-meta { display: flex; } .p-meta div { flex: 1 1 0; } }
.p-cover { position: relative; max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter); }
.p-cover img { width: 100%; max-height: 84vh; object-fit: cover; background: var(--paper-deep); border: 1px solid var(--border); }
.p-cover .kind { left: calc(var(--gutter) + 0.6rem); }
.p-body { padding-top: clamp(2.5rem, 6vw, 4.5rem); }
.p-summary { font-family: var(--display); font-size: clamp(1.4rem, 2.7vw, 2.3rem); line-height: 1.2; font-weight: 500; letter-spacing: -0.015em; max-width: 52rem; padding-bottom: clamp(2rem, 5vw, 3.5rem); }
.p-cols { display: grid; gap: 2.5rem; }
.p-cols > * { min-width: 0; }
.txt { display: grid; gap: 0.5rem; padding: 1.3rem 0; border-top: 1px solid var(--border); }
.txt h2 { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); font-weight: 400; }
.txt p { max-width: 40rem; color: var(--muted); }
.p-specs { align-self: start; border: 1px solid var(--border); border-radius: 0.375rem; overflow: hidden; background: var(--surface); }
.p-specs h2 { padding: 0.9rem 1rem; border-bottom: 1px solid var(--border); }
.p-specs dl div { padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); }
.p-specs dl div:last-child { border-bottom: 0; }
.p-specs dd { font-size: 0.95rem; font-weight: 500; margin-top: 0.2rem; }
@media (min-width: 1000px) {
  .p-cols { grid-template-columns: 1fr 21rem; gap: 4.5rem; }
  .txt { grid-template-columns: 9.5rem 1fr; gap: 2rem; }
  .txt h2 { padding-top: 0.4rem; }
  .p-specs { position: sticky; top: 5.5rem; }
}
.gallery { display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(0.75rem, 1.6vw, 1.25rem); padding-top: clamp(3rem, 7vw, 5.5rem); }
.g { grid-column: span 6; position: relative; }
.g img { width: 100%; height: auto; background: var(--paper-deep); border: 1px solid var(--border); }
.g figcaption { font-size: 0.85rem; color: var(--muted); padding-top: 0.55rem; }
@media (min-width: 761px) {
  .g-half { grid-column: span 3; } .g-third { grid-column: span 2; }
  .g-half img, .g-third img { aspect-ratio: 4 / 5; object-fit: cover; }
  .g-land img { aspect-ratio: var(--ar, 1.5); }
  .g-wide img { max-height: none; }
}
.p-next { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; margin-top: clamp(4rem, 8vw, 6rem); border-top: 1px solid var(--border-strong); }
.p-next a { display: grid; gap: 0.35rem; padding: 1.4rem 0; text-decoration: none; }
.p-next .nx { text-align: right; }
.p-next b { font-family: var(--display); overflow-wrap: anywhere; font-size: clamp(1.15rem, 3.2vw, 2.6rem); line-height: 1.02; font-weight: 800; letter-spacing: -0.02em; }
.p-next a:hover b { color: var(--brass); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
