/* ==========================================================================
   Gholamali Kafashan — Personal Portfolio
   style.css
   --------------------------------------------------------------------------
   1.  Design tokens
   2.  Reset & base
   3.  Typography helpers
   4.  Layout primitives (container / sections / grids)
   5.  Glass surfaces & cards
   6.  Buttons, tags, chips
   7.  Header & navigation
   8.  Loader, progress, cursor light, back-to-top
   9.  Hero
   10. About & timeline
   11. Services
   12. Portfolio (filters + cards)
   13. Skills
   14. Academic / credentials
   15. Contact & form
   16. Footer
   17. Modal
   18. Reveal animations
   19. Responsive breakpoints
   20. Reduced motion & print
   ========================================================================== */

/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */
:root {
  /* Surfaces */
  --bg: #080B12;
  --bg-2: #0E1420;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-strong: rgba(255, 255, 255, 0.085);
  --border: rgba(255, 255, 255, 0.12);
  --border-soft: rgba(255, 255, 255, 0.07);

  /* Text */
  --text: #F4F7FB;
  --muted: #A6B0C0;

  /* Accents */
  --accent: #20C7C9;
  --accent-2: #7C83FD;
  --accent-soft: rgba(32, 199, 201, 0.14);
  --violet-soft: rgba(124, 131, 253, 0.14);

  /* Effects */
  --glow: 0 0 40px rgba(32, 199, 201, 0.18);
  --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 18px 50px rgba(0, 0, 0, 0.45);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --blur: 16px;

  /* Type */
  --font-fa: "IRANSans", "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  --font-en: "Inter", "Vazirmatn", "Segoe UI", system-ui, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.55s;

  /* Layout */
  --nav-h: 74px;
  --container: 1200px;
}

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchors clear the fixed header */
  scroll-padding-top: calc(var(--nav-h) + 18px);
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-fa);
  font-size: clamp(15px, 0.55vw + 13.5px, 17px);
  line-height: 1.85;
  letter-spacing: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* English mode swaps the primary family */
html[lang="en"] body { font-family: var(--font-en); line-height: 1.7; }

/* Ambient lighting: soft radial gradients behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 620px at 78% -8%, rgba(32, 199, 201, 0.14), transparent 62%),
    radial-gradient(760px 560px at 8% 22%, rgba(124, 131, 253, 0.12), transparent 60%),
    radial-gradient(1000px 700px at 50% 108%, rgba(32, 199, 201, 0.09), transparent 65%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 46%, var(--bg) 100%);
  pointer-events: none;
}

/* Very light technical grid */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at 50% 32%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 32%, #000 0%, transparent 78%);
  pointer-events: none;
}

img, svg, canvas { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; }

button, input, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}

button { cursor: pointer; }

/* IMPORTANT: class rules such as `.contact-list li { display: flex }` would
   otherwise beat the user-agent `[hidden] { display: none }` rule and reveal
   elements that JS has hidden (e.g. the Telegram row). */
[hidden] { display: none !important; }

::selection { background: rgba(32, 199, 201, 0.32); color: #fff; }

/* Visible, consistent focus ring (keyboard users) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Slim scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: rgba(32, 199, 201, 0.5); }

/* Accessibility helpers */
.skip-link {
  position: fixed;
  top: -100px;
  inset-inline-start: 16px;
  z-index: 200;
  padding: 12px 20px;
  background: var(--accent);
  color: #04252a;
  font-weight: 700;
  border-radius: 0 0 12px 12px;
  transition: top 0.25s var(--ease);
}
.skip-link:focus { top: 0; }

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

/* ==========================================================================
   3. TYPOGRAPHY HELPERS
   ========================================================================== */
.grad-text {
  background: linear-gradient(100deg, var(--accent) 0%, #63e0e2 38%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ==========================================================================
   4. LAYOUT PRIMITIVES
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 40px);
}

.section {
  position: relative;
  padding-block: clamp(64px, 9vw, 124px);
  scroll-margin-top: calc(var(--nav-h) + 12px);
}

.section--alt::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 30%);
  border-top: 1px solid var(--border-soft);
  pointer-events: none;
}

.section-head {
  max-width: 760px;
  margin-bottom: clamp(34px, 5vw, 60px);
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  backdrop-filter: blur(6px);
}
.section-tag::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.section-title {
  margin-top: 18px;
  font-size: clamp(1.7rem, 3.4vw, 2.85rem);
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-desc {
  margin-top: 14px;
  color: var(--muted);
  max-width: 62ch;
}

/* Responsive card grids */
.cards-grid {
  display: grid;
  gap: clamp(16px, 2vw, 26px);
}
.cards-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ==========================================================================
   5. GLASS SURFACES & CARDS
   ========================================================================== */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 2.2vw, 28px);
  overflow: hidden;
  transition: transform var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              background-color var(--dur) var(--ease);
  transform: perspective(1000px)
             rotateX(var(--rx, 0deg))
             rotateY(var(--ry, 0deg))
             translate3d(0, var(--lift, 0px), 0);
  will-change: transform;
}

/* Animated gradient accent line on card hover */
.card::after {
  content: "";
  position: absolute;
  inset-inline: 22px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
  opacity: 0;
  transform: scaleX(0.4);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.card:hover,
.card:focus-within {
  --lift: -6px;
  background: var(--surface-strong);
  border-color: rgba(32, 199, 201, 0.36);
  box-shadow: var(--shadow-md), var(--glow);
}
.card:hover::after,
.card:focus-within::after { opacity: 1; transform: scaleX(1); }

/* ==========================================================================
   6. BUTTONS, TAGS, CHIPS
   ========================================================================== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.97rem;
  line-height: 1.4;
  border: 1px solid transparent;
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.35s var(--ease),
              background-color 0.35s var(--ease), border-color 0.35s var(--ease),
              color 0.35s var(--ease);
  will-change: transform;
}

.btn-primary {
  background: linear-gradient(120deg, var(--accent) 0%, #19b3d6 55%, var(--accent-2) 130%);
  color: #04252a;
  box-shadow: 0 10px 30px rgba(32, 199, 201, 0.24);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(32, 199, 201, 0.34); }
.btn-primary:active { transform: translateY(-1px) scale(0.985); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover {
  transform: translateY(-3px);
  border-color: rgba(32, 199, 201, 0.5);
  background: rgba(32, 199, 201, 0.1);
}
.btn-ghost:active { transform: translateY(-1px) scale(0.985); }

.btn-sm { padding: 10px 18px; font-size: 0.88rem; border-radius: 12px; }
.btn-block { display: flex; width: 100%; }

/* Submit loading state */
.btn.is-loading { pointer-events: none; opacity: 0.85; }
.btn__spinner {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid rgba(4, 37, 42, 0.35);
  border-top-color: #04252a;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn.is-loading .btn__spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.tag {
  display: inline-block;
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: 99px;
  background: var(--accent-soft);
  border: 1px solid rgba(32, 199, 201, 0.3);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.chips li {
  padding: 7px 13px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: 0.84rem;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}
.chips li:hover {
  border-color: rgba(32, 199, 201, 0.45);
  color: var(--text);
  transform: translateY(-2px);
}

/* ==========================================================================
   7. HEADER & NAVIGATION
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 90;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease),
              backdrop-filter 0.4s var(--ease), height 0.4s var(--ease);
}

.site-header.is-scrolled {
  height: 66px;
  background: rgba(8, 11, 18, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border-soft);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
}

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand__mark { flex: none; transition: transform 0.5s var(--ease); }
.brand:hover .brand__mark { transform: rotate(-8deg) scale(1.05); }
.brand__text { display: flex; flex-direction: column; line-height: 1.3; }
.brand__text strong { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; }
.brand__text small { color: var(--muted); font-size: 0.72rem; letter-spacing: 0.06em; }

.nav-menu { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); }

.nav-links { display: flex; align-items: center; gap: clamp(6px, 1.4vw, 20px); }

.nav-link {
  position: relative;
  padding: 9px 12px;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 500;
  transition: color 0.3s var(--ease);
}
.nav-link::after {
  content: "";
  position: absolute;
  inset-inline: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.35s var(--ease);
}
.nav-link:hover { color: var(--text); }
.nav-link:hover::after,
.nav-link.is-active::after { transform: scaleX(1); }
.nav-link.is-active { color: var(--text); }

.nav-actions { display: flex; align-items: center; gap: 12px; }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.lang-toggle:hover {
  border-color: rgba(32, 199, 201, 0.55);
  background: rgba(32, 199, 201, 0.12);
  transform: translateY(-2px);
}
.lang-toggle svg { color: var(--accent); }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.nav-toggle__bar {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.35s var(--ease), opacity 0.25s var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   8. LOADER, PROGRESS, CURSOR LIGHT, BACK-TO-TOP
   ========================================================================== */
.loader { display: none; }
.js .loader {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.6s var(--ease), visibility 0.6s var(--ease);
}
.js .loader.is-done { opacity: 0; visibility: hidden; }

.loader__mark { display: grid; justify-items: center; gap: 20px; }
.loader__mark svg { animation: markFloat 2.4s var(--ease) infinite; }
@keyframes markFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(4deg); }
}
.loader__bar {
  display: block;
  width: 160px;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.loader__bar i {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  animation: loadSlide 1.1s var(--ease) infinite;
}
@keyframes loadSlide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(360%); }
}

.scroll-progress {
  position: fixed;
  top: 0;
  inset-inline: 0;
  height: 3px;
  z-index: 120;
  background: transparent;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(32, 199, 201, 0.7);
  transition: width 0.12s linear;
}

/* Cursor-following light: only rendered on precise pointers via JS */
.cursor-light {
  position: fixed;
  top: 0;
  left: 0;
  width: 420px;
  height: 420px;
  margin: -210px 0 0 -210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(32, 199, 201, 0.16), rgba(124, 131, 253, 0.07) 45%, transparent 70%);
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  will-change: transform;
}
.cursor-light.is-on { opacity: 1; }

.back-top {
  position: fixed;
  inset-inline-end: 22px;
  bottom: 22px;
  z-index: 80;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(14, 20, 32, 0.85);
  backdrop-filter: blur(10px);
  color: var(--text);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease),
              visibility 0.4s var(--ease), border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.back-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-top:hover {
  border-color: rgba(32, 199, 201, 0.6);
  background: rgba(32, 199, 201, 0.16);
  color: var(--accent);
}

/* ==========================================================================
   9. HERO
   ========================================================================== */
.hero {
  position: relative;
  min-height: min(100svh, 940px);
  display: flex;
  align-items: center;
  padding-block: calc(var(--nav-h) + clamp(40px, 7vw, 90px)) clamp(70px, 9vw, 110px);
  overflow: hidden;
  scroll-margin-top: 0;
}

.hero__particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.75;
  pointer-events: none;
}

.hero__glow {
  position: absolute;
  inset-inline-end: -12%;
  top: 8%;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(32, 199, 201, 0.2), transparent 66%);
  filter: blur(30px);
  pointer-events: none;
  z-index: 0;
}

.hero__grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  align-items: center;
  gap: clamp(30px, 5vw, 64px);
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
}
.hero__eyebrow .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(32, 199, 201, 0.6);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(32, 199, 201, 0.55); }
  70% { box-shadow: 0 0 0 12px rgba(32, 199, 201, 0); }
  100% { box-shadow: 0 0 0 0 rgba(32, 199, 201, 0); }
}

.hero__title {
  margin-top: 24px;
  font-size: clamp(2.1rem, 5.2vw, 4rem);
  line-height: 1.32;
  font-weight: 700;
  letter-spacing: -0.02em;
  max-width: 16ch;
}
.hero__title span { display: block; }
.hero__title .grad-text { max-width: 20ch; }

.hero__desc {
  margin-top: 22px;
  color: var(--muted);
  font-size: clamp(1rem, 1.2vw, 1.12rem);
  max-width: 56ch;
}

.hero__roles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 24px;
}
.hero__roles li {
  position: relative;
  padding-inline-start: 18px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
}
.hero__roles li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  width: 7px; height: 7px;
  transform: translateY(-50%) rotate(45deg);
  background: var(--accent);
  border-radius: 2px;
}
.hero__roles li:not(:last-child)::after {
  content: "";
  position: absolute;
  inset-inline-end: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px dashed var(--border);
}
.hero__chips li {
  padding: 6px 13px;
  border-radius: 9px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.79rem;
  font-family: var(--font-en);
  letter-spacing: 0.02em;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.hero__chips li:hover {
  color: var(--accent);
  border-color: rgba(32, 199, 201, 0.45);
  transform: translateY(-3px);
}

/* Hero visual */
.hero__visual { position: relative; }
.visual-card {
  position: relative;
  padding: clamp(12px, 2vw, 22px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  background: rgba(14, 20, 32, 0.5);
  overflow: hidden;
}
.visual-card::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 70%; height: 90%;
  background: radial-gradient(circle, rgba(124, 131, 253, 0.25), transparent 65%);
  pointer-events: none;
}
.visual-svg { width: 100%; height: auto; }

.visual-svg text {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 600;
  fill: #F4F7FB;
  letter-spacing: 0.04em;
}

.orbit { transform-origin: 230px 230px; transform-box: view-box; }
.orbit--1 { animation: spin 46s linear infinite; }
.orbit--2 { animation: spin 62s linear infinite reverse; }

.core { transform-origin: 230px 230px; transform-box: view-box; animation: coreBeat 5s var(--ease) infinite; }
@keyframes coreBeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.node { transform-box: fill-box; transform-origin: center; animation: nodeFloat 6s var(--ease) infinite; animation-delay: var(--d, 0s); }
@keyframes nodeFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.float-card { animation: cardDrift 9s var(--ease) infinite; transform-box: fill-box; transform-origin: center; }
.float-card--2 { animation-duration: 11s; animation-delay: -3s; }
@keyframes cardDrift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(6px, -10px); }
}

.hero__scroll {
  position: absolute;
  bottom: 26px;
  inset-inline-start: 50%;
  transform: translateX(50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  z-index: 3;
  transition: color 0.3s var(--ease);
}
html[dir="rtl"] .hero__scroll { transform: translateX(50%); }
.hero__scroll:hover { color: var(--accent); }
.hero__scroll-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(180deg, transparent, var(--accent));
  overflow: hidden;
  position: relative;
}
.hero__scroll-line::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: -50%;
  height: 50%;
  background: #fff;
  animation: scrollDrop 2s var(--ease) infinite;
}
@keyframes scrollDrop {
  0% { top: -50%; }
  100% { top: 120%; }
}

/* ==========================================================================
   10. ABOUT & TIMELINE
   ========================================================================== */
.about__grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
}

.about__bio {
  padding: clamp(24px, 3vw, 40px);
  border-radius: var(--radius-lg);
}
.about__bio p { color: var(--muted); }
.about__bio p + p { margin-top: 18px; }

.about__focus {
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--border-soft);
}
.about__focus h3 {
  font-size: 1.02rem;
  margin-bottom: 16px;
}
.focus-list { display: grid; gap: 12px; }
.focus-list li {
  position: relative;
  padding-inline-start: 30px;
  color: var(--muted);
  font-size: 0.94rem;
}
.focus-list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.6em;
  width: 16px; height: 8px;
  border-inline-start: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  border-radius: 0 0 0 6px;
  transform: rotate(-45deg);
}
html[dir="rtl"] .focus-list li::before { transform: rotate(0deg); }

/* Timeline */
.about__timeline {
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(var(--blur));
}
.timeline__heading { font-size: 1.15rem; }
.timeline__note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.timeline {
  position: relative;
  margin-top: 26px;
  padding-inline-start: 4px;
}
.timeline::before {
  content: "";
  position: absolute;
  inset-inline-start: 7px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(180deg, var(--accent), rgba(124, 131, 253, 0.5), transparent);
}

.timeline__item {
  position: relative;
  padding-inline-start: 34px;
  padding-bottom: 26px;
}
.timeline__item:last-child { padding-bottom: 0; }

.timeline__marker {
  position: absolute;
  inset-inline-start: 0;
  top: 6px;
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg-2);
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease);
}
.timeline__item:hover .timeline__marker {
  box-shadow: 0 0 0 6px rgba(32, 199, 201, 0.16);
  transform: scale(1.12);
}

.timeline__date {
  display: inline-block;
  color: var(--accent);
  font-size: 0.79rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.timeline__body h4 {
  margin-top: 4px;
  font-size: 1rem;
  font-weight: 600;
}
.timeline__body p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ==========================================================================
   11. SERVICES
   ========================================================================== */
.service-card__icon {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  margin-bottom: 20px;
  border-radius: 16px;
  background: linear-gradient(140deg, rgba(32, 199, 201, 0.2), rgba(124, 131, 253, 0.14));
  border: 1px solid rgba(32, 199, 201, 0.34);
  color: var(--accent);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.service-card:hover .service-card__icon {
  transform: translateY(-4px) rotate(-6deg);
  box-shadow: 0 10px 26px rgba(32, 199, 201, 0.25);
}
.service-card__icon svg { width: 24px; height: 24px; }

.service-card h3 {
  font-size: 1.06rem;
  font-weight: 650;
  line-height: 1.5;
  margin-bottom: 12px;
}
.service-card p {
  color: var(--muted);
  font-size: 0.92rem;
  flex: 1;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 600;
  transition: gap 0.3s var(--ease), color 0.3s var(--ease);
}
.card-link::after {
  content: "←";
  transition: transform 0.3s var(--ease);
}
html[dir="ltr"] .card-link::after { content: "→"; }
.card-link:hover { gap: 12px; }
.card-link:hover::after { transform: translateX(-4px); }
html[dir="ltr"] .card-link:hover::after { transform: translateX(4px); }

/* ==========================================================================
   12. PORTFOLIO
   ========================================================================== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: clamp(24px, 3vw, 38px);
}
.filter-btn {
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.89rem;
  font-weight: 500;
  transition: all 0.35s var(--ease);
}
.filter-btn:hover { color: var(--text); border-color: rgba(32, 199, 201, 0.45); transform: translateY(-2px); }
.filter-btn.is-active {
  background: linear-gradient(120deg, rgba(32, 199, 201, 0.9), rgba(124, 131, 253, 0.85));
  color: #052026;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(32, 199, 201, 0.22);
}

.project-card { padding: 0; overflow: hidden; }

.project-card__cover {
  position: relative;
  aspect-ratio: 16 / 10;
  background:
    radial-gradient(circle at 30% 20%, rgba(32, 199, 201, 0.18), transparent 60%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  border-bottom: 1px solid var(--border-soft);
  overflow: hidden;
}
.project-card__cover svg {
  width: 100%;
  height: 100%;
  transition: transform 0.7s var(--ease);
}
.project-card:hover .project-card__cover svg { transform: scale(1.045); }
.cover--java { background: radial-gradient(circle at 70% 25%, rgba(124, 131, 253, 0.2), transparent 62%), rgba(255, 255, 255, 0.02); }
.cover--design { background: radial-gradient(circle at 25% 75%, rgba(124, 131, 253, 0.22), transparent 60%), rgba(255, 255, 255, 0.02); }

/* Honest labelling: these are abstract summaries, not screenshots */
.cover-badge {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  padding: 5px 11px;
  border-radius: 99px;
  background: rgba(8, 11, 18, 0.8);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.7rem;
  backdrop-filter: blur(6px);
}

.project-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: clamp(18px, 2vw, 26px);
}
.project-card__body h3 {
  margin-top: 14px;
  font-size: 1.1rem;
  font-weight: 650;
  line-height: 1.5;
}
.project-card__body > p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.91rem;
  flex: 1;
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}
.tech-list li {
  padding: 4px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-soft);
  color: var(--muted);
  font-family: var(--font-en);
  font-size: 0.74rem;
}

.project-card__btn { margin-top: 18px; align-self: flex-start; }

.project-card.is-hidden {
  display: none;
}
.project-card.is-filtering {
  animation: cardIn 0.45s var(--ease) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.empty-state {
  grid-column: 1 / -1;
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

/* ==========================================================================
   13. SKILLS
   ========================================================================== */
.skill-group h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.02rem;
  margin-bottom: 18px;
}
.skill-group .chips {
  flex: 1;
  align-content: space-evenly;
}
.skill-group__dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  flex: none;
}
.skill-group__dot--violet { background: var(--accent-2); box-shadow: 0 0 12px var(--accent-2); }

/* Restrained animated underline sweep on group hover */
.skill-group { position: relative; }
.skill-group::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: inline-start;
  transition: transform 0.5s var(--ease);
}
.skill-group:hover::before { transform: scaleX(1); }

/* ==========================================================================
   14. ACADEMIC & CREDENTIALS
   ========================================================================== */
.info-card__num {
  font-family: var(--font-en);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(32, 199, 201, 0.5);
  display: block;
  margin-bottom: 16px;
}
.info-card h3 { font-size: 1.08rem; font-weight: 650; line-height: 1.5; }
.info-card__role {
  margin-top: 8px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
}
.info-card p:last-child {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.91rem;
}

.cred-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
}
.cred-col__title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.05rem;
  margin-bottom: 18px;
}
.cred-col__title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}
.cred-stack { display: grid; gap: 14px; }

.cred-card {
  position: relative;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.cred-card:hover {
  transform: translateY(-4px);
  border-color: rgba(32, 199, 201, 0.4);
  box-shadow: var(--shadow-sm);
}
.cred-card h4 { font-size: 0.98rem; font-weight: 600; line-height: 1.6; }
.cred-card p { margin-top: 6px; color: var(--muted); font-size: 0.87rem; }

.cred-card__badge {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 600;
}
.cred-card__chip {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 11px;
  border-radius: 99px;
  background: var(--violet-soft);
  border: 1px solid rgba(124, 131, 253, 0.4);
  color: #b9beff;
  font-size: 0.73rem;
  font-weight: 600;
}
.cred-card--highlight {
  background: linear-gradient(135deg, rgba(32, 199, 201, 0.16), rgba(124, 131, 253, 0.1));
  border-color: rgba(32, 199, 201, 0.42);
}
.cred-card__medal {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: rgba(32, 199, 201, 0.2);
  color: var(--accent);
}

/* ==========================================================================
   15. CONTACT & FORM
   ========================================================================== */
.contact__grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
}

.contact__form-wrap {
  padding: clamp(24px, 3vw, 38px);
  border-radius: var(--radius-lg);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field { display: flex; flex-direction: column; gap: 9px; margin-bottom: 18px; }
.field label { font-size: 0.89rem; font-weight: 600; }

.field input,
.field textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  resize: vertical;
}
.field textarea { min-height: 140px; line-height: 1.75; }
.field input::placeholder,
.field textarea::placeholder { color: rgba(166, 176, 192, 0.62); }

.field input:hover,
.field textarea:hover { border-color: rgba(255, 255, 255, 0.22); }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(32, 199, 201, 0.07);
  box-shadow: 0 0 0 4px rgba(32, 199, 201, 0.14);
}

.field.is-invalid input,
.field.is-invalid textarea {
  border-color: #ff7b7b;
  background: rgba(255, 123, 123, 0.07);
}
.field.is-invalid input:focus,
.field.is-invalid textarea:focus { box-shadow: 0 0 0 4px rgba(255, 123, 123, 0.16); }

.field__error {
  min-height: 1em;
  color: #ff9b9b;
  font-size: 0.8rem;
  line-height: 1.5;
}

.form-privacy {
  color: var(--muted);
  font-size: 0.82rem;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px dashed var(--border);
}

.form-actions { margin-top: 20px; }

/* Honeypot field: collapsed in place so it never widens the page (RTL-safe) */
.honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.form-status {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 13px;
  font-size: 0.9rem;
  line-height: 1.7;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
}
.form-status a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.form-status--success { border-color: rgba(32, 199, 201, 0.5); background: rgba(32, 199, 201, 0.12); }
.form-status--error { border-color: rgba(255, 123, 123, 0.5); background: rgba(255, 123, 123, 0.12); }
.form-status--info { border-color: rgba(124, 131, 253, 0.5); background: rgba(124, 131, 253, 0.12); }

.contact__aside { display: grid; gap: 18px; }

.contact-card {
  padding: clamp(22px, 2.6vw, 32px);
  border-radius: var(--radius-lg);
}
.contact-card h3 { font-size: 1.18rem; }
.contact-card > p { margin-top: 12px; color: var(--muted); font-size: 0.93rem; }
.contact-card .btn { margin-top: 22px; }

.contact-list { display: grid; gap: 16px; margin-top: 24px; }
.contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease), background-color 0.35s var(--ease);
}
.contact-list li:hover {
  border-color: rgba(32, 199, 201, 0.45);
  background: rgba(32, 199, 201, 0.07);
  transform: translateX(-4px);
}
html[dir="ltr"] .contact-list li:hover { transform: translateX(4px); }

.contact-list__icon {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  flex: none;
  border-radius: 11px;
  background: rgba(32, 199, 201, 0.16);
  color: var(--accent);
}
.contact-list__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.contact-list__label { color: var(--muted); font-size: 0.78rem; }
.contact-list__body a {
  font-size: 0.94rem;
  font-weight: 600;
  word-break: break-word;
  transition: color 0.3s var(--ease);
}
.contact-list__body a:hover { color: var(--accent); }

.contact-card--meta h4 {
  font-size: 0.86rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: 16px;
}
.contact-card--meta h4:first-child { margin-top: 0; }
.contact-card--meta p { margin-top: 6px; color: var(--muted); font-size: 0.9rem; }

/* ==========================================================================
   16. FOOTER
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.25));
  padding-block: clamp(34px, 5vw, 56px);
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
}
.footer__brand strong { font-size: 1.05rem; }
.footer__brand p { margin-top: 10px; color: var(--muted); font-size: 0.9rem; max-width: 42ch; }

.footer__links { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.footer__links a {
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 0.3s var(--ease);
}
.footer__links a:hover { color: var(--accent); }

.footer__meta { color: var(--muted); font-size: 0.86rem; }
.footer__meta p + p { margin-top: 6px; }
.footer__note { color: rgba(166, 176, 192, 0.7); font-size: 0.8rem; }

/* ==========================================================================
   17. MODAL
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 30px);
}
.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 11, 0.78);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.35s var(--ease) both;
}

.modal__dialog {
  position: relative;
  width: min(760px, 100%);
  max-height: min(88vh, 900px);
  overflow-y: auto;
  border-radius: var(--radius-lg);
  background: rgba(14, 20, 32, 0.96);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  animation: modalIn 0.45s var(--ease) both;
  overscroll-behavior: contain;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal__close {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(8, 11, 18, 0.8);
  color: var(--text);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.modal__close:hover {
  transform: rotate(90deg);
  border-color: rgba(32, 199, 201, 0.6);
  background: rgba(32, 199, 201, 0.18);
}

.modal__cover {
  height: 150px;
  background:
    radial-gradient(circle at 25% 30%, rgba(32, 199, 201, 0.35), transparent 62%),
    radial-gradient(circle at 78% 70%, rgba(124, 131, 253, 0.3), transparent 60%),
    linear-gradient(140deg, rgba(255, 255, 255, 0.06), transparent);
  border-bottom: 1px solid var(--border-soft);
}

.modal__body { padding: clamp(22px, 3vw, 36px); }
.modal__body h3 {
  margin-top: 14px;
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
  line-height: 1.45;
}
.modal__desc { margin-top: 14px; color: var(--muted); }

.modal__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
}
.modal__meta h4 {
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 600;
}
.modal__meta p { color: var(--muted); font-size: 0.9rem; }

.modal__actions { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ==========================================================================
   18. REVEAL ANIMATIONS
   ========================================================================== */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
  transition-delay: var(--delay, 0ms);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Content is never blocked: if IO is unavailable, everything shows */
.no-js .reveal { opacity: 1; transform: none; }

/* ==========================================================================
   19. RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1180px) {
  .cards-grid--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .hero__visual { max-width: 560px; margin-inline: auto; width: 100%; }
  .hero__title { max-width: 100%; }
  .hero__title .grad-text { max-width: 100%; }
  .hero__scroll { display: none; }

  .about__grid { grid-template-columns: 1fr; }
  .cards-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cred-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact__grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  /* Mobile navigation */
  .nav-toggle { display: flex; }

  .nav-menu {
    position: fixed;
    top: 0;
    inset-inline: 0;
    height: 100dvh;
    flex-direction: column;
    justify-content: center;
    gap: 34px;
    padding: 90px clamp(24px, 8vw, 60px) 40px;
    background: rgba(8, 11, 18, 0.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-14px);
    transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), visibility 0.4s var(--ease);
    overflow-y: auto;
    z-index: -1;
  }
  .nav-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
  }
  .nav-link {
    display: block;
    padding: 15px 18px;
    font-size: 1.1rem;
    text-align: center;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: var(--surface);
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.45s var(--ease), transform 0.45s var(--ease),
                color 0.3s var(--ease), border-color 0.3s var(--ease);
  }
  .nav-menu.is-open .nav-link { opacity: 1; transform: none; }
  .nav-menu.is-open li:nth-child(1) .nav-link { transition-delay: 0.05s; }
  .nav-menu.is-open li:nth-child(2) .nav-link { transition-delay: 0.10s; }
  .nav-menu.is-open li:nth-child(3) .nav-link { transition-delay: 0.15s; }
  .nav-menu.is-open li:nth-child(4) .nav-link { transition-delay: 0.20s; }
  .nav-menu.is-open li:nth-child(5) .nav-link { transition-delay: 0.25s; }
  .nav-menu.is-open li:nth-child(6) .nav-link { transition-delay: 0.30s; }
  .nav-link::after { display: none; }
  .nav-link.is-active { border-color: rgba(32, 199, 201, 0.55); color: var(--accent); }

  .nav-actions { flex-direction: column; align-self: stretch; gap: 14px; }
  .nav-actions .btn { width: 100%; }
  .lang-toggle { justify-content: center; padding: 13px 20px; }

  .site-header.is-menu-open { background: transparent; border-color: transparent; backdrop-filter: none; }
}

@media (max-width: 768px) {
  :root { --nav-h: 66px; }

  /* Reduce expensive blur on mobile for battery & performance */
  .glass, .card, .about__timeline, .contact__form-wrap { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .glass, .card { background: rgba(255, 255, 255, 0.05); }

  .cards-grid--3,
  .cards-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cred-grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }

  .hero__roles li:not(:last-child)::after { display: none; }
  .modal__meta { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .cards-grid--3,
  .cards-grid--4 { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; gap: 0; }

  .brand__text small { display: none; }
  .hero { padding-top: calc(var(--nav-h) + 34px); }
  .hero__cta .btn { flex: 1 1 100%; }
  .filters { gap: 8px; }
  .filter-btn { padding: 9px 16px; font-size: 0.84rem; }
  .back-top { inset-inline-end: 14px; bottom: 14px; width: 44px; height: 44px; }
}

@media (max-width: 380px) {
  .container { padding-inline: 16px; }
  .hero__title { font-size: 1.85rem; }
  .brand__text strong { font-size: 0.92rem; }
}

/* Large displays */
@media (min-width: 1600px) {
  :root { --container: 1320px; }
}

/* ==========================================================================
   20. REDUCED MOTION & PRINT
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .js .reveal { opacity: 1 !important; transform: none !important; }
  .cursor-light { display: none; }
  .hero__particles { display: none; }
}

@media print {
  .site-header, .back-top, .cursor-light, .hero__particles,
  .scroll-progress, .loader, .modal, .hero__scroll { display: none !important; }
  body { background: #fff; color: #000; }
  body::before, body::after { display: none; }
  .glass, .card, .cred-card { border: 1px solid #ccc; background: #fff; color: #000; }
  .section-title, .section-tag, h1, h2, h3, h4 { color: #000; }
  p, li, .muted { color: #333 !important; }
}
