/* ==========================================================================
   Tim Morera — Portfolio
   Layout follows arsene.design, measured from a render of the live page:
     · page sits on light grey; white / dark rounded cards float on it
     · container ≈ 976px, centred
     · section headings centred, with a centred sub beneath
     · project cards = wide banners ≈ 2.55 : 1, own colour each,
       text one side, media bleeding off the other, alternating
     · case-study covers = book covers, 2-up, ratio 0.746
     · explorations = 4-across grid of 4:3 cards
   ========================================================================== */

/* ---------- 1. Fonts ---------------------------------------------------- */

@font-face { font-family:'General Sans'; src:url('../fonts/general-sans-400.woff2') format('woff2'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'General Sans'; src:url('../fonts/general-sans-500.woff2') format('woff2'); font-weight:500; font-style:normal; font-display:swap; }
@font-face { font-family:'General Sans'; src:url('../fonts/general-sans-600.woff2') format('woff2'); font-weight:600; font-style:normal; font-display:swap; }
@font-face { font-family:'General Sans'; src:url('../fonts/general-sans-700.woff2') format('woff2'); font-weight:700; font-style:normal; font-display:swap; }
@font-face { font-family:'Fragment Mono'; src:url('../fonts/fragment-mono-400.woff2') format('woff2'); font-weight:400; font-style:normal; font-display:swap; }

/* ---------- 2. Tokens --------------------------------------------------- */

:root {
  --page:    #f2f1ee;   /* the grey the cards sit on */
  --card:    #ffffff;
  --card-2:  #ebe9e4;
  --ink:     #14130f;
  --body:    #4f4c46;
  --muted:   #8c877e;
  --line:    #e4e0d8;
  --line-2:  #d5d0c6;
  --accent:  #f16a00;
  --accent-ink: #b34e00;
  --green:   #2f9e44;
  --dark:    #171612;

  /* Per-project card colours */
  --p-med:   #255b44;   /* mobile medical unit — the green cargo bike */
  --p-tool:  #201f1a;   /* powertool — charcoal */
  --p-buig:  radial-gradient(ellipse 70% 120% at 24% 50%, #6f7126 0%, #33340f 46%, #16160d 100%); /* buigbaar — their olive as a glow on near-black */
  --p-abri:  #354659;   /* bus shelter — slate, so the glass reads */
  --p-bench: #a26a3c;   /* lounge bench — warm timber */
  --p-epoxy: #14514f;   /* epoxy tray — deep resin teal */

  --font-sans:'General Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',system-ui,sans-serif;
  --font-mono:'Fragment Mono',ui-monospace,'SFMono-Regular',Menlo,Consolas,monospace;

  --text-xs:0.75rem;
  --text-sm:0.8125rem;
  --text-base:1rem;
  --text-md:1.0625rem;
  --text-lg:clamp(1.25rem,0.7vw + 1.1rem,1.5rem);
  --text-xl:clamp(1.6rem,1.1vw + 1.35rem,2rem);
  --text-2xl:clamp(1.9rem,1.8vw + 1.45rem,2.5rem);
  --text-3xl:clamp(2.1rem,2.2vw + 1.5rem,2.9rem);

  --s-1:0.25rem; --s-2:0.5rem;  --s-3:0.75rem; --s-4:1rem;
  --s-5:1.5rem;  --s-6:2rem;    --s-7:3rem;    --s-8:4rem;
  --s-9:5.5rem;  --s-10:7rem;

  --r-card:24px; --r-md:14px; --r-sm:8px;

  --shadow: 0 1px 2px rgba(20,19,15,.04), 0 10px 30px rgba(20,19,15,.06);
  --shadow-lift: 0 2px 6px rgba(20,19,15,.06), 0 18px 44px rgba(20,19,15,.10);
  --shadow-btn: 0 1px 2px rgba(20,19,15,.10), 0 4px 10px rgba(20,19,15,.10);
  --shadow-btn-lift: 0 2px 4px rgba(20,19,15,.12), 0 8px 18px rgba(20,19,15,.14);

  --ease: cubic-bezier(.22,.61,.36,1);
  --dur: 620ms;

  --frame: 976px;
}

/* ---------- 3. Reset ---------------------------------------------------- */

*,*::before,*::after { box-sizing:border-box; }
* { margin:0; }

html { -webkit-text-size-adjust:100%; scroll-behavior:smooth; scroll-padding-top:5.5rem; }

body {
  background: var(--page);
  color: var(--body);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,svg,video { display:block; max-width:100%; height:auto; }
button,input,textarea,select { font:inherit; color:inherit; }
button { cursor:pointer; background:none; border:0; }
ul { list-style:none; padding:0; }

h1,h2,h3,h4 { color:var(--ink); font-weight:600; line-height:1.12; letter-spacing:-0.03em; text-wrap:balance; }
p { text-wrap:pretty; }
a { color:inherit; }

:focus-visible { outline:2px solid var(--accent); outline-offset:3px; border-radius:var(--r-sm); }
::selection { background:var(--accent); color:#fff; }

/* ---------- 4. Frame ---------------------------------------------------- */

.container { width:100%; max-width:var(--frame); margin-inline:auto; padding-inline:clamp(1rem,4vw,1.5rem); }
.section { padding-block:clamp(3rem,6vw,5rem); }
#projects { padding-top:clamp(4rem,7.5vw,6.5rem); }   /* a little extra air under the hero's closing line */
.skip-link {
  position:absolute; left:var(--s-4); top:-100px; z-index:200;
  background:var(--ink); color:#fff; padding:var(--s-3) var(--s-5);
  border-radius:var(--r-md); text-decoration:none; font-weight:500;
  transition:top 180ms var(--ease);
}
.skip-link:focus { top:var(--s-4); }

/* ---------- 5. Centred section heads ------------------------------------ */

.sec-head { text-align:center; margin-bottom:var(--s-7); }
.sec-head h2 { font-size:var(--text-2xl); letter-spacing:-0.035em; }
.sec-head .sub {
  margin:var(--s-3) auto 0;
  max-width: 32ch;
  font-size:clamp(1rem,0.5vw + 0.9rem,1.1875rem);
  color:var(--muted);
  line-height:1.4;
}
.sec-head .sub a { color:#2d84eb; text-decoration:none; }
.sec-head .sub a:hover { text-decoration:underline; }

.meta { font-family:var(--font-mono); font-size:var(--text-sm); color:var(--muted); }

/* ---------- 6. Buttons -------------------------------------------------- */

.btn {
  display:inline-flex; align-items:center; gap:var(--s-2);
  padding:0.6rem 1.15rem; border:1px solid transparent; border-radius:999px;
  font-size:0.9375rem; font-weight:600; letter-spacing:-0.01em;
  color:var(--ink); text-decoration:none; background:var(--card);
  box-shadow:var(--shadow-btn);
  transition:background 220ms var(--ease), color 220ms var(--ease),
             transform 220ms var(--ease), box-shadow 220ms var(--ease);
}
.btn:hover { transform:translateY(-1px); box-shadow:var(--shadow-btn-lift); }
.btn--dark   { background:var(--ink); color:#fff; }
.btn--dark:hover { background:var(--accent); }
.btn--accent { background:var(--accent); color:#fff; }
.btn--accent:hover { background:var(--ink); }
.btn--sm { padding:0.45rem 0.95rem; font-size:var(--text-sm); }

/* Small circular icon buttons beside the main CTA */
.icon-btn {
  width:38px; height:38px; display:grid; place-items:center;
  border-radius:50%; background:var(--card-2); color:var(--ink);
  text-decoration:none; box-shadow:var(--shadow-btn);
  transition:background 200ms var(--ease), transform 200ms var(--ease), box-shadow 200ms var(--ease);
}
.icon-btn:hover { background:var(--ink); color:#fff; transform:translateY(-1px); box-shadow:var(--shadow-btn-lift); }
.icon-btn svg { width:16px; height:16px; }

/* ---------- 7. Header --------------------------------------------------- */

.site-header {
  position:sticky; top:0; z-index:100;
  background:color-mix(in srgb, var(--page) 82%, transparent);
  backdrop-filter:saturate(180%) blur(14px);
  -webkit-backdrop-filter:saturate(180%) blur(14px);
}
.nav { display:flex; align-items:center; justify-content:space-between; gap:var(--s-4); min-height:64px; }

.brand { display:inline-flex; align-items:center; gap:var(--s-3); font-weight:600; color:var(--ink); text-decoration:none; transform-origin:left center; transition:transform 220ms var(--ease); }
.brand:hover { transform:scale(1.05); }
.brand .avatar {
  width:32px; height:32px; border-radius:10px; overflow:hidden; flex:none;
  background:var(--ink); color:#fff; display:grid; place-items:center;
  font-size:var(--text-sm); font-weight:600; box-shadow:var(--shadow);
}
.brand .avatar img { width:100%; height:100%; object-fit:cover; }
/* Photo avatar gets the same white frame as the hero portrait */
.brand .avatar:has(img) { background:#fff; padding:2px; box-shadow:var(--shadow-lift); }
.brand .avatar:has(img) img { border-radius:8px; }

.nav-links { display:flex; align-items:center; gap:var(--s-6); }
.nav-links a { text-decoration:none; color:var(--body); font-size:0.9375rem; font-weight:500; transition:color 200ms var(--ease); }
.nav-links a:not(.btn) { display:inline-block; transition:color 200ms var(--ease), transform 200ms var(--ease); }
.nav-links a:not(.btn):hover { transform:scale(1.08); }
.nav-links a:hover, .nav-links a.is-active { color:var(--ink); }
.nav-links a.btn { color:#fff; }

/* NL | EN switch. The page stays hidden for a moment when it opens in Dutch, so the English never flashes. */
.i18n-wait body { visibility:hidden; }
.lang { display:inline-flex; width:max-content; padding:2px; border-radius:999px; background:var(--card-2); }
.lang button {
  padding:0.2rem 0.6rem; border-radius:999px; font-size:var(--text-sm); font-weight:600;
  color:var(--muted); transition:background 200ms var(--ease), color 200ms var(--ease);
}
.lang button:hover { color:var(--ink); }
.lang button[aria-pressed="true"] { background:var(--ink); color:#fff; }

.nav-toggle { display:none; width:38px; height:38px; border-radius:10px; background:var(--card); box-shadow:var(--shadow); padding:0; place-items:center; }
.nav-toggle span { display:block; width:15px; height:1.5px; background:var(--ink); transition:transform 260ms var(--ease), opacity 200ms var(--ease); }
.nav-toggle span + span { margin-top:4px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1){ transform:translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2){ opacity:0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3){ transform:translateY(-5.5px) rotate(-45deg); }

@media (max-width:800px){
  .nav-toggle { display:grid; }
  .nav-links {
    position:fixed; inset:64px 0 auto 0; flex-direction:column; align-items:stretch; gap:0;
    background:var(--page); border-bottom:1px solid var(--line);
    padding:var(--s-3) clamp(1rem,4vw,1.5rem) var(--s-6);
    transform:translateY(-8px); opacity:0; visibility:hidden; pointer-events:none;
    transition:opacity 220ms var(--ease), transform 220ms var(--ease), visibility 220ms;
    max-height:calc(100dvh - 64px); overflow-y:auto;
  }
  .nav-links.is-open { opacity:1; visibility:visible; pointer-events:auto; transform:none; }
  .nav-links li { border-bottom:1px solid var(--line); }
  .nav-links li:last-child { border-bottom:0; padding-top:var(--s-4); }
  .nav-links a { display:block; padding:var(--s-4) 0; font-size:var(--text-lg); }
  .nav-links a.btn { display:inline-flex; padding:0.6rem 1.15rem; }
}

/* ---------- 8. Hero ----------------------------------------------------- */

.hero { padding-block:clamp(2.5rem,6vw,4.5rem) clamp(1.5rem,3vw,2.5rem); }

.hero-grid {
  display:grid;
  grid-template-columns: 1fr 300px;
  gap:clamp(2rem,5vw,4rem);
  align-items:center;
  padding-inline: clamp(0rem, 3vw, 2.5rem);
}

.hero h1 { font-size:var(--text-3xl); letter-spacing:-0.04em; }

.hero-tagline {
  margin-top:var(--s-4);
  font-size:var(--text-lg);
  font-weight:600;
  line-height:1.32;
  letter-spacing:-0.025em;
  color:var(--ink);
  max-width:26ch;
}

.hero-note { margin-top:var(--s-4); font-size:0.9375rem; color:var(--muted); }

.hero-open {
  margin-top:var(--s-2);
  display:inline-flex; align-items:center; gap:var(--s-2);
  font-size:0.9375rem; font-weight:500; color:var(--green);
}
.hero-open .dot {
  width:9px; height:9px; border-radius:50%; background:var(--green); flex:none;
  box-shadow:0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent);
  animation:dot-pulse 2.6s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { box-shadow:0 0 0 0 color-mix(in srgb, var(--green) 45%, transparent); }
  50%      { box-shadow:0 0 0 8px color-mix(in srgb, var(--green) 12%, transparent); }
}

.hero-cta { display:flex; flex-wrap:wrap; align-items:center; gap:var(--s-3); margin-top:var(--s-5); }

/* Tilted, framed portrait */
.hero-photo {
  background:#fff;
  padding:8px;
  border-radius:18px;
  box-shadow:var(--shadow-lift);
  transform:rotate(3.2deg);
  transition:transform 500ms var(--ease);
}
.hero-photo:hover { transform:rotate(0deg); }
.hero-photo > * { border-radius:12px; overflow:hidden; aspect-ratio:1303/1218; background:var(--card-2); }
.hero-photo img { width:100%; height:100%; object-fit:cover; }

/* One line of credibility under the hero text, with the logo set inline */
.hero-trust {
  margin:clamp(3rem,6vw,4.75rem) 0 0;
  padding-inline:clamp(0rem, 3vw, 2.5rem);   /* lines up with the hero text above */
  font-size:clamp(1rem,0.5vw + 0.9rem,1.1875rem); line-height:1.9; color:var(--body);
}
.trust-logo {
  display:inline-block; vertical-align:middle; margin:-3px 2px 0 1px; line-height:0; border-radius:3px; overflow:hidden;
  transition:transform 220ms var(--ease), box-shadow 220ms var(--ease);
}
.trust-logo:hover { transform:scale(1.07); box-shadow:var(--shadow-btn); }
.trust-logo img { display:block; height:26px; width:auto; }

/* Short fading line that closes the hero */
.hero-rule {
  width:min(380px,62%); height:1px; border:0; margin:clamp(3rem,6vw,4.75rem) auto 0;
  background:linear-gradient(90deg, transparent, color-mix(in srgb, var(--ink) 22%, transparent), transparent);
}

/* On desktop the hero fills the first screen, so the next section starts
   below the fold: the intro sits centred in the free space and the Streetlife
   line and closing rule rest near the bottom edge */
@media (min-width:801px){
  .hero { min-height:calc(100svh - 4.5rem); display:flex; }
  .hero > .container { display:flex; flex-direction:column; width:100%; }
  .hero-grid { margin-block:auto; }
}

@media (max-width:800px){
  .hero-grid { grid-template-columns:1fr; }
  .hero-photo { max-width:220px; order:-1; margin-bottom:var(--s-4); }
}

/* ---------- 9. Projects — wide banner cards ----------------------------- */

.project-list { display:flex; flex-direction:column; gap:var(--s-5); }

.pcard {
  position:relative;
  display:grid;
  grid-template-columns: minmax(0,0.92fr) minmax(0,1.08fr);
  align-items:center;
  min-height:360px;
  border-radius:var(--r-card);
  overflow:hidden;
  background:var(--card);
  box-shadow:var(--shadow);
  transition:box-shadow 320ms var(--ease), transform 320ms var(--ease);
}
.pcard:hover { box-shadow:var(--shadow-lift); transform:translateY(-2px) scale(1.02); }

.pcard-text { padding:clamp(1.75rem,3.4vw,2.75rem) clamp(1.75rem,6vw,4.5rem); z-index:2; }
.pcard h3 { font-size:clamp(1.75rem,1.6vw + 1.3rem,2.375rem); line-height:1.08; letter-spacing:-0.035em; max-width:14ch; }
.pcard h3 a { text-decoration:none; }
.pcard h3 a::after { content:''; position:absolute; inset:0; }
.pcard-outcome { margin-top:var(--s-4); font-size:clamp(1rem,0.5vw + 0.9rem,1.1875rem); font-weight:500; line-height:1.4; max-width:30ch; }
.pcard .btn { margin-top:var(--s-5); }

.pcard-media { position:relative; align-self:stretch; overflow:hidden; }
.pcard-media img { width:100%; height:100%; object-fit:cover; transition:transform 900ms var(--ease); }
.pcard:hover .pcard-media img { transform:scale(1.03); }

/* media on the left instead */
.pcard--flip .pcard-text { order:2; }
.pcard--flip .pcard-media { order:1; }

/* Full-card artwork: one wide image (product on one side, calm ground on the
   other) sits behind the whole card and the text is laid over the calm half */
.pcard--art .pcard-media { position:static; }
.pcard--art .pcard-media img { position:absolute; inset:0; object-position:right bottom; }
.pcard--art.pcard--flip .pcard-media img { object-position:left bottom; }

/* Dark-ground variants */
/* In-progress card: a client logo instead of a render, a status line instead of a button, not a link */
.pcard--wip:hover, .pcard--wip.reveal.is-in:hover { transform:none; box-shadow:var(--shadow); }
.pcard-media--logo { display:grid; place-items:center; padding:var(--s-6); }
.pcard-media--logo img, .pcard--wip:hover .pcard-media--logo img {
  width:min(58%,340px); height:auto; object-fit:contain; transform:none;
  filter:brightness(0) invert(1); opacity:.95;
}
.pcard-status {
  display:inline-flex; align-items:center; gap:var(--s-3); margin-top:var(--s-5);
  font-size:0.9375rem; font-weight:500; color:#fff;
}
.pcard-status .dot {
  width:9px; height:9px; border-radius:50%; background:#fff; flex:none;
  animation:dot-pulse-light 2.6s ease-in-out infinite;
}
@keyframes dot-pulse-light {
  0%, 100% { box-shadow:0 0 0 0 rgba(255,255,255,.5); }
  50%      { box-shadow:0 0 0 8px rgba(255,255,255,.12); }
}

.pcard--dark { color:rgba(255,255,255,.84); }
.pcard--dark h3 { color:#fff; }
.pcard--dark .btn { background:#fff; color:var(--ink); }
.pcard--dark .btn:hover { background:var(--accent); color:#fff; }

@media (max-width:760px){
  .pcard { grid-template-columns:1fr; min-height:0; }
  /* phone: just the photo with the title under it; the whole card opens the project */
  .pcard-text { order:2; padding:var(--s-4) var(--s-5) var(--s-5); }
  .pcard-media { order:1; width:100%; aspect-ratio:16/10; }   /* explicit width: the absolutely placed image gives the block no size of its own */
  .pcard h3 { max-width:none; font-size:1.5rem; }
  .pcard-outcome, .pcard .btn { display:none; }
  .pcard-status { margin-top:var(--s-3); }
  /* stacked: artwork drops back into its own block, cropped to the product
     side and faded into the card colour where it meets the title */
  .pcard--art .pcard-media { position:relative; }
  .pcard--art .pcard-media img,
  .pcard--art.pcard--flip .pcard-media img { object-position:center; -webkit-mask-image:linear-gradient(to top, transparent, #000 6%); mask-image:linear-gradient(to top, transparent, #000 6%); }
}

/* ---------- 10. Case studies — book covers ------------------------------ */

.case-cards { display:grid; grid-template-columns:repeat(2,1fr); gap:var(--s-6); max-width:820px; margin-inline:auto; }
@media (max-width:640px){ .case-cards { grid-template-columns:1fr; max-width:360px; } }

.case-card { position:relative; }
.case-book {
  position:relative;
  aspect-ratio:0.746;
  border-radius:6px 16px 16px 6px;
  overflow:hidden;
  background:var(--card-2);
  box-shadow:var(--shadow-lift);
  transition:transform 380ms var(--ease), box-shadow 380ms var(--ease);
}
.case-card:hover .case-book { transform:translateY(-4px) rotate(-.6deg); }
/* the spine */
.case-book::before {
  content:''; position:absolute; inset:0 auto 0 0; width:14px; z-index:3;
  background:linear-gradient(90deg, rgba(0,0,0,.28), rgba(0,0,0,.06) 60%, transparent);
}
.case-book img { width:100%; height:100%; object-fit:cover; }

.case-book-body {
  position:absolute; inset:0; z-index:2;
  display:flex; flex-direction:column; justify-content:flex-start;
  padding:var(--s-6) var(--s-5) var(--s-5) calc(var(--s-5) + 14px);
  color:#fff;
}
.case-book-kicker { font-family:var(--font-mono); font-size:var(--text-xs); opacity:.8; }
.case-book-title { color:#fff; font-size:var(--text-lg); letter-spacing:-0.03em; margin-top:var(--s-2); }
.case-book-sub { margin-top:var(--s-3); font-size:0.875rem; opacity:.85; line-height:1.45; }
.case-book-read {
  position:absolute; top:var(--s-5); right:var(--s-5);
  font-family:var(--font-mono); font-size:var(--text-xs); opacity:.75;
}
.case-card h3 { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.case-card h3 a::after { content:''; position:absolute; inset:0; }

/* "Coming soon" band across a placeholder cover */
.case-book--soon { background:#3a3730; }
.case-soon-band {
  position:absolute; left:0; right:0; top:50%; transform:translateY(-50%); z-index:3;
  background:rgba(20,19,15,.75); color:#fff; text-align:center;
  padding:var(--s-3); font-size:0.9375rem; font-weight:500;
}

/* ---------- 11. Explorations -------------------------------------------- */

.expl-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:var(--s-4); }
@media (max-width:860px){ .expl-grid { grid-template-columns:repeat(2,1fr); } }

.expl {
  position:relative; display:block; width:100%; margin:0; border:0; padding:0;
  border-radius:var(--r-md); overflow:hidden;
  background:var(--card-2); aspect-ratio:4/3;
  box-shadow:var(--shadow);
  transition:transform 320ms var(--ease), box-shadow 320ms var(--ease);
}
.expl.ph { min-height:0; padding:0; }
.expl--soon {
  display:grid; place-items:center; background:none; box-shadow:none;
  border:1.5px dashed var(--line-2); color:var(--muted); font-weight:500;
}
figure.expl { border:3px solid rgba(255,255,255,.9); }
figure.expl:hover { transform:scale(1.04); box-shadow:var(--shadow-lift); }
.expl img { width:100%; height:100%; object-fit:cover; }
/* caption stays in the markup as the tile's accessible name, never shown */
.expl figcaption { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }


/* Lightbox */
.lightbox {
  position:fixed; inset:0; z-index:200; display:grid; place-items:center;
  background:rgba(12,11,9,.94); padding:clamp(1rem,5vw,4rem);
  opacity:0; visibility:hidden; transition:opacity 260ms var(--ease), visibility 260ms;
}
.lightbox.is-open { opacity:1; visibility:visible; }
.lightbox img { max-width:100%; max-height:82vh; object-fit:contain; border-radius:var(--r-md); }
.lightbox-cap { margin-top:var(--s-4); text-align:center; font-family:var(--font-mono); font-size:var(--text-sm); color:#cfcabf; }
.lightbox-close {
  position:absolute; top:var(--s-5); right:var(--s-5); width:44px; height:44px;
  display:grid; place-items:center; border-radius:50%;
  border:1px solid rgba(255,255,255,.28); color:#fff; font-size:1.25rem; line-height:1;
}
.lightbox-close:hover { background:rgba(255,255,255,.12); }

/* Sheet: an exploration opened as a page on top of the page */
.sheet {
  position:fixed; inset:0; z-index:200; padding:clamp(0.5rem,1.4vw,1.25rem);
  background:rgba(34,37,42,.8);
  opacity:0; visibility:hidden; transition:opacity 260ms var(--ease), visibility 260ms;
}
.sheet.is-open { opacity:1; visibility:visible; }
.sheet-panel {
  position:relative; height:100%; overflow-y:auto; overscroll-behavior:contain;
  background:var(--page); border-radius:var(--r-card);
  padding:clamp(3.5rem,6vw,4.5rem) clamp(1rem,4vw,3rem) clamp(2rem,5vw,4rem);
  transform:translateY(24px); transition:transform 320ms var(--ease);
}
.sheet.is-open .sheet-panel { transform:none; }
.sheet-panel > * { max-width:960px; margin-inline:auto; }
.sheet-panel > .sheet-head, .sheet-panel > .sheet-text { max-width:640px; }
.sheet-head h2 { font-size:var(--text-3xl); letter-spacing:-0.035em; }
.sheet-tags { display:flex; flex-wrap:wrap; gap:var(--s-2); margin:var(--s-3) 0 0; padding:0; list-style:none; }
.sheet-tags li { padding:0.15rem 0.7rem; border-radius:999px; box-shadow:inset 0 0 0 1px var(--line-2); font-size:var(--text-sm); }
.sheet-img { display:block; width:100%; height:auto; margin-top:var(--s-5); border-radius:var(--r-card); box-shadow:var(--shadow); }
.sheet-text { margin-top:var(--s-6); }
.sheet-text p + p { margin-top:var(--s-4); }
.sheet-text + .sheet-img { margin-top:var(--s-6); }
.sheet-pair { display:grid; grid-template-columns:1fr 1fr; gap:var(--s-5); }
@media (max-width:640px){ .sheet-pair { grid-template-columns:1fr; gap:0; } }
.sheet-panel > .sheet-close {
  position:sticky; top:0; float:right; z-index:1; width:48px; height:48px;
  margin:calc(var(--s-6) * -1) 0 0 var(--s-3);
  display:grid; place-items:center; border-radius:50%;
  background:var(--card-2); color:var(--ink); font-size:1.5rem; line-height:1;
  transition:background 200ms var(--ease), color 200ms var(--ease);
}
.sheet-close:hover { background:var(--ink); color:#fff; }

/* ---------- 12. About & CV ---------------------------------------------- */

.panel {
  background:var(--card); border-radius:var(--r-card);
  box-shadow:var(--shadow); padding:clamp(1.5rem,3vw,2.25rem);
}
.panel + .panel { margin-top:var(--s-5); }

.about-bio { max-width:62ch; }
.about-bio p + p { margin-top:var(--s-4); }
.panel > h3 { font-size:var(--text-base); margin-bottom:var(--s-4); }

/* Fields of expertise — label left, chips right */
.fields { display:grid; grid-template-columns:190px 1fr; gap:var(--s-5); align-items:center; }
@media (max-width:680px){ .fields { grid-template-columns:1fr; gap:var(--s-4); } }
.fields-label { display:flex; align-items:center; gap:var(--s-3); }
.fields-label .ico {
  width:42px; height:42px; border-radius:12px; flex:none; display:grid; place-items:center;
  background:var(--card-2); color:var(--accent-ink);
}
.fields-label .ico svg { width:22px; height:22px; }
.fields-label h3 { font-size:var(--text-base); margin:0; max-width:9ch; }

.chips { display:flex; flex-wrap:wrap; gap:var(--s-2); }
.chip {
  display:inline-flex; align-items:center; gap:var(--s-2);
  padding:0.4rem 0.85rem; border:1px solid var(--line);
  border-radius:999px; font-size:0.9375rem; font-weight:500;
  color:var(--ink); background:var(--card);
  transition:border-color 200ms var(--ease), transform 200ms var(--ease);
}
.chip:hover { border-color:var(--line-2); transform:translateY(-1px); }
.chip--plain { border-color:transparent; color:var(--muted); font-weight:400; }
.chip .ico {
  width:22px; height:22px; border-radius:6px; flex:none; display:grid; place-items:center;
  background:var(--card-2); font-family:var(--font-mono); font-size:0.5625rem; color:var(--ink);
  overflow:hidden;
}
.chip .ico img { width:100%; height:100%; object-fit:contain; }
.chip .ico:has(img) { background:none; border-radius:0; overflow:visible; }

/* Three skill columns */
.skill-cols { display:grid; grid-template-columns:repeat(3,1fr); gap:var(--s-6); margin-top:var(--s-7); }
@media (max-width:760px){ .skill-cols { grid-template-columns:1fr; gap:var(--s-6); } }
.skill-col h3 { font-size:var(--text-lg); margin-bottom:var(--s-4); }

.about-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:var(--s-3); margin-top:var(--s-7); }

/* Timeline */
.timeline { display:flex; flex-direction:column; }
.tl-item { display:grid; grid-template-columns:9.5rem 1fr; gap:var(--s-2) var(--s-5); padding-block:var(--s-4); border-top:1px solid var(--line); }
.tl-item:first-child { border-top:0; padding-top:0; }
.tl-when { font-family:var(--font-mono); font-size:var(--text-sm); color:var(--muted); padding-top:3px; }
.tl-role { font-size:var(--text-md); font-weight:600; color:var(--ink); }
.tl-org { color:var(--accent-ink); font-weight:500; }
.tl-desc { margin-top:var(--s-2); font-size:0.9375rem; max-width:56ch; }
@media (max-width:600px){ .tl-item { grid-template-columns:1fr; } }

/* ---------- 13. Contact + closing CTA ----------------------------------- */

.contact-grid { display:grid; grid-template-columns:1fr 1fr; gap:clamp(1.5rem,4vw,3rem); align-items:start; }
@media (max-width:800px){ .contact-grid { grid-template-columns:1fr; } }

.contact-list { display:flex; flex-direction:column; margin-top:var(--s-5); }
.contact-list a {
  display:flex; align-items:center; justify-content:space-between; gap:var(--s-4);
  padding:var(--s-4) 0; border-top:1px solid var(--line); text-decoration:none;
  transition:padding-inline 260ms var(--ease);
}
.contact-list a:last-child { border-bottom:1px solid var(--line); }
.contact-list a:hover { padding-inline:var(--s-3); }
.ci-label { display:block; font-family:var(--font-mono); font-size:var(--text-xs); color:var(--muted); }
.ci-value { display:block; color:var(--ink); font-weight:500; }
.contact-list a:hover .ci-value { color:var(--accent-ink); }

.form { display:flex; flex-direction:column; gap:var(--s-4); }
.field { display:flex; flex-direction:column; gap:var(--s-2); }
.field label { font-family:var(--font-mono); font-size:var(--text-xs); color:var(--muted); }
.field input, .field textarea {
  width:100%; padding:0.7rem 0.9rem; background:var(--card);
  border:1px solid var(--line-2); border-radius:var(--r-md); color:var(--ink);
  transition:border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.field input:focus, .field textarea:focus {
  outline:none; border-color:var(--accent);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.field textarea { min-height:130px; resize:vertical; }
.form-note { font-size:var(--text-sm); color:var(--muted); }

/* Dark closing card */
.cta-card {
  background:var(--dark); color:#a9a49a;
  border-radius:var(--r-card); text-align:center;
  padding:clamp(2.5rem,5vw,3.75rem) var(--s-5);
  box-shadow:var(--shadow-lift);
  position:relative; overflow:hidden;
}
.cta-card h2 { color:#fff; font-size:var(--text-2xl); letter-spacing:-0.04em; }
.cta-card p { margin-top:var(--s-3); font-size:0.9375rem; }
.cta-actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:var(--s-3); margin-top:var(--s-5); }
.cta-card .icon-btn { background:rgba(255,255,255,.12); color:#fff; box-shadow:none; }
.cta-card .icon-btn:hover { background:#fff; color:var(--ink); }

/* ---------- 14. Footer -------------------------------------------------- */

.site-footer { padding-block:var(--s-6) var(--s-7); }
.footer-inner { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:var(--s-4); }
.footer-links { display:flex; flex-wrap:wrap; gap:var(--s-5); }
.footer-links a, .to-top { text-decoration:none; font-size:0.9375rem; color:var(--body); transition:color 200ms var(--ease); }
.footer-links a:hover, .to-top:hover { color:var(--accent-ink); }
.footer-copy { font-size:var(--text-sm); color:var(--muted); }

/* ---------- 15. Case-study pages ---------------------------------------- */

.case-hero { padding-block:clamp(2rem,5vw,3rem) var(--s-5); }
.back-link {
  display:inline-flex; align-items:center; gap:var(--s-2);
  font-family:var(--font-mono); font-size:var(--text-sm); color:var(--muted);
  text-decoration:none; transition:color 200ms var(--ease), gap 240ms var(--ease);
}
.back-link:hover { color:var(--ink); gap:var(--s-3); }
.case-title { font-size:var(--text-2xl); letter-spacing:-0.04em; margin-top:var(--s-4); max-width:20ch; }
.case-summary { margin-top:var(--s-4); max-width:58ch; }
.case-hero-media { border-radius:var(--r-card); overflow:hidden; background:var(--card-2); margin-top:var(--s-6); box-shadow:var(--shadow); }
.case-meta {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:var(--s-5);
  margin-top:var(--s-6); padding:var(--s-5); background:var(--card);
  border-radius:var(--r-card); box-shadow:var(--shadow);
}
.case-meta dt { font-family:var(--font-mono); font-size:var(--text-xs); color:var(--muted); margin-bottom:var(--s-2); }
.case-meta dd { margin:0; color:var(--ink); font-weight:500; font-size:0.9375rem; }

.case-body { padding-block:var(--s-7) var(--s-9); }
.case-block + .case-block { margin-top:var(--s-8); }
.case-block h2 { font-size:var(--text-lg); margin-bottom:var(--s-4); }
.case-block p { max-width:66ch; }
.case-block p + p { margin-top:var(--s-4); }

.case-steps { display:flex; flex-direction:column; gap:var(--s-5); counter-reset:step; }
.case-step { display:grid; grid-template-columns:2.5rem 1fr; gap:var(--s-4); }
.case-step::before {
  counter-increment:step; content:counter(step,decimal-leading-zero);
  font-family:var(--font-mono); font-size:var(--text-sm); color:var(--accent); padding-top:3px;
}
.case-step h3 { font-size:var(--text-md); margin-bottom:var(--s-2); }

.case-figure { margin:var(--s-6) 0 0; }
.case-figure img, .case-figure .ph { border-radius:var(--r-card); background:var(--card-2); width:100%; }
.case-figcap { margin-top:var(--s-3); font-family:var(--font-mono); font-size:var(--text-xs); color:var(--muted); }
.media-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:var(--s-4); }
.media-grid .case-figure { margin-top:0; }
.case-nav { display:flex; flex-wrap:wrap; justify-content:space-between; gap:var(--s-4); margin-top:var(--s-8); padding-top:var(--s-5); border-top:1px solid var(--line); }

/* ---------- 16. Image placeholders -------------------------------------- */

.ph {
  display:grid; place-content:center; justify-items:center; gap:var(--s-2);
  text-align:center; padding:var(--s-5); width:100%; height:100%;
  min-height:160px;
  border-radius:inherit;
  background:
    repeating-linear-gradient(45deg, transparent 0 9px,
      rgba(140,135,126,.10) 9px 18px);
  color:var(--muted); font-family:var(--font-mono); font-size:var(--text-xs); line-height:1.55;
  box-shadow:inset 0 0 0 1px var(--line-2);
}
.ph b { display:block; color:var(--ink); font-weight:500; font-size:var(--text-sm); }
.ph .ph-dim { color:var(--accent-ink); }
.ph .ph-path { word-break:break-all; max-width:34ch; opacity:.85; }
/* on dark project cards */
.pcard--dark .ph { color:#b3aea5; box-shadow:inset 0 0 0 1px rgba(255,255,255,.16);
  background:repeating-linear-gradient(45deg, transparent 0 9px, rgba(255,255,255,.06) 9px 18px); }
.pcard--dark .ph b { color:#fff; }
.pcard--dark .ph .ph-dim { color:var(--accent); }

/* ---------- 17. Motion -------------------------------------------------- */

.reveal {
  opacity:0; transform:perspective(1200px) translateY(20px);
  transition:opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  transition-delay:calc(var(--d,0) * 80ms);
}
.reveal.is-in { opacity:1; transform:perspective(1200px) translateY(0); }
.no-js .reveal { opacity:1; transform:none; }

/* .reveal.is-in outranks a component's own transform, so restate the ones that need it */
.pcard.reveal { transition:opacity var(--dur) var(--ease), transform 320ms var(--ease), box-shadow 320ms var(--ease); }
.pcard.reveal.is-in:hover { transform:translateY(-2px) scale(1.02); }
.hero-photo.reveal.is-in, .no-js .hero-photo.reveal { transform:rotate(3.2deg); }
.hero-photo.reveal.is-in:hover, .no-js .hero-photo.reveal:hover { transform:rotate(0deg); }

@media (prefers-reduced-motion: reduce){
  html { scroll-behavior:auto; }
  *,*::before,*::after {
    animation-duration:0.01ms !important; animation-iteration-count:1 !important;
    transition-duration:0.01ms !important; scroll-behavior:auto !important;
  }
  .reveal { opacity:1; transform:none; }
  .hero-photo { transform:rotate(3.2deg); }
  /* the status dot keeps its halo pulse: the dot itself never moves */
  .hero-open .dot, .pcard-status .dot { animation-duration:2.6s !important; animation-iteration-count:infinite !important; }
}

/* ---------- 18. Print --------------------------------------------------- */

@media print {
  .site-header,.hero-cta,.form,.lightbox,.to-top,.cta-card { display:none !important; }
  body { background:#fff; color:#000; font-size:11pt; }
  a { text-decoration:underline; }
  .pcard,.case-card { break-inside:avoid; page-break-inside:avoid; box-shadow:none; }
}

/* ==========================================================================
   19. Project pages — structure taken from arsene.design/lending-platform
   ========================================================================== */

.proj-hero { padding-block:clamp(2rem,5vw,3.5rem) clamp(2.5rem,6vw,4.5rem); }
.proj-hero-grid {
  display:grid; grid-template-columns:minmax(0,0.85fr) minmax(0,1.15fr);
  gap:clamp(1.5rem,4vw,3rem); align-items:center;
}
@media (max-width:820px){ .proj-hero-grid { grid-template-columns:1fr; } }

.proj-hero h1 { font-size:clamp(2.4rem,4.6vw,3.9rem); letter-spacing:-0.045em; line-height:1.02; }
.proj-hero .proj-desc {
  margin-top:var(--s-5); font-size:var(--text-md); font-weight:500;
  color:var(--body); max-width:34ch; line-height:1.5;
}
.proj-hero-media { border-radius:var(--r-card); overflow:hidden; background:var(--card-2); box-shadow:var(--shadow-lift); aspect-ratio:4/3; }
.proj-hero-media img { width:100%; height:100%; object-fit:cover; }

/* Two-column block: heading + prose left, side card right */
.proj-split {
  display:grid; grid-template-columns:minmax(0,1fr) minmax(0,0.62fr);
  gap:clamp(1.5rem,4vw,3.5rem); align-items:start;
  padding-block:clamp(2.5rem,5vw,4rem);
}
@media (max-width:820px){ .proj-split { grid-template-columns:1fr; } }
.proj-split h2 { font-size:var(--text-xl); letter-spacing:-0.035em; margin-bottom:var(--s-4); }
.proj-split p { max-width:56ch; }
.proj-split p + p { margin-top:var(--s-4); }
.proj-split strong { color:var(--ink); font-weight:600; }

.role-title {
  font-size:0.9375rem; font-weight:600; color:var(--ink);
  letter-spacing:0.04em; text-transform:uppercase; margin-bottom:var(--s-3);
}

/* The small white "Case Focus" card */
.focus-card {
  background:var(--card); border-radius:var(--r-card);
  box-shadow:var(--shadow); padding:var(--s-5);
}
.focus-head { display:flex; align-items:center; gap:var(--s-3); margin-bottom:var(--s-3); }
.focus-head .ico {
  width:36px; height:36px; border-radius:10px; flex:none; display:grid; place-items:center;
  background:color-mix(in srgb, var(--accent) 14%, transparent); color:var(--accent-ink);
}
.focus-head .ico svg { width:19px; height:19px; }
.focus-head h3 { font-size:var(--text-md); margin:0; }
.focus-card p { font-size:0.9375rem; }

/* Full-bleed-ish image between blocks */
.proj-figure { margin-block:clamp(1.5rem,4vw,2.5rem); }
.proj-figure > img, .proj-figure > .ph {
  width:100%; border-radius:var(--r-card); background:var(--card-2);
  box-shadow:var(--shadow); aspect-ratio:16/9; object-fit:cover;
}
.proj-figcap { margin-top:var(--s-3); font-family:var(--font-mono); font-size:var(--text-xs); color:var(--muted); text-align:center; }

/* The orange goal banner */
.goal-banner {
  display:grid; grid-template-columns:auto 1fr; gap:var(--s-5); align-items:center;
  background:linear-gradient(100deg,#f0522a,#f58a15);
  border-radius:var(--r-card); color:#fff;
  padding:clamp(1.5rem,3vw,2.25rem);
  box-shadow:var(--shadow-lift);
}
@media (max-width:600px){ .goal-banner { grid-template-columns:1fr; } }
.goal-banner .ico {
  width:54px; height:54px; border-radius:16px; display:grid; place-items:center;
  background:rgba(255,255,255,.18); flex:none;
}
.goal-banner .ico svg { width:28px; height:28px; }
.goal-label {
  font-size:var(--text-sm); font-weight:600; letter-spacing:0.06em;
  text-transform:uppercase; opacity:.9;
}
.goal-text { margin-top:var(--s-2); font-size:var(--text-lg); font-weight:600; letter-spacing:-0.025em; line-height:1.3; }

/* Dark band holding Challenges + Solutions */
.dark-band {
  background:#080807; color:#a9a49a;
  padding-block:clamp(3rem,6vw,5rem);
  margin-block:clamp(2.5rem,5vw,4rem);
}
.dark-band h2 { color:#fff; }
.band-head { position:relative; margin-bottom:var(--s-7); }
/* the oversized ghost word behind the heading */
.band-head .ghost {
  position:absolute; left:0; top:50%; transform:translateY(-58%);
  font-size:clamp(3.5rem,8.5vw,6.5rem); font-weight:700; letter-spacing:-0.05em;
  line-height:1; white-space:nowrap; pointer-events:none; user-select:none;
}
.band-head h2 { position:relative; font-size:var(--text-2xl); letter-spacing:-0.04em; }
.band-head .sub { position:relative; margin-top:var(--s-3); font-size:0.9375rem; color:#8c877e; }

.num-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:var(--s-4); }
@media (max-width:820px){ .num-grid { grid-template-columns:repeat(2,1fr); } }
@media (max-width:560px){ .num-grid { grid-template-columns:1fr; } }

.num-card { border-radius:var(--r-md); padding:var(--s-5); }
.num-card .n { font-family:var(--font-mono); font-size:var(--text-sm); margin-bottom:var(--s-3); display:block; }
.num-card h3 { font-size:var(--text-md); margin-bottom:var(--s-2); }
.num-card p { font-size:0.9375rem; line-height:1.5; }

/* Challenges: dark cards, orange numerals */
.challenges .ghost { color:#2a1a0d; }
.num-card--dark { background:#191713; color:#8f8a81; box-shadow:inset 0 0 0 1px #262320; }
.num-card--dark .n { color:var(--accent); }
.num-card--dark h3 { color:#fff; }

/* Solutions: white cards with a green edge glow, green numerals */
.solutions .ghost { color:#0c2b16; }
.num-card--light {
  background:#fff; color:var(--body);
  box-shadow:0 0 0 1px rgba(47,158,68,.35), 0 0 26px rgba(47,158,68,.22);
}
.num-card--light .n { color:var(--green); }
.num-card--light h3 { color:var(--ink); }

/* Key views — a wide photo band with the heading laid over it */
.keyviews { position:relative; border-radius:var(--r-card); overflow:hidden; margin-block:clamp(2rem,4vw,3rem); }
.keyviews > img, .keyviews > .ph { width:100%; aspect-ratio:16/9; object-fit:cover; }
.keyviews h2 { position:absolute; top:var(--s-6); left:var(--s-6); font-size:var(--text-xl); z-index:2; }
/* photo with a dark top edge: light heading over a soft shade */
.keyviews--dark h2 { color:#fff; }
.keyviews--dark::before {
  content:''; position:absolute; inset:0 0 auto 0; height:38%; z-index:1; pointer-events:none;
  background:linear-gradient(to bottom, rgba(10,9,7,.55), transparent);
}

/* Prev / next between projects */
.proj-nav {
  display:flex; flex-wrap:wrap; justify-content:space-between; gap:var(--s-4);
  padding-block:var(--s-6); border-top:1px solid var(--line);
}

/* Placeholders that sit where a real photo will go */
.ph--wide { aspect-ratio:16/9; }
.ph--4x3  { aspect-ratio:4/3; }

/* Anything still awaiting Tim's copy */
.todo {
  display:inline-block;
  background:color-mix(in srgb, var(--accent) 16%, transparent);
  color:var(--accent-ink); border-radius:var(--r-sm);
  padding:0.05em 0.4em; font-family:var(--font-mono); font-size:0.9em;
}
.dark-band .todo, .goal-banner .todo, .pcard--dark .todo {
  background:rgba(255,255,255,.16); color:#fff;
}

/* --- fixes --------------------------------------------------------------- */

/* Solutions cards are white, so the dark-band TODO style made them invisible */
.num-card--light .todo {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent-ink);
}

/* Challenges and Solutions are one continuous black band, as in the reference */
.dark-band + .dark-band { margin-top: 0; }
.dark-band:has(+ .dark-band) { margin-bottom: 0; padding-bottom: 0; }
