/* ==========================================================
   TNJO Production — redesign
   ========================================================== */
:root {
  --bg: #0b0b10;
  --bg-2: #13131b;
  --line: rgba(255, 255, 255, .1);
  --text: #f4f2ee;
  --muted: #8d8b96;
  --red: #e5194a;
  --orange: #f7941d;
  --yellow: #ffc233;
  --cyan: #1fb6d9;
  --purple: #b51fd1;
  --brand: linear-gradient(90deg, var(--red), var(--orange) 30%, var(--yellow) 45%, var(--cyan) 70%, var(--purple));
  --warm: linear-gradient(90deg, var(--red), var(--orange) 55%, var(--yellow));   /* buttons: warm half of the brand only */
  --text-grad: linear-gradient(90deg, var(--red), var(--orange) 30%, var(--yellow) 55%, var(--cyan));   /* gradient text: stops at blue */
  /* side padding; on very wide screens it grows so content never exceeds ~1760px */
  --gutter: max(clamp(16px, 5vw, 72px), calc((100vw - 1760px) / 2));
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 300 17px/1.6 "Raleway", system-ui, sans-serif;
  overflow-x: hidden;
}
body.is-loading { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
.mono { font-family: "Space Mono", ui-monospace, monospace; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
::selection { background: var(--orange); color: #000; }

/* grain overlay */
body::after {
  content: ""; position: fixed; inset: -50%; z-index: 9990; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(4) infinite;
}
@keyframes grain { 0%{transform:translate(0,0)} 25%{transform:translate(-3%,2%)} 50%{transform:translate(2%,-3%)} 75%{transform:translate(-2%,-1%)} }

/* ===== Logo ===== */
.tnjo-logo { display: block; width: 100%; height: auto; overflow: visible; }
.tnjo-logo .facets polygon { transition: fill 1.2s ease; }

/* ===== Preloader ===== */
#page-loader {
  position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: var(--bg);
}
.loader-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }
/* line-drawn logo is only the fallback when the particle canvas can't start */
.loader-logo { width: min(460px, 72vw); position: relative; z-index: 2; display: none; }
.no-particles .loader-logo { display: block; }
/* Counter sits centred just under the logo (logo is min(74vw, 620px) wide, 145:460 ratio — see loaderParticles) */
.loader-meta {
  --p: 0;
  position: absolute; left: 50%; top: calc(50% + min(37vw, 310px) * .3152 + clamp(28px, 5vh, 48px)); z-index: 3;
  transform: translateX(-50%); display: grid; justify-items: center; gap: 10px; width: min(180px, 46vw);
}
/* same size, font and colour as the LOADING label */
.loader-num { font: 400 9px/1 "Space Mono", ui-monospace, monospace; letter-spacing: .3em; padding-left: .3em; font-variant-numeric: tabular-nums; color: var(--muted); }
.loader-num sup { font-size: 1em; vertical-align: baseline; }
.loader-bar { position: relative; width: 100%; height: 1px; border-radius: 2px; background: rgba(255, 255, 255, .1); }
.loader-bar i { position: absolute; inset: 0; border-radius: inherit; background: var(--brand); background-size: min(180px, 46vw) 100%; transform: scaleX(var(--p)); transform-origin: left; }
.loader-bar::after { /* glowing head */
  content: ""; position: absolute; top: 50%; left: calc(var(--p) * 100%); width: 6px; height: 6px; border-radius: 50%;
  background: #fff; transform: translate(-50%, -50%); box-shadow: 0 0 12px 3px rgba(255, 194, 51, .7), 0 0 28px 6px rgba(31, 182, 217, .35);
}
.loader-label { color: var(--muted); letter-spacing: .5em; padding-left: .5em; font-size: 9px; animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* ===== Cursor ===== */
.cursor { position: fixed; inset: 0 auto auto 0; z-index: 9995; pointer-events: none; mix-blend-mode: difference; }
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; border-radius: 50%; transform: translate(-50%, -50%); }
.cursor-dot { width: 6px; height: 6px; background: #fff; }
.cursor-ring {
  width: 40px; height: 40px; border: 1px solid #fff; display: grid; place-items: center;
  transition: width .4s var(--ease), height .4s var(--ease), background .3s;
}
.cursor-label { font: 600 11px/1 "Space Mono", monospace; letter-spacing: .1em; text-transform: uppercase; font-style: normal; color: #000; opacity: 0; transition: opacity .2s; }
.cursor.is-hover .cursor-ring { width: 64px; height: 64px; }
.cursor.is-view .cursor-ring { width: 96px; height: 96px; background: #fff; }
.cursor.is-view .cursor-label { opacity: 1; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 9000; background: var(--brand); transform-origin: left; transform: scaleX(0); }

/* ===== Nav ===== */
#main-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 8000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--gutter);
  transition: padding .5s var(--ease), background .5s, transform .6s var(--ease);
}
#main-nav.is-scrolled { padding-top: 14px; padding-bottom: 14px; background: rgba(11, 11, 16, .72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
#main-nav.is-hidden { transform: translateY(-110%); }
.nav-logo { width: 96px; display: block; }
#site-nav ul { display: flex; gap: clamp(18px, 3vw, 40px); list-style: none; margin: 0; padding: 0; }
#site-nav a {
  position: relative; display: block; overflow: hidden; height: 1.4em;
  font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; line-height: 1.4em;
}
#site-nav a > span { display: block; transition: transform .5s var(--ease); }
#site-nav a > span::after { content: attr(data-roll); display: block; background: var(--text-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
#site-nav a:hover > span, #site-nav a.active > span { transform: translateY(-50%); }
.nav-toggle { display: none; width: 44px; height: 44px; position: relative; z-index: 2; }
.nav-toggle span { position: absolute; left: 10px; right: 10px; height: 1.5px; background: var(--text); transition: transform .5s var(--ease); }
.nav-toggle span:first-child { top: 17px; }
.nav-toggle span:last-child { top: 26px; }
.nav-open .nav-toggle span:first-child { transform: translateY(4.5px) rotate(45deg); }
.nav-open .nav-toggle span:last-child { transform: translateY(-4.5px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  #site-nav {
    position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; padding: var(--gutter);
    clip-path: circle(0 at calc(100% - 38px) 38px); transition: clip-path .9s var(--ease);
  }
  .nav-open #site-nav { clip-path: circle(150% at calc(100% - 38px) 38px); }
  #site-nav ul { flex-direction: column; gap: 6px; }
  #site-nav a { font: 200 clamp(40px, 11vw, 64px)/1.15 "Raleway"; height: 1.15em; letter-spacing: 0; text-transform: none; }
  #site-nav li { opacity: 0; transform: translateY(40px); transition: opacity .6s, transform .8s var(--ease); }
  .nav-open #site-nav li { opacity: 1; transform: none; }
  .nav-open #site-nav li:nth-child(2) { transition-delay: .06s; }
  .nav-open #site-nav li:nth-child(3) { transition-delay: .12s; }
  .nav-open #site-nav li:nth-child(4) { transition-delay: .18s; }
  .nav-open #site-nav li:nth-child(5) { transition-delay: .24s; }
}

/* ===== Hero ===== */
#home { position: relative; min-height: 100svh; display: flex; align-items: center; padding: 120px var(--gutter) 80px; overflow: hidden; }
.poly-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
#home::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 50%, transparent 0%, rgba(11,11,16,.55) 55%, var(--bg) 100%); pointer-events: none; }
.hero-particles { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.hero-inner { position: relative; z-index: 2; width: 100%; pointer-events: none; }
.hero-inner a { pointer-events: auto; }
/* Desktop: text left, particle logo right. Mobile: logo on top, text at the bottom. */
@media (min-width: 901px) {
  .hero-title .line { font-size: clamp(28px, 3.6vw, 60px); }
  .hero-title .word-wrap { font-size: clamp(52px, 6.6vw, 116px); }
}
@media (max-width: 900px) {
  #home { align-items: flex-end; padding-bottom: 110px; }
  .hero-title .word-wrap { font-size: clamp(48px, 15vw, 120px); }
}
.hero-title { margin: 0; font-weight: 200; line-height: .95; letter-spacing: -.02em; }
.hero-title .line { display: block; overflow: hidden; padding-bottom: .06em; font-size: clamp(34px, 6.4vw, 96px); }
.hero-title .line > * { display: inline-block; }
.hero-title b { font-weight: 800; }
.hero-title .word-wrap { font-size: clamp(64px, 17vw, 260px); line-height: .9; padding-bottom: .1em; }
.hero-word { font-weight: 800; text-transform: uppercase; letter-spacing: -.04em; white-space: nowrap; }
.word-wrap { perspective: 800px; }
.hero-word .ch { display: inline-block; will-change: transform; transform-origin: 50% 100%; }
.scroll-cue { position: absolute; left: var(--gutter); bottom: 32px; z-index: 2; display: flex; align-items: center; gap: 14px; color: var(--muted); }
.scroll-cue i { width: 1px; height: 48px; background: var(--line); position: relative; overflow: hidden; }
.scroll-cue i::after { content: ""; position: absolute; left: 0; top: -50%; width: 100%; height: 50%; background: var(--text); animation: drip 1.8s var(--ease) infinite; }
@keyframes drip { to { top: 110%; } }

/* ===== Marquee ===== */
.marquee { border-block: 1px solid var(--line); overflow: hidden; padding: 22px 0; background: var(--bg-2); }
.marquee-track { display: flex; width: max-content; gap: 40px; align-items: center; will-change: transform; }
.marquee span { font: 800 clamp(40px, 7vw, 96px)/1 "Raleway"; text-transform: uppercase; color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.35); transition: color .4s; }
.marquee span:hover { color: var(--text); }
.marquee b { font-size: 28px; color: var(--orange); }
.marquee b:nth-of-type(2n) { color: var(--cyan); }
.marquee b:nth-of-type(3n) { color: var(--red); }

/* ===== Sections ===== */
section { position: relative; }
#services, #about, #portfolio, #contact { padding: clamp(96px, 14vw, 180px) var(--gutter); }
.section-index { display: block; color: var(--muted); margin-bottom: 24px; }
.section-title { margin: 0; font: 200 clamp(40px, 7vw, 104px)/1 "Raleway"; letter-spacing: -.03em; }
.section-title em, .contact-title em { font-style: normal; font-weight: 800; }
/* gradient sits on the innermost span so it survives the split-text transforms */
.section-title em .w > span, .contact-title em .w > span { background: var(--text-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; }
.split .w > span { display: inline-block; }

/* services */
.services-grid { margin-top: clamp(48px, 7vw, 96px); display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; perspective: 1000px; }
.service-card {
  position: relative; min-height: 340px; padding: 28px; border-radius: 20px; background: var(--bg-2); border: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; transform-style: preserve-3d;
}
.service-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: 0; transition: opacity .5s;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--c1) 35%, transparent), transparent 60%);
}
.service-card:hover::before { opacity: 1; }
.service-card::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--c1), var(--c2)); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }
.service-card:hover::after { transform: scaleX(1); }
.svc-icon { width: 64px; height: 64px; fill: none; stroke: var(--c1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transform: translateZ(40px); }
.svc-no { color: var(--muted); position: absolute; top: 28px; right: 28px; }
.service-card h3 { margin: 0; font: 300 clamp(26px, 2.4vw, 34px)/1.1 "Raleway"; transform: translateZ(30px); }
.svc-big {
  position: absolute; right: -10px; bottom: -40px; font: 800 clamp(140px, 16vw, 260px)/1 "Raleway"; letter-spacing: -.06em;
  color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--c1) 55%, transparent); pointer-events: none; opacity: .7;
}
.services-progress { display: none; }
/* Desktop: the section pins and the cards travel horizontally (see initServices in main.js). */
@media (min-width: 901px) {
  #services { min-height: 100vh; padding-top: clamp(96px, 12vh, 140px); padding-bottom: 48px; overflow: hidden; display: flex; flex-direction: column; }
  .services-grid { display: flex; width: max-content; margin-top: clamp(32px, 6vh, 64px); gap: 24px; }
  .service-card { flex: 0 0 clamp(320px, 36vw, 560px); min-height: clamp(300px, 52vh, 520px); padding: 36px; }
  .service-card h3 { font-size: clamp(32px, 3.4vw, 56px); }
  .services-progress { display: block; margin-top: auto; padding-top: 32px; }
  .services-progress i { display: block; height: 2px; background: var(--line); position: relative; overflow: hidden; }
  .services-progress i::after { content: ""; position: absolute; inset: 0; background: var(--brand); transform: scaleX(var(--p, 0)); transform-origin: left; }
}
@media (max-width: 900px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .services-grid { grid-template-columns: 1fr; } .service-card { min-height: 220px; } }

/* cursor trail */
.trail-tri { position: fixed; top: 0; left: 0; z-index: 9994; pointer-events: none; clip-path: polygon(50% 0, 100% 100%, 0 100%); will-change: transform, opacity; }

/* about */
#about { border-top: 1px solid var(--line); }
.about-statement { margin: 0; max-width: 18ch; font: 300 clamp(40px, 7.4vw, 112px)/1.04 "Raleway"; letter-spacing: -.03em; }
.about-statement .w { color: rgba(255,255,255,.12); display: inline; }
.about-foot { margin-top: clamp(48px, 7vw, 96px); display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 40px; }
.stats { list-style: none; margin: 0; padding: 0; display: flex; gap: clamp(28px, 6vw, 80px); }
.stats b { display: block; font: 800 clamp(48px, 6vw, 88px)/1 "Raleway"; }
.stats li:nth-child(1) b { color: var(--orange); }
.stats li:nth-child(2) b { color: var(--cyan); }
.stats li:nth-child(3) b { color: var(--red); }
.stats span { color: var(--muted); }

.btn-magnetic {
  position: relative; display: inline-flex; align-items: center; gap: 16px; padding: 22px 34px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.3); overflow: hidden; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: 13px;
  isolation: isolate;
}
.btn-magnetic::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--warm); transform: translateY(101%); border-radius: inherit; transition: transform .6s var(--ease); }
.btn-magnetic:hover::before { transform: none; }
.btn-magnetic:hover { color: #000; border-color: transparent; }
.btn-magnetic i { font-style: normal; transition: transform .5s var(--ease); }
.btn-magnetic:hover i { transform: translateX(6px); }

/* portfolio */
#portfolio-header { display: grid; gap: 0; margin-bottom: clamp(40px, 6vw, 72px); }
#filter-works { position: relative; display: inline-flex; flex-wrap: wrap; gap: 4px; margin-top: 40px; padding: 6px; border: 1px solid var(--line); border-radius: 999px; width: max-content; max-width: 100%; }
#filter-works button { position: relative; z-index: 1; padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); transition: color .4s; }
#filter-works button.active { color: #000; }
.filter-pill { position: absolute; top: 6px; left: 6px; height: calc(100% - 12px); border-radius: 999px; background: var(--warm); background-size: 300% 100%; }
@media (max-width: 560px) { #filter-works { width: auto; border-radius: 20px; } #filter-works button { padding: 10px 14px; } }

.project-item { color: inherit; }
#projects-container .project-item.is-hidden { display: none; } /* id-level so it beats the flex rule below */

/* Portfolio: uniform card grid. Cards stay small enough that the 350 px legacy
   thumbnails remain sharp; the image keeps its own 35:23 shape (no cropping) and
   the text sits below it, never on top of a logo. */
#projects-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: clamp(18px, 2.2vw, 32px) clamp(16px, 2vw, 28px); }
#projects-container .project-item { display: flex; flex-direction: column; gap: 14px; }
#projects-container .work-media { position: relative; aspect-ratio: 35 / 23; border-radius: 14px; overflow: hidden; background: var(--bg-2);
  transition: transform .7s var(--ease), box-shadow .7s var(--ease); }
#projects-container .work-media::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); pointer-events: none; }
#projects-container .work-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
#projects-container .project-item:hover .work-media { transform: translateY(-6px); box-shadow: 0 24px 50px -24px rgba(247,148,29,.55), 0 10px 30px -18px rgba(31,182,217,.5); }
#projects-container .project-item:hover .work-media img { transform: scale(1.05); }
#projects-container .work-info { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; padding: 0 2px; }
#projects-container .work-title { margin: 0; font: 600 clamp(15px, 1.15vw, 18px)/1.3 "Raleway"; transition: color .3s; }
#projects-container .project-item:hover .work-title { color: var(--orange); }
#projects-container .work-no { color: var(--muted); font-size: 11px; }
#projects-container .work-meta { grid-column: 1 / -1; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) {
  #projects-container { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
  #projects-container .project-item { gap: 10px; }
  #projects-container .work-media { border-radius: 10px; }
  #projects-container .work-title { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  #projects-container .work-no { display: none; }
  #projects-container .work-meta { font-size: 9px; letter-spacing: .08em; }
}

/* contact */
#contact { border-top: 1px solid var(--line); overflow: hidden; }
.contact-title { margin: 0; font: 200 clamp(48px, 10vw, 160px)/.95 "Raleway"; letter-spacing: -.04em; }
.contact-info { max-width: 44ch; color: var(--muted); font-size: clamp(17px, 1.6vw, 21px); margin: 40px 0; }
.socials { list-style: none; padding: 0; margin: 56px 0 0; display: flex; gap: 14px; flex-wrap: wrap; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }

/* contact form — floating labels, gradient focus line */
.contact-form { position: relative; display: grid; gap: 28px; margin-top: 40px; }
.field { position: relative; }
.field input, .field textarea {
  width: 100%; padding: 26px 0 12px; background: transparent; border: 0; border-bottom: 1px solid rgba(255,255,255,.2);
  color: var(--text); font: 300 clamp(18px, 1.6vw, 22px)/1.4 "Raleway"; resize: vertical; outline: none; border-radius: 0;
}
.field textarea { min-height: 140px; }
.field label { position: absolute; left: 0; top: 26px; color: var(--muted); pointer-events: none; font-size: clamp(16px, 1.4vw, 20px); transition: transform .5s var(--ease), color .3s; transform-origin: left top; }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label { transform: translateY(-24px) scale(.7); color: var(--orange); }
.field::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--brand); transform: scaleX(0); transform-origin: left; transition: transform .7s var(--ease); }
.field:focus-within::after { transform: scaleX(1); }
.field.has-error input, .field.has-error textarea { border-bottom-color: var(--red); }
.field-err { display: block; min-height: 1em; margin-top: 6px; color: #ff6b8a; font-size: 13px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn-send { justify-self: start; }
.btn-send.is-busy { pointer-events: none; opacity: .6; }
.btn-send.is-busy i { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-status { margin: 0; color: #ff6b8a; min-height: 1.4em; }
.form-done { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; gap: 8px; background: var(--bg); visibility: hidden; opacity: 0; }
.form-done svg { width: 84px; height: 84px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.form-done circle { stroke: var(--cyan); }
.form-done path { stroke: var(--orange); }
.form-done h3 { margin: 12px 0 0; font: 800 clamp(28px, 3vw, 40px)/1.1 "Raleway"; }
.form-done p { margin: 0; color: var(--muted); }
.socials a { width: 72px; height: 72px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; transition: background .4s, border-color .4s; }
.socials svg { width: 22px; height: 22px; fill: var(--text); transition: fill .3s; }
.socials li:nth-child(1) a:hover { background: var(--red); border-color: var(--red); }
.socials li:nth-child(2) a:hover { background: var(--orange); border-color: var(--orange); }
.socials li:nth-child(3) a:hover { background: var(--cyan); border-color: var(--cyan); }
.socials li:nth-child(4) a:hover { background: var(--purple); border-color: var(--purple); }
.socials li:nth-child(5) a:hover { background: var(--yellow); border-color: var(--yellow); }
.socials li:nth-child(5) a:hover svg { fill: #000; }
@media (max-width: 560px) { .socials { gap: 10px; } .socials a { width: 56px; height: 56px; } .socials svg { width: 20px; height: 20px; } }

/* footer */
#main-footer { padding: 40px var(--gutter) 32px; border-top: 1px solid var(--line); }
.footer-logo { width: 100%; max-width: none; margin-bottom: 32px; }
#main-footer p { color: var(--muted); margin: 0; }
.footer-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 24px; }
.footer-ver { display: inline-flex; align-items: center; gap: 10px; }
.footer-ver i { width: 18px; height: 2px; border-radius: 2px; background: var(--warm); }

/* modal */
#project-modal { position: fixed; inset: 0; z-index: 9500; display: grid; place-items: center; padding: var(--gutter); visibility: hidden; }
#project-modal.is-open { visibility: visible; }
.modal-bg { position: absolute; inset: 0; background: rgba(5,5,8,.85); backdrop-filter: blur(10px); opacity: 0; }
.modal-panel { position: relative; width: min(1100px, 100%); max-height: calc(100svh - 2 * var(--gutter)); overflow: auto; display: grid; grid-template-columns: 1.5fr 1fr; background: var(--bg-2); border: 1px solid var(--line); border-radius: 24px; clip-path: inset(50% 50% 50% 50% round 24px);
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; } /* scrolls on its own, never the page behind */
.modal-close { position: absolute; top: 14px; right: 14px; z-index: 3; width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,.6); }
.modal-media { position: relative; background: #000; min-height: 320px; }
.modal-slides img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .8s; }
.modal-slides img.on { opacity: 1; }
.modal-dots { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; z-index: 2; }
.modal-dots button { width: 28px; height: 3px; background: rgba(255,255,255,.3); border-radius: 2px; }
.modal-dots button.on { background: var(--orange); }
.modal-body { padding: clamp(24px, 3vw, 44px); display: flex; flex-direction: column; gap: 14px; }
.modal-cat { color: var(--orange); }
.modal-title { margin: 0; font: 800 clamp(26px, 3vw, 40px)/1.1 "Raleway"; }
.modal-sub { color: var(--muted); margin: 0; text-transform: none; }
.modal-desc { color: #cfcdd6; margin: 0; }
.modal-link { margin-top: auto; align-self: flex-start; }
/* Phones: image on top with a fixed shape (it can't shrink and slide under the text), text below, the whole card scrolls */
@media (max-width: 760px) {
  .modal-panel { display: flex; flex-direction: column; }
  .modal-media { flex: none; min-height: 0; aspect-ratio: 4 / 3; }
  .modal-body { flex: none; }
}

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

/* Touch devices: drop the costliest effects (full-screen animated grain, live blur) */
@media (hover: none), (pointer: coarse) {
  body::after { display: none; }
  #main-nav.is-scrolled { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(11, 11, 16, .95); }
  .modal-bg { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(5, 5, 8, .94); }
}
