/* Tommaso D’Acunzio — personal site. Hand-written, no build step for CSS. */

@font-face { font-family: "Space Grotesk"; src: url("fonts/space-grotesk.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("fonts/dm-sans.woff2") format("woff2"); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: "Homemade Apple"; src: url("fonts/homemade-apple.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --paper: #efecdf;
  --paper-light: #f7f4ea;
  --ink: #2a3f4e;
  --muted: #4f5f69;          /* 5.6:1 on --paper */
  --accent: #46607f;         /* link / small accent text, 5.3:1 on --paper */
  --blue: #617896;           /* large decorative text only */
  --line: rgb(42 63 78 / .22);
  --tone-sage: #b5c2b0;
  --tone-lavender: #c3bed0;
  --tone-sand: #dcd1b5;
  --tone-blue: #b9c7ca;
  --display: "Space Grotesk", "Segoe UI", Arial, sans-serif;
  --body: "DM Sans", "Segoe UI", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
  --hand: "Homemade Apple", "Segoe Script", "Bradley Hand", cursive;
  --gutter: clamp(1.25rem, 5vw, 3.5rem);
  --measure: 46rem;
  --page: 88rem;             /* widest content column; the root size itself grows with the screen */
}

*, *::before, *::after { box-sizing: border-box; }
@media (min-width: 861px) { html { font-size: clamp(14.4px, calc(7.2px + .5vw), 22px); } }
@media (max-width: 860px) { html { font-size: 87.5%; } }
html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 1.0625rem/1.65 var(--body); -webkit-font-smoothing: antialiased;
}
body:has(dialog[open]) { overflow: hidden; }
::selection { background: var(--tone-sage); }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.1; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 5.6vw, 4.5rem); letter-spacing: -.04em; line-height: 1.05; overflow-wrap: anywhere; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); letter-spacing: -.03em; }
h3 { font-size: 1.375rem; letter-spacing: -.02em; line-height: 1.2; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
em { font-style: normal; color: var(--blue); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
main:focus, h1:focus { outline: none; }
.email-svg { display: block; max-width: 100%; fill: currentColor; }
.icon { width: 1.1em; height: 1.1em; flex-shrink: 0; vertical-align: -.15em; }
.wrap { width: 100%; max-width: var(--page); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; background: var(--ink); color: var(--paper); padding: 12px 16px; }
.skip-link:focus { top: 12px; }

/* Small recurring elements */
.eyebrow, .label {
  font: .75rem/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 .75rem;
}
.eyebrow { display: block; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.5rem; }
.tags li { font: .75rem/1.4 var(--mono); padding: .3rem .55rem; border: 1px solid var(--line); background: var(--paper-light); }
.button {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 3rem;
  padding: .75rem 1.25rem; border: 1px solid var(--ink); background: var(--ink); color: var(--paper-light);
  font-size: .9375rem; line-height: 1.3; transition: background .15s;
}
.button:hover { background: #3d5565; }
.button.secondary { background: transparent; color: var(--ink); }
.button.secondary:hover { background: rgb(42 63 78 / .07); }
.text-link { display: inline-flex; align-items: center; gap: .5rem; font-size: .9375rem; border-bottom: 1px solid currentColor; padding-block: .15rem; }
.text-link:hover { color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; margin-top: 2rem; }

/* Header */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  padding: 1.1rem max(var(--gutter), calc((100% - var(--page)) / 2 + var(--gutter))); min-height: 5rem; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .9rem; }
.brand-mark { font: 600 2rem/1 var(--display); letter-spacing: -.1em; }
.brand-mark i { font-style: normal; color: var(--accent); }
.brand-name { font: .8125rem/1.2 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
nav { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2rem); font-size: .9375rem; }
nav a { padding-block: .5rem; position: relative; }
nav a[aria-current="page"]::after { content: ""; position: absolute; inset: auto 0 .1rem; height: 2px; background: var(--ink); }
nav .nav-contact { border: 1px solid var(--line); padding: .6rem 1rem; display: inline-flex; gap: .6rem; align-items: center; }
nav .nav-contact[aria-current="page"]::after { display: none; }
nav .nav-contact:hover { border-color: var(--ink); }
.lang { display: flex; gap: .15rem; font: .8125rem var(--mono); padding-left: clamp(.5rem, 1.5vw, 1.25rem); border-left: 1px solid var(--line); }
.lang a, .lang span { padding: .25rem .45rem; }
.lang span { background: var(--ink); color: var(--paper-light); }
.lang a:hover { background: rgb(42 63 78 / .1); }
.lang a::after { display: none; }
.menu-toggle { display: none; align-items: center; gap: .6rem; background: none; border: 1px solid var(--line); padding: .55rem .85rem; font-size: .9375rem; }

/* Hero: photo fades into the paper colour, with the scanline texture */
.hero { --hs: clamp(.74rem, 2.25svh, 1.0625rem); position: relative; isolation: isolate; overflow: hidden; padding-block: clamp(1rem, 5svh, 4rem); }
.hero-copy { position: relative; z-index: 2; max-width: 40em; font-size: var(--hs); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hero-copy p { font-size: 1em; max-width: none; margin-bottom: 1.1em; }
.hero-copy p.eyebrow { display: block; font: 500 1.95em/1.1 var(--display); letter-spacing: -.03em; text-transform: none; color: var(--ink); margin-bottom: .6em; }
.hero-copy p.eyebrow::before { display: none; }
.hero .actions { margin-top: clamp(1rem, 3.2svh, 2rem); }
.hero-media { position: absolute; z-index: -1; top: 0; right: 0; width: 65%; height: 100%; margin: 0; background: var(--tone-sage); }
.hero-media img {
  width: 100%; height: 100%; object-fit: cover; object-position: 63% 68%;
  filter: grayscale(.35) saturate(.62) contrast(.88);
}
.hero-media::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, var(--paper) 0%, #efecdfed 18%, #efecdf94 40%, transparent 68%),
              linear-gradient(0deg, #efecdf50, transparent 30%);
}
.hero-media::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .7;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, #3045550a 3px, #3045550a 4px);
}

.hero-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); }
.hero-strip-inner { display: flex; justify-content: space-between; align-items: center; gap: .5rem 2rem; flex-wrap: wrap; padding-block: .9rem; }
.strip-link { display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem 1rem; font-size: .9375rem; }
.strip-label { font: .75rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.strip-cta { display: inline-flex; align-items: center; gap: .4rem; border-bottom: 1px solid currentColor; }
.strip-link:hover { color: var(--accent); }

/* Sections */
.section { padding-block: clamp(3rem, 6vw, 5rem); }
.section-tight { padding-top: 0; }
.section-ruled { border-top: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; margin-bottom: 2.25rem; }
.page-head { padding-block: clamp(2rem, 5vw, 3.75rem) 0; }
.page-head-top { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.page-head h1 { margin-top: .5rem; }
.page-head .lead { max-width: 40rem; margin: 1.25rem 0 0; font-size: 1.1875rem; color: var(--muted); }
/* Projects: editorial header with the title and the statement side by side */
.projects-head .page-head-top { padding-top: .75rem; border-top: 1px solid var(--ink); }
.projects-head .page-head-top .eyebrow { margin: 0; }
.projects-head-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 1.5rem clamp(2rem, 5vw, 5rem); align-items: end; margin-top: clamp(1.5rem, 3vw, 2.5rem); }
.projects-head-grid h1 { margin: 0; font-size: clamp(3.25rem, 7vw, 6rem); }
.projects-head-grid .page-intro { max-width: 40rem; margin: 0 0 .4rem; }
.back-link { display: inline-flex; gap: .4rem; align-items: center; font: .8125rem var(--mono); color: var(--muted); }
.back-link:hover { color: var(--ink); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3rem 2rem; }
.card[hidden] { display: none; }
.card-link { display: block; }
.card-meta { display: flex; justify-content: space-between; gap: 1rem; margin: 0; padding: .75rem 0; border-top: 1px solid var(--ink); font: .75rem/1.4 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.card-visual { aspect-ratio: 16 / 9; overflow: hidden; padding: 5.5% 5.5% 0; border: 1px solid rgb(42 63 78 / .1); }
.card-visual img { width: 100%; height: 100%; object-fit: cover; object-position: center top; background: #f6f6f6; box-shadow: 0 0 26px rgb(42 63 78 / .16); transition: transform .35s; }
.card-link:hover .card-visual img { transform: translateY(-3px); }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 1.25rem 0 .5rem; font-size: clamp(1.5rem, 2.4vw, 1.875rem); }
.card-title .icon { width: 1.4rem; height: 1.4rem; transition: transform .2s; }
.card-link:hover .card-title .icon { transform: translate(3px, -3px); }
.card-text { margin: 0 0 1rem; max-width: 34rem; color: var(--muted); }
.tone-sage { background: var(--tone-sage); } .tone-lavender { background: var(--tone-lavender); }
.tone-sand { background: var(--tone-sand); } .tone-blue { background: var(--tone-blue); }

/* Project page */
.project-cover { padding-top: 2.5rem; }
.figure-frame { padding: 0; }
.project-cover .figure-frame { padding: clamp(1rem, 3vw, 2rem); }
.zoom { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.zoom img { margin-inline: auto; width: auto; max-height: min(78vh, 51rem); border: 1px solid var(--line); background: #fff; box-shadow: 0 10px 34px rgb(42 63 78 / .12); }
.figure-note { display: flex; justify-content: space-between; gap: 1.5rem; margin: 1rem 0 0; font-size: .9375rem; color: var(--muted); }
.figure-note .hint { font: .75rem var(--mono); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.figure-credit { margin: .25rem 0 0; font-size: .875rem; color: var(--muted); }
.figure-credit a { text-decoration: underline; text-underline-offset: 3px; }
.project-layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); }
.project-aside { align-self: start; position: sticky; top: 1.5rem; }
.project-aside .button { width: 100%; margin-top: .5rem; }
.aside-value { margin: 0 0 1.5rem; }
.aside-note { font: .8125rem/1.7 var(--mono); color: var(--muted); }
.project-body { max-width: var(--measure); }
.lead-large { font: 500 clamp(1.25rem, 2.2vw, 1.5rem)/1.4 var(--display); letter-spacing: -.02em; margin-bottom: 2rem; }
.facts { margin: 0; }
.facts > div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1.5rem; padding-block: 1.5rem; border-top: 1px solid var(--line); }
.facts dt { font: 500 1.125rem/1.3 var(--display); }
.facts dd { margin: 0; }
.note { margin-top: 1.5rem; padding: 1.1rem 1.4rem; border-left: 3px solid var(--blue); background: rgb(42 63 78 / .04); }
.note p:last-child { margin: 0; }
.note .label { margin-bottom: .35rem; }
.gallery-intro { max-width: var(--measure); margin: -1rem 0 2rem; color: var(--muted); font-size: 1.0625rem; }
.step { margin: 0; padding-block: 2.5rem; border-top: 1px solid var(--line); }
.step-copy { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.step-number { font: .8125rem var(--mono); color: var(--muted); padding-top: .5rem; margin: 0; }
.step-copy h3 { font-size: clamp(1.5rem, 2.6vw, 1.875rem); margin-bottom: .6rem; }
.step-copy p { max-width: var(--measure); }
.step figcaption { margin-top: .9rem; font-size: .9375rem; color: var(--muted); max-width: 60rem; }
.next-project { display: block; border-top: 1px solid var(--line); }
.next-inner { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; padding-block: 2rem; }
.next-inner .label { margin: 0; }
.next-inner strong { font: 500 clamp(1.25rem, 2.6vw, 1.75rem) var(--display); letter-spacing: -.02em; display: inline-flex; align-items: center; gap: .6rem; }
.next-project:hover strong { color: var(--accent); }

/* About */
.profile { display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.portrait { margin: 0; }
.portrait img { width: 100%; aspect-ratio: 4 / 4.6; object-fit: cover; filter: saturate(.7); background: var(--tone-sage); }
.prose { max-width: var(--measure); }
.prose .button { margin-top: .75rem; }
.about-section { padding-block: clamp(1.5rem, 3vw, 2.5rem) clamp(.5rem, 1vw, 1.25rem); }
.about-section .portrait img { max-height: calc(100svh - 14rem); width: auto; max-width: 100%; }
.page-intro { max-width: 46rem; margin: 0; font: 500 clamp(1.25rem, 2.2vw, 1.625rem)/1.35 var(--display); letter-spacing: -.025em; text-wrap: balance; }
.about-intro { border-top: 1px solid var(--ink); padding-top: 1rem; margin-bottom: clamp(1.25rem, 2.5vw, 2rem); }
.about-intro .eyebrow { margin: 0 0 .6rem; }
.about-statement { font: 500 clamp(1.6rem, 2.8vw, 2.25rem)/1.2 var(--display); letter-spacing: -.03em; margin: 0; max-width: 24em; text-wrap: balance; }
/* About: the whole page fits the window, content centred vertically */
@media (min-width: 861px) {
  body.page-about { min-height: 100svh; display: flex; flex-direction: column; }
  body.page-about main { flex: 1; display: flex; align-items: center; }
  body.page-about .about-section { width: 100%; }
}
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(1.5rem, 5vw, 4rem); }
.timeline li { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1.5rem; padding-block: 1.5rem; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top-color: var(--ink); }
.timeline-period { font: .75rem/1.6 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: .3rem 0 0; }
.timeline h3 { margin-bottom: .25rem; }
.timeline-org { color: var(--accent); font-size: .9375rem; margin-bottom: .6rem; }
.timeline li p:last-child { margin: 0; }
.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.skills > div { border-top: 1px solid var(--ink); padding-top: 1.1rem; }
.skills h3 { margin-bottom: .6rem; }
.skills p { color: var(--muted); margin: 0; }

/* Blog */
.article-list li a { display: grid; grid-template-columns: 11rem minmax(0, 1fr) 1.5rem; gap: 1.5rem; align-items: start; padding-block: 1.75rem; border-top: 1px solid var(--line); }
.article-list li:first-child a { border-top-color: var(--ink); }
.article-list h3 { font-size: clamp(1.4rem, 2.6vw, 1.875rem); margin-bottom: .4rem; }
.article-list p { margin: 0; color: var(--muted); }
.article-list .article-meta { display: flex; flex-direction: column; gap: .25rem; font: .75rem/1.5 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.article-list a:hover h3 { color: var(--accent); }
.blog-note { max-width: var(--measure); margin: 0 0 2.5rem; padding-left: 1.25rem; border-left: 3px solid var(--blue); color: var(--muted); }
/* Blog: a single note, as if written by hand in the middle of the page */
body.page-blog:has(.scribble) { min-height: 100svh; display: flex; flex-direction: column; }
body.page-blog:has(.scribble) main { flex: 1; display: grid; place-items: center; padding: 3rem var(--gutter) 4rem; }
.scribble {
  margin: 0; text-align: center; color: #1f2f44;
  font: 400 clamp(2.2rem, 3.4vw, 4rem)/1.7 var(--hand); transform: rotate(-4deg);
}
@media (min-width: 761px) { .scribble { white-space: nowrap; } }
/* letters follow a slightly bowed line, each a little off, as written by hand */
.scribble .w { white-space: nowrap; }
.scribble span[style] { display: inline-block; transform: translateY(var(--y)) rotate(var(--r)); }
.empty { max-width: 40rem; padding-block: 1rem; }
.empty h2 { margin-bottom: 1rem; }
.empty p { color: var(--muted); }
.article-body { max-width: calc(var(--measure) + 2 * var(--gutter)); padding-block: 3rem 5rem; font-size: 1.125rem; line-height: 1.8; }
.article-body h2 { font-size: 1.875rem; margin: 2.5rem 0 1rem; }
.article-body h3 { margin: 2rem 0 .75rem; }
.article-body a { text-decoration: underline; text-underline-offset: 3px; color: var(--accent); }
.article-body blockquote { margin: 1.75rem 0; padding-left: 1.25rem; border-left: 3px solid var(--blue); color: var(--muted); }
.article-body img { margin-block: 1.5rem; border: 1px solid var(--line); }
.article-body code { font: .9em var(--mono); background: rgb(42 63 78 / .08); padding: .1em .3em; }
.article-body pre { overflow-x: auto; padding: 1rem; background: rgb(42 63 78 / .08); line-height: 1.5; }
.article-body pre code { background: none; padding: 0; }

/* Contact */
.contact-band { margin-block: 1rem clamp(3rem, 6vw, 5rem); padding: clamp(1.75rem, 4vw, 3rem); background: var(--ink); color: var(--paper); display: flex; justify-content: space-between; align-items: center; gap: 1.5rem 3rem; flex-wrap: wrap; }
.contact-band h2 { margin-bottom: .6rem; }
.contact-band p { margin: 0; max-width: 30rem; color: rgb(239 236 223 / .85); }
.band-email { display: inline-block; font-size: clamp(1.15rem, 2.6vw, 1.875rem); padding-bottom: .15em; border-bottom: 1px solid currentColor; max-width: 100%; }
.band-email:hover { opacity: .85; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); }
.email-big { display: inline-block; margin: .5rem 0 1.5rem; font-size: clamp(1.3rem, 4.4vw, 2.75rem); padding-bottom: .15em; border-bottom: 1px solid var(--ink); max-width: 100%; }
.email-big:hover { color: var(--accent); }
.status { min-height: 1.6em; margin-top: .75rem; font-size: .9375rem; color: var(--muted); }
.contact-links li a { display: flex; justify-content: space-between; align-items: center; padding-block: 1.25rem; border-top: 1px solid var(--line); font-size: 1.1875rem; }
.contact-links li:first-child a { border-top-color: var(--ink); }
.contact-links a:hover { color: var(--accent); }

/* Credits */
.credits-section { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 2rem; padding-block: 2rem; border-bottom: 1px solid var(--line); }
.credits-section h2 { font-size: 1.5rem; }
.credits-section ul { max-width: 52rem; }
.credits-section li + li { margin-top: 1rem; }
.credits-section a { text-decoration: underline; text-underline-offset: 3px; }

/* Footer */
.site-footer { margin-top: 1rem; border-top: 1px solid var(--line); padding-block: 1.75rem; }
.footer-grid { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem 2rem; align-items: center; }
.footer-name { font: 500 1.25rem var(--display); margin: 0; }
.footer-role { font: .75rem var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: .4rem 0 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: .75rem 1.75rem; font-size: .9375rem; }
.footer-links a { display: inline-flex; align-items: center; gap: .35rem; transform-origin: center; }
.footer-links a:hover { color: var(--accent); }
.footer-links a.is-pulsing { animation: contact-pulse 1.1s cubic-bezier(.2, .8, .2, 1); animation-delay: var(--pulse-delay, 0ms); }
@keyframes contact-pulse {
  0% { transform: scale(1); color: inherit; text-shadow: none; }
  22% { transform: scale(1.09); color: var(--accent); text-shadow: 0 0 14px rgb(70 96 127 / .35); }
  45% { transform: scale(.97); color: var(--accent); }
  68% { transform: scale(1.04); }
  100% { transform: scale(1); color: inherit; text-shadow: none; }
}
.footer-small { margin: 0; font: .75rem var(--mono); color: var(--muted); }
.footer-small a { text-decoration: underline; text-underline-offset: 3px; }

/* Lightbox */
.lightbox { border: 0; padding: 1.25rem; background: var(--paper-light); color: var(--ink); width: min(96vw, 1800px); max-width: 96vw; max-height: 95dvh; }
.lightbox::backdrop { background: rgb(24 36 43 / .86); backdrop-filter: blur(5px); }
.lightbox-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; margin-bottom: 1rem; font-size: .9375rem; }
.lightbox-bar p { margin: 0; }
.lightbox-actions { display: flex; align-items: center; gap: 1.25rem; flex-shrink: 0; }
.lightbox-actions a { text-decoration: underline; text-underline-offset: 3px; font-size: .875rem; }
.lightbox-close { background: var(--ink); color: var(--paper); border: 0; padding: .6rem 1rem; }
.lightbox img { width: 100%; max-height: 80dvh; object-fit: contain; }

/* Home: first screen ends on the blog strip; second row of projects fades out */
.first-screen { display: flex; flex-direction: column; }
.home-projects { padding-top: 2.75rem; }
.cards-peek { margin-top: 3rem; max-height: 12rem; overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 20%, transparent 96%); mask-image: linear-gradient(180deg, #000 20%, transparent 96%); }
.peek-cta { display: flex; justify-content: center; margin-top: -.5rem; position: relative; }
.strip-scroll { display: inline-flex; align-items: center; gap: .5rem; font: .75rem var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.strip-scroll:hover { color: var(--ink); }

/* Tablet and phone */
@media (max-width: 960px) {
  .project-layout { grid-template-columns: 1fr; }
  .project-aside { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; }
  .project-aside .button { grid-column: 1 / -1; max-width: 20rem; }
}
@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }
  nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0; padding-top: 1rem; }
  nav.is-open { display: flex; }
  nav > a { padding-block: .85rem; border-top: 1px solid var(--line); }
  nav a[aria-current="page"]::after { display: none; }
  nav a[aria-current="page"] { font-weight: 700; }
  nav .nav-contact { margin-top: .5rem; justify-content: space-between; }
  .lang { border-left: 0; padding: 1rem 0 .25rem; }
  .profile, .split, .contact-grid, .projects-head-grid { grid-template-columns: 1fr; }
  .projects-head-grid { gap: 1.25rem; }
  .hero { padding-block: 0 2rem; }
  .hero > .wrap { display: flex; flex-direction: column; }
  .hero-media { position: relative; z-index: 0; order: -1; top: auto; right: auto; width: auto; height: 9.5rem; margin: 0 calc(-1 * var(--gutter)) 1.5rem; }
  .hero-media::before { background: linear-gradient(0deg, var(--paper) 0%, #efecdf99 30%, transparent 70%); }
  .portrait { max-width: 20rem; }
  .skills { grid-template-columns: 1fr; gap: 1.5rem; }
}
@media (max-width: 700px) {
  .cards { grid-template-columns: 1fr; gap: 2.5rem; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .facts > div, .step-copy, .timeline li, .credits-section { grid-template-columns: 1fr; gap: .5rem; }
  .article-list li a { grid-template-columns: minmax(0, 1fr) 1.5rem; gap: .75rem; }
  .article-list .article-meta { grid-column: 1 / -1; flex-direction: row; gap: 1.25rem; }
  .figure-note { flex-direction: column; gap: .25rem; }
  .figure-note .hint { display: none; }
  .project-aside { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-small { order: 2; }
  .lightbox { padding: .75rem; }
  .lightbox-bar { flex-direction: column; gap: .75rem; }
}

/* Motion: the "scroll" cue animation, and project cards rising into view */
@media (prefers-reduced-motion: no-preference) {
  /* One animation for the "scroll" cue: a light travels through the text and lands on the arrow, which dips. */
  .strip-scroll-text {
    background: linear-gradient(100deg, var(--muted) 38%, var(--ink) 50%, var(--muted) 62%) 100% 0 / 300% 100% no-repeat;
    -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
    animation: cue-text 3.2s ease-in-out infinite;
  }
  .strip-scroll .icon { animation: cue-arrow 3.2s ease-in-out infinite; }
  .strip-scroll:hover .strip-scroll-text, .strip-scroll:hover .icon { animation-duration: 1.8s; }
  @keyframes cue-text { 0% { background-position: 100% 0; } 68%, 100% { background-position: 0% 0; } }
  @keyframes cue-arrow { 0%, 62% { transform: translateY(0); opacity: .5; } 76% { transform: translateY(5px); opacity: 1; } 92%, 100% { transform: translateY(0); opacity: .5; } }
  .js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0s); }
  .js .reveal.is-visible { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .site-header, .site-footer, .actions, .button, .contact-band, .menu-toggle { display: none; }
  body { background: #fff; color: #111; }
  .project-layout, .profile, .split { display: block; }
}

@media (min-width: 861px) {
  .site-header { height: 5rem; flex-wrap: nowrap; }
  .first-screen { min-height: calc(100svh - 5rem); }
  .first-screen .hero { flex: 1; display: flex; align-items: center; }
  .first-screen .hero > .wrap { width: 100%; }
}
