/* =========================================================
   Portfolio · Snap-scroll showcase
   Colors are theme tokens; main.js tweens --bg/--accent/--glow
   on :root when a new section becomes active.
   ========================================================= */

:root {
  --bg: #0e0e10;
  --surface: #18181b;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --line: rgba(255, 255, 255, .09);
  --accent: #ff5b1f;
  --accent-ink: #0e0e10;
  --glow: rgba(255, 255, 255, .10);

  --font: 'Plus Jakarta Sans Variable', 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --nav-h: 72px;
  --gutter: clamp(16px, 4vw, 56px);
  --radius: 14px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* Per-section palettes (read by main.js, also used as fallback when JS is off) */
[data-theme="base"]      { --t-bg: #0e0e10; --t-surface: #18181b; --t-text: #f4f4f5; --t-muted: #a1a1aa; --t-accent: #ff5b1f; --t-ink: #0e0e10; --t-glow: rgba(255,255,255,.10); --t-line: rgba(255,255,255,.09); }
[data-theme="unitprice"] { --t-bg: #141310; --t-surface: #201e1a; --t-text: #f5f3ee; --t-muted: #a8a399; --t-accent: #c6f432; --t-ink: #141310; --t-glow: rgba(198,244,50,.16); --t-line: rgba(255,255,255,.09); }
[data-theme="trials"]    { --t-bg: #111116; --t-surface: #1c1b22; --t-text: #f1eef0; --t-muted: #a39ca3; --t-accent: #e04660; --t-ink: #ffffff; --t-glow: rgba(200,50,74,.28); --t-line: rgba(255,255,255,.09); }
[data-theme="crafting"]  { --t-bg: #171717; --t-surface: #232323; --t-text: #ececec; --t-muted: #a3a3a3; --t-accent: #a335ee; --t-ink: #ffffff; --t-glow: rgba(163,53,238,.22); --t-line: rgba(255,255,255,.09); }
[data-theme="mrsproperty"] { --t-bg: #f9f3ee; --t-surface: #ffffff; --t-text: #2b2127; --t-muted: #7d6d74; --t-accent: #8e4666; --t-ink: #ffffff; --t-glow: rgba(142,70,102,.16); --t-line: rgba(43,33,39,.12); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.mono { font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
em { font-style: normal; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { width: 100%; max-width: 1360px; margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Panels (snap sections) ---------- */
.panel {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--nav-h);
  overflow: hidden;
  isolation: isolate;
}

/* Without JS, sections carry their own background */
html:not(.js) .panel { background: var(--t-bg); }

/* ---------- Progress bar ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding-inline: var(--gutter);
}
/* Glass layer lives on a pseudo-element: backdrop-filter on .nav itself would
   become the containing block for the fixed mobile menu and clip it to 72px. */
.nav::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.nav__brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: -.01em; }
/* mt_ logo: frame + "mt" follow the text color, the cursor takes the project color */
.nav__logo { display: block; width: 36px; height: 36px; color: var(--text); line-height: 0; transition: color .3s; }
.nav__logo svg { width: 100%; height: 100%; display: block; }
.nav__cursor { fill: var(--accent); animation: mt-blink 1.1s steps(1) infinite; }
@keyframes mt-blink { 50% { opacity: 0; } }

.nav__links { display: flex; align-items: center; gap: 6px; }
.nav__links a {
  position: relative;
  padding: 8px 14px; border-radius: 999px;
  font-size: .9rem; font-weight: 500; color: var(--muted);
  transition: color .3s, background-color .3s;
}
.nav__links a:hover { color: var(--text); }
.nav__links a.is-active { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
.nav__links a.is-active::after {
  content: ''; position: absolute; left: 50%; bottom: 2px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
  transform: translateX(-50%);
}
.nav__links .nav__cta { margin-left: 8px; color: var(--accent-ink); background: var(--accent); }
.nav__links .nav__cta:hover,
.nav__links .nav__cta.is-active { color: var(--accent-ink); background: var(--accent); filter: brightness(1.1); }
.nav__links .nav__cta.is-active::after { display: none; }

.nav__burger { display: none; width: 44px; height: 44px; position: relative; z-index: 2; }
.nav__burger span {
  position: absolute; left: 11px; right: 11px; height: 2px; border-radius: 2px;
  background: var(--text); transition: transform .4s var(--ease), top .4s var(--ease);
}
.nav__burger span:first-child { top: 17px; }
.nav__burger span:last-child { top: 25px; }
.nav.is-open .nav__burger span:first-child { top: 21px; transform: rotate(45deg); }
.nav.is-open .nav__burger span:last-child { top: 21px; transform: rotate(-45deg); }

/* Side dots */
.dots {
  position: fixed; right: 22px; top: 50%; z-index: 40;
  display: flex; flex-direction: column; gap: 14px;
  transform: translateY(-50%);
}
.dots a {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted); opacity: .35;
  transition: opacity .3s, transform .4s var(--ease), background-color .3s;
}
.dots a:hover { opacity: .8; }
.dots a.is-active { opacity: 1; background: var(--accent); transform: scale(1.6); }

/* ---------- Shared bits ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 28px; padding: 6px 14px 6px 10px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255,255,255,.03);
  font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--t-accent); }
.pulse::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; background: inherit;
  animation: pulse 2s var(--ease) infinite;
}
@keyframes pulse { to { transform: scale(3); opacity: 0; } }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.04);
  font-weight: 600;
  transition: transform .4s var(--ease), background-color .3s, border-color .3s;
}
.btn:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.25); }
.btn--primary { background: var(--text); color: var(--bg); border-color: transparent; }
.btn--primary span { transition: transform .4s var(--ease); }
.btn--primary:hover span { transform: translateX(4px); }

/* Split words (built by main.js) */
.word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.word > span { display: inline-block; }

/* ---------- Hero ---------- */
.hero__glow { position: absolute; inset: 0; z-index: -1; filter: blur(90px); opacity: .55; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; mix-blend-mode: screen; }
.blob--a { width: 42vmax; height: 42vmax; left: -10vmax; top: -12vmax; background: #ffffff; opacity: .07; animation: drift-a 22s ease-in-out infinite alternate; }
.blob--b { width: 38vmax; height: 38vmax; right: -12vmax; top: 10vh; background: #d4d4d8; opacity: .05; animation: drift-b 26s ease-in-out infinite alternate; }
.blob--c { width: 34vmax; height: 34vmax; left: 30vw; bottom: -20vmax; background: #a1a1aa; opacity: .05; animation: drift-c 30s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate(18vw, 14vh) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-16vw, 20vh) scale(.9); } }
@keyframes drift-c { to { transform: translate(-10vw, -18vh) scale(1.2); } }

.hero__grid {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  opacity: .5;
}

.hero__title, .contact__title {
  margin: 0; max-width: 15ch;
  font-size: clamp(2.6rem, 7.4vw, 6.4rem);
  line-height: 1.02; letter-spacing: -.045em; font-weight: 800;
}
.hero__title em, .contact__title em { color: var(--t-accent); }
/* Blinking "_" after the contact headline, echoing the logo cursor */
.type-cursor {
  display: inline-block; width: .42em; height: .1em; margin-left: .06em;
  background: var(--t-accent); vertical-align: baseline;
  animation: mt-blink 1.1s steps(1) infinite;
}
.js .type-cursor { visibility: hidden; }
.hero__actions .btn--primary span { color: var(--t-accent); }
.hero__lead { max-width: 52ch; margin: 28px 0 0; font-size: clamp(1rem, 1.3vw, 1.15rem); color: var(--muted); }

/* Portrait */
.hero__inner { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.hero__inner .hero__title { font-size: clamp(2.6rem, 6vw, 5.6rem); }
.portrait { position: relative; margin: 0; width: 100%; max-width: min(520px, 62svh); justify-self: end; aspect-ratio: 1; }
.portrait img {
  position: relative; width: 100%; height: 100%; object-fit: cover;
  /* Photo background matches --bg (#0e0e10), so only the outer edges need to melt into the page.
     Two linear fades (sides + top/bottom) intersect, keeping head AND shoulders fully visible. */
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, #000 14%, #000 86%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 8%, #000 76%, transparent 100%);
  -webkit-mask-composite: source-in;
          mask-image:
    linear-gradient(to right, transparent 0%, #000 14%, #000 86%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 8%, #000 76%, transparent 100%);
          mask-composite: intersect;
}
.portrait__ring {
  position: absolute; inset: -6%; border-radius: 50%; z-index: -1;
  background: radial-gradient(closest-side, rgba(255,255,255,.22), transparent);
  filter: blur(40px); opacity: .6;
}
.portrait__badge {
  position: absolute; left: 0; bottom: 16%;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line); color: var(--text); font-size: .7rem;
  box-shadow: 0 20px 40px -12px rgba(0,0,0,.6);
}

/* Small avatar in the contact eyebrow */
.eyebrow--avatar { padding-left: 5px; }
.eyebrow--avatar img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.hero__actions .btn--primary:hover span { transform: translateY(3px); }

.scroll-hint {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted);
}
.scroll-hint__line { width: 1px; height: 44px; background: linear-gradient(var(--muted), transparent); position: relative; overflow: hidden; }
.scroll-hint__line::after {
  content: ''; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--text);
  animation: scroll-line 2s var(--ease) infinite;
}
@keyframes scroll-line { to { top: 110%; } }

/* ---------- Project ---------- */
.project__glow {
  position: absolute; z-index: -1; pointer-events: none;
  width: 80vmax; height: 80vmax; right: -30vmax; top: 50%;
  transform: translateY(-50%);
  background: radial-gradient(closest-side, var(--t-glow), transparent);
}
.project__num {
  position: absolute; z-index: -1; left: calc(var(--gutter) - .06em); bottom: -.22em;
  font-size: clamp(10rem, 28vw, 26rem); font-weight: 800; line-height: 1; letter-spacing: -.06em;
  color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--t-text) 7%, transparent);
  pointer-events: none; user-select: none;
}

.project__inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
  padding-block: 32px;
}

.project__count { margin: 0 0 14px; color: var(--t-accent); }
.project__count span { color: var(--muted); }
.project__title {
  margin: 0;
  font-size: clamp(2.4rem, 4.6vw, 4.4rem); line-height: 1; letter-spacing: -.04em; font-weight: 800;
}
.project__tag { margin: 16px 0 0; color: var(--muted); }
.project__desc { margin: 22px 0 0; color: color-mix(in srgb, var(--t-text) 78%, transparent); max-width: 50ch; }

.project { --line: var(--t-line); }
.project__meta { list-style: none; margin: 24px 0 0; padding: 18px 0 0; display: grid; gap: 8px; border-top: 1px solid var(--line); font-size: .92rem; }
.project__meta li { display: grid; grid-template-columns: 70px 1fr; gap: 12px; align-items: baseline; }
.project__meta .mono { color: var(--muted); font-size: .68rem; }
.project__link { color: var(--t-accent); border-bottom: 1px solid color-mix(in srgb, var(--t-accent) 35%, transparent); transition: border-color .3s; }
.project__link:hover { border-color: var(--t-accent); }

/* Browser mockup */
.project__visual { margin: 0; position: relative; }
.browser {
  display: block; position: relative;
  border-radius: var(--radius); overflow: hidden;
  background: var(--t-surface);
  border: 1px solid var(--t-line);
  box-shadow:
    0 0 0 1px rgba(0,0,0,.4),
    0 40px 80px -20px rgba(0,0,0,.65),
    0 0 120px -30px var(--t-glow);
  transition: transform .6s var(--ease), box-shadow .6s var(--ease);
}
.browser:hover { transform: translateY(-4px); }
.browser__bar {
  display: flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 14px;
  background: color-mix(in srgb, var(--t-text) 4%, transparent); border-bottom: 1px solid var(--t-line);
}
.browser__bar i { width: 10px; height: 10px; border-radius: 50%; background: color-mix(in srgb, var(--t-text) 14%, transparent); }
.browser__bar i:first-child { background: #ff5f57; }
.browser__bar i:nth-child(2) { background: #febc2e; }
.browser__bar i:nth-child(3) { background: #28c840; }
.browser__url {
  margin-left: 12px; flex: 1; max-width: 280px;
  padding: 3px 12px; border-radius: 6px; background: color-mix(in srgb, var(--t-text) 6%, transparent);
  color: var(--muted); font-size: .64rem; text-transform: none; letter-spacing: .04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.browser__view { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.browser__view img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0%; }

[data-theme="mrsproperty"] .browser {
  box-shadow: 0 0 0 1px rgba(43,33,39,.04), 0 40px 80px -24px rgba(90,40,62,.28), 0 0 120px -30px var(--t-glow);
}

/* Full-page preview: scroll the long screenshot inside the frame */
.browser__view.is-scroll img { transition: object-position 7s cubic-bezier(.45, 0, .25, 1); }
@media (hover: hover) {
  .browser:hover .browser__view.is-scroll img { object-position: 50% 100%; transition-duration: 9s; }
}
@media (hover: none) {
  .browser__view.is-scroll img { animation: page-scroll 16s cubic-bezier(.45, 0, .55, 1) infinite alternate; }
}
@keyframes page-scroll { 0%, 12% { object-position: 50% 0%; } 88%, 100% { object-position: 50% 100%; } }

.project__visual figcaption { margin-top: 14px; color: var(--muted); font-size: .66rem; text-align: right; }

/* Gallery slider */
.gallery { margin-top: 26px; }
.gallery__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.gallery__head > .mono { color: var(--muted); font-size: .66rem; }
.gallery__ctrl { display: flex; align-items: center; gap: 8px; }
.gallery__count { color: var(--muted); font-size: .66rem; margin-right: 6px; min-width: 3.5em; text-align: right; }
.gallery__btn {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); font-size: .9rem;
  transition: background-color .3s, color .3s, border-color .3s, opacity .3s;
}
.gallery__btn:hover:not(:disabled) { background: var(--t-accent); color: var(--t-ink); border-color: transparent; }
.gallery__btn:disabled, .gallery__btn.swiper-button-disabled { opacity: .3; cursor: default; }

.gallery .swiper { overflow: visible; }
.gallery { overflow: hidden; margin-right: -2px; padding-right: 2px; }
.gallery .swiper-slide {
  width: 46%;
  display: block; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--t-line); background: var(--t-surface);
  transition: border-color .3s, opacity .3s;
}
.gallery .swiper-slide img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; transition: transform .8s var(--ease); }
.gallery .swiper-slide:hover { border-color: color-mix(in srgb, var(--t-accent) 55%, transparent); }
.gallery .swiper-slide:hover img { transform: scale(1.05); }
html:not(.js) .gallery .swiper-wrapper { display: flex; gap: 12px; overflow-x: auto; }
html:not(.js) .gallery .swiper-slide { flex: 0 0 46%; }

/* Theme accents on project text */
.project .project__title { color: var(--t-text); }

/* ---------- Contact ---------- */
.contact { justify-content: space-between; }
.contact__inner { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-block: 40px; }
.contact__title { max-width: 14ch; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.footer {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-block: 24px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .66rem;
}
.footer__links { display: flex; gap: 20px; }
.footer a:hover { color: var(--t-accent); }

/* ---------- Legal popup ---------- */
html.is-locked { overflow: hidden; }
.legal {
  width: min(760px, calc(100vw - 32px)); max-height: min(86svh, 900px);
  padding: 0; border: 1px solid rgba(255,255,255,.1); border-radius: 18px;
  background: #141416; color: #e4e4e7;
  box-shadow: 0 40px 120px -20px rgba(0,0,0,.8);
  display: none; flex-direction: column; overflow: hidden;
}
.legal[open] { display: flex; animation: legal-in .5s var(--ease); }
.legal::backdrop { background: rgba(8,8,10,.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fade-in .4s ease; }
@keyframes legal-in { from { opacity: 0; transform: translateY(24px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }

.legal__head {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 16px 16px 28px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.legal__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.legal__tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255,255,255,.05); }
.legal__tabs button {
  padding: 8px 16px; border-radius: 999px; font-size: .88rem; font-weight: 600; color: #a1a1aa;
  transition: background-color .3s, color .3s;
}
.legal__tabs button[aria-selected="true"] { background: #ff5b1f; color: #0e0e10; }
.legal__tabs button:hover:not([aria-selected="true"]) { color: #f4f4f5; }
.legal__close {
  margin-left: auto; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.1); color: #a1a1aa; font-size: .9rem;
  transition: color .3s, border-color .3s, transform .4s var(--ease);
}
.legal__close:hover { color: #f4f4f5; border-color: rgba(255,255,255,.3); transform: rotate(90deg); }

.legal__body { overflow-y: auto; overscroll-behavior: contain; padding: 8px 28px 36px; font-size: .94rem; line-height: 1.7; }
.legal__body h3 { margin: 24px 0 4px; font-size: 1.6rem; letter-spacing: -.02em; color: #f4f4f5; }
.legal__sub { margin: 0 0 20px; color: #71717a; font-size: .66rem; }
.legal__body h4 { margin: 26px 0 6px; font-size: .98rem; color: #f4f4f5; }
.legal__body p { margin: 0 0 10px; color: #b4b4bb; }
.legal__body ul { margin: 0 0 10px; padding-left: 1.2em; color: #b4b4bb; }
.legal__body a { color: #ff5b1f; }
.legal__body a:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .legal { width: 100vw; max-width: 100vw; max-height: 100svh; height: 100svh; border-radius: 0; border: 0; }
  .legal__head { padding-left: 16px; }
  .legal__body { padding: 4px 18px 32px; }
}

/* ---------- Lightbox tweaks ---------- */
.glightbox-clean .gslide-description { background: #111; }
.glightbox-clean .gslide-title { font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: #ddd; margin: 0; }
.goverlay { background: rgba(8, 8, 10, .92); backdrop-filter: blur(8px); }

/* ---------- Short desktop viewports ---------- */
@media (min-width: 1024px) and (max-height: 820px) {
  .project__desc { font-size: .94rem; margin-top: 16px; }
  .project__meta { margin-top: 16px; padding-top: 12px; }
  .gallery { margin-top: 18px; }
  .project__visual figcaption { display: none; }
  .hero__actions { margin-top: 28px; }
}
@media (min-width: 1024px) {
  .panel { height: 100vh; height: 100svh; }
  /* Keep the frame inside the viewport */
  .project__visual { max-width: calc((100svh - var(--nav-h) - 120px) * 1.6); justify-self: end; width: 100%; }
}

/* ---------- Tablet & mobile ---------- */
@media (max-width: 1023px) {
  html { scroll-snap-type: y proximity; }
  .panel { scroll-snap-stop: normal; }
  .dots { display: none; }
  .hero__inner { grid-template-columns: 1fr; gap: 0; }
  .portrait { order: -1; justify-self: start; width: 112px; margin-bottom: 24px; }
  .portrait img { -webkit-mask-image: none; mask-image: none; border-radius: 50%; border: 1px solid var(--line); }
  .portrait__ring { inset: -10%; filter: blur(24px); }
  .portrait__badge { display: none; }
  .project__inner { grid-template-columns: 1fr; padding-block: 40px 56px; gap: 32px; }
  .project__visual { order: -1; }
  .project__visual figcaption { display: none; }
  .gallery .swiper-slide { width: 72%; }
  .project__num { font-size: 42vw; bottom: auto; top: calc(var(--nav-h) - .1em); left: auto; right: var(--gutter); }
  .project__glow { right: -50vmax; top: 30%; }
}

@media (max-width: 1100px) {
  .nav__burger { display: block; }
  .nav__links {
    position: fixed; inset: 0; z-index: 1;
    flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px;
    padding: var(--nav-h) var(--gutter) 40px;
    background: var(--bg);
    opacity: 0; visibility: hidden;
    transition: opacity .4s var(--ease), visibility .4s;
  }
  .nav__links a { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; padding: 8px 0; background: none !important; transform: translateY(12px); transition: transform .5s var(--ease), color .3s; }
  .nav__links a.is-active { color: var(--accent); }
  .nav__links a.is-active::after { display: none; }
  .nav__links .nav__cta { margin: 20px 0 0; padding: 12px 24px; font-size: 1.1rem; background: var(--accent) !important; }
  .nav.is-open .nav__links { opacity: 1; visibility: visible; }
  .nav.is-open .nav__links a { transform: none; }
  .nav.is-open .nav__links a:nth-child(2) { transition-delay: .04s; }
  .nav.is-open .nav__links a:nth-child(3) { transition-delay: .08s; }
  .nav.is-open .nav__links a:nth-child(4) { transition-delay: .12s; }
  .nav__brand { position: relative; z-index: 2; }
}

@media (max-width: 560px) {
  :root { --nav-h: 64px; }
  .nav__name { display: none; }
  .scroll-hint { display: none; }
  .hero__inner, .contact__inner { padding-block: 40px; }
  .btn { padding: 12px 18px; }
  .contact__actions .btn--primary { width: 100%; justify-content: space-between; }
  .browser__bar { height: 30px; }
  .browser__url { max-width: 160px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
