/* afesa — nordic design system shared by the portal and every project page */
:root {
  --snow: #f4f2ee;
  --paper: #ebe8e1;
  --mist: #dcd9d1;
  --ink: #1c1e1d;
  --stone: #62665f;
  --line: rgba(28, 30, 29, .12);
  --accent: #3f5a66;
  --sans: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --pad: clamp(20px, 4.2vw, 72px);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 0; background: var(--snow); color: var(--ink); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
::selection { background: var(--ink); color: var(--snow); }
.mono { font: 400 12px/1.5 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.muted { color: var(--stone); }

/* ---------- global layers ---------- */
#gl { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
.page { position: relative; z-index: 1; }
.grain { position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: .05; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); animation: grain 1.2s steps(6) infinite; }
@keyframes grain { 0%, 100% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } }

.veil { position: fixed; inset: 0; z-index: 80; pointer-events: none; background: var(--snow); transform: scaleY(0); transform-origin: bottom; transition: transform .18s var(--ease); }
.veil.is-open { transform: scaleY(0); }
.veil.is-closing { transform-origin: top; transform: scaleY(1); transition-duration: .18s; }

.loader { position: fixed; inset: 0; z-index: 85; display: flex; flex-direction: column; justify-content: flex-end; padding: var(--pad); background: var(--snow); transition: transform 1.1s var(--ease) .1s; }
.loader.is-done { transform: translateY(-100%); }
.loader-count { font: 200 clamp(90px, 18vw, 260px)/.8 var(--sans); letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.loader-bar { height: 1px; margin-top: 28px; background: var(--line); }
.loader-bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .3s linear; }
.loader-meta { display: flex; justify-content: space-between; margin-top: 14px; color: var(--stone); }

.cursor { position: fixed; top: 0; left: 0; z-index: 95; pointer-events: none; width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 1px solid var(--ink); border-radius: 50%; opacity: 0; transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background .35s, opacity .3s; mix-blend-mode: difference; border-color: #fff; }
.cursor.is-visible { opacity: 1; }
.cursor.is-hover { width: 74px; height: 74px; margin: -37px 0 0 -37px; background: #fff; }
.cursor-dot { position: fixed; top: 0; left: 0; z-index: 96; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: #fff; mix-blend-mode: difference; pointer-events: none; }
@media (hover: none) { .cursor, .cursor-dot { display: none; } }

/* ---------- header ---------- */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 24px var(--pad); transition: transform .6s var(--ease), background .4s; }
.site-header.is-hidden { transform: translateY(-110%); }
.site-header.is-solid { background: rgba(244, 242, 238, .78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.portfolio-header { grid-template-columns: 1fr auto auto auto; gap: clamp(14px, 2vw, 34px); }
.wordmark { display: inline-flex; align-items: baseline; gap: 2px; font: 500 21px/1 var(--sans); letter-spacing: -.045em; }
.wordmark i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.nav { display: flex; gap: clamp(18px, 3vw, 42px); }
.coming-soon .site-header { grid-template-columns: 1fr auto auto; gap: clamp(16px, 3vw, 42px); }
.coming-soon .hero { display: flex; flex-direction: column; justify-content: flex-end; gap: 36px; padding: 110px var(--pad) 144px; }
.coming-soon .hero-title { max-width: 14ch; font-size: 104px; }
.coming-heading { display: grid; gap: 24px; align-self: flex-start; }
.coming-kicker { display: flex; align-items: center; gap: 14px; color: var(--stone); }
.coming-soon .hero-foot { grid-template-columns: minmax(240px, 1.1fr) auto auto; margin-top: 0; }
.language-switch { gap: 14px; }
.language-switch button { color: var(--stone); transition: color .3s; }
.language-switch button[aria-pressed="true"], .language-switch button:hover { color: var(--ink); }
.language-switch button:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
.nav a, .header-status { position: relative; color: var(--ink); }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease); }
.nav a:hover::after, .nav a.is-active::after { transform: scaleX(1); transform-origin: left; }
.header-status { justify-self: end; display: inline-flex; align-items: center; gap: 10px; }
.pulse { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.pulse::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid var(--accent); animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }

/* ---------- text reveal ---------- */
.line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.line > span { display: inline-block; max-width: 100%; transform: none; transition: transform 1.2s var(--ease); transition-delay: calc(var(--i, 0) * 90ms + var(--d, 0ms)); }
.is-in .line > span, .line.is-in > span { transform: none; }
.fade { opacity: 1; transform: none; transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); transition-delay: var(--d, 0ms); }
.fade.is-in { opacity: 1; transform: none; }

/* ---------- shared primitives ---------- */
.section { position: relative; padding: clamp(110px, 16vw, 220px) var(--pad); }
.rule { display: flex; justify-content: space-between; align-items: center; padding-bottom: 16px; margin-bottom: clamp(48px, 7vw, 96px); border-bottom: 1px solid var(--line); color: var(--stone); }
.display { font: 300 clamp(44px, 7.4vw, 124px)/.95 var(--sans); letter-spacing: -.055em; }
.display em { letter-spacing: -.02em; }
.headline { font: 300 clamp(34px, 4.6vw, 72px)/1.02 var(--sans); letter-spacing: -.045em; }
.lead { max-width: 440px; color: var(--stone); font-size: clamp(15px, 1.15vw, 17px); line-height: 1.65; }
.btn { display: inline-flex; align-items: center; gap: 18px; padding: 16px 22px; border: 1px solid var(--ink); border-radius: 999px; font: 500 13px/1 var(--sans); letter-spacing: -.01em; overflow: hidden; position: relative; isolation: isolate; transition: color .5s var(--ease); }
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ink); border-radius: inherit; transform: translateY(101%); transition: transform .5s var(--ease); }
.btn:hover { color: var(--snow); }
.btn:hover::before { transform: none; }
.btn-solid { background: var(--ink); color: var(--snow); }
.btn-solid::before { background: var(--accent); }
.arrow { display: inline-block; transition: transform .5s var(--ease); }
a:hover .arrow { transform: translateX(5px); }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; }

/* ---------- home: hero ---------- */
.hero { position: relative; min-height: 100svh; display: grid; grid-template-rows: 1fr auto; padding: 130px var(--pad) 34px; }
.hero-title { align-self: end; max-width: 13ch; font: 300 clamp(58px, 10.4vw, 188px)/.9 var(--sans); letter-spacing: -.065em; }
.hero-title em { letter-spacing: -.035em; }
.hero-foot { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 30px; align-items: end; margin-top: clamp(40px, 6vw, 80px); padding-top: 20px; border-top: 1px solid var(--line); }
.hero-foot p { max-width: 360px; font-size: 15px; line-height: 1.6; }
.coming-status { justify-self: end; display: flex; align-items: center; gap: 12px; color: var(--stone); }
.hero-index a { display: grid; grid-template-columns: 34px 1fr auto; padding: 7px 0; border-bottom: 1px solid var(--line); transition: padding .5s var(--ease), color .3s; }
.hero-index a:hover { padding-left: 10px; color: var(--accent); }
.scroll-hint { justify-self: end; display: flex; align-items: center; gap: 14px; }
.scroll-hint > span:not(.scroll-label) { display: block; width: 1px; height: 46px; background: var(--line); position: relative; overflow: hidden; }
.scroll-hint > span:not(.scroll-label)::after { content: ""; position: absolute; inset: 0; background: var(--ink); animation: drip 2.2s var(--ease) infinite; }
@keyframes drip { from { transform: translateY(-100%); } to { transform: translateY(100%); } }

/* ---------- home: about ---------- */
.about-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.about-grid .headline { grid-column: 1 / span 8; }
.about-grid .headline .word { transition: color .35s; color: var(--stone); }
.about-grid .headline .word.is-lit { color: var(--ink); }
.about-copy { grid-column: 7 / span 5; margin-top: clamp(60px, 8vw, 120px); display: grid; gap: 24px; }
.about-copy p { color: var(--stone); line-height: 1.7; }
.disciplines { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(70px, 10vw, 150px); border-top: 1px solid var(--line); }
.disciplines div { padding: 22px 20px 0 0; }
.disciplines b { display: block; margin: 16px 0 8px; font: 400 21px/1.2 var(--sans); letter-spacing: -.03em; }
.disciplines small { color: var(--stone); font-size: 13px; }
.tools { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; }

/* ---------- CV ---------- */
.cv-columns { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: clamp(42px, 7vw, 112px); align-items: start; }
.cv-heading { margin-bottom: 26px; font: 400 22px/1.2 var(--sans); }
.cv-timeline { border-top: 1px solid var(--line); }
.cv-entry { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 24px; padding: 25px 0; border-bottom: 1px solid var(--line); }
.cv-date, .cv-education .mono { color: var(--stone); }
.cv-entry h3, .cv-education h3 { font: 500 17px/1.35 var(--sans); }
.cv-entry h3 span, .cv-education h3 span { color: var(--stone); font-weight: 400; }
.cv-entry p, .cv-education p, .cv-highlights p { color: var(--stone); font-size: 14px; line-height: 1.65; }
.cv-entry .cv-role { margin: 8px 0; color: var(--ink); font-size: 13px; }
.cv-side { display: grid; gap: clamp(44px, 6vw, 76px); }
.cv-education { border-top: 1px solid var(--line); }
.cv-education article { padding: 18px 0; border-bottom: 1px solid var(--line); }
.cv-education .mono { display: block; margin-top: 10px; font-size: 10px; }
.cv-highlights { display: grid; gap: 12px; }
.cv-highlights .cv-heading { margin-bottom: 8px; }
.cv-highlights p { padding-left: 14px; border-left: 1px solid var(--accent); }
.cv-languages { display: grid; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.cv-languages span:first-child { color: var(--stone); }

/* ---------- home: work ---------- */
.work { padding-bottom: 0; }
.work-item { position: relative; min-height: 100svh; display: grid; grid-template-columns: repeat(12, 1fr); align-items: center; border-top: 1px solid var(--line); }
.work-copy { grid-column: 1 / span 5; padding: 60px 0; }
.work-num { display: flex; gap: 14px; align-items: center; margin-bottom: 30px; color: var(--stone); }
.work-num i { width: 34px; height: 1px; background: var(--accent-item, var(--accent)); }
.work-title { font: 300 clamp(48px, 7vw, 116px)/.92 var(--sans); letter-spacing: -.06em; transition: letter-spacing .9s var(--ease); }
.work-item:hover .work-title { letter-spacing: -.045em; }
.work-copy .lead { margin: 26px 0 36px; }
.work-meta { display: flex; gap: 26px; margin-bottom: 38px; color: var(--stone); }
.work-hit { position: absolute; inset: 0 0 0 42%; z-index: 1; }
.work-counter { position: sticky; top: 50vh; z-index: 2; height: 0; display: flex; justify-content: flex-end; pointer-events: none; }
.work-counter span { transform: translateY(-50%) rotate(90deg); transform-origin: right; color: var(--stone); }

/* ---------- home: contact ---------- */
.contact { min-height: 90svh; display: flex; flex-direction: column; justify-content: space-between; background: var(--ink); color: var(--snow); }
.contact .rule { border-color: rgba(244, 242, 238, .14); color: rgba(244, 242, 238, .7); }
.contact-mail { display: inline-block; font: 300 clamp(40px, 8.6vw, 150px)/.95 var(--sans); letter-spacing: -.06em; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .9s var(--ease); }
.contact-mail:hover { background-size: 100% 1px; }
.contact-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; margin-top: 80px; color: rgba(244, 242, 238, .55); }
.contact-row a:hover { color: var(--snow); }
.contact .pulse { background: #9fb8ae; }
.contact .pulse::after { border-color: #9fb8ae; }

footer { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 20px; padding: 22px var(--pad); color: var(--stone); border-top: 1px solid var(--line); }
.contact + footer { background: var(--ink); border-color: rgba(244, 242, 238, .1); color: rgba(244, 242, 238, .4); }

/* ---------- project page ---------- */
.p-hero { min-height: 76svh; display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; align-content: end; padding: 150px var(--pad) 50px; }
.p-back { grid-column: 1 / -1; align-self: start; margin-bottom: auto; }
.p-kicker { grid-column: 1 / -1; display: flex; gap: 18px; align-items: center; margin-bottom: 26px; color: var(--stone); }
.p-kicker i { width: 40px; height: 1px; background: var(--accent); }
.p-title { grid-column: 1 / span 10; font: 300 clamp(64px, 13vw, 230px)/.86 var(--sans); letter-spacing: -.07em; }
.p-intro { grid-column: 1 / span 5; margin-top: 44px; }
.p-specs { grid-column: 8 / -1; margin-top: 44px; align-self: end; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.p-specs div { padding-top: 16px; }
.p-specs b { display: block; margin-top: 10px; font: 300 clamp(28px, 3vw, 44px)/1 var(--sans); letter-spacing: -.05em; }

.viewer { position: relative; height: 78svh; min-height: 560px; margin: 0 var(--pad); overflow: hidden; border-radius: 4px; background: radial-gradient(120% 90% at 50% 35%, #f7f6f2 0, var(--paper) 55%, var(--mist) 100%); clip-path: inset(0 round 4px); transition: clip-path 1.6s var(--ease); }
.viewer.is-in { clip-path: inset(0 0 0 0 round 4px); }
.viewer canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: pan-y pinch-zoom; }
.viewer canvas:active { cursor: grabbing; }
.viewer-ui { position: absolute; inset: 0; pointer-events: none; padding: 22px; display: grid; grid-template-rows: auto 1fr auto; }
.viewer-top, .viewer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.viewer-tools { display: flex; gap: 8px; pointer-events: auto; }
.viewer-tools button { padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(244, 242, 238, .7); backdrop-filter: blur(8px); transition: background .3s, color .3s, border-color .3s; }
.viewer-tools button:hover, .viewer-tools button[aria-pressed="true"] { background: var(--ink); color: var(--snow); border-color: var(--ink); }
.viewer-progress { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: var(--stone); transition: opacity .6s; }
.viewer-progress.is-done { opacity: 0; }
.part-card { position: absolute; right: 22px; top: 70px; width: min(280px, calc(100% - 44px)); padding: 20px; border-radius: 4px; background: rgba(244, 242, 238, .9); backdrop-filter: blur(12px); border: 1px solid var(--line); pointer-events: auto; opacity: 1; transform: none; transition: opacity .5s var(--ease), transform .5s var(--ease); }
.part-card.is-in { opacity: 1; transform: none; }
.part-card small { color: var(--accent); }
.part-card strong { display: block; margin: 10px 0 8px; font: 400 24px/1.1 var(--sans); letter-spacing: -.04em; }
.part-card p { color: var(--stone); font-size: 13px; line-height: 1.55; }
.part-card button { position: absolute; top: 12px; right: 14px; font-size: 18px; color: var(--stone); }

.split { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.split .headline { grid-column: 1 / span 7; }
.split .lead { grid-column: 9 / -1; align-self: end; }
.cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: clamp(60px, 8vw, 110px); background: var(--line); border: 1px solid var(--line); }
.cell { position: relative; min-height: 340px; display: flex; flex-direction: column; padding: 26px; background: var(--snow); transition: background .5s var(--ease); }
.cell:hover { background: #fbfaf7; }
.cell-art { flex: 1; display: grid; place-items: center; min-height: 150px; }
.cell h3 { font: 400 24px/1.15 var(--sans); letter-spacing: -.04em; margin: 18px 0 10px; }
.cell p { color: var(--stone); font-size: 14px; line-height: 1.6; max-width: 320px; }
.art-angle { width: 120px; height: 80px; border-left: 1px solid var(--ink); border-bottom: 1px solid var(--ink); position: relative; }
.art-angle::after { content: ""; position: absolute; left: 0; bottom: 0; width: 140px; height: 1px; background: var(--accent); transform-origin: left; transform: rotate(-30deg); }
.art-dial { width: 86px; height: 86px; border-radius: 50%; border: 1px dashed var(--ink); animation: spin 18s linear infinite; position: relative; }
.art-dial::after { content: ""; position: absolute; top: 6px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.art-stack { display: grid; gap: 8px; }
.art-stack i { display: block; width: 130px; height: 22px; border: 1px solid var(--ink); border-radius: 2px; transition: transform .7s var(--ease); }
.art-stack i:nth-child(2) { border-color: var(--accent); }
.cell:hover .art-stack i:nth-child(1) { transform: translateY(-8px); }
.cell:hover .art-stack i:nth-child(3) { transform: translateY(8px); }

.rows { border-top: 1px solid var(--line); }
.rows > * { display: grid; grid-template-columns: 70px 1fr 1fr auto; gap: 20px; align-items: center; min-height: 84px; border-bottom: 1px solid var(--line); transition: padding .5s var(--ease), background .4s; }
.rows > a:hover { padding: 0 14px; background: #fbfaf7; }
.rows strong { font: 400 20px/1.2 var(--sans); letter-spacing: -.03em; }

.gallery { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.gallery figure { margin: 0; overflow: hidden; border-radius: 4px; background: var(--paper); }
.gallery figure:nth-child(4n + 1) { grid-column: span 7; }
.gallery figure:nth-child(4n + 2) { grid-column: span 5; margin-top: 18vh; }
.gallery figure:nth-child(4n + 3) { grid-column: 2 / span 5; }
.gallery figure:nth-child(4n + 4) { grid-column: span 6; margin-top: 10vh; }
.gallery img { width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; transform: scale(1.12); transition: transform 1.6s var(--ease); }
.gallery figure.is-in img { transform: scale(1); }
.gallery figcaption { padding: 12px 14px; color: var(--stone); background: var(--snow); }

.cta { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: end; padding: clamp(40px, 6vw, 90px); border-radius: 4px; background: var(--paper); }
.price { display: flex; align-items: flex-start; gap: 10px; font: 200 clamp(90px, 10vw, 160px)/.8 var(--sans); letter-spacing: -.07em; }
.price small { margin-top: 12px; font: 400 18px var(--mono); letter-spacing: 0; }
.cta-side { display: grid; gap: 20px; justify-items: start; }

.next { position: relative; display: block; padding: clamp(80px, 12vw, 180px) var(--pad); overflow: hidden; border-top: 1px solid var(--line); isolation: isolate; }
.next::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--next-accent, var(--ink)); transform: scaleY(0); transform-origin: bottom; transition: transform .9s var(--ease); }
.next:hover { color: var(--snow); }
.next:hover::before { transform: scaleY(1); }
.next .mono { color: inherit; opacity: .8; }
.next-title { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 26px; font: 300 clamp(56px, 11vw, 190px)/.88 var(--sans); letter-spacing: -.07em; transition: color .6s; }
.next-title .arrow { font-size: .5em; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto; }
  .header-status { display: none; }
  .portfolio-header { grid-template-columns: 1fr auto auto; }
  .cv-columns { grid-template-columns: 1fr; }
  .coming-soon .site-header { grid-template-columns: 1fr auto auto; }
  .coming-soon .header-status { display: inline-flex; }
  .coming-soon .hero-title { font-size: 72px; }
  .coming-soon .hero-foot { grid-template-columns: 1fr; }
  .coming-soon .hero { gap: 24px; padding-top: 96px; padding-bottom: 120px; }
  .hero-foot { grid-template-columns: 1fr; }
  .coming-status { justify-self: start; }
  .scroll-hint { display: none; }
  .about-grid .headline, .about-copy { grid-column: 1 / -1; }
  .disciplines { grid-template-columns: 1fr 1fr; row-gap: 30px; }
  .work-item { align-items: end; }
  .work-copy { grid-column: 1 / -1; padding-bottom: 12vh; }
  .work-hit { inset: 0; }
  .work-copy { position: relative; z-index: 2; pointer-events: none; }
  .work-copy a { pointer-events: auto; }
  .work-counter { display: none; }
  .p-title, .p-intro, .p-specs { grid-column: 1 / -1; }
  .split .headline, .split .lead { grid-column: 1 / -1; }
  .cells { grid-template-columns: 1fr; }
  .gallery figure { grid-column: 1 / -1 !important; margin-top: 0 !important; }
  .cta { grid-template-columns: 1fr; }
  .rows > * { grid-template-columns: 44px 1fr auto; }
  .rows > * > :nth-child(3) { display: none; }
}
@media (max-width: 560px) {
  .nav { gap: 16px; }
  .coming-soon .hero-title { font-size: 46px; }
  .portfolio-header { grid-template-columns: 1fr auto; }
  .portfolio-header .site-nav { display: none; }
  .mobile-menu { display: block; }
  .cv-entry { grid-template-columns: 1fr; gap: 10px; }
  .project-nav a { display: inline-flex; }
  .viewer { margin: 0; border-radius: 0; height: 78svh; }
  .viewer-tools button { padding: 8px 11px; }
  .p-specs { grid-template-columns: repeat(3, 1fr); row-gap: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Accessible enhancement and resilient layouts. Content is readable without JS. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
section[id], main[id] { scroll-margin-top: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.contact :focus-visible { outline-color: var(--snow); }
button, summary, .nav a { min-height: 44px; }
button:disabled, select:disabled { cursor: default; opacity: .55; }
.nav { align-items: center; }
.nav a { display: inline-flex; align-items: center; }
.nav a::after { bottom: 5px; }
.language-switch { gap: 2px; }
.language-switch button { min-width: 44px; min-height: 44px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 12px; left: 20px; z-index: 120; padding: 12px 20px; color: var(--snow); background: var(--ink); transform: translateY(-200%); }
.skip-link:focus { transform: none; }
.loader { display: none; }
.will-reveal:not(.is-in) { opacity: 0; transform: translateY(18px); }
.will-reveal:not(.is-in) .line > span { transform: translateY(110%); }
.mobile-menu { display: none; position: relative; }
.mobile-menu summary { display: flex; align-items: center; justify-content: center; gap: 12px; cursor: pointer; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; list-style: none; }
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu summary::after { content: '+'; font-size: 18px; }
.mobile-menu[open] summary::after { content: '−'; }
.mobile-menu nav { position: absolute; top: 56px; right: 0; min-width: 220px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--snow); box-shadow: 0 16px 40px #1c1e1d12; }
.mobile-menu nav a { display: flex; align-items: center; padding: 12px; min-height: 48px; }
.mobile-menu nav a:hover { background: var(--paper); }
.hero-title { font-size: clamp(46px, 9.2vw, 164px); max-width: 15ch; }
.hero-foot { grid-template-columns: 1.2fr 1fr .6fr; }
.hero-foot p { font-size: 16px; }
.hero-summary { display: grid; gap: 22px; justify-items: start; }
.hero-contact { padding: 13px 19px; }
.work-note { max-width: 600px; margin: -36px 0 60px; }
.work-preview { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 52%; height: auto; max-height: 70%; object-fit: contain; border-radius: 8px; }
.has-scene .work-item.model-ready .work-preview { opacity: 0; }
.project-header { grid-template-columns: 1fr auto auto auto; gap: clamp(12px, 2vw, 32px); }
.p-hero { padding-top: 130px; }
.p-intro .lead { font-size: 17px; }
.viewer-stage { position: absolute; inset: 62px 20px 142px; }
.viewer-poster { width: 100%; height: 100%; object-fit: contain; }
.viewer:not(.is-ready) canvas { visibility: hidden; }
.viewer.is-ready .viewer-poster { visibility: hidden; }
.viewer-ui { grid-template-rows: auto 1fr; }
.viewer-bottom { align-self: end; display: grid; grid-template-columns: 1fr minmax(180px, 300px); gap: 12px 24px; }
.viewer-tools { flex-wrap: wrap; }
.viewer-tools button { min-height: 44px; }
.viewer-inspector { pointer-events: auto; }
.viewer-inspector select { width: 100%; min-height: 44px; padding: 8px 30px 8px 12px; border: 1px solid var(--stone); border-radius: 5px; background: var(--snow); color: var(--ink); font: 400 13px var(--sans); }
.viewer-help { grid-column: 1 / -1; line-height: 1.6; font-size: 11px; }
.viewer-progress { top: 52%; background: var(--snow); padding: 10px 14px; border-radius: 4px; max-width: 85%; text-align: center; }
.viewer-progress:empty { display: none; }
.viewer-retry { position: absolute; top: 60%; left: 50%; transform: translateX(-50%); background: var(--snow); }
.part-card { z-index: 3; text-transform: none; letter-spacing: normal; }
.part-card button { min-width: 44px; min-height: 44px; top: 0; right: 0; }
.part-card small { display: block; padding-right: 20px; }
.gallery figure { align-self: start; }
.gallery img { transform: none; }
.rows > * { padding: 18px 0; }
.contact-row { color: rgba(244,242,238,.72); }
footer { font-size: 11px; }
@media (max-width: 1100px) {
  .portfolio-header .header-status { display: none; }
  .portfolio-header { grid-template-columns: 1fr auto auto; gap: 12px; }
}
@media (max-width: 900px) {
  .hero-foot { grid-template-columns: 1fr; }
  .hero { padding-top: 120px; }
  .work-item { min-height: auto; display: flex; flex-direction: column; align-items: stretch; padding: 46px 0 64px; gap: 32px; }
  .work-copy { padding: 0; }
  .work-copy .lead { margin: 20px 0; }
  .work-preview, .has-scene .work-preview, .has-scene .work-item.model-ready .work-preview { position: relative; top: auto; width: 100%; max-height: 360px; transform: none; opacity: 1; order: -1; }
  .work-meta { margin-bottom: 24px; }
  .has-scene #gl { opacity: .35; }
  .work { background: var(--snow); }
  .project-header { grid-template-columns: 1fr auto; gap: 4px; }
  .project-header .project-nav { grid-column: 1 / -1; grid-row: 2; justify-content: center; gap: 28px; }
  .project-header .language-switch { grid-column: 2; grid-row: 1; }
  .project-header .header-status { display: none; }
  .viewer-stage { bottom: 190px; }
  .viewer-bottom { grid-template-columns: 1fr; gap: 10px; }
  .viewer-help { grid-column: auto; }
  .viewer-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .viewer-tools button { padding: 8px 5px; font-size: 11px; letter-spacing: 0; }
  .viewer { min-height: 580px; }
  .p-hero { min-height: auto; padding-top: 160px; }
  .p-intro { margin-top: 20px; }
  .p-specs { margin-top: 12px; }
  .work-note { margin-top: 0; }
}
@media (max-width: 560px) {
  .site-header { padding-top: 12px; padding-bottom: 12px; background: rgba(244,242,238,.94); }
  .portfolio-header { grid-template-columns: 1fr auto auto; gap: 4px; }
  .portfolio-header .site-nav { display: none; }
  .mobile-menu { display: block; }
  .language-switch { gap: 0; }
  .language-switch button { min-width: 36px; }
  .hero { gap: 36px; padding-top: 110px; }
  .hero-title { font-size: clamp(42px, 10.9vw, 60px); }
  .hero-foot { gap: 26px; margin-top: 0; }
  .hero-index { max-width: 100%; }
  .section { padding-top: 90px; padding-bottom: 90px; }
  .contact-mail { font-size: clamp(28px, 7.6vw, 44px); overflow-wrap: anywhere; }
  .p-title { font-size: clamp(56px, 13vw, 76px); }
  .p-kicker { flex-wrap: wrap; gap: 10px; }
  .p-specs b { font-size: 32px; }
  .viewer { min-height: 560px; height: 78svh; }
  .viewer-ui { padding: 16px; }
  .viewer-stage { inset: 60px 12px 190px; }
  .viewer-top .chip { font-size: 10px; }
  .rows > * { grid-template-columns: 28px minmax(0,1fr) auto; gap: 10px; }
  .rows > * > :nth-child(3) { display: block; grid-column: 2 / -1; grid-row: 2; }
  .rows strong { font-size: 17px; }
  footer { flex-wrap: wrap; }
  .next-title { font-size: clamp(40px, 10vw, 64px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .will-reveal:not(.is-in) { opacity: 1; transform: none; }
  .will-reveal:not(.is-in) .line > span { transform: none; }
  .grain { animation: none; }
}

@media print {
  .site-header, .grain, .veil, #gl, .skip-link, .viewer-ui, .viewer-progress, .viewer-retry, .part-card, .next, .work-hit, .scroll-hint { display: none !important; }
  .will-reveal, .fade { opacity: 1 !important; transform: none !important; }
  .line > span { transform: none !important; }
  .hero, .p-hero, .contact, .work-item { min-height: 0; }
  .hero, .p-hero, .section { padding: 24px 0; }
  .contact { background: white; color: var(--ink); }
  .work-preview, .has-scene .work-item.model-ready .work-preview { opacity: 1; }
  .viewer canvas { display: none; }
  .viewer.is-ready .viewer-poster { visibility: visible; }
  .viewer { height: 400px; min-height: 0; break-inside: avoid; }
  .viewer-stage { inset: 0; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 360px) {
  .viewer-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .viewer-stage { bottom: 244px; }
  .viewer { min-height: 620px; }
  .work-meta { gap: 16px; }
}
.coming-soon .hero-title { align-self: flex-start; }
@media (max-width: 560px) {
  .coming-soon .site-header { gap: 4px; }
  .coming-soon .header-status { font-size: 10px; gap: 6px; }
}

/* Maker home: the projects are the primary content; the author is a short note. */
.maker-header { grid-template-columns: 1fr auto auto; gap: clamp(24px, 4vw, 64px); }
.maker-brand { display: flex; align-items: center; gap: 18px; }
.maker-brand-note { color: var(--stone); font-size: 10px; letter-spacing: .08em; }
.maker-hero { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(250px, .8fr); gap: clamp(40px, 6vw, 100px); align-items: end; padding: clamp(118px, 9vw, 140px) var(--pad) 44px; }
.maker-kicker { color: var(--stone); margin-bottom: 20px; }
.maker-title { font: 300 clamp(54px, 6.7vw, 104px)/1.02 var(--sans); letter-spacing: -.055em; }
.maker-title em { letter-spacing: -.035em; }
.maker-intro { display: grid; gap: 26px; padding-bottom: 4px; }
.maker-intro > p { color: var(--stone); font-size: 17px; line-height: 1.65; max-width: 360px; }
.maker-text-link { display: inline-flex; align-items: center; justify-content: space-between; gap: 28px; min-height: 44px; justify-self: start; border-bottom: 1px solid var(--line); }
.maker-text-link span:last-child { transition: transform .2s var(--ease); }
.maker-text-link:hover span:last-child { transform: translateY(3px); }
.maker-work { padding: 12px var(--pad) 100px; }
.maker-section-label { display: flex; justify-content: space-between; align-items: center; gap: 24px; color: var(--stone); border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 28px; }
.maker-project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 2.6vw, 44px); }
.maker-card { min-width: 0; }
.maker-project-link { height: 100%; display: flex; flex-direction: column; border-radius: 7px 7px 0 0; }
.maker-project-link:focus-visible { outline-offset: 7px; }
.maker-project-visual { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 6px; background: #262a2c; }
.maker-project-visual img { width: 100%; height: 100%; object-fit: contain; transition: transform .6s var(--ease); }
.maker-project-visual--architecture { background: #d7d5ce; }
.maker-project-link:hover .maker-project-visual img { transform: scale(1.045); }
.maker-project-number { position: absolute; top: 15px; left: 15px; display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid #f4f2ee44; border-radius: 50%; color: var(--snow); background: #1c1e1dbd; font-size: 10px; }
.maker-project-open { position: absolute; bottom: 15px; right: 15px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--snow); color: var(--ink); font: 20px var(--sans); transition: transform .3s var(--ease); }
.maker-project-link:hover .maker-project-open { transform: rotate(45deg); }
.maker-project-category { color: var(--stone); margin: 22px 0 10px; font-size: 11px; letter-spacing: .075em; }
.maker-project-title { font: 400 clamp(28px, 2.7vw, 42px)/1.1 var(--sans); letter-spacing: -.04em; }
.maker-project-summary { margin-top: 15px; color: var(--stone); font-size: 15px; line-height: 1.65; }
.maker-project-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 26px; color: var(--stone); font-size: 11px; }
.maker-project-tags span { padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; }
.maker-project-bottom { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 48px; margin-top: auto; border-top: 1px solid var(--line); font-size: 13px; }
.maker-about { padding: 44px var(--pad) 110px; background: var(--paper); }
.maker-about .maker-section-label { margin-bottom: 56px; }
.maker-about-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .8fr); gap: clamp(40px, 9vw, 150px); align-items: end; }
.maker-about-grid > p { color: var(--stone); font-size: 17px; line-height: 1.75; max-width: 420px; }
.maker-about .headline { font-size: clamp(36px, 4.6vw, 66px); }
.maker-contact { min-height: 0; gap: 36px; padding-top: 48px; padding-bottom: 64px; }
.maker-contact .rule { margin-bottom: 12px; }
.maker-contact-prompt { color: #f4f2eebd; margin-bottom: 22px; font-size: 18px; }
.maker-contact .contact-mail { font-size: clamp(32px, 6.7vw, 104px); }
.maker-contact .contact-row { margin-top: 42px; }
.maker-site > footer { background: var(--ink); color: #f4f2eebd; border-color: #f4f2ee24; }
@media (max-width: 1100px) {
  .maker-header { grid-template-columns: 1fr auto auto; gap: 24px; }
  .maker-brand-note { display: none; }
  .maker-hero { grid-template-columns: minmax(0, 1.5fr) minmax(220px, 1fr); gap: 34px; }
  .maker-title { font-size: clamp(50px, 7.1vw, 82px); }
  .maker-project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 28px; }
}
@media (max-width: 700px) {
  .maker-hero { grid-template-columns: 1fr; padding-top: 118px; padding-bottom: 36px; gap: 24px; }
  .maker-title { font-size: clamp(46px, 9vw, 66px); }
  .maker-kicker { font-size: 10px; margin-bottom: 18px; }
  .maker-intro { gap: 10px; }
  .maker-intro > p { max-width: 480px; font-size: 16px; }
  .maker-section-label { margin-bottom: 24px; gap: 12px; }
  .maker-section-label > .mono { font-size: 11px; }
  .maker-work { padding-bottom: 64px; }
  .maker-project-grid { grid-template-columns: 1fr; gap: 40px; }
  .maker-project-title { font-size: 34px; }
  .maker-project-category { margin-top: 20px; }
  .maker-project-summary { margin-top: 12px; }
  .maker-project-tags { margin-bottom: 20px; }
  .maker-about { padding-top: 32px; padding-bottom: 58px; }
  .maker-about .maker-section-label { margin-bottom: 32px; }
  .maker-about-grid { grid-template-columns: 1fr; gap: 26px; }
  .maker-about-grid > p { max-width: none; font-size: 16px; }
  .maker-contact { padding-top: 36px; padding-bottom: 42px; }
  .maker-contact .rule { align-items: flex-start; gap: 20px; }
  .maker-contact .rule > span { text-align: right; }
  .maker-contact-prompt { font-size: 17px; }
}
@media (max-width: 560px) {
  .maker-header { grid-template-columns: 1fr auto auto; gap: 4px; }
  .maker-title { font-size: clamp(40px, 11.7vw, 57px); }
  .maker-contact .contact-mail { font-size: clamp(27px, 7.8vw, 42px); }
  .maker-contact .contact-row { flex-direction: column; gap: 12px; }
}
@media print {
  .maker-hero, .maker-work, .maker-about { padding: 24px 0; }
  .maker-project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .maker-card { break-inside: avoid; }
}

/* Original full-screen cover; the approved project gallery stays as-is. */
.original-cover .maker-work { position: relative; background: var(--snow); padding-top: 64px; }
.original-cover .hero-title { max-width: 15ch; }
@media (max-width: 700px) { .original-cover .maker-work { padding-top: 36px; } }
