/* =========================================================
   محمد حفيان — Portfolio
   Palette: #250902 · #38040E · #640D14 · #800E13 · #AD2831
   ========================================================= */

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

/* خط ثمانية — Thmanyah Sans (self-hosted) */
@font-face { font-family: 'Thmanyah Sans'; font-weight: 300; font-display: swap; src: url('../assets/fonts/thmanyahsans-Light.otf') format('opentype'); }
@font-face { font-family: 'Thmanyah Sans'; font-weight: 400; font-display: swap; src: url('../assets/fonts/thmanyahsans-Regular.otf') format('opentype'); }
@font-face { font-family: 'Thmanyah Sans'; font-weight: 500 600; font-display: swap; src: url('../assets/fonts/thmanyahsans-Medium.otf') format('opentype'); }
@font-face { font-family: 'Thmanyah Sans'; font-weight: 700 800; font-display: swap; src: url('../assets/fonts/thmanyahsans-Bold.otf') format('opentype'); }
@font-face { font-family: 'Thmanyah Sans'; font-weight: 900; font-display: swap; src: url('../assets/fonts/thmanyahsans-Black.otf') format('opentype'); }

:root {
  --c-950: #120302;
  --c-900: #250902;
  --c-800: #38040E;
  --c-700: #640D14;
  --c-600: #800E13;
  --c-500: #AD2831;
  --c-400: #cf3f49;
  --c-300: #ec7a80;
  --c-200: #f6b8bb;

  --bg: #160403;
  --ink: #fbeff0;
  --ink-2: #dcbfc2;
  --ink-3: #a8868a;
  --surface: rgba(56, 4, 14, .42);
  --surface-2: rgba(37, 9, 2, .72);
  --line: rgba(173, 40, 49, .22);
  --line-2: rgba(236, 122, 128, .38);
  --ok: #5fd39a;

  --r: 22px;
  --r-sm: 14px;
  --f-head: 'Thmanyah Sans', system-ui, sans-serif;
  --f-body: 'Thmanyah Sans', system-ui, sans-serif;
  --f-mono: 'Thmanyah Sans', system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink);
  background: linear-gradient(180deg, #120302, #160403 50%, #120302);
  background-attachment: fixed;
  overflow-x: hidden;
}
/* Aurora background */
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; mix-blend-mode: screen; }
.aurora i:nth-child(1) { width: 55vw; height: 55vw; top: -18vw; right: -12vw; background: radial-gradient(circle, #AD2831, transparent 68%); animation: drift-1 26s ease-in-out infinite; }
.aurora i:nth-child(2) { width: 48vw; height: 48vw; top: 35vh; left: -16vw; background: radial-gradient(circle, #800E13, transparent 68%); animation: drift-2 32s ease-in-out infinite; }
.aurora i:nth-child(3) { width: 40vw; height: 40vw; bottom: -14vw; right: 18vw; background: radial-gradient(circle, #640D14, transparent 70%); animation: drift-3 28s ease-in-out infinite; opacity: .7; }
.aurora::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(246, 184, 187, .07) 1px, transparent 1.2px); background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 80%);
}
body.is-booting { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--f-head); line-height: 1.25; margin: 0; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--c-500); color: #fff; }
:focus-visible { outline: 2px solid var(--c-300); outline-offset: 3px; border-radius: 6px; }

.container { width: min(1200px, 100% - 32px); margin-inline: auto; }
.mono { font-family: var(--f-mono); }
.accent { color: var(--c-400); }
.grad {
  background: linear-gradient(100deg, var(--c-300), var(--c-500) 50%, #cf3f49);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ico { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------- Background layers ---------- */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.cursor-glow {
  position: fixed; z-index: 1; pointer-events: none; width: 520px; height: 520px; margin: -260px 0 0 -260px;
  border-radius: 50%; left: 0; top: 0;
  background: radial-gradient(circle, rgba(173, 40, 49, .16), transparent 62%);
  transform: translate3d(-999px, -999px, 0); transition: opacity .4s; opacity: 0;
}
.cursor-glow.on { opacity: 1; }
main, .footer, .nav { position: relative; z-index: 2; }
.progress {
  position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 60; transform-origin: right; transform: scaleX(0);
  background: linear-gradient(90deg, var(--c-700), var(--c-500), var(--c-300));
}

/* ---------- Boot screen ---------- */
.boot {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--c-950);
  transition: opacity .6s var(--ease), visibility .6s;
}
.boot.done { opacity: 0; visibility: hidden; }
.boot__inner { width: min(420px, 86vw); }
.boot__logo { font-family: var(--f-head); font-weight: 900; font-size: 54px; text-align: center; margin-bottom: 18px; color: var(--ink); }
.boot__logo span { color: var(--c-500); }
.boot__log { font-family: var(--f-mono); font-size: 13px; color: var(--ink-3); min-height: 96px; margin: 0 0 14px; white-space: pre-wrap; line-height: 1.8; }
.boot__log .ok { color: var(--ok); }
.boot__bar { height: 3px; background: rgba(255, 255, 255, .06); border-radius: 3px; overflow: hidden; }
.boot__bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--c-600), var(--c-300)); transition: width .25s; }

/* ---------- Buttons ---------- */
.btn {
  --pad: 14px 24px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: var(--pad); border-radius: 999px; border: 1px solid transparent;
  font-family: var(--f-head); font-weight: 700; font-size: 16px; line-height: 1.2;
  transition: transform .3s var(--ease), box-shadow .3s, background .3s, border-color .3s;
  white-space: nowrap; position: relative;
}
.btn--sm { --pad: 9px 18px; font-size: 14px; }
.btn--lg { --pad: 16px 28px; font-size: 17px; }
.btn--primary {
  background: linear-gradient(135deg, var(--c-500), var(--c-600) 60%, var(--c-700));
  color: #fff; border-color: rgba(246, 184, 187, .25);
  box-shadow: 0 10px 30px -10px rgba(173, 40, 49, .7), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn--primary:hover { box-shadow: 0 16px 40px -10px rgba(207, 63, 73, .85), inset 0 1px 0 rgba(255, 255, 255, .25); transform: translateY(-2px); }
.btn--ghost { background: rgba(56, 4, 14, .35); border-color: var(--line-2); color: var(--ink); backdrop-filter: blur(8px); }
.btn--ghost:hover { background: rgba(100, 13, 20, .5); border-color: var(--c-300); transform: translateY(-2px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none; }
.btn .ico { width: 1.2em; height: 1.2em; }

/* ---------- Nav ---------- */
.nav { position: fixed; top: 0; inset-inline: 0; z-index: 50; transition: background .3s, border-color .3s, padding .3s; border-bottom: 1px solid transparent; padding: 18px 0; }
.nav.scrolled { background: rgba(22, 4, 3, .72); backdrop-filter: blur(16px) saturate(1.3); border-color: var(--line); padding: 10px 0; }
.nav__inner { display: flex; align-items: center; gap: 24px; }
.logo { font-family: var(--f-head); font-weight: 900; font-size: 24px; letter-spacing: .5px; }
.logo__br { color: var(--c-500); font-family: var(--f-mono); font-weight: 600; font-size: .8em; }
.nav__links { display: flex; gap: 4px; margin-inline-start: auto; }
.nav__links a { padding: 8px 14px; border-radius: 999px; font-size: 15px; color: var(--ink-2); transition: color .2s, background .2s; position: relative; }
.nav__links a:hover, .nav__links a.active { color: var(--ink); background: rgba(173, 40, 49, .16); }
.nav__play::after { content: ''; position: absolute; top: 6px; inset-inline-end: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--c-400); box-shadow: 0 0 0 0 rgba(207, 63, 73, .7); animation: ping 1.8s infinite; }
.nav__toggle { display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(56, 4, 14, .4); position: relative; }
.nav__toggle span { position: absolute; inset-inline: 12px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s, top .3s; }
.nav__toggle span:first-child { top: 16px; }
.nav__toggle span:last-child { top: 26px; }
.nav__toggle[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { min-height: 100svh; display: flex; align-items: center; padding: 120px 0 80px; position: relative; }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(56, 4, 14, .45); font-size: 14px; color: var(--ink-2); margin-bottom: 22px; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(95, 211, 154, .6); animation: ping-ok 2s infinite; }
.hero__title { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.hero__hi { font-size: clamp(20px, 2.4vw, 26px); font-weight: 700; color: var(--ink-2); }
.hero__name {
  font-size: clamp(52px, 8.4vw, 112px); font-weight: 900; line-height: 1.1; letter-spacing: -1px;
  background: linear-gradient(180deg, #fff 10%, var(--c-200) 55%, var(--c-400));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  position: relative; display: inline-block; width: fit-content;
  filter: drop-shadow(0 10px 40px rgba(173, 40, 49, .35));
}
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none; opacity: 0;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.glitch::before { background-image: linear-gradient(var(--c-300), var(--c-300)); }
.glitch::after { background-image: linear-gradient(#7ad8ff, #7ad8ff); }
.glitch:hover::before { opacity: .8; animation: glitch-a .5s steps(2) infinite; }
.glitch:hover::after { opacity: .6; animation: glitch-b .45s steps(2) infinite; }
.hero__role { font-family: var(--f-head); font-size: clamp(20px, 2.6vw, 30px); font-weight: 700; color: var(--ink); margin-bottom: 18px; min-height: 1.5em; display: flex; align-items: center; gap: 10px; }
.caret { display: inline-block; width: 3px; height: 1.1em; background: var(--c-400); animation: blink 1s steps(1) infinite; margin-inline-start: 2px; }
.hero__lead { font-size: clamp(17px, 1.5vw, 19px); color: var(--ink-2); max-width: 560px; margin-bottom: 32px; }
.hero__lead strong { color: var(--ink); font-weight: 600; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 44px; }
.hero__stats { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__stats li { padding: 14px 20px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); backdrop-filter: blur(10px); min-width: 132px; }
.hero__stats strong { display: block; font-family: var(--f-head); font-size: 30px; font-weight: 900; color: var(--ink); line-height: 1.1; direction: ltr; text-align: right; }
.hero__stats li > span { font-size: 14px; color: var(--ink-3); }

.hero__visual { position: relative; padding-inline: 36px; }
.hero__visual::before {
  content: ''; position: absolute; inset: 10% 0 0; margin: auto; width: 80%; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(173, 40, 49, .55), transparent 65%); filter: blur(40px); z-index: -1;
}
.portrait { position: relative; width: min(430px, 100%); aspect-ratio: 4 / 5; margin-inline: auto; transform-style: preserve-3d; transition: transform .4s var(--ease); }
.portrait__ring {
  position: absolute; inset: -2px; border-radius: 38px;
  background: conic-gradient(from var(--a), var(--c-500), transparent 25%, var(--c-700) 45%, transparent 65%, var(--c-300) 85%, var(--c-500));
  animation: spin 7s linear infinite;
}
.portrait__img { position: absolute; inset: 2px; border-radius: 36px; overflow: hidden; background: var(--c-900); }
.portrait__img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; filter: saturate(.92) contrast(1.04); transform: scale(1.02); }
.portrait__img::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(100, 13, 20, .25), transparent 30%, transparent 55%, rgba(37, 9, 2, .9)),
    linear-gradient(120deg, rgba(173, 40, 49, .18), transparent 50%);
  mix-blend-mode: normal;
}
.chip {
  position: absolute; z-index: 3; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(56, 4, 14, .92), rgba(22, 4, 3, .92)); border: 1px solid rgba(236, 122, 128, .45);
  backdrop-filter: blur(12px); font-size: 14.5px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 22px 40px -14px rgba(0, 0, 0, .8), 0 0 26px -6px rgba(207, 63, 73, .55);
  animation: float-a 5.5s ease-in-out infinite;
}
.chip .ico { color: var(--c-300); }
.chip .mono { color: var(--c-300); }
.chip--1 { top: 7%; inset-inline-end: -16%; }
.chip--2 { top: 34%; inset-inline-start: -20%; animation: float-b 7s ease-in-out infinite; font-family: var(--f-mono); font-size: 12.5px; }
.chip--3 { top: 60%; inset-inline-end: -13%; animation: float-c 6.4s ease-in-out infinite; }
.portrait__badge {
  position: absolute; bottom: 18px; inset-inline: 18px; display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border-radius: 18px; background: rgba(22, 4, 3, .72); border: 1px solid var(--line-2); backdrop-filter: blur(14px);
  overflow: hidden; animation: float-a 7s ease-in-out infinite; animation-name: badge-bob;
}
.portrait__badge::after {
  content: ''; position: absolute; inset-block: 0; left: 0; width: 35%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(246, 184, 187, .22), transparent);
  animation: shine 4s ease-in-out infinite;
}
@keyframes badge-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.portrait__badge .ico { width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: var(--c-600); color: #fff; }
.portrait__badge strong { display: block; font-family: var(--f-head); font-size: 15px; }
.portrait__badge small { color: var(--ink-3); font-size: 13px; }
.scroll-hint { position: absolute; bottom: 26px; inset-inline-start: 50%; transform: translateX(50%); width: 26px; height: 42px; border: 2px solid var(--line-2); border-radius: 14px; }
.scroll-hint span { position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--c-300); animation: scrolldot 1.8s infinite; }

/* ---------- Marquee ---------- */
.marquee { position: relative; z-index: 2; overflow: hidden; border-block: 1px solid var(--line); background: rgba(37, 9, 2, .55); padding: 18px 0; transform: rotate(-1.2deg); margin: 20px -10px; }
.marquee__track { display: flex; gap: 34px; width: max-content; animation: marquee 26s linear infinite; font-family: var(--f-mono); font-size: 18px; font-weight: 600; color: var(--ink-2); align-items: center; }
.marquee__track i { color: var(--c-500); font-style: normal; }

/* ---------- Sections ---------- */
.section { padding: clamp(80px, 11vw, 140px) 0; position: relative; }
.sec-head { margin-bottom: 36px; }
.sec-head--center { text-align: center; max-width: 720px; margin: 0 auto 56px; }
.kicker { display: inline-block; font-family: var(--f-mono); font-size: 13px; color: var(--c-300); letter-spacing: 1px; margin-bottom: 12px; padding: 4px 12px; border-radius: 8px; background: rgba(173, 40, 49, .12); border: 1px solid var(--line); }
.sec-head h2, .contact h2 { font-size: clamp(34px, 5vw, 56px); font-weight: 900; margin-bottom: 16px; letter-spacing: -.5px; }
.sec-head p { color: var(--ink-2); font-size: 18px; }

/* reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.about__text p { color: var(--ink-2); font-size: 18px; }
.about__text strong { color: var(--ink); }
.pills { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; }
.pills li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); font-weight: 500; }
.pills .ico { color: var(--c-300); width: 22px; height: 22px; }

/* Terminal */
.term { border-radius: var(--r); background: rgba(18, 3, 2, .88); border: 1px solid var(--line-2); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(173, 40, 49, .1), 0 0 60px -20px rgba(173, 40, 49, .4); overflow: hidden; }
.term__head { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: rgba(56, 4, 14, .55); border-bottom: 1px solid var(--line); }
.dots { display: flex; gap: 7px; direction: ltr; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }
.term__title { font-family: var(--f-mono); font-size: 13px; color: var(--ink-3); }
.term__hint { margin-inline-start: auto; font-size: 12px; color: var(--ink-3); }
.term__body { height: 340px; overflow-y: auto; padding: 16px 18px; font-family: var(--f-mono); font-size: 14px; line-height: 1.75; cursor: text; scrollbar-width: thin; scrollbar-color: var(--c-700) transparent; }
.term__out > div { unicode-bidi: plaintext; text-align: start; white-space: pre-wrap; word-break: break-word; }
.term__out .t-cmd { color: var(--ink); }
.term__out .t-cmd b { color: var(--ok); font-weight: 600; }
.term__out .t-dim { color: var(--ink-3); }
.term__out .t-acc { color: var(--c-300); }
.term__out .t-ok { color: var(--ok); }
.term__out .t-key { color: #ec7a80; }
.term__line { display: flex; gap: 10px; align-items: center; direction: ltr; }
.term__prompt { color: var(--ok); white-space: nowrap; }
.term__line input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--ink); font: inherit; caret-color: var(--c-400); }
.term__line input::placeholder { color: rgba(168, 134, 138, .45); }
.term__chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); direction: ltr; }
.term__chips button { font-family: var(--f-mono); font-size: 12.5px; padding: 5px 12px; border-radius: 8px; background: rgba(173, 40, 49, .12); border: 1px solid var(--line); color: var(--ink-2); transition: background .2s, color .2s; }
.term__chips button:hover { background: rgba(173, 40, 49, .3); color: #fff; }

/* ---------- Services ---------- */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.svc {
  --mx: 50%; --my: 0%;
  position: relative; padding: 30px 28px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
  overflow: hidden; isolation: isolate; transition: border-color .3s, transform .4s var(--ease);
}
.svc::before {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(173, 40, 49, .28), transparent 45%);
}
.svc:hover { border-color: var(--line-2); transform: translateY(-6px); }
.svc:hover::before { opacity: 1; }
.svc__ic { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 22px; background: linear-gradient(135deg, var(--c-600), var(--c-800)); border: 1px solid rgba(246, 184, 187, .25); box-shadow: 0 12px 30px -10px rgba(173, 40, 49, .6); }
.svc__ic .ico { width: 28px; height: 28px; color: #fff; }
.svc h3 { font-size: 22px; font-weight: 800; margin-bottom: 10px; }
.svc p { color: var(--ink-2); font-size: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: rgba(173, 40, 49, .14); border: 1px solid var(--line); color: var(--c-200); font-family: var(--f-mono); }

/* ---------- Games ---------- */
.play::before { content: ''; position: absolute; inset: 8% 0; background: radial-gradient(60% 50% at 50% 50%, rgba(128, 14, 19, .22), transparent 70%); pointer-events: none; }
.gtabs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 820px; margin: 0 auto 24px; }
.gtab { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); text-align: start; transition: all .3s var(--ease); }
.gtab strong { display: block; font-family: var(--f-head); font-size: 18px; }
.gtab small { display: block; color: var(--ink-3); font-size: 13.5px; line-height: 1.5; }
.gtab__emoji { font-size: 30px; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 14px; background: rgba(0, 0, 0, .25); flex-shrink: 0; }
.gtab:hover { border-color: var(--line-2); }
.gtab.is-active { background: linear-gradient(135deg, rgba(173, 40, 49, .35), rgba(56, 4, 14, .6)); border-color: var(--c-500); box-shadow: 0 20px 50px -20px rgba(173, 40, 49, .6); }
.gpanel[hidden] { display: none; }
.game-shell { position: relative; border-radius: 26px; border: 1px solid var(--line-2); background: linear-gradient(180deg, rgba(37, 9, 2, .9), rgba(22, 4, 3, .95)); box-shadow: 0 50px 100px -40px rgba(0, 0, 0, .9), 0 0 80px -30px rgba(173, 40, 49, .45); padding: clamp(16px, 3vw, 32px); min-height: 480px; }

/* ===== Builder game ===== */
.bd-intro { text-align: center; max-width: 620px; margin: 6px auto 26px; }
.bd-intro h3 { font-size: 26px; font-weight: 900; margin-bottom: 8px; }
.bd-intro p { color: var(--ink-2); }
.bd-clients { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.bd-client { display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: 18px; border: 1px solid var(--line); background: rgba(56, 4, 14, .35); text-align: start; transition: all .3s var(--ease); }
.bd-client:hover { transform: translateY(-6px); border-color: var(--c-500); background: rgba(100, 13, 20, .4); box-shadow: 0 24px 50px -20px rgba(173, 40, 49, .6); }
.bd-client__av { font-size: 40px; line-height: 1; }
.bd-client__who { font-size: 13px; color: var(--c-300); }
.bd-client strong { font-family: var(--f-head); font-size: 20px; }
.bd-client__brief { color: var(--ink-2); font-size: 15px; line-height: 1.7; flex: 1; }
.bd-client__meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-3); border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 4px; }
.bd-client__meta b { color: #ec7a80; }

.bd-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.bd-back { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, .2); font-size: 14px; }
.bd-back:hover { border-color: var(--line-2); }
.bd-brief { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 240px; }
.bd-brief__av { font-size: 34px; }
.bd-brief strong { font-family: var(--f-head); font-size: 18px; }
.bd-brief p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.bd-budget { min-width: 220px; }
.bd-budget__row { display: flex; gap: 6px; align-items: baseline; font-size: 14px; color: var(--ink-2); margin-bottom: 6px; direction: rtl; }
.bd-budget__row b { font-family: var(--f-head); font-size: 22px; color: var(--ink); }
.bd-budget.over b { color: #ff6b6b; }
.meter { height: 8px; border-radius: 8px; background: rgba(0, 0, 0, .35); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ec7a80, #AD2831); border-radius: 8px; transition: width .4s var(--ease), background .3s; }
.bd-budget.over .meter i { background: linear-gradient(90deg, #ff6b6b, #c92a2a); }

.bd-main { display: grid; grid-template-columns: 1.3fr .9fr; gap: 22px; align-items: start; }
.bd-main > *, .bd-side > * { min-width: 0; }
.game-shell { min-width: 0; overflow-wrap: anywhere; }
.bd-layers { display: flex; flex-direction: column; gap: 14px; }
.bd-layer { padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: rgba(0, 0, 0, .18); transition: border-color .3s; }
.bd-layer.done { border-color: rgba(95, 211, 154, .35); }
.bd-layer__head { display: flex; gap: 12px; margin-bottom: 12px; }
.bd-layer__n { font-family: var(--f-mono); font-size: 13px; color: var(--c-300); padding-top: 3px; }
.bd-layer__head strong { font-family: var(--f-head); font-size: 17px; }
.bd-layer__head em { font-style: normal; font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); margin-inline-start: 6px; }
.bd-layer__head p { margin: 2px 0 0; font-size: 14px; color: var(--ink-3); line-height: 1.6; }
.bd-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bd-opt { display: flex; flex-direction: column; gap: 4px; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(56, 4, 14, .35); text-align: start; transition: all .2s; position: relative; }
.bd-opt:hover { border-color: var(--line-2); background: rgba(100, 13, 20, .35); }
.bd-opt.sel { border-color: var(--c-400); background: linear-gradient(160deg, rgba(173, 40, 49, .45), rgba(56, 4, 14, .6)); box-shadow: 0 0 0 1px var(--c-500) inset, 0 10px 24px -12px rgba(207, 63, 73, .8); }
.bd-opt.sel::after { content: '✓'; position: absolute; top: 8px; inset-inline-end: 10px; width: 20px; height: 20px; border-radius: 50%; background: var(--c-500); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.bd-opt__tier { font-size: 11px; color: var(--c-300); font-weight: 600; letter-spacing: .3px; }
.bd-opt__name { font-family: var(--f-head); font-weight: 700; font-size: 14.5px; line-height: 1.4; }
.bd-opt__desc { font-size: 12.5px; color: var(--ink-3); line-height: 1.55; flex: 1; }
.bd-opt__foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px; }
.bd-opt__foot b { font-size: 13px; color: #ec7a80; white-space: nowrap; }
.bd-opt__stats { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.bd-opt__stats i { font-style: normal; font-size: 11px; padding: 1px 5px; border-radius: 6px; background: rgba(0, 0, 0, .3); white-space: nowrap; }
.bd-side { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 14px; }

/* preview mock */
.pv { border-radius: 14px; overflow: hidden; border: 1px solid var(--line-2); background: #fff; color: #222; position: relative; transition: box-shadow .4s, transform .3s; font-family: var(--f-body); }
.pv__bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #2a0a0c; color: var(--ink-2); font-size: 11.5px; }
.pv__bar .dots i { width: 9px; height: 9px; }
.pv__url { flex: 1; direction: ltr; text-align: left; padding: 3px 10px; border-radius: 6px; background: rgba(0, 0, 0, .35); font-family: var(--f-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv__url.ok { color: var(--ok); }
.pv__url.warn { color: #ffb86b; }
.pv__status { font-size: 11px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: rgba(0, 0, 0, .35); }
.pv__status.off { color: #ff8a8a; }
.pv__status.slow { color: #ffcf8a; }
.pv__status.on { color: var(--ok); }
.pv__body { padding: 14px; min-height: 230px; background: #f4f4f4; transition: background .3s; position: relative; }
.pv__empty { height: 200px; display: grid; place-items: center; text-align: center; color: #888; font-size: 15px; background: repeating-linear-gradient(45deg, #ececec 0 10px, #f4f4f4 10px 20px); border-radius: 10px; }
.pv__empty small { font-size: 12.5px; color: #999; }
.pv__nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 14px; }
.pv__cart em { font-style: normal; display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 10px; background: #ccc; font-size: 11px; padding: 0 5px; transition: transform .25s; }
.pv__cart em.bump { transform: scale(1.4); }
.pv__hero { padding: 16px; margin-bottom: 10px; font-weight: 700; font-size: 15px; background: #ddd; }
.pv__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pv__item { padding: 10px 8px; background: #fff; border: 1px solid #ddd; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.pv__item b { font-size: 12.5px; }
.pv__val { color: #555; font-family: var(--f-mono); font-size: 12px; direction: ltr; text-align: right; }
.pv__val.err { color: #d00; }
.pv__sk { height: 9px; border-radius: 4px; background: linear-gradient(90deg, #e4e4e4, #f2f2f2, #e4e4e4); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.pv__sk.s { width: 60%; }
.pv__btn { margin-top: 4px; padding: 5px 6px; font-size: 11.5px; border: 1px solid #bbb; background: #eee; color: #333; }
.pv__btn:disabled { color: #aaa; cursor: not-allowed; }
/* fe tiers */
.pv.fe-0 .pv__body { font-weight: 300; letter-spacing: .2px; }
.pv.fe-0 .pv__hero { background: #e5e5e5; font-weight: 400; }
.pv.fe-0 .pv__grid { grid-template-columns: 1fr; gap: 3px; }
.pv.fe-1 .pv__body, .pv.fe-2 .pv__body { background: linear-gradient(180deg, #fff, #fbf1f2); }
.pv.fe-1 .pv__nav b, .pv.fe-2 .pv__nav b { color: var(--c-600); font-family: var(--f-head); }
.pv.fe-1 .pv__hero, .pv.fe-2 .pv__hero { border-radius: 12px; color: #fff; background: linear-gradient(135deg, var(--c-500), var(--c-700)); font-family: var(--f-head); font-size: 16px; }
.pv.fe-1 .pv__item, .pv.fe-2 .pv__item { border-radius: 10px; border-color: #f0d6d8; box-shadow: 0 4px 12px -6px rgba(100, 13, 20, .3); }
.pv.fe-1 .pv__btn, .pv.fe-2 .pv__btn { border-radius: 8px; border: 0; background: var(--c-500); color: #fff; font-weight: 600; }
.pv.fe-1 .pv__btn:disabled, .pv.fe-2 .pv__btn:disabled { background: #ddd; color: #999; }
.pv.fe-1 .pv__cart em, .pv.fe-2 .pv__cart em { background: var(--c-500); color: #fff; }
.pv.fe-2 .pv__hero { background: linear-gradient(120deg, var(--c-400), var(--c-700), var(--c-500)); background-size: 200% 200%; animation: gradmove 4s ease infinite; position: relative; }
.pv.fe-2 .pv__hero::after { content: 'PWA 📲 ثبّت التطبيق'; position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); font-size: 10.5px; padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, .22); font-family: var(--f-body); }
.pv.fe-2 .pv__item { transition: transform .2s; }
.pv.fe-2 .pv__item:hover { transform: translateY(-3px); }
.pv.is-live { box-shadow: 0 0 0 2px var(--ok), 0 0 40px -8px rgba(95, 211, 154, .6); }
.pv.flash-ok { animation: okpulse .7s; }
.pv.shake { animation: shake .5s; }
.pv__fx { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; text-align: center; padding: 20px; background: rgba(18, 3, 2, .86); color: #fff; font-family: var(--f-head); font-weight: 800; font-size: 20px; animation: fadein .2s; }
.pv__fx small { display: block; font-family: var(--f-body); font-weight: 400; font-size: 13px; color: var(--c-200); margin-top: 6px; }

.bd-stats { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, .2); display: flex; flex-direction: column; gap: 10px; }
.bd-stat__row { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 4px; }
.bd-stat__row span:last-child { font-family: var(--f-mono); color: var(--ink-3); }
.bd-stat__bar { position: relative; height: 9px; border-radius: 6px; background: rgba(255, 255, 255, .07); overflow: visible; }
.bd-stat__bar > i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 6px; background: linear-gradient(90deg, var(--c-600), var(--c-300)); transition: width .5s var(--ease); }
.bd-stat__bar > i.pass { background: linear-gradient(90deg, #2f9e6a, var(--ok)); }
.bd-stat__bar > u { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #ec7a80; border-radius: 2px; text-decoration: none; }
.bd-stat__bar > u::after { content: 'المطلوب'; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: 9.5px; color: #ec7a80; white-space: nowrap; }
.bd-actions { display: flex; flex-direction: column; gap: 8px; }
.bd-launch { width: 100%; }
.bd-msg { margin: 0; font-size: 14px; color: var(--ink-2); text-align: center; min-height: 1.6em; line-height: 1.6; }
.bd-msg.warn { color: #ffb86b; }
.bd-msg.good { color: var(--ok); }
.bd-tip { padding: 12px 14px; border-radius: 12px; background: rgba(236, 122, 128, .07); border: 1px solid rgba(236, 122, 128, .3); font-size: 14px; line-height: 1.7; color: var(--ink); text-align: start; }

.bd-sim h4 { font-size: 20px; margin-bottom: 14px; }
.bd-tests { display: flex; flex-direction: column; gap: 10px; }
.bd-test { display: flex; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, .2); transition: all .3s; }
.bd-test__ic { font-size: 22px; line-height: 1.2; }
.bd-test strong { font-family: var(--f-head); font-size: 15.5px; }
.bd-test__res { margin: 2px 0 0; font-size: 14px; color: var(--ink-3); }
.bd-test > div { flex: 1; }
.bd-test__bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .06); margin-top: 8px; overflow: hidden; }
.bd-test__bar i { display: block; height: 100%; width: 0; background: var(--c-300); }
.bd-test.run { border-color: var(--line-2); }
.bd-test.run .bd-test__bar i { animation: load 1.1s linear forwards; }
.bd-test.ok { border-color: rgba(95, 211, 154, .45); background: rgba(95, 211, 154, .06); }
.bd-test.ok .bd-test__res { color: #9be8c1; }
.bd-test.bad { border-color: rgba(255, 107, 107, .45); background: rgba(255, 107, 107, .06); }
.bd-test.bad .bd-test__res { color: #ffb0b0; }
.bd-test.ok .bd-test__bar, .bd-test.bad .bd-test__bar { display: none; }
.bd-result { margin-top: 18px; padding: 22px; border-radius: 18px; border: 1px solid var(--line-2); background: linear-gradient(160deg, rgba(100, 13, 20, .5), rgba(37, 9, 2, .7)); text-align: center; animation: pop .5s var(--ease); }
.bd-stars { font-size: 40px; letter-spacing: 6px; color: rgba(255, 255, 255, .15); line-height: 1; margin-bottom: 8px; }
.bd-stars .on { color: #ffcf5a; text-shadow: 0 0 20px rgba(255, 207, 90, .6); display: inline-block; animation: starpop .5s var(--ease) both; }
.bd-stars .on:nth-child(2) { animation-delay: .15s; }
.bd-stars .on:nth-child(3) { animation-delay: .3s; }
.bd-result h4 { font-size: 24px; margin-bottom: 6px; }
.bd-result > p { color: var(--ink-2); font-size: 14.5px; }
.bd-learn { text-align: start; padding: 12px 16px; border-radius: 12px; background: rgba(0, 0, 0, .25); margin-bottom: 12px; font-size: 14.5px; }
.bd-learn ul { list-style: disc; padding-inline-start: 20px; margin-top: 6px; color: var(--ink-2); }
.bd-real { text-align: start; padding: 14px 16px; border-radius: 12px; border: 1px dashed rgba(236, 122, 128, .4); background: rgba(236, 122, 128, .06); font-size: 15px; line-height: 1.8; margin-bottom: 16px; }
.bd-real b { color: #ec7a80; }
.bd-result__act { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ===== Defense game ===== */
.df { padding: clamp(12px, 2vw, 22px); }
.df-hud { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.df-stat { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); font-family: var(--f-mono); font-size: 14px; font-weight: 600; }
.df-stat b { font-weight: 400; }
.df-stat.flash { animation: flashred .5s; }
.df-hpbar { width: 80px; height: 8px; border-radius: 6px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.df-hpbar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #2f9e6a, var(--ok)); transition: width .3s, background .3s; }
.df-hpbar i.mid { background: linear-gradient(90deg, #d08a1e, #ffcf5a); }
.df-hpbar i.low { background: linear-gradient(90deg, #a51d1d, #ff6b6b); }
.df-hud__sp { flex: 1; }
.df-btn { padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(56, 4, 14, .5); font-family: var(--f-head); font-weight: 700; font-size: 14px; transition: all .2s; }
.df-btn:hover:not(:disabled) { background: rgba(100, 13, 20, .7); }
.df-btn:disabled { opacity: .4; cursor: not-allowed; }
.df-btn--go { background: linear-gradient(135deg, var(--c-500), var(--c-700)); border-color: var(--c-400); color: #fff; }
.df-btn--go.pulse { animation: btnpulse 1.6s infinite; }
.df-stage { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #1a0505; }
.df-canvas-wrap { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--c-700) transparent; }
#dfCanvas { display: block; width: 100%; min-width: 680px; aspect-ratio: 16 / 9; cursor: pointer; touch-action: manipulation; }
.df-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(18, 3, 2, .84); backdrop-filter: blur(4px); z-index: 3; transition: opacity .4s; overflow-y: auto; }
.df-overlay.hide { opacity: 0; pointer-events: none; }
.df-card { max-width: 560px; text-align: center; }
.df-card__ic { font-size: 54px; line-height: 1; margin-bottom: 10px; }
.df-card h3 { font-size: clamp(24px, 3vw, 32px); font-weight: 900; margin-bottom: 8px; }
.df-card p { color: var(--ink-2); font-size: 15.5px; line-height: 1.75; }
.df-card .btn { margin: 4px; }
.df-svc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 18px; text-align: start; }
.df-svc div { padding: 10px 12px; border-radius: 12px; background: rgba(56, 4, 14, .55); border: 1px solid var(--line); font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.df-svc b { display: block; color: var(--ink); font-family: var(--f-head); font-size: 14px; }
.df-tools { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 12px; }
.df-tool { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: rgba(56, 4, 14, .4); transition: all .2s; text-align: center; }
.df-tool:hover { border-color: var(--line-2); transform: translateY(-2px); }
.df-tool.sel { border-color: var(--c-300); background: linear-gradient(160deg, rgba(173, 40, 49, .5), rgba(56, 4, 14, .6)); box-shadow: 0 0 0 1px var(--c-400) inset; }
.df-tool.poor { opacity: .5; }
.df-tool__ic { font-size: 24px; line-height: 1.2; }
.df-tool strong { font-family: var(--f-head); font-size: 13.5px; line-height: 1.3; }
.df-tool small { color: #ec7a80; font-family: var(--f-mono); font-size: 12px; }
.df-info { margin-top: 10px; padding: 12px 16px; border-radius: 12px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); font-size: 14.5px; line-height: 1.7; color: var(--ink-2); min-height: 54px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.df-info b { color: var(--ink); }
.df-info .df-btn { padding: 6px 12px; font-size: 13px; }
.df-info__txt { flex: 1; min-width: 220px; }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: .95fr 1.05fr; gap: 56px; align-items: center; }
.skills__chart { position: relative; }
#radar { width: 100%; max-width: 520px; margin-inline: auto; display: block; overflow: visible; }
#radar .r-grid { fill: none; stroke: rgba(173, 40, 49, .25); stroke-width: 1; }
#radar .r-axis { stroke: rgba(173, 40, 49, .2); }
#radar .r-shape { fill: rgba(173, 40, 49, .32); stroke: var(--c-300); stroke-width: 2.5; stroke-linejoin: round; transform-origin: 180px 180px; transform: scale(0); transition: transform 1.4s var(--ease); filter: drop-shadow(0 0 18px rgba(207, 63, 73, .5)); }
#radar.in .r-shape { transform: scale(1); }
#radar .r-dot { fill: #fff; stroke: var(--c-500); stroke-width: 3; opacity: 0; transition: opacity .5s 1.1s; }
#radar.in .r-dot { opacity: 1; }
#radar .r-label { fill: var(--ink); font-family: var(--f-head); font-size: 15px; font-weight: 700; }
#radar .r-val { fill: var(--c-300); font-family: var(--f-mono); font-size: 12px; }
.stack { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stack__g { padding: 18px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); }
.stack__g h4 { font-size: 16px; margin-bottom: 10px; color: var(--c-200); }
.stack__g ul { display: flex; flex-wrap: wrap; gap: 6px; }
.stack__g li { font-family: var(--f-mono); font-size: 13px; padding: 4px 10px; border-radius: 8px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); direction: ltr; transition: all .2s; }
.stack__g li:hover { border-color: var(--c-400); color: #fff; background: rgba(173, 40, 49, .25); }

/* ---------- Projects ---------- */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.proj { border-radius: var(--r); overflow: hidden; background: var(--surface); border: 1px solid var(--line); transition: border-color .3s, transform .4s var(--ease); transform-style: preserve-3d; }
.proj:hover { border-color: var(--line-2); }
.proj__thumb { height: 220px; position: relative; display: grid; place-items: center; overflow: hidden; }
.proj__thumb::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px); background-size: 24px 24px; }
.proj__thumb--1 { background: linear-gradient(135deg, #800E13, #38040E); }
.proj__thumb--2 { background: linear-gradient(135deg, #640D14, #250902); }
.proj__thumb--3 { background: linear-gradient(135deg, #AD2831, #38040E 70%); }
.proj__thumb--4 { background: linear-gradient(135deg, #38040E, #800E13); }
.mock { position: relative; width: 62%; height: 64%; border-radius: 12px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(6px); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6); transition: transform .5s var(--ease); }
.proj:hover .mock { transform: translateY(-6px) scale(1.03); }
.mock--shop { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 34px 14px 14px; }
.mock--shop::before { content: ''; position: absolute; top: 12px; inset-inline: 14px; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, .2); }
.mock--shop i { border-radius: 8px; background: rgba(255, 255, 255, .15); }
.mock--shop b { position: absolute; bottom: -12px; inset-inline-start: 16px; padding: 6px 16px; border-radius: 8px; background: #fff; }
.mock--shop b::after { content: '🛒 +1'; color: var(--c-600); font-size: 12px; }
.mock--cal { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 14px; }
.mock--cal i { border-radius: 8px; background: rgba(255, 255, 255, .12); }
.mock--cal i:nth-child(3), .mock--cal i:nth-child(6) { background: #fff; box-shadow: 0 0 20px rgba(255, 255, 255, .4); }
.mock--iot { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px; align-content: flex-start; }
.mock--iot span { flex: 1; height: 40px; border-radius: 8px; background: rgba(255, 255, 255, .14); }
.mock--iot svg { position: absolute; bottom: 14px; inset-inline: 14px; width: calc(100% - 28px); height: 46%; }
.mock--iot path { fill: none; stroke: #fff; stroke-width: 2; stroke-dasharray: 300; stroke-dashoffset: 300; animation: draw 3s ease forwards infinite alternate; vector-effect: non-scaling-stroke; }
.mock--cap { display: grid; place-items: center; width: 120px; height: 120px; border-radius: 50%; }
.mock--cap .ico { width: 56px; height: 56px; color: #fff; }
.proj__body { padding: 24px 26px 28px; }
.proj__type { font-size: 13px; color: var(--c-300); font-weight: 600; }
.proj h3 { font-size: 22px; margin: 4px 0 8px; }
.proj p { color: var(--ink-2); font-size: 15.5px; }

/* ---------- Process ---------- */
.process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; position: relative; counter-reset: s; }
.process::before { content: ''; position: absolute; top: 46px; inset-inline: 10%; height: 2px; background: linear-gradient(90deg, transparent, var(--c-600), var(--c-500), var(--c-600), transparent); }
.step { position: relative; padding: 26px 22px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); text-align: center; }
.step__n { position: absolute; top: 12px; inset-inline-end: 16px; font-family: var(--f-mono); font-size: 13px; color: var(--ink-3); }
.step .ico { width: 42px; height: 42px; padding: 10px; border-radius: 50%; background: var(--c-600); color: #fff; box-shadow: 0 0 0 6px rgba(173, 40, 49, .18), 0 0 30px rgba(173, 40, 49, .5); margin-bottom: 14px; position: relative; }
.step h3 { font-size: 20px; margin-bottom: 6px; }
.step p { color: var(--ink-2); font-size: 15px; margin: 0; }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; padding: clamp(24px, 4vw, 48px); border-radius: 30px; border: 1px solid var(--line-2); background: linear-gradient(150deg, rgba(100, 13, 20, .45), rgba(37, 9, 2, .75) 60%); position: relative; overflow: hidden; }
.contact::before { content: ''; position: absolute; width: 420px; height: 420px; border-radius: 50%; top: -160px; inset-inline-start: -120px; background: radial-gradient(circle, rgba(173, 40, 49, .4), transparent 65%); pointer-events: none; }
.contact__info > p { color: var(--ink-2); font-size: 17px; }
.cinfo { display: flex; flex-direction: column; gap: 10px; margin: 22px 0; }
.cinfo__item { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: var(--r-sm); background: rgba(0, 0, 0, .22); border: 1px solid var(--line); text-align: start; transition: border-color .2s; width: 100%; }
a.cinfo__item:hover, button.cinfo__item:hover { border-color: var(--line-2); }
.cinfo__item > .ico { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: rgba(173, 40, 49, .2); color: var(--c-300); }
.cinfo__item span { flex: 1; min-width: 0; }
.cinfo__item small { display: block; font-size: 12.5px; color: var(--ink-3); }
.cinfo__item b { display: block; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.cinfo__copy { color: var(--ink-3); }
.socials { display: flex; gap: 10px; }
.socials a { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .2); transition: all .25s var(--ease); }
.socials a:hover { background: var(--c-500); border-color: var(--c-400); transform: translateY(-3px); }
.socials .ico { width: 20px; height: 20px; }
.cform { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-content: start; position: relative; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field span { font-size: 14px; color: var(--ink-2); font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(18, 3, 2, .6);
  color: var(--ink); font: inherit; font-size: 16px; transition: border-color .2s, box-shadow .2s; resize: vertical;
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--c-300) 50%), linear-gradient(135deg, var(--c-300) 50%, transparent 50%); background-position: 18px 55%, 24px 55%; background-size: 6px 6px; background-repeat: no-repeat; }
.field select option { background: var(--c-900); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--c-400); box-shadow: 0 0 0 4px rgba(173, 40, 49, .2); }
.field.err input, .field.err textarea { border-color: #ff6b6b; }
.cform__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
.cform__note { grid-column: 1 / -1; margin: 0; font-size: 14px; color: var(--ink-3); min-height: 1.4em; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 28px 0; background: rgba(18, 3, 2, .6); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer p { margin: 0; color: var(--ink-3); font-size: 14px; }
.totop { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line-2); transition: all .2s; }
.totop:hover { background: var(--c-500); }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 120px); z-index: 90; padding: 12px 22px; border-radius: 14px; background: var(--c-800); border: 1px solid var(--c-500); box-shadow: 0 20px 50px -10px rgba(0, 0, 0, .7); font-weight: 600; transition: transform .4s var(--ease); max-width: calc(100% - 32px); text-align: center; }
.toast.show { transform: translate(-50%, 0); }

/* ---------- Keyframes ---------- */
@keyframes spin { to { --a: 360deg; } }
@keyframes float-a { 0%, 100% { transform: translate(0, 0) rotate(-3deg); } 50% { transform: translate(-10px, -20px) rotate(2deg); } }
@keyframes float-b { 0%, 100% { transform: translate(0, 0) rotate(2deg); } 35% { transform: translate(12px, -16px) rotate(-2deg); } 70% { transform: translate(-6px, 10px) rotate(1deg); } }
@keyframes float-c { 0%, 100% { transform: translate(0, 0) rotate(3deg); } 50% { transform: translate(-12px, 18px) rotate(-3deg); } }
@keyframes shine { 0%, 60% { transform: translateX(-120%) skewX(-20deg); } 100% { transform: translateX(320%) skewX(-20deg); } }
@keyframes drift-1 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-18vw, 14vh) scale(1.25); } }
@keyframes drift-2 { 0%, 100% { transform: translate(0, 0) scale(1.1); } 50% { transform: translate(20vw, -12vh) scale(.85); } }
@keyframes drift-3 { 0%, 100% { transform: translate(0, 0) scale(.9); } 50% { transform: translate(-10vw, -18vh) scale(1.2); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(207, 63, 73, .7); } 80%, 100% { box-shadow: 0 0 0 8px rgba(207, 63, 73, 0); } }
@keyframes ping-ok { 0% { box-shadow: 0 0 0 0 rgba(95, 211, 154, .6); } 80%, 100% { box-shadow: 0 0 0 9px rgba(95, 211, 154, 0); } }
@keyframes scrolldot { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes glitch-a { 0% { transform: translate(-3px, 1px); clip-path: inset(10% 0 60% 0); } 50% { transform: translate(3px, -1px); clip-path: inset(50% 0 20% 0); } 100% { transform: translate(-2px, 2px); clip-path: inset(30% 0 40% 0); } }
@keyframes glitch-b { 0% { transform: translate(3px, -1px); clip-path: inset(60% 0 10% 0); } 50% { transform: translate(-3px, 1px); clip-path: inset(20% 0 55% 0); } 100% { transform: translate(2px, 0); clip-path: inset(5% 0 75% 0); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes gradmove { 50% { background-position: 100% 50%; } }
@keyframes okpulse { 0% { box-shadow: 0 0 0 0 rgba(95, 211, 154, .8); } 100% { box-shadow: 0 0 0 18px rgba(95, 211, 154, 0); } }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }
@keyframes fadein { from { opacity: 0; } }
@keyframes load { to { width: 100%; } }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(10px); } }
@keyframes starpop { from { transform: scale(0) rotate(-40deg); } }
@keyframes flashred { 50% { background: rgba(255, 60, 60, .45); } }
@keyframes btnpulse { 0% { box-shadow: 0 0 0 0 rgba(207, 63, 73, .7); } 70%, 100% { box-shadow: 0 0 0 12px rgba(207, 63, 73, 0); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .bd-main { grid-template-columns: 1fr; }
  .bd-side { position: static; order: -1; }
  .bd-side .bd-preview { max-width: 520px; margin-inline: auto; width: 100%; }
  .process { grid-template-columns: repeat(2, 1fr); }
  .process::before { display: none; }
}
@media (max-width: 980px) {
  .hero__grid { grid-template-columns: 1fr; gap: 64px; }
  .hero__text { text-align: center; }
  .hero__title { align-items: center; }
  .hero__name { margin-inline: auto; }
  .hero__role, .hero__actions, .hero__stats { justify-content: center; }
  .hero__lead { margin-inline: auto; }
  .portrait { width: min(380px, 78%); }
  .about, .skills, .contact { grid-template-columns: 1fr; }
  .services { grid-template-columns: repeat(2, 1fr); }
  .bd-clients { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .nav__links {
    position: fixed; inset: 64px 16px auto 16px; flex-direction: column; padding: 14px; border-radius: 18px;
    background: rgba(22, 4, 3, .96); border: 1px solid var(--line-2); backdrop-filter: blur(16px);
    opacity: 0; transform: translateY(-10px); pointer-events: none; transition: all .3s var(--ease);
  }
  .nav__links.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav__links a { padding: 12px 16px; font-size: 17px; }
  .nav__cta { margin-inline-start: auto; }
  .nav__toggle { display: block; }
  .df-tools { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .services, .projects, .stack, .gtabs, .process { grid-template-columns: 1fr; }
  .nav__cta { display: none; }
  .nav__toggle { margin-inline-start: auto; }
  .hero { padding-top: 104px; }
  .hero__stats li { min-width: 0; flex: 1; padding: 12px; }
  .hero__stats strong { font-size: 24px; text-align: center; white-space: nowrap; }
  .hero__stats li > span { font-size: 12.5px; display: block; text-align: center; }
  .hero__visual { padding-inline: 0; }
  .portrait { width: 84%; }
  .chip { font-size: 12.5px; padding: 7px 11px; }
  .chip--1 { top: 4%; inset-inline-end: -8%; }
  .chip--2 { display: none; }
  .chip--3 { top: 56%; inset-inline-end: -8%; }
  .portrait__badge { bottom: 12px; inset-inline: 12px; padding: 10px 12px; }
  .bd-opts { grid-template-columns: 1fr; }
  .cform { grid-template-columns: 1fr; }
  .df-svc { grid-template-columns: 1fr; }
  .df-tools { grid-template-columns: repeat(2, 1fr); }
  .term__body { height: 300px; font-size: 13px; }
  .marquee__track { font-size: 15px; }
  .game-shell { border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
