/* =========================================================
   Dipesh Shrestha — Portfolio styles

   HOW SIZING WORKS
   Every size comes from the tokens below. Components never hard-code a font size,
   spacing step or control height; they use a token. Breakpoints only
   (a) redefine tokens and (b) change layout (columns, carousels). To make the whole
   site more/less compact, change the tokens, not individual components.
   ========================================================= */
:root {
  /* ---- size multipliers (1 = default). Set from admin → Sizes & Spacing ---- */
  --k-text: 1; --k-head: 1; --k-space: 1; --k-ctl: 1; --k-radius: 1; --k-hero: 1; --k-img: 1;

  /* ---- colour ---- */
  --orange: #fd853a;
  --orange-2: #f26b1d;
  --orange-soft: #feb273;
  --ink: var(--brand-dark, #171717);   /* dark sections / nav */
  --ink-2: #2a2622;
  --bg: #fdfbf8;            /* warm paper white */
  --surface: #f5f0ea;       /* warm light grey for chips, bars, placeholders */
  --card: #ffffff;
  --heading: #1c1714;       /* warm near-black: headings (16:1 on bg) */
  --text: #4a423c;          /* warm dark grey: body text (9.6:1) */
  --muted: #776c63;         /* warm mid grey: captions (5:1, passes WCAG AA) */
  --line: #ebe4dc;
  --accent-ink: var(--accent-ink-light, #b15d29);  /* deeper orange for accent TEXT on light backgrounds (4.7:1) */
  --on-dark: #f6f1ec;       /* text on dark sections */
  --on-dark-2: #cfc5bc;
  --on-dark-3: #a89c92;

  /* ---- type scale: one ladder for the whole site ---- */
  --fs-2xs: calc(12px * var(--k-text));                                   /* uppercase labels */
  --fs-xs: calc(13px * var(--k-text));                                    /* captions, tags */
  --fs-sm: calc(14px * var(--k-text));                                    /* secondary text, card copy, lists */
  --fs-md: calc(15px * var(--k-text));                                    /* body, buttons, nav, inputs */
  --fs-lead: calc(16.5px * var(--k-text));                                /* intro paragraphs */
  --fs-h3: calc(18px * var(--k-head));                                    /* card titles */
  --fs-h2: calc(clamp(25px, 1.5vw + 15px, 36px) * var(--k-head));         /* section titles */
  --fs-h1: calc(clamp(34px, 3.4vw + 12px, 60px) * var(--k-head));         /* hero title */
  --fs-stat: calc(30px * var(--k-head));                                  /* big numbers */
  --lh-body: 1.55;
  --lh-tight: 1.15;

  /* ---- spacing scale ---- */
  --sp-1: calc(4px * var(--k-space)); --sp-2: calc(8px * var(--k-space)); --sp-3: calc(12px * var(--k-space)); --sp-4: calc(16px * var(--k-space)); --sp-5: calc(24px * var(--k-space)); --sp-6: calc(32px * var(--k-space)); --sp-7: calc(48px * var(--k-space));
  --section-y: calc(64px * var(--k-space));       /* vertical padding of a section */
  --head-gap: calc(32px * var(--k-space));        /* space under a section heading */
  --gutter: 32px;          /* page side margin */
  --maxw: 1120px;          /* content width */

  /* ---- control sizes ---- */
  --ctl: calc(40px * var(--k-ctl));             /* button height */
  --ctl-sm: calc(34px * var(--k-ctl));
  --icon-btn: calc(40px * var(--k-ctl));        /* round buttons */
  --chip-h: calc(36px * var(--k-ctl));
  --nav-btn: calc(38px * var(--k-ctl));
  --nav-link-y: 9px;

  /* ---- radius ---- */
  --r-sm: calc(10px * var(--k-radius)); --r-md: calc(14px * var(--k-radius)); --r-lg: calc(20px * var(--k-radius)); --r-pill: 999px; --r-section: calc(36px * var(--k-radius));
  --radius: var(--r-lg);

  /* ---- big visuals ---- */
  --hero-h: calc(440px * var(--k-hero)); --hero-photo-w: calc(340px * var(--k-hero)); --hero-photo-h: calc(420px * var(--k-hero)); --hero-circle: calc(440px * var(--k-hero));
  --about-h: calc(400px * var(--k-img)); --thumb-h: calc(226px * var(--k-img));

  --ease: cubic-bezier(.22, 1, .36, 1);
}
/* large monitors: a little more room, never a wider stretch than needed */
@media (min-width: 1700px) { :root { --maxw: 1200px; --section-y: calc(72px * var(--k-space)); --fs-lead: calc(17px * var(--k-text)); } }
/* small laptops & tablets in landscape */
@media (max-width: 1100px) {
  :root { --gutter: 24px; --section-y: calc(52px * var(--k-space)); --head-gap: calc(28px * var(--k-space)); --hero-h: calc(400px * var(--k-hero)); --hero-photo-w: calc(310px * var(--k-hero)); --hero-photo-h: calc(380px * var(--k-hero)); --hero-circle: calc(400px * var(--k-hero)); --nav-link-y: 8px; --thumb-h: calc(236px * var(--k-img)); }
}
/* tablets portrait & phones */
@media (max-width: 860px) {
  :root {
    --gutter: 16px; --section-y: calc(44px * var(--k-space)); --head-gap: calc(22px * var(--k-space));
    --fs-md: calc(15px * var(--k-text)); --fs-lead: calc(15.5px * var(--k-text)); --fs-h3: calc(17px * var(--k-head)); --fs-stat: calc(26px * var(--k-head));
    --ctl: calc(44px * var(--k-ctl)); --ctl-sm: calc(38px * var(--k-ctl)); --icon-btn: calc(44px * var(--k-ctl)); --chip-h: calc(40px * var(--k-ctl)); --nav-btn: calc(40px * var(--k-ctl)); --nav-link-y: 11px;
    --r-lg: calc(18px * var(--k-radius)); --r-md: calc(12px * var(--k-radius)); --r-section: calc(26px * var(--k-radius));
    --hero-h: calc(330px * var(--k-hero)); --hero-photo-w: calc(270px * var(--k-hero)); --hero-photo-h: calc(320px * var(--k-hero)); --hero-circle: calc(320px * var(--k-hero));
    --about-h: calc(340px * var(--k-img));
  }
}
/* small phones */
@media (max-width: 400px) {
  :root { --hero-h: calc(300px * var(--k-hero)); --hero-photo-w: calc(245px * var(--k-hero)); --hero-photo-h: calc(290px * var(--k-hero)); --hero-circle: calc(290px * var(--k-hero)); --fs-h1: calc(32px * var(--k-head)); }
}
[data-theme="dark"] {
  --ink: #1a1a1a;
  --ink-2: #2b2723;
  --bg: #100e0d;
  --surface: #1e1b18;
  --card: #171513;
  --heading: #f6f1ec;
  --text: #cfc6be;
  --muted: #a0958c;
  --line: #2f2a26;
  --accent-ink: var(--orange);
}

/* ---------- base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
[hidden] { display: none !important; }
body { font-family: var(--font, "DM Sans"), "DM Sans", system-ui, sans-serif; font-size: var(--fs-md); line-height: var(--lh-body); color: var(--text); background: var(--bg); overflow-x: hidden; overflow-x: clip; transition: background .4s, color .4s; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; font-size: inherit; }
ol, ul { list-style: none; }
.container { width: min(var(--maxw), calc(100% - var(--gutter) * 2)); margin: 0 auto; }
.accent { color: var(--accent-ink); }
.dark-section .accent, .footer .accent { color: var(--orange); }
h1, h2, h3, .logo, .about-num, .hero-stat strong, .step-num, .marquee-track, .page-link span, .services-cta p {
  font-family: var(--font-head, var(--font, "Bricolage Grotesque")), "Bricolage Grotesque", system-ui, sans-serif;
}
h1, h2, h3 { color: var(--heading); font-weight: 600; letter-spacing: -0.03em; transition: color .4s; }
h1 { font-size: var(--fs-h1); line-height: 1.08; }
h2 { font-size: var(--fs-h2); line-height: var(--lh-tight); }
h3 { font-size: var(--fs-h3); line-height: 1.2; letter-spacing: -0.02em; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: var(--r-sm); }
.skip-link { position: absolute; left: -999px; top: 10px; background: var(--orange); color: #fff; padding: 8px 14px; border-radius: var(--r-sm); z-index: 999; }
.skip-link:focus { left: 10px; }

/* ---------- image slots (show a labelled placeholder until the image exists) ---------- */
.img-slot { position: relative; overflow: hidden; background: var(--surface); }
.img-slot img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.img-slot.missing img { display: none; }
.img-slot.missing::after {
  content: "📷 " attr(data-file);
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: var(--sp-3);
  font: 600 var(--fs-2xs)/1.4 ui-monospace, Consolas, monospace; color: rgba(255,255,255,.95);
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.08) 0 10px, transparent 10px 20px);
  word-break: break-all;
}
.img-slot.missing { background-color: var(--orange-soft); }

/* ---------- buttons & small controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: var(--ctl); padding: 0 22px; border-radius: var(--r-pill); font-weight: 600; font-size: var(--fs-md); line-height: 1; border: 0; cursor: pointer; transition: background .25s, color .25s, box-shadow .25s; will-change: transform; }
.btn .arr { display: inline-block; transition: transform .3s var(--ease); }
.btn:hover .arr { transform: translate(3px, -3px); }
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 6px 18px rgba(253,133,58,.32); }
.btn-primary:hover { background: var(--orange-2); box-shadow: 0 9px 24px rgba(253,133,58,.45); }
.btn-ghost { color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.15); }
.btn-outline { border: 1.5px solid var(--orange); color: var(--accent-ink); }
.btn-outline:hover { background: var(--orange); color: #fff; }
.btn.small { min-height: var(--ctl-sm); padding: 0 16px; font-size: var(--fs-sm); }
.round-btn { width: var(--icon-btn); height: var(--icon-btn); border-radius: 50%; border: 1.5px solid currentColor; background: transparent; color: inherit; font-size: 17px; cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .2s; }
.round-btn:hover { background: var(--orange); border-color: var(--orange); color: #fff; transform: scale(1.06); }
.tag { display: inline-block; background: var(--surface); color: var(--heading); padding: 4px 11px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; }

/* ---------- custom cursor (desktop only) ---------- */
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999; border-radius: 50%; opacity: 0; transition: opacity .3s; }
.cursor-dot { width: 8px; height: 8px; background: var(--orange); margin: -4px 0 0 -4px; }
.cursor-ring { width: 36px; height: 36px; border: 1.5px solid var(--orange); margin: -18px 0 0 -18px; transition: opacity .3s, width .25s, height .25s, margin .25s, background .25s; }
.cursor-ring.hover { width: 60px; height: 60px; margin: -30px 0 0 -30px; background: rgba(253,133,58,.12); }
body.has-cursor .cursor-dot, body.has-cursor .cursor-ring { opacity: 1; }

/* ---------- scroll progress / back to top / toast ---------- */
.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; background: var(--orange); transform-origin: 0 50%; transform: scaleX(0); z-index: 100; }
.to-top { position: fixed; right: var(--gutter); bottom: var(--gutter); width: var(--icon-btn); height: var(--icon-btn); border-radius: 50%; border: 0; background: var(--orange); color: #fff; font-size: 19px; cursor: pointer; box-shadow: 0 8px 20px rgba(253,133,58,.4); opacity: 0; transform: translateY(20px); pointer-events: none; transition: opacity .3s, transform .3s; z-index: 60; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.toast { position: fixed; left: 50%; bottom: var(--gutter); transform: translate(-50%, 30px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s var(--ease); z-index: 200; border: 1px solid var(--ink-2); max-width: calc(100vw - var(--gutter) * 2); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- nav ---------- */
.nav-wrap { position: sticky; top: 12px; z-index: 50; padding-inline: var(--gutter); transition: top .3s; }
.nav { max-width: var(--maxw); margin: 0 auto; background: var(--ink); border: 1px solid transparent; border-radius: var(--r-pill); padding: 5px; display: flex; align-items: center; justify-content: space-between; transition: box-shadow .3s, border-color .3s; }
.nav-wrap.scrolled .nav { box-shadow: 0 12px 32px rgba(0,0,0,.25); }
[data-theme="dark"] .nav { border-color: var(--ink-2); }
.nav-links { display: flex; gap: 2px; flex: 1; }
.nav-links:nth-of-type(2) { justify-content: flex-end; }
.nav-links a { position: relative; color: #fff; padding: var(--nav-link-y) 18px; border-radius: var(--r-pill); display: block; font-size: var(--fs-md); line-height: 1.3; transition: background .25s, color .25s; }
.nav-links a:hover { background: var(--ink-2); }
.nav-links a.active { background: var(--orange); font-weight: 700; }
.logo { display: inline-flex; align-items: center; min-height: var(--nav-btn); gap: var(--sp-2); color: #fff; font-weight: 800; font-size: 19px; letter-spacing: .02em; padding: 0 14px; }
.logo-mark { width: 34px; height: 34px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 800; transition: transform .5s var(--ease); }
.logo:hover .logo-mark { transform: rotate(360deg); }
.nav-tools { display: flex; align-items: center; gap: var(--sp-1); margin-left: var(--sp-1); }
.theme-toggle { width: var(--nav-btn); height: var(--nav-btn); border-radius: 50%; border: 0; background: var(--ink-2); color: #fff; font-size: 16px; cursor: pointer; position: relative; overflow: hidden; }
.theme-toggle span { position: absolute; inset: 0; display: grid; place-items: center; transition: transform .4s var(--ease), opacity .4s; }
.theme-toggle .moon { transform: translateY(100%); opacity: 0; }
[data-theme="dark"] .theme-toggle .sun { transform: translateY(-100%); opacity: 0; }
[data-theme="dark"] .theme-toggle .moon { transform: none; opacity: 1; }
.menu-btn { display: none; width: var(--nav-btn); height: var(--nav-btn); border-radius: 50%; border: 0; background: var(--orange); cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.menu-btn span { width: 18px; height: 2px; background: #fff; border-radius: 2px; transition: transform .3s, opacity .3s; }
.nav.open .menu-btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav.open .menu-btn span:nth-child(2) { opacity: 0; }
.nav.open .menu-btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero { text-align: center; padding: var(--sp-5) var(--gutter) 0; position: relative; overflow-x: clip; }
.hello { position: relative; display: inline-block; border: 1.5px solid var(--heading); border-radius: var(--r-pill); padding: 5px 16px; font-weight: 500; font-size: var(--fs-sm); color: var(--heading); }
.spark { position: absolute; right: -24px; top: -18px; width: 24px; height: 24px; background:
  linear-gradient(var(--orange),var(--orange)) 3px 12px/3px 12px no-repeat,
  linear-gradient(var(--orange),var(--orange)) 12px 2px/3px 12px no-repeat; transform: rotate(25deg); animation: wiggle 2.4s ease-in-out infinite; }
@keyframes wiggle { 50% { transform: rotate(10deg) scale(1.15); } }
.hero h1 { margin-top: var(--sp-3); position: relative; z-index: 3; }
.typed { white-space: nowrap; }
.caret { display: inline-block; width: 3px; height: .85em; background: var(--orange); margin-left: 5px; vertical-align: -0.05em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-grid { max-width: var(--maxw); margin: -14px auto 0; display: grid; grid-template-columns: 1fr 1.5fr 1fr; align-items: center; }
.hero-quote { text-align: left; max-width: 260px; }
.quote-mark { font-size: 48px; line-height: .6; color: var(--heading); font-weight: 800; display: block; height: 22px; }
.hero-quote p { font-size: var(--fs-md); font-weight: 500; }
.hero-stat { text-align: right; justify-self: end; }
.hero-stat .stars { color: var(--orange); font-size: 19px; letter-spacing: 2px; }
.hero-stat strong { display: block; font-size: var(--fs-stat); line-height: 1.2; color: var(--heading); font-weight: 700; }
.hero-stat > span { font-size: var(--fs-sm); }
/* clip only the bottom so the orange circle stays round left and right */
.hero-visual { position: relative; height: var(--hero-h); display: flex; justify-content: center; align-items: flex-end; clip-path: inset(-100vh -100vw 0 -100vw); }
.hero-circle { position: absolute; bottom: calc(var(--hero-circle) * -.31); width: var(--hero-circle); height: var(--hero-circle); border-radius: 50%; background: var(--orange-soft); animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.04); } }
.hero-photo { position: relative; z-index: 1; width: var(--hero-photo-w); height: var(--hero-photo-h); background: transparent; }
.hero-photo img { object-fit: contain; object-position: bottom; }
.hero-photo.missing { background: linear-gradient(160deg, var(--orange), #e2621a); border-radius: 200px 200px 0 0; }
.hero-cta { position: absolute; bottom: var(--sp-5); z-index: 2; display: flex; gap: 4px; padding: 5px; border-radius: var(--r-pill); background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.5); backdrop-filter: blur(10px); }

/* ---------- section heads ---------- */
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--sp-5); margin-bottom: var(--head-gap); position: relative; }
.section-head p { max-width: 400px; font-size: var(--fs-md); }

/* ---------- dark sections ---------- */
.dark-section { background: var(--ink); border-radius: var(--r-section); padding: var(--section-y) 0; position: relative; overflow: hidden; color: var(--on-dark-2); --muted: var(--on-dark-3); }
.dark-section h2, .dark-section h3 { color: var(--on-dark); }
.dark-section::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 15% 10%, rgba(253,133,58,.25), transparent 40%), radial-gradient(circle at 90% 90%, rgba(253,133,58,.18), transparent 40%); pointer-events: none; }
[data-theme="dark"] .dark-section { border: 1px solid var(--ink-2); }

/* ---------- services ---------- */
.service-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); position: relative; }
.service-card { display: flex; flex-direction: column; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.1); border-radius: var(--r-lg); padding: var(--sp-2); transition: transform .45s var(--ease), border-color .3s, background .3s; position: relative; }
.service-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--orange) 70%, transparent); background: rgba(255,255,255,.07); }
.service-card:hover .service-img img { transform: scale(1.06); }
.service-img { aspect-ratio: 16 / 10; border-radius: var(--r-md); }
.service-img.missing.art-0 { background: linear-gradient(135deg, #fd853a, #f04438); }
.service-img.missing.art-1 { background: linear-gradient(135deg, #7a5af8, #ee46bc); }
.service-img.missing.art-2 { background: linear-gradient(135deg, #12b76a, #0e9384); }
.service-img.missing.art-3 { background: linear-gradient(135deg, #2e90fa, #1849a9); }
.service-body { display: flex; flex-direction: column; flex: 1; padding: var(--sp-3) var(--sp-2) var(--sp-1); }
.service-num { font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .14em; color: var(--orange); }
.service-card h3 { margin: 4px 0 6px; }
.service-card p { color: var(--on-dark-3); font-size: var(--fs-sm); line-height: 1.5; }
.service-list { margin: var(--sp-3) 0; padding-top: var(--sp-3); border-top: 1px solid rgba(255,255,255,.1); display: grid; gap: 6px; }
.service-list li { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--on-dark-2); }
.service-list li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--orange); flex: none; }
.service-link { margin-top: auto; display: inline-flex; align-items: center; gap: var(--sp-2); min-height: var(--ctl-sm); padding-top: 6px; width: fit-content; font-size: var(--fs-sm); font-weight: 600; color: var(--on-dark); transition: color .25s; }
.service-link .arr { transition: transform .3s var(--ease); }
.service-card:hover .service-link, .service-link:focus-visible { color: var(--orange); }
.service-card:hover .service-link .arr { transform: translateX(5px); }
.services-cta { position: relative; margin-top: var(--sp-5); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-5); border-radius: var(--r-lg); border: 1px dashed rgba(255,255,255,.22); background: rgba(255,255,255,.03); }
.services-cta p { color: var(--on-dark); font-size: var(--fs-h3); font-weight: 500; letter-spacing: -0.01em; }

/* ---------- about ---------- */
.about { padding: var(--section-y) 0; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-7); align-items: center; }
.about-visual { position: relative; height: var(--about-h); }
.about-photo { position: absolute; inset: 24px 44px 0 44px; border-radius: calc(var(--r-lg) + 6px); }
.about-card { position: absolute; left: 0; top: 56px; background: var(--card); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); box-shadow: 0 14px 32px rgba(16,24,40,.14); display: flex; flex-direction: column; font-size: var(--fs-sm); font-weight: 600; color: var(--heading); z-index: 2; border: 1px solid var(--line); }
.about-card:nth-child(2) { left: auto; top: auto; right: 0; bottom: 40px; }
.about-card:nth-child(3) { left: auto; right: 8px; top: 0; }
.about-card:nth-child(4) { top: auto; bottom: 0; left: 24px; }
.about-num { font-size: var(--fs-stat); line-height: 1.15; font-weight: 800; color: var(--orange); }
.float { animation: float 5s ease-in-out infinite; }
.float.delay { animation-delay: -2.5s; }
@keyframes float { 50% { transform: translateY(-10px); } }
.about-text p { font-size: var(--fs-lead); line-height: 1.6; margin: var(--sp-4) 0 var(--sp-5); }
.skills { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.skill-top { display: flex; justify-content: space-between; font-size: var(--fs-sm); font-weight: 700; color: var(--heading); margin-bottom: 5px; }
.bar { height: 7px; background: color-mix(in srgb, var(--orange) 14%, var(--surface)); border-radius: 7px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--orange-soft), var(--orange)); border-radius: 7px; transition: width 1.4s var(--ease) .2s; }
.skills.in .bar i { width: var(--w); }
.tools { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-5); }
.tools span { background: var(--surface); padding: 6px 14px; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600; color: var(--heading); transition: background .2s, color .2s, transform .2s; }
.tools span:hover { background: var(--orange); color: #fff; transform: translateY(-2px); }

/* ---------- process ---------- */
.process { padding: 0 0 var(--section-y); }
.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); counter-reset: s; }
.process-step { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-5) var(--sp-4); position: relative; transition: transform .4s var(--ease), box-shadow .4s, border-color .3s; }
.process-step:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(16,24,40,.1); border-color: var(--orange); }
.step-num { font-size: 40px; font-weight: 800; color: transparent; -webkit-text-stroke: 1.5px var(--orange); line-height: 1; transition: color .3s; }
.process-step:hover .step-num { color: var(--orange); }
.process-step h3 { margin: var(--sp-3) 0 var(--sp-1); }
.process-step p { font-size: var(--fs-sm); line-height: 1.5; }

/* ---------- work ---------- */
.work { padding: 0 0 var(--section-y); }
.work-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: var(--sp-4); }
.work-hint { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-5); }
.chip { background: var(--surface); border: 0; border-radius: var(--r-pill); min-height: var(--chip-h); padding: 0 16px; font-size: var(--fs-sm); font-weight: 600; color: var(--heading); cursor: pointer; transition: background .25s, color .25s, transform .2s; }
.chip:hover { transform: translateY(-2px); }
.chip.active { background: var(--orange); color: #fff; }
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5) var(--sp-4); }
.project { position: relative; display: block; cursor: pointer; background: none; border: 0; text-align: left; color: inherit; transition: opacity .4s, transform .4s var(--ease); }
.project.hide { display: none; }
.project.pop { animation: pop .5s var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(20px); } }
.thumb { height: var(--thumb-h); border-radius: var(--r-lg); transform-style: preserve-3d; transition: transform .3s ease-out, box-shadow .3s; }
.project:hover .thumb { box-shadow: 0 22px 44px rgba(16,24,40,.16); }
.project:hover .thumb img { transform: scale(1.06); }
.project:nth-child(6n+2) .thumb.missing { background: linear-gradient(135deg, #ee46bc, #7a5af8); }
.project:nth-child(6n+3) .thumb.missing { background: #2a2a2a; }
.project:nth-child(6n+4) .thumb.missing { background: linear-gradient(135deg, #12b76a, #087443); }
.project:nth-child(6n+5) .thumb.missing { background: linear-gradient(135deg, #2e90fa, #1849a9); }
.project:nth-child(6n+6) .thumb.missing { background: linear-gradient(160deg, #fec84b, #fd853a); }
.view-label { position: absolute; left: 50%; top: calc(var(--thumb-h) / 2); transform: translate(-50%, -50%) scale(.6); background: var(--orange); color: #fff; font-size: var(--fs-sm); font-weight: 700; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; opacity: 0; transition: opacity .3s, transform .4s var(--ease); pointer-events: none; z-index: 2; }
.project:hover .view-label { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.project-info { padding: var(--sp-3) 4px 0; }
.project-info h3 { margin-top: var(--sp-2); transition: color .2s; }
.project:hover .project-info h3 { color: var(--orange); }
.arrow { position: absolute; top: var(--sp-3); right: var(--sp-3); width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 18px; transition: background .3s, transform .4s var(--ease); z-index: 2; }
.project:hover .arrow { background: var(--orange); transform: rotate(45deg); }

/* ---------- testimonials slider ---------- */
.slider-btns { display: flex; gap: var(--sp-2); color: #fff; }
.t-track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - var(--sp-4) * 2) / 3); gap: var(--sp-4); overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; position: relative; padding-bottom: 4px; }
.t-track::-webkit-scrollbar { display: none; }
.t-card { scroll-snap-align: start; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: var(--r-lg); padding: var(--sp-5) var(--sp-4); backdrop-filter: blur(8px); transition: border-color .3s, transform .3s; }
.t-card:hover { border-color: var(--orange); transform: translateY(-3px); }
.t-person { display: flex; align-items: center; gap: var(--sp-3); }
.t-person strong { color: var(--on-dark); font-size: var(--fs-md); display: block; }
.t-person small { color: var(--muted); font-size: var(--fs-xs); }
.avatar { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }
.avatar.missing { background: var(--orange); }
.avatar.missing::after { content: attr(data-initials); background: none; font: 700 var(--fs-sm)/1 var(--font, "Urbanist"), sans-serif; padding: 0; }
.t-card .stars { color: var(--orange); font-size: var(--fs-md); margin: var(--sp-3) 0 var(--sp-2); }
.t-card .stars b { color: #fff; margin-left: 4px; }
.t-card p { line-height: 1.55; font-size: var(--fs-sm); }
.t-dots { display: flex; justify-content: center; gap: 0; margin-top: var(--sp-3); position: relative; }
.t-dots button { width: 32px; height: 40px; padding: 0; border: 0; background: none; display: grid; place-items: center; cursor: pointer; transition: width .3s; }
.t-dots button::after { content: ""; width: 8px; height: 8px; border-radius: 8px; background: #555; transition: width .3s, background .3s; }
.t-dots button.active { width: 48px; }
.t-dots button.active::after { width: 26px; background: var(--orange); }

/* ---------- contact ---------- */
.contact { padding: var(--section-y) 0; }
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: var(--sp-7); align-items: start; }
.contact-intro p { font-size: var(--fs-lead); line-height: 1.6; margin: var(--sp-3) 0 var(--sp-5); }
.contact-meta { display: grid; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: 700; color: var(--heading); }
.contact-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-5); display: grid; gap: 14px; box-shadow: 0 18px 44px rgba(16,24,40,.08); }
.field { position: relative; }
.field input, .field textarea { width: 100%; border: 1.5px solid var(--line); background: transparent; border-radius: var(--r-md); padding: 20px 14px 7px; font: 500 var(--fs-md) var(--font, "Urbanist"), sans-serif; color: var(--heading); resize: vertical; transition: border-color .2s, box-shadow .2s; }
.field textarea { min-height: 96px; }
.field label { position: absolute; left: 15px; top: 14px; font-size: var(--fs-md); color: var(--muted); pointer-events: none; transition: transform .2s var(--ease), font-size .2s, color .2s; transform-origin: 0 0; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(253,133,58,.15); }
.field input:focus + label, .field textarea:focus + label,
.field input:not(:placeholder-shown) + label, .field textarea:not(:placeholder-shown) + label { transform: translateY(-9px); font-size: var(--fs-2xs); color: var(--accent-ink); }
.err { display: none; color: #d92d20; font-size: var(--fs-xs); font-weight: 600; margin: 5px 4px 0; }
.field.invalid input, .field.invalid textarea { border-color: #f04438; }
.field.invalid .err { display: block; }
.field-chips { border: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.field-chips legend { font-size: var(--fs-sm); font-weight: 700; color: var(--heading); margin-bottom: var(--sp-2); }
.field-chips input { position: absolute; opacity: 0; }
.field-chips span { display: inline-flex; align-items: center; min-height: var(--chip-h); padding: 0 14px; border-radius: var(--r-pill); background: var(--surface); color: var(--heading); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; transition: background .2s, color .2s; }
.field-chips input:checked + span { background: var(--orange); color: #fff; }
.field-chips input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }
.contact-form .btn { justify-self: start; }

/* ---------- marquee ---------- */
.marquee-wrap { position: relative; height: 110px; overflow: hidden; contain: paint; }
.marquee-wrap::before { content: ""; position: absolute; left: -5%; right: -5%; top: 50%; height: 52px; transform: translateY(-50%) rotate(3deg); background: var(--ink); }
.marquee { position: absolute; left: -5%; right: -5%; top: 50%; transform: translateY(-50%) rotate(-3deg); background: var(--orange); padding: 12px 0; box-shadow: 0 0 0 8px var(--bg); overflow: hidden; }
.marquee-track { display: flex; gap: var(--sp-5); width: max-content; animation: scroll 28s linear infinite; color: #fff; font-size: 24px; font-weight: 600; white-space: nowrap; }
.marquee-wrap:hover .marquee-track { animation-play-state: paused; }
.marquee-track i { font-style: normal; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- footer ---------- */
.footer { --muted: var(--on-dark-3); background: var(--ink); border-radius: var(--r-section) var(--r-section) 0 0; color: var(--on-dark-2); padding: var(--sp-7) 0 var(--sp-4); margin-top: var(--sp-5); }
.footer-top { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4); padding-bottom: var(--sp-5); border-bottom: 1px solid #3a3a3a; }
.footer-top h2 { color: var(--on-dark); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--sp-6); padding: var(--sp-6) 0 var(--sp-5); }
.footer .logo { padding: 0; }
.footer-about { margin-top: var(--sp-3); font-size: var(--fs-sm); line-height: 1.6; max-width: 360px; }
.footer h4 { color: var(--orange); font-size: var(--fs-sm); margin-bottom: var(--sp-3); }
.footer-col a, .footer-col span { display: block; font-size: var(--fs-sm); margin-bottom: 6px; width: fit-content; }
.footer-col a { background: linear-gradient(var(--orange), var(--orange)) 0 100%/0 2px no-repeat; transition: background-size .3s, color .3s; }
.footer-col a:hover { color: var(--orange); background-size: 100% 2px; }
.footer-bottom { border-top: 1px solid #3a3a3a; padding-top: var(--sp-4); text-align: center; font-size: var(--fs-xs); color: var(--muted); }

/* social icons (footer) */
.footer-col a.social-link { display: flex; align-items: center; gap: var(--sp-3); background: none; }
.s-badge { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid #3a3a3a; flex: none; transition: background .3s, border-color .3s, color .3s, transform .3s; }
.s-badge .s-icon { width: 16px; height: 16px; }
.social-link .s-name { background: linear-gradient(var(--orange), var(--orange)) 0 100%/0 2px no-repeat; transition: background-size .3s; }
.social-link:hover .s-badge { background: var(--orange); border-color: var(--orange); color: #fff; transform: translateY(-3px) rotate(-8deg); }
.social-link:hover .s-name { background-size: 100% 2px; }
.footer-col .social-link .s-badge { display: grid; margin: 0; width: 32px; height: 32px; }
.footer-col .social-link .s-name { display: inline; margin: 0; }

/* ---------- project pop-up ---------- */
.modal { border: 0; padding: 0; margin: auto; width: min(940px, calc(100vw - var(--gutter) * 2)); max-height: 90vh; border-radius: var(--r-lg); background: var(--card); color: var(--text); overflow: auto; }
.modal::backdrop { background: rgba(10,10,10,.7); backdrop-filter: blur(6px); }
.modal[open] { animation: modalIn .45s var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translateY(40px) scale(.97); } }
.modal-close { position: absolute; top: var(--sp-3); right: var(--sp-3); width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font-size: 15px; cursor: pointer; z-index: 3; transition: background .2s, transform .3s; }
.modal-close:hover { background: var(--orange); transform: rotate(90deg); }
.modal-body { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--sp-5); padding: var(--sp-5); }
.modal-main { height: clamp(240px, 50vh, 360px); border-radius: var(--r-md); }
.modal-thumbs { display: flex; gap: var(--sp-2); margin-top: var(--sp-2); }
.modal-thumbs .img-slot { width: 72px; height: 54px; border-radius: var(--r-sm); cursor: pointer; border: 2px solid transparent; opacity: .6; transition: opacity .2s, border-color .2s; }
.modal-thumbs .img-slot.missing::after { content: "📷"; font-size: 15px; }
.modal-thumbs .img-slot.active { border-color: var(--orange); opacity: 1; }
.modal-info { padding: var(--sp-3) var(--sp-2) var(--sp-1) 0; display: flex; flex-direction: column; }
.modal-info .tag { align-self: flex-start; }
.modal-info h3 { font-size: calc(clamp(20px, 1.2vw + 12px, 26px) * var(--k-head)); margin: var(--sp-3) 0 var(--sp-2); }
.modal-desc { line-height: 1.6; font-size: var(--fs-md); }
.modal-meta { display: grid; gap: var(--sp-2); margin: var(--sp-4) 0; padding: var(--sp-3) 0; font-size: var(--fs-sm); border-block: 1px solid var(--line); }
.modal-meta div { display: flex; justify-content: space-between; gap: var(--sp-4); }
.modal-meta dt { color: var(--muted); font-weight: 600; }
.modal-meta dd { color: var(--heading); font-weight: 700; text-align: right; }
.modal-nav { display: flex; gap: var(--sp-2); align-items: center; margin-top: auto; color: var(--heading); flex-wrap: wrap; }
.modal-cta { margin-left: auto; }
body.modal-open { overflow: hidden; }

/* ---------- desktop pages ("folders"): one section at a time ---------- */
.page-next { display: none; }
body.paged [data-page]:not(.current):not(.page-out) { display: none; }
body.paged .page-in { animation: pageIn .7s var(--ease) both; }
body.paged .page-in + .page-in { animation-delay: .08s; }
@keyframes pageIn { from { opacity: 0; transform: translate(calc(var(--dir, 0) * 44px), 26px); filter: blur(4px); } }
@keyframes pageOut { to { opacity: 0; transform: translate(calc(var(--dir, 0) * -44px), 0); filter: blur(3px); } }
body.paged main { min-height: calc(100vh - 100px); }
body.paged .dark-section { margin-top: var(--sp-5); }
body.paged .work, body.paged .about, body.paged .contact { padding-top: var(--sp-6); }
body.paged .page-next { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--sp-4); width: min(var(--maxw), calc(100% - var(--gutter) * 2)); margin: var(--sp-6) auto var(--sp-3); padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.page-link { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); border: 1px solid var(--line); background: var(--card); transition: border-color .25s, transform .3s var(--ease), box-shadow .3s; }
.page-link.next { text-align: right; justify-self: end; }
.page-link.prev { justify-self: start; }
.page-link small { color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: var(--fs-2xs); }
.page-link span { color: var(--heading); font-size: var(--fs-h3); font-weight: 700; }
.page-link:hover { border-color: var(--orange); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(16,24,40,.1); }
.page-link:hover span { color: var(--orange); }
.page-count { font-size: var(--fs-sm); font-weight: 800; color: var(--muted); letter-spacing: .1em; }

/* =========================================================
   RESPONSIVE LAYOUT (sizes come from the tokens above; these rules only re-arrange)
   ========================================================= */
/* desktop hero: photo + buttons on the left, text on the right */
@media (min-width: 861px) {
  .hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); grid-template-rows: 1fr auto auto auto auto 1fr; column-gap: var(--sp-7);
    width: min(var(--maxw), calc(100% - var(--gutter) * 2)); margin: 0 auto; padding: var(--sp-5) 0 0; text-align: left; }
  .hero-grid { display: contents; }
  .hero-visual { grid-column: 1; grid-row: 1 / 7; }
  .hello { grid-column: 2; grid-row: 2; justify-self: start; }
  .hero h1 { grid-column: 2; grid-row: 3; font-size: calc(clamp(34px, 2.6vw + 10px, 52px) * var(--k-head)); margin-top: var(--sp-3); }
  .hero-quote { grid-column: 2; grid-row: 4; max-width: 440px; margin-top: var(--sp-4); }
  .hero-quote p { font-size: var(--fs-lead); line-height: 1.55; }
  .hero-stat { grid-column: 2; grid-row: 5; justify-self: start; text-align: left; margin-top: var(--sp-5); display: flex; align-items: center; gap: var(--sp-3) var(--sp-4); flex-wrap: wrap; }
  .hero-stat strong { display: inline; font-size: var(--fs-stat); }
}
@media (max-width: 1100px) {
  .service-grid, .process-grid { grid-template-columns: repeat(2, 1fr); }
  .work-grid { grid-template-columns: repeat(2, 1fr); }
  .t-track { grid-auto-columns: calc((100% - var(--sp-4)) / 2); }
  .nav-links a { padding-inline: 12px; }
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; gap: var(--sp-5); }
}
@media (max-width: 860px) {
  html { scroll-padding-top: 72px; }
  .nav-wrap { top: 8px; }
  .nav { flex-wrap: wrap; border-radius: 26px; }
  .nav-links { display: none; order: 3; flex-basis: 100%; flex-direction: column; padding: 4px; }
  .nav-links:nth-of-type(2) { order: 4; }
  .menu-btn { display: flex; }
  .logo { padding: 0 10px; }

  /* hero: name, photo and buttons fit on the first screen */
  .hero { padding: var(--sp-4) var(--gutter) var(--sp-5); }
  .hero-grid { display: flex; flex-direction: column; align-items: center; margin-top: 4px; gap: var(--sp-3); }
  .hero-visual { order: 0; width: 100%; }
  .hero-cta { bottom: var(--sp-4); }
  .hero-stat { order: 1; display: flex; align-items: center; gap: 4px var(--sp-3); flex-wrap: wrap; justify-content: center; text-align: center; }
  .hero-stat .stars { font-size: var(--fs-md); }
  .hero-stat strong { display: inline; }
  .hero-stat > span { color: var(--muted); }
  .hero-quote { order: 2; max-width: 34ch; text-align: center; }
  .quote-mark { font-size: 40px; height: 18px; }

  .section-head, .work-head, .footer-top { flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
  .section-head { gap: var(--sp-2); }
  .footer-top h2 { font-size: var(--fs-h2); }
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: var(--sp-5); }
  .about-photo { inset: 20px 30px 0; }
  .about-card { left: 6px; top: 44px; }
  .about-card:nth-child(2) { right: 6px; bottom: 30px; }
  .about-card:nth-child(3) { right: 6px; }
  .about-card:nth-child(4) { left: 6px; }

  /* services: swipe sideways instead of a tall stack */
  .service-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; gap: var(--sp-3);
    overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(var(--gutter) * -1); padding: 4px var(--gutter) 6px; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
  .service-grid::-webkit-scrollbar { display: none; }
  .service-card { scroll-snap-align: start; }
  .service-card:hover { transform: none; }
  .service-link { min-height: 40px; }
  .services-cta { flex-direction: column; align-items: flex-start; padding: var(--sp-4); gap: var(--sp-3); }

  /* process: compact rows, number on the left */
  .process-grid { grid-template-columns: 1fr; gap: var(--sp-2); }
  .process-step { display: grid; grid-template-columns: 54px 1fr; column-gap: var(--sp-4); padding: var(--sp-4); align-items: start; }
  .step-num { grid-row: span 2; font-size: 34px; }
  .process-step h3 { margin: 0 0 2px; }
  .process-step:hover { transform: none; }

  /* work: one swipeable filter row, 2-column project grid */
  .filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(var(--gutter) * -1) var(--sp-4); padding: 2px var(--gutter); scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .work-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-4) var(--sp-3); }
  .thumb { height: auto; aspect-ratio: 1; }
  .thumb.missing::after { font-size: 10px; padding: 10px; }
  .view-label { display: none; }
  .arrow { width: 32px; height: 32px; top: 6px; right: 6px; font-size: 15px; }
  .project-info { padding: var(--sp-2) 2px 0; }
  .tag { font-size: var(--fs-2xs); padding: 3px 9px; }
  .project-info h3 { font-size: var(--fs-md); line-height: 1.3; margin-top: 4px; }

  /* testimonials: swipe + dots (arrows aren't needed on a phone) */
  .slider-btns { display: none; }
  .t-track { grid-auto-columns: 86%; gap: var(--sp-3); }
  .t-card { padding: var(--sp-4); }

  /* contact form */
  .contact-form { padding: var(--sp-4) var(--sp-3); gap: var(--sp-3); }
  .contact-form .btn { justify-self: stretch; }
  .marquee-wrap { height: 84px; }
  .marquee { padding: 9px 0; }
  .marquee-wrap::before { height: 40px; }
  .marquee-track { font-size: 19px; gap: var(--sp-4); }

  /* footer: full-width about text, comfortable tap sizes */
  .footer { padding: var(--sp-6) 0 var(--sp-4); margin-top: var(--sp-3); }
  .footer-top { padding-bottom: var(--sp-4); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-4); padding: var(--sp-5) 0 var(--sp-4); }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .footer-about { max-width: none; }
  .footer-col a { padding: 9px 0; margin: 0; }
  .footer-col > span { margin: 9px 0 0; }
  .footer h4 { margin-bottom: 2px; }
  .footer-col a.social-link { padding: 4px 0; margin-bottom: 2px; }
  .footer-bottom { text-align: left; padding-right: 60px; }

  /* project pop-up becomes a single column */
  .modal { width: calc(100vw - 24px); }
  .modal-body { grid-template-columns: 1fr; padding: var(--sp-3); gap: var(--sp-3); }
  .modal-main { height: 240px; }
  .modal-info { padding: 0 var(--sp-1) var(--sp-1); }
  .to-top { right: var(--sp-3); bottom: var(--sp-3); }
}
/* tablets (portrait): its own proportions, not a stretched phone */
@media (min-width: 600px) and (max-width: 860px) {
  :root { --gutter: 24px; --section-y: 48px; --hero-h: 380px; --hero-photo-w: 310px; --hero-photo-h: 370px; --hero-circle: 380px; --about-h: 360px; --thumb-h: 200px; }
  .service-grid { grid-auto-columns: 44%; }
  .process-grid { grid-template-columns: 1fr 1fr; }
  .work-grid { grid-template-columns: repeat(3, 1fr); }
  .thumb { aspect-ratio: 4 / 3; }
  .about-grid { grid-template-columns: 1fr 1fr; }
  .t-track { grid-auto-columns: 46%; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .footer-grid > :first-child { grid-column: auto; }
}
@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; animation-delay: 0s !important; transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .social-link:hover .s-badge { transform: none; }
}

/* =========================================================
   HEADER SCROLL ANIMATIONS
   ========================================================= */
.nav-wrap { transition: top .3s, transform .5s var(--ease); }
.nav { position: relative; transition: max-width .6s var(--ease), padding .5s var(--ease), background .4s, box-shadow .4s, border-color .3s; }
/* 1. shrink + frosted glass once you start scrolling */
.nav-wrap.scrolled .nav { background: color-mix(in srgb, var(--ink) 80%, transparent); -webkit-backdrop-filter: blur(16px) saturate(1.5); backdrop-filter: blur(16px) saturate(1.5); border-color: rgba(255,255,255,.08); }
@media (min-width: 861px) {
  .nav-wrap.scrolled .nav { max-width: calc(var(--maxw) - 100px); padding: 3px; }
  .nav-wrap.scrolled .nav-links a { padding-block: calc(var(--nav-link-y) - 2px); padding-inline: 16px; }
  .nav-wrap.scrolled .logo { font-size: 17px; }
  .nav-links a { transition: background .25s, color .25s, padding .5s var(--ease); }
  .logo { transition: font-size .5s var(--ease); }
}
/* 2. tuck away on scroll down, drop back in on scroll up */
.nav-wrap.tucked { transform: translateY(calc(-100% - 30px)); }
/* 3. orange pill that slides between menu links */
.nav-pill { position: absolute; top: 0; left: 0; width: 0; height: 0; border-radius: var(--r-pill); background: var(--orange); box-shadow: 0 5px 14px color-mix(in srgb, var(--orange) 45%, transparent); opacity: 0; pointer-events: none; z-index: 0;
  transition: transform .55s var(--ease), width .55s var(--ease), height .3s, opacity .3s; }
.nav.has-pill .nav-links a.active { background: none; }
.nav-links a, .logo, .nav-tools { position: relative; z-index: 1; }
@media (max-width: 860px) {
  .nav-pill { display: none; }
  .nav.has-pill .nav-links a.active { background: var(--orange); }
}
/* 4. reading-progress ring around the logo mark */
.logo-mark { position: relative; }
.logo-mark::before { content: ""; position: absolute; inset: -4px; border-radius: 50%;
  background: conic-gradient(var(--orange) calc(var(--p, 0) * 1turn), rgba(255,255,255,.14) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  opacity: 0; transition: opacity .4s; }
.nav-wrap.scrolled .logo-mark::before { opacity: 1; }
.footer .logo-mark::before { display: none; }

/* =========================================================
   MOTION SYSTEM — one set of timings for the whole site
   fast .18s = feedback · base .3s = state changes · slow .5s = things arriving
   Everything below is switched off by "reduce motion" (see the block above).
   ========================================================= */
:root { --t-fast: .18s; --t-base: .3s; --t-slow: .5s; --ease-out: cubic-bezier(.22, 1, .36, 1); --ease-in: cubic-bezier(.5, 0, .9, .4); --ease-io: cubic-bezier(.65, 0, .35, 1); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes shake { 20% { translate: -6px 0; } 40% { translate: 5px 0; } 60% { translate: -3px 0; } 80% { translate: 2px 0; } }
@keyframes focusPop { from { outline-offset: 9px; outline-color: transparent; } }

/* ---------- feedback on every control: hover (above), press, focus, disabled ---------- */
:focus-visible { animation: focusPop var(--t-fast) var(--ease-out); }
.btn { transition: background var(--t-base), color var(--t-base), box-shadow var(--t-base), border-color var(--t-base), scale .16s var(--ease-out), transform var(--t-base) var(--ease-out); }
.btn:active { scale: .96; }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; pointer-events: none; }
.round-btn { transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-base) var(--ease-out), scale .16s var(--ease-out); }
.round-btn:active { scale: .9; }
.chip { transition: background var(--t-base), color var(--t-base), transform var(--t-fast), scale .16s var(--ease-out); }
.chip:not(.active):hover { background: color-mix(in srgb, var(--orange) 14%, var(--surface)); }
.chip:active { scale: .94; }
.theme-toggle { transition: background var(--t-base), scale .16s var(--ease-out); }
.theme-toggle:hover { background: color-mix(in srgb, var(--ink-2) 65%, var(--orange)); }
.theme-toggle:active, .menu-btn:active { scale: .9; }
.menu-btn { transition: background var(--t-base), scale .16s var(--ease-out); }
.menu-btn:hover { background: var(--orange-2); }
.modal-close { transition: background var(--t-fast), transform var(--t-base) var(--ease-out), scale .16s var(--ease-out); }
.modal-close:active { scale: .88; }
.nav-links a { transition: background var(--t-base), color var(--t-base), padding .5s var(--ease), scale .16s var(--ease-out); }
.nav-links a:active { scale: .95; }
.nav-links a:focus-visible { outline-offset: -3px; }
.project { transition: opacity .4s, transform .4s var(--ease), scale .16s var(--ease-out); }
.project:active { scale: .985; }
.page-link { transition: border-color .25s, transform var(--t-base) var(--ease), box-shadow var(--t-base), scale .16s var(--ease-out); }
.page-link:active { scale: .98; }
.t-dots button { transition: width var(--t-base) var(--ease-out), scale .16s var(--ease-out); }
.t-dots button:hover::after { background: #8a8078; }
.t-dots button.active:hover::after { background: var(--orange); }
.t-dots button:active { scale: .85; }
.field-chips span { transition: background var(--t-base), color var(--t-base), scale .16s var(--ease-out); }
.field-chips label:hover input:not(:checked) + span { background: color-mix(in srgb, var(--orange) 14%, var(--surface)); }
.field-chips label:active span { scale: .95; }
.service-link:active { scale: .96; }
.skip-link { left: 10px; transform: translateY(-220%); transition: transform var(--t-base) var(--ease-out); }
.skip-link:focus { transform: none; }

/* floating "back to top" button grows in, lifts on hover, presses in */
.to-top { transform: translateY(16px) scale(.7); transition: opacity var(--t-base), transform var(--t-base) var(--ease-out), scale .16s var(--ease-out), background var(--t-fast); }
.to-top.show:hover { transform: translateY(-3px); background: var(--orange-2); }
.to-top:active { scale: .9; }

/* toast: rises with a little scale, leaves the same way */
.toast { transform: translate(-50%, 24px) scale(.96); transition: opacity var(--t-base) var(--ease-out), transform .4s var(--ease-out); }
.toast.show { transform: translate(-50%, 0) scale(1); }

/* ---------- images: shimmer while loading, fade in when ready ---------- */
.img-slot img { opacity: 0; transition: opacity var(--t-slow) var(--ease-out), transform .6s var(--ease); }
.img-slot.is-ready img { opacity: 1; }
.img-slot:not(.is-ready):not(.missing):not(.hero-photo)::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(100deg, transparent 35%, rgba(255,255,255,.32) 50%, transparent 65%); transform: translateX(-100%); animation: shimmer 1.5s ease-in-out infinite; }
.img-slot.missing::after { animation: fadeIn .4s var(--ease-out); }
.modal-main img { transition: opacity .25s var(--ease-out); }

/* ---------- form: error slides in and the field shakes, button confirms ---------- */
.err { display: block; max-height: 0; margin: 0 4px; opacity: 0; visibility: hidden; overflow: hidden; transform: translateY(-6px);
  transition: max-height var(--t-base) var(--ease-out), margin var(--t-base) var(--ease-out), opacity var(--t-fast), transform var(--t-base) var(--ease-out), visibility 0s var(--t-base); }
.field.invalid .err { max-height: 3em; margin-top: 6px; opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.field.invalid input, .field.invalid textarea { box-shadow: 0 0 0 4px rgba(240,68,56,.12); animation: shake .45s var(--ease-io); }
.btn-icon { display: inline-grid; place-items: center; }
.btn .btn-icon > * { grid-area: 1 / 1; transition: opacity .25s var(--ease-out), transform .4s var(--ease-out); }
.btn-check { opacity: 0; transform: scale(.3) rotate(-30deg); }
.btn.is-sent .arr { opacity: 0; transform: scale(.3); }
.btn.is-sent .btn-check { opacity: 1; transform: none; }
.btn-primary.is-sent { background: #12b76a; box-shadow: 0 8px 24px rgba(18,183,106,.35); pointer-events: none; }

/* ---------- work filters: cards leave, then the matching ones arrive one by one ---------- */
.project.pop { animation-delay: var(--pd, 0ms); animation-fill-mode: backwards; }
.project.leaving { animation: projectOut .2s var(--ease-in) forwards; pointer-events: none; }
@keyframes projectOut { to { opacity: 0; transform: scale(.94) translateY(10px); } }
.work-empty { text-align: center; padding: 48px 16px; border: 1.5px dashed var(--line); border-radius: var(--radius); color: var(--muted); font-weight: 600; }
.work-empty.pop { animation: rise .45s var(--ease-out); }

/* ---------- project pop-up: fade + slide in/out, content staggers, switching slides sideways ---------- */
.modal[open]::backdrop { animation: fadeIn .35s var(--ease-out); }
.modal.closing { animation: modalOut .22s var(--ease-in) forwards; }
.modal.closing::backdrop { animation: fadeOut .22s var(--ease-in) forwards; }
@keyframes modalOut { to { opacity: 0; transform: translateY(22px) scale(.97); } }
.modal-body.swap-out { animation: modalSwapOut .16s var(--ease-in) forwards; pointer-events: none; }
@keyframes modalSwapOut { to { opacity: 0; transform: translateX(calc(var(--d, 1) * -36px)); } }
.modal-body.swap-in { animation: modalSwapIn .42s var(--ease-out); }
@keyframes modalSwapIn { from { opacity: 0; transform: translateX(calc(var(--d, 1) * 44px)); } }
.modal[open] .modal-body.swap-in .modal-info > * { animation: riseIn .45s var(--ease-out) backwards; animation-delay: calc(.06s + var(--k, 0) * 45ms); }
@keyframes riseIn { from { opacity: 0; transform: translateY(12px); } }
.modal[open] .modal-info > * { animation: rise .5s var(--ease-out) backwards; animation-delay: calc(.1s + var(--k, 0) * 55ms); }
.modal-info > :nth-child(1) { --k: 0; } .modal-info > :nth-child(2) { --k: 1; } .modal-info > :nth-child(3) { --k: 2; }
.modal-info > :nth-child(4) { --k: 3; } .modal-info > :nth-child(5) { --k: 4; }
.modal-thumbs .img-slot { transition: opacity var(--t-base), border-color var(--t-base), scale .16s var(--ease-out); }
.modal-thumbs .img-slot:hover { opacity: 1; }
.modal-thumbs .img-slot:active { scale: .94; }

/* ---------- pages (desktop): the old one slides out, the new one comes in from the side you are heading to ---------- */
body.paged .page-out { animation: pageOut .16s var(--ease-in) both; pointer-events: none; }

/* ---------- light / dark: colours crossfade instead of snapping ---------- */
html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after { transition: background-color .45s ease, color .45s ease, border-color .45s ease, box-shadow .45s ease, fill .45s ease; }
html.theme-anim .theme-toggle span { transition: transform .4s var(--ease), opacity .4s; }

/* ---------- phone menu: grows open, items arrive one by one, page dims behind it ---------- */
.nav-scrim { display: none; }
@media (max-width: 860px) {
  .nav-links { display: flex; max-height: 0; padding: 0 4px; overflow: hidden; visibility: hidden; opacity: 0;
    transition: max-height .5s var(--ease-io), padding .4s var(--ease-io), opacity .25s var(--ease-io), visibility 0s .5s; }
  .nav.open .nav-links { padding-block: 4px; opacity: 1; visibility: visible; transition-delay: 0s; animation: none; }
  .nav-links:nth-of-type(2) { justify-content: flex-start; } /* bottom-aligned items overflow upwards, which can't be measured */
  .nav-links li { opacity: 0; transform: translateY(-10px); transition: opacity .2s, transform .2s; }
  .nav.open .nav-links li { opacity: 1; transform: none;
    transition: opacity .35s var(--ease-out) calc(.08s + var(--i, 0) * 45ms), transform .45s var(--ease-out) calc(.08s + var(--i, 0) * 45ms); }
  .nav-scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(12,9,6,.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
    opacity: 0; visibility: hidden; transition: opacity .35s var(--ease-out), visibility 0s .35s; }
  body.menu-open .nav-scrim { opacity: 1; visibility: visible; transition-delay: 0s; }
}

/* ---------- "Inspired by" reference in the contact form ---------- */
.liked-ref { display: flex; align-items: center; gap: var(--sp-2); padding: 6px 6px 6px var(--sp-3); border-radius: var(--r-md); font-size: var(--fs-sm);
  background: color-mix(in srgb, var(--orange) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--orange) 35%, transparent); }
.liked-ref:not([hidden]) { animation: rise .35s var(--ease-out); }
.liked-ref-label { color: var(--muted); font-weight: 600; white-space: nowrap; }
.liked-ref b { color: var(--heading); font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liked-ref-x { flex: none; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; transition: background .2s, color .2s, scale .16s var(--ease-out); }
.liked-ref-x:hover { background: color-mix(in srgb, var(--orange) 22%, transparent); color: var(--heading); }
.liked-ref-x:active { scale: .88; }

/* ---------- 3D service icons: they fill the card picture when there is no photo ---------- */
.service-img.missing::after { content: none; }
.service-img.missing::before, .service-img.is-icon::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 28% 18%, rgba(255,255,255,.38), transparent 58%), radial-gradient(circle at 80% 100%, rgba(0,0,0,.18), transparent 60%); }
.service-icon { position: absolute; inset: 0; display: none; place-items: center; perspective: 700px; }
.service-img.missing .service-icon, .service-img.is-icon .service-icon { display: grid; animation: fadeIn .5s var(--ease-out); }
.service-img.is-icon.art-0 { background: linear-gradient(135deg, #fd853a, #f04438); }
.service-img.is-icon.art-1 { background: linear-gradient(135deg, #7a5af8, #ee46bc); }
.service-img.is-icon.art-2 { background: linear-gradient(135deg, #12b76a, #0e9384); }
.service-img.is-icon.art-3 { background: linear-gradient(135deg, #2e90fa, #1849a9); }
.service-img.is-icon { aspect-ratio: 3 / 2; }
.service-icon svg { height: 84%; width: auto; overflow: visible; filter: drop-shadow(0 10px 12px rgba(0,0,0,.22)); transition: transform .6s var(--ease), filter .4s; animation: iconFloat 4.6s ease-in-out infinite; }
.service-card:hover .service-icon svg { transform: translateY(-4px) rotateY(-14deg) rotateX(7deg) scale(1.08); filter: drop-shadow(0 16px 16px rgba(0,0,0,.28)); }
.service-card:nth-child(2) .service-icon svg { animation-delay: -1.1s; }
.service-card:nth-child(3) .service-icon svg { animation-delay: -2.2s; }
.service-card:nth-child(4) .service-icon svg { animation-delay: -3.3s; }
@keyframes iconFloat { 50% { translate: 0 -6px; } }
/* icon colours per card (the card's own gradient) */
.service-img.art-0 { --ic-tint: #ffe6d3; --ic-shade: #f4a06b; --ic-accent: #e5501a; }
.service-img.art-1 { --ic-tint: #efe6ff; --ic-shade: #b497fb; --ic-accent: #7632ee; }
.service-img.art-2 { --ic-tint: #d9f9e9; --ic-shade: #62d3a0; --ic-accent: #0b9a5f; }
.service-img.art-3 { --ic-tint: #dcebff; --ic-shade: #80b4fb; --ic-accent: #1d6ce0; }

.btn.is-busy { opacity: .7; pointer-events: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* =========================================================
   SCROLLBARS — one thin, rounded, orange design everywhere
   (the swipe rows on phones keep theirs hidden on purpose)
   ========================================================= */
:root { --sb: 10px; --sb-thumb: color-mix(in srgb, var(--orange) 60%, transparent); --sb-thumb-hover: var(--orange); --sb-track: transparent; }
html { scrollbar-gutter: stable; }                       /* no page jump when the pop-up locks scrolling */
::-webkit-scrollbar { width: var(--sb); height: var(--sb); }
::-webkit-scrollbar-track { background: var(--sb-track); }
::-webkit-scrollbar-thumb { background: var(--sb-thumb); border-radius: var(--r-pill); border: 3px solid transparent; background-clip: content-box; transition: background-color .2s; }
::-webkit-scrollbar-thumb:hover { background: var(--sb-thumb-hover); background-clip: content-box; }
::-webkit-scrollbar-thumb:active { background: var(--orange-2); background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }
/* the page's own bar: slightly wider, with a faint track so it reads as part of the design */
html::-webkit-scrollbar { width: 12px; }
html::-webkit-scrollbar-track { background: color-mix(in srgb, var(--heading) 5%, transparent); border-left: 1px solid var(--line); }
/* small text boxes */
textarea::-webkit-scrollbar { width: 8px; height: 8px; }
/* Firefox and other browsers without ::-webkit-scrollbar */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--sb-thumb) transparent; }
}
