/* =========================================================
   Tokens
   ========================================================= */
:root {
  --bg: #f5f4ef;
  --bg-2: #ecebe4;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, .72);
  --text: #0f1214;
  --muted: #555c66;
  --border: rgba(15, 18, 20, .10);
  --border-strong: rgba(15, 18, 20, .18);
  --accent: #0b7a83;
  --accent-ink: #ffffff;
  --accent-2: #c98a1c;
  --accent-soft: rgba(11, 122, 131, .10);
  --grad: linear-gradient(120deg, #0b7a83 0%, #11a99c 45%, #d39a2c 100%);
  --arch: linear-gradient(170deg, #12a39a 0%, #0b6f78 55%, #08464d 100%);
  --blob-1: rgba(17, 169, 156, .22);
  --blob-2: rgba(211, 154, 44, .16);
  --blob-3: rgba(59, 91, 219, .10);
  --grid-line: rgba(15, 18, 20, .05);
  --shadow: 0 1px 2px rgba(15, 18, 20, .04), 0 12px 32px -12px rgba(15, 18, 20, .18);
  --shadow-lg: 0 30px 60px -20px rgba(8, 70, 77, .35);
  --code-bg: #0f1418;
  --focus: #c25e00;

  --radius: 20px;
  --max: 1160px;
  --header-h: 72px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, "Geeza Pro", system-ui, sans-serif;
  --display: "Alexandria", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0c0f;
    --bg-2: #0f1216;
    --surface: #12161b;
    --surface-glass: rgba(18, 22, 27, .72);
    --text: #eef0f2;
    --muted: #9aa3ad;
    --border: rgba(255, 255, 255, .08);
    --border-strong: rgba(255, 255, 255, .16);
    --accent: #2ccabd;
    --accent-ink: #04211f;
    --accent-2: #f2b84b;
    --accent-soft: rgba(44, 202, 189, .12);
    --grad: linear-gradient(120deg, #2ccabd 0%, #7be3d6 45%, #f2b84b 100%);
    --blob-1: rgba(44, 202, 189, .16);
    --blob-2: rgba(242, 184, 75, .10);
    --blob-3: rgba(99, 125, 255, .10);
    --grid-line: rgba(255, 255, 255, .035);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -16px rgba(0, 0, 0, .6);
    --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .7);
    --focus: #ffb35c;
  }
}

:root[data-theme="dark"] {
  --bg: #0a0c0f;
  --bg-2: #0f1216;
  --surface: #12161b;
  --surface-glass: rgba(18, 22, 27, .72);
  --text: #eef0f2;
  --muted: #9aa3ad;
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);
  --accent: #2ccabd;
  --accent-ink: #04211f;
  --accent-2: #f2b84b;
  --accent-soft: rgba(44, 202, 189, .12);
  --grad: linear-gradient(120deg, #2ccabd 0%, #7be3d6 45%, #f2b84b 100%);
  --blob-1: rgba(44, 202, 189, .16);
  --blob-2: rgba(242, 184, 75, .10);
  --blob-3: rgba(99, 125, 255, .10);
  --grid-line: rgba(255, 255, 255, .035);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -16px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .7);
  --focus: #ffb35c;
}

@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.85;
  overflow-x: clip;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--display);
  line-height: 1.25;
  letter-spacing: 0;
}

p { margin: 0; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
svg { flex-shrink: 0; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
  border-radius: 8px;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: 24px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed;
  inset-inline-start: 16px;
  top: -80px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  transition: top .3s var(--ease);
}
.skip-link:focus { top: 16px; }

.gradient-text {
  background: var(--grad);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 8s ease-in-out infinite alternate;
}

@keyframes shimmer {
  from { background-position: 0% 50%; }
  to   { background-position: 100% 50%; }
}

/* =========================================================
   Background layers
   ========================================================= */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}

.blob {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  animation: drift 26s ease-in-out infinite alternate;
}
.blob-1 { background: radial-gradient(circle, var(--blob-1), transparent 62%); top: -28vmax; left: -18vmax; }
.blob-2 { background: radial-gradient(circle, var(--blob-2), transparent 62%); top: 18vh; right: -26vmax; animation-duration: 32s; animation-delay: -8s; }
.blob-3 { background: radial-gradient(circle, var(--blob-3), transparent 62%); bottom: -34vmax; left: 20vw; animation-duration: 38s; animation-delay: -14s; }

@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(6vw, 4vh, 0) scale(1.08); }
  100% { transform: translate3d(-4vw, 8vh, 0) scale(.95); }
}

.bg-spot {
  position: absolute;
  inset: 0;
  background: radial-gradient(520px circle at var(--cx, 50%) var(--cy, -20%), var(--accent-soft), transparent 60%);
  transition: opacity .4s;
}

/* Scroll progress */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 120;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--grad);
  transform-origin: right center;
  transform: scaleX(var(--p, 0));
}

/* Cursor ring (fine pointers only, enabled by JS) */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 36px; height: 36px;
  margin: -18px 0 0 -18px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 150;
  opacity: 0;
  transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease),
              background-color .3s, opacity .3s, border-color .3s;
  will-change: transform;
}
.has-cursor .cursor { opacity: .7; }
.has-cursor .cursor.is-hover {
  width: 64px; height: 64px;
  margin: -32px 0 0 -32px;
  background: var(--accent-soft);
  border-color: transparent;
  opacity: 1;
}
.has-cursor .cursor.is-down { width: 26px; height: 26px; margin: -13px 0 0 -13px; }

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background-color .4s var(--ease), box-shadow .4s var(--ease), transform .4s var(--ease);
}
.site-header.is-scrolled {
  background: var(--surface-glass);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  box-shadow: 0 1px 0 var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--arch);
  color: #fff;
  font-size: 1.2rem;
  box-shadow: 0 6px 18px -6px rgba(11, 122, 131, .6);
  transition: transform .5s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }

.nav-list {
  position: relative;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.nav-list a {
  position: relative;
  z-index: 1;
  display: block;
  padding: 8px 18px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color .3s;
}
.nav-list a:hover,
.nav-list a.is-active { color: var(--text); }

.nav-indicator {
  position: absolute;
  top: 6px; bottom: 6px;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--border);
  opacity: 0;
  transition: transform .5s var(--ease), width .5s var(--ease), opacity .3s;
}

.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-glass);
  color: var(--text);
  cursor: pointer;
  transition: transform .3s var(--ease), border-color .3s, background-color .3s;
}
.icon-btn:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.theme-toggle svg { transition: transform .6s var(--ease), opacity .4s; }
.theme-toggle .i-moon { position: absolute; opacity: 0; transform: rotate(-90deg) scale(.5); }
.theme-toggle { position: relative; }
.is-dark .theme-toggle .i-sun { opacity: 0; transform: rotate(90deg) scale(.5); }
.is-dark .theme-toggle .i-moon { opacity: 1; transform: none; }

.menu-toggle { display: none; }
.burger { position: relative; display: block; width: 18px; height: 12px; }
.burger span {
  position: absolute;
  inset-inline: 0;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .4s var(--ease), top .4s var(--ease);
}
.burger span:first-child { top: 1px; }
.burger span:last-child { top: 9px; }
.menu-open .burger span:first-child { top: 5px; transform: rotate(45deg); }
.menu-open .burger span:last-child { top: 5px; transform: rotate(-45deg); }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), color .3s, border-color .3s;
}
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .4s var(--ease); }
.btn > * { pointer-events: none; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 30px -10px var(--accent);
}
.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--grad);
  opacity: 0;
  transition: opacity .4s var(--ease);
}
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 40%;
  left: -60%;
  z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: skewX(-20deg);
  transition: left .8s var(--ease);
}
.btn-primary:hover { box-shadow: 0 18px 40px -12px var(--accent); }
.btn-primary:hover::before { opacity: 1; }
.btn-primary:hover::after { left: 130%; }
.btn-primary:hover svg { transform: translateX(-4px); }

.btn-ghost {
  color: var(--text);
  border: 1px solid var(--border-strong);
  background: var(--surface-glass);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-lg { min-height: 60px; padding: 0 34px; font-size: 1.08rem; }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 40px) 0 96px;
  overflow-x: clip;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  gap: 48px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px 6px 14px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-glass);
  color: var(--muted);
  font-size: .92rem;
  font-weight: 500;
}
.pulse {
  position: relative;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #22c55e;
}
.pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #22c55e;
  animation: ping 2s var(--ease) infinite;
}
@keyframes ping {
  0% { transform: scale(1); opacity: .7; }
  100% { transform: scale(3); opacity: 0; }
}

.hero-title {
  font-size: clamp(2.9rem, 8.2vw, 6.2rem);
  font-weight: 800;
  line-height: 1.12;
}
.hero-title .line {
  display: block;
  overflow: hidden;
  padding-block: .06em;
}
.hero-title .line > span { display: inline-block; }

.role {
  margin-top: 18px;
  font-family: var(--display);
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  font-weight: 600;
  color: var(--text);
}

.hero-sub {
  margin-top: 10px;
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  color: var(--muted);
}

.rotator {
  display: inline-grid;
  justify-items: start;
  vertical-align: bottom;
  overflow: hidden;
  transition: width .6s var(--ease);
  color: var(--accent);
  font-weight: 600;
}
.rotator > span {
  grid-area: 1 / 1;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(100%);
  transition: transform .7s var(--ease), opacity .7s var(--ease);
}
.rotator > span.is-active { opacity: 1; transform: none; }
.rotator > span.is-leaving { opacity: 0; transform: translateY(-100%); }

.location {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: .98rem;
}
.location svg { width: 18px; height: 18px; fill: var(--accent); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

/* Visual */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  translate: -50% 0;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  color: var(--muted);
}
.mouse {
  position: relative;
  width: 24px; height: 38px;
  border: 1.5px solid currentColor;
  border-radius: 14px;
}
.mouse span {
  position: absolute;
  top: 7px; left: 50%;
  width: 3px; height: 7px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--accent);
  animation: wheel 1.8s var(--ease) infinite;
}
@keyframes wheel {
  0% { transform: translateY(0); opacity: 1; }
  80% { transform: translateY(12px); opacity: 0; }
  100% { opacity: 0; }
}

/* Intro (CSS only, plays on load) */
.intro, .intro-up, .intro-visual {
  animation: 1s var(--ease) both;
  animation-delay: calc(.15s + var(--i, 0) * .1s);
}
.intro { animation-name: fade-up; }
.intro-up { animation-name: rise; animation-duration: 1.1s; }
.intro-visual { animation-name: zoom-in; animation-duration: 1.4s; animation-delay: .3s; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
@keyframes rise {
  from { transform: translateY(110%); }
  to { transform: none; }
}
@keyframes zoom-in {
  from { opacity: 0; transform: translateY(40px) scale(.94); }
  to { opacity: 1; transform: none; }
}

/* =========================================================
   Marquee
   ========================================================= */
.marquee {
  position: relative;
  overflow: hidden;
  padding: 22px 0;
  border-block: 1px solid var(--border);
  background: var(--surface-glass);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 36px;
  width: max-content;
  animation: marquee 36s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span {
  font-family: var(--display);
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1px var(--muted);
  transition: color .3s, -webkit-text-stroke-color .3s;
}
.marquee span:hover { color: var(--accent); -webkit-text-stroke-color: var(--accent); }
.marquee i { font-style: normal; color: var(--accent-2); font-size: 1.1rem; }
@keyframes marquee { to { transform: translateX(calc(-50% - 18px)); } }

/* =========================================================
   Sections
   ========================================================= */
.section { padding: clamp(72px, 10vw, 120px) 0; }

.section-head { margin-bottom: 48px; }
.section-head.center { text-align: center; }
.section-head h2 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--accent);
  font-weight: 600;
  font-size: .95rem;
}
.kicker span {
  font-family: var(--mono);
  font-size: .82rem;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid currentColor;
}
.kicker::after {
  content: "";
  width: 48px;
  height: 1px;
  background: currentColor;
  opacity: .5;
}

/* Reveal on scroll (only when JS runs) */
.js [data-reveal] {
  opacity: 0;
  translate: 0 40px;
  transition: opacity 1s var(--ease), translate 1s var(--ease);
  transition-delay: calc(var(--d, 0) * 120ms);
}
.js [data-reveal].is-in { opacity: 1; translate: none; }

/* Theme switch: circular reveal via View Transitions */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 999; }

/* While the mobile menu is open the header must not trap the fixed overlay */
.menu-open .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: transparent; box-shadow: none; }


/* Contact */
.contact-card {
  position: relative;
  padding: clamp(40px, 7vw, 88px) clamp(24px, 6vw, 80px);
  border-radius: 32px;
  background: var(--surface);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow-lg);
}
.contact-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--angle), transparent 0 60%, var(--accent) 75%, var(--accent-2) 85%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: rotate-border 6s linear infinite;
}
@keyframes rotate-border { to { --angle: 360deg; } }

.contact-glow {
  position: absolute;
  inset: auto -20% -60% -20%;
  height: 120%;
  z-index: -2;
  background: radial-gradient(ellipse at center, var(--accent-soft), transparent 60%);
}

.contact-card .kicker { justify-content: center; }
.contact-card .kicker::after { display: none; }

.contact-title {
  font-size: clamp(2.6rem, 8vw, 5.4rem);
  font-weight: 800;
  line-height: 1.15;
}
.lead {
  max-width: 560px;
  margin: 20px auto 36px;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--muted);
}

.contact-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.footer-link { margin-inline-start: auto; white-space: nowrap; color: var(--text); font-weight: 600; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .4s var(--ease), color .3s; }
.footer-link:hover { color: var(--accent); background-size: 100% 1.5px; }

.email-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  margin-top: 28px;
}
.email {
  font-family: var(--mono);
  font-size: clamp(.86rem, 3.6vw, 1rem);
  color: var(--muted);
  overflow-wrap: anywhere;
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
  transition: border-color .3s, color .3s, background-color .3s;
}
.copy-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn.is-done { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.toast {
  min-height: 1.5em;
  margin-top: 14px;
  font-size: .9rem;
  color: var(--accent);
}

/* Footer */
.site-footer {
  padding: 32px 0 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .95rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.to-top {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  color: var(--text);
}
.to-top svg.ring {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  transform: rotate(-90deg);
  fill: none;
  stroke-width: 2;
}
.to-top .ring circle { stroke: var(--border-strong); }
.to-top .ring .ring-fill {
  stroke: var(--accent);
  stroke-dasharray: 125.7;
  stroke-dashoffset: calc(125.7 - 125.7 * var(--p, 0));
  stroke-linecap: round;
}
.to-top .arrow { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .4s var(--ease); }
.to-top:hover .arrow { transform: translateY(-4px); }


/* =========================================================
   Portfolio: hero
   ========================================================= */
.eyebrow .count {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 700;
}

.hero-sub { max-width: 34ch; color: var(--muted); font-size: clamp(1.1rem, 2vw, 1.3rem); margin-top: 18px; }

.index {
  margin: 44px 0 0;
  padding: 0;
  list-style: none;
  max-width: 520px;
  border-top: 1px solid var(--border);
}
.index a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: padding .4s var(--ease), color .3s, background-color .3s;
}
.index .idx { font-family: var(--mono); font-size: .8rem; color: var(--accent); }
.index .idx-title { font-weight: 600; }
.index .idx-tag {
  margin-inline-start: auto;
  font-size: .82rem;
  color: var(--muted);
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.index a::after {
  content: "←";
  color: var(--accent);
  opacity: 0;
  transform: translateX(8px);
  transition: opacity .3s, transform .4s var(--ease);
}
.index a:hover { padding-inline: 14px; color: var(--accent); background: var(--accent-soft); }
.index a:hover::after { opacity: 1; transform: none; }

/* Deck of project previews */
.deck {
  position: relative;
  width: min(540px, 100%);
  aspect-ratio: 1 / 1;
  --mx: 0;
  --my: 0;
}
.deck-card {
  position: absolute;
  width: 84%;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transition: transform .9s var(--ease), translate .9s var(--ease), box-shadow .5s;
}
.dc-3 { top: 2%; left: 0; transform: rotate(-9deg); }
.dc-2 { top: 22%; left: 14%; transform: rotate(5deg); }
.dc-1 { top: 42%; left: 5%; transform: rotate(-2deg); }
.deck-card .dc-1, .dc-1 { z-index: 3; }
.dc-2 { z-index: 2; }
.dc-3 { z-index: 1; }
.deck:hover .dc-3 { transform: rotate(-14deg) translate(-26px, -22px); }
.deck:hover .dc-2 { transform: rotate(9deg) translate(34px, -8px); }
.deck:hover .dc-1 { transform: rotate(0deg) translate(-8px, 18px) scale(1.03); }

.deck .frame-media { aspect-ratio: 1440 / 900; }

/* =========================================================
   Frames (shared by deck + projects)
   ========================================================= */
.frame-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  direction: ltr;
}
.frame-bar i { width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; }
.frame-bar i:nth-child(2) { background: #febc2e; }
.frame-bar i:nth-child(3) { background: #28c840; }
.frame-bar span {
  flex: 1;
  margin: 0 10px 0 14px;
  padding: 2px 12px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--mono);
  font-size: .72rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frame-media {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--bg-2);
}
.frame-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* =========================================================
   Projects
   ========================================================= */
.projects { display: grid; gap: clamp(96px, 14vw, 180px); }

.project {
  position: relative;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
}
.project:nth-child(even) .shot { order: 2; }

.p-ghost {
  position: absolute;
  top: -0.55em;
  inset-inline-end: -0.05em;
  z-index: -1;
  font-family: var(--display);
  font-size: clamp(7rem, 16vw, 13rem);
  font-weight: 800;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--border-strong);
  direction: ltr;
  pointer-events: none;
  translate: 0 calc(var(--sy, 0) * 1px);
}
.project:nth-child(even) .p-ghost { inset-inline-end: auto; inset-inline-start: -0.05em; }

.shot { margin: 0; perspective: 1400px; }

.frame {
  --rx: 0deg;
  --ry: 0deg;
  --x: 50%;
  --y: 50%;
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .6s var(--ease), box-shadow .5s var(--ease);
}
.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(500px circle at var(--x) var(--y), rgba(255, 255, 255, .18), transparent 45%);
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}
.frame:hover::after { opacity: 1; }

.zoom {
  aspect-ratio: 1440 / 900;
  padding: 0;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: zoom-in;
}
.zoom:disabled { cursor: default; }
.zoom img {
  scale: 1.001;
  transition: scale 1.2s var(--ease), filter .6s;
}
.frame:hover .zoom:not(:disabled) img { scale: 1.045; }

.zoom-hint {
  position: absolute;
  top: 50%; left: 50%;
  display: grid;
  place-items: center;
  width: 64px; height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .4);
  opacity: 0;
  scale: .6;
  transition: opacity .35s var(--ease), scale .5s var(--ease);
}
.zoom-hint svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.zoom:focus-visible .zoom-hint,
html:not(.has-cursor) .frame:hover .zoom-hint { opacity: 1; scale: 1; }
.zoom:disabled .zoom-hint { display: none; }

.shot-note {
  margin-top: 14px;
  font-size: .88rem;
  color: var(--muted);
  text-align: center;
}

/* Wipe reveal for screenshots */
/* The clip lives on the inner frame so the observed <figure> keeps its real box */
.js .shot[data-reveal] { opacity: 1; translate: none; }
.js .shot[data-reveal] .frame {
  clip-path: inset(100% 0 0 0 round 22px);
  transition: clip-path 1.3s var(--ease), transform .6s var(--ease), box-shadow .5s var(--ease);
}
.js .shot[data-reveal].is-in .frame { clip-path: inset(-30% -30% -30% -30% round 22px); }
.js .shot[data-reveal] .zoom img { scale: 1.15; }
.js .shot[data-reveal].is-in .zoom img { scale: 1.001; }
.js .shot[data-reveal].is-in .frame:hover .zoom:not(:disabled) img { scale: 1.045; }

/* Project text */
.p-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 18px;
}
.p-num {
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--accent);
  padding: 2px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
}
.p-domain { color: var(--muted); font-weight: 500; font-size: .98rem; }

.project h3 {
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 20px;
}

.p-result {
  position: relative;
  padding-inline-start: 20px;
  border-inline-start: 3px solid var(--accent);
  font-size: clamp(1.05rem, 1.7vw, 1.2rem);
  line-height: 1.9;
  margin-bottom: 28px;
}
.p-label {
  display: block;
  margin-bottom: 4px;
  font-family: var(--display);
  font-size: .82rem;
  font-weight: 700;
  color: var(--accent);
}

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: .92rem;
  font-weight: 500;
  transition: transform .4s var(--ease), border-color .3s;
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 700;
}
.steps li:last-child { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.steps li:last-child::before { background: rgba(255, 255, 255, .22); color: inherit; }
.steps li:hover { transform: translateY(-3px); border-color: var(--accent); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tags li {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .9rem;
  font-weight: 500;
  transition: transform .4s var(--ease);
}
.tags li:hover { transform: translateY(-3px) rotate(-2deg); }

/* Contact title (single word) */
.contact-title { background: var(--grad); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 8s ease-in-out infinite alternate; }

/* Cursor label */
.cursor-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: .8rem;
  font-weight: 700;
  color: var(--accent-ink);
  opacity: 0;
  transition: opacity .2s;
}
.has-cursor .cursor.is-view {
  width: 84px; height: 84px;
  margin: -42px 0 0 -42px;
  background: var(--accent);
  border-color: transparent;
  opacity: 1;
}
.has-cursor .cursor.is-view .cursor-label { opacity: 1; }

/* =========================================================
   Lightbox
   ========================================================= */
.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 24px;
  border: 0;
  background: transparent;
  color: #fff;
  overflow: hidden;
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop {
  background: rgba(6, 8, 10, .86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lightbox figure { margin: 0; max-width: min(1280px, 100%); animation: lb-in .5s var(--ease); }
.lightbox img {
  max-height: 80vh;
  width: auto;
  margin-inline: auto;
  border-radius: 14px;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .7);
}
.lightbox figcaption { margin-top: 16px; text-align: center; color: #c9d0d6; font-size: .95rem; }
.lb-close {
  position: fixed;
  top: 20px;
  inset-inline-end: 20px;
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .2);
  color: #fff;
  z-index: 2;
}
@keyframes lb-in {
  from { opacity: 0; transform: scale(.94) translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 56px; }
  .hero-visual { order: -1; }
  .deck { width: min(460px, 86vw); margin-inline: auto; aspect-ratio: 1 / .92; }
  .index { max-width: none; }
  .scroll-hint { display: none; }
  .project { grid-template-columns: 1fr; gap: 28px; }
  .project:nth-child(even) .shot { order: 0; }
  .p-ghost { top: -0.75em; }
}

@media (max-width: 760px) {
  :root { --header-h: 64px; }
  .menu-toggle { display: grid; }
  .brand-name { display: none; }
  .nav {
    position: fixed;
    inset: 0;
    z-index: -1;
    display: grid;
    place-items: center;
    background: var(--bg);
    clip-path: circle(0% at 46px 32px);
    visibility: hidden;
    transition: clip-path .7s var(--ease), visibility 0s .7s;
  }
  .menu-open .nav {
    clip-path: circle(150% at 46px 32px);
    visibility: visible;
    transition: clip-path .7s var(--ease), visibility 0s;
  }
  .nav-list {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .nav-list a {
    font-family: var(--display);
    font-size: 2.2rem;
    font-weight: 700;
    padding: 10px 24px;
    color: var(--text);
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .5s var(--ease), transform .5s var(--ease), color .3s;
  }
  .menu-open .nav-list a { opacity: 1; transform: none; }
  .menu-open .nav-list li:nth-child(1) a { transition-delay: .2s; }
  .menu-open .nav-list li:nth-child(2) a { transition-delay: .28s; }
  .nav-list a.is-active { color: var(--accent); }
  .nav-indicator { display: none; }

  .hero { padding-top: calc(var(--header-h) + 24px); }
  .frame-bar { height: 28px; }
  .frame-bar span { font-size: .65rem; }
  .zoom-hint { opacity: 1; scale: .8; top: auto; left: auto; bottom: 12px; right: 12px; margin: 0; width: 44px; height: 44px; }
  .zoom-hint svg { width: 20px; height: 20px; }
  .lightbox { padding: 12px; }
}

@media (max-width: 400px) {
  .container { padding-inline: 18px; }
  .hero-actions .btn, .btn-lg { width: 100%; }
  .btn-lg { padding: 0 18px; font-size: 1rem; }
  .index .idx-tag { display: none; }
}

/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .001ms !important;
  }
  .js [data-reveal] { opacity: 1; translate: none; }
  .js .shot[data-reveal] .frame { clip-path: none; }
  .js .shot[data-reveal] .zoom img { scale: 1; }
  .layer, .p-ghost { translate: none; }
}

/* =========================================================
   Print
   ========================================================= */
@page { margin: 16mm 14mm; }

@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --muted: #333; --border: #bbb; --accent: #000; --shadow: none; --shadow-lg: none; }
  .bg, .progress, .cursor, .site-header, .skip-link, .hero-visual, .scroll-hint, .marquee, .hero-actions,
  .index, .p-ghost, .zoom-hint, .frame-bar, .copy-btn, .toast, .contact-glow, .site-footer, .btn, .lightbox { display: none !important; }
  .js [data-reveal], .js [data-reveal] .frame, .intro, .intro-up { opacity: 1 !important; transform: none !important; translate: none !important; clip-path: none !important; animation: none !important; }
  .gradient-text, .contact-title { color: #000 !important; background: none !important; }
  .hero { min-height: 0; padding: 0 0 12pt; display: block; border-bottom: 1px solid #000; }
  .hero-title { font-size: 24pt; }
  .hero-title .line { display: inline; }
  .section { padding: 14pt 0 0; }
  .projects { gap: 14pt; }
  .project { grid-template-columns: 38% 1fr; gap: 12pt; break-inside: avoid; }
  .project:nth-child(even) .shot { order: 0; }
  .frame { box-shadow: none; transform: none !important; }
  .project h3 { font-size: 14pt; margin-bottom: 4pt; }
  .p-result { font-size: 10.5pt; margin-bottom: 4pt; }
  .contact-card { padding: 0; text-align: start; box-shadow: none; overflow: visible; }
  .contact-card::before { display: none; }
  .lead { margin: 4pt 0; }
  .email-row { justify-content: flex-start; }
  .email { color: #000; }
  .container { max-width: none; padding: 0; }
}
