/* =====================================================================
   REZAN — ULTRA HIGH-END PORTFOLIO
   Architecture:
   1. CSS Variables (Themeable)
   2. Reset & Base
   3. Custom Cursor & Noise Overlay
   4. Header & Navigation
   5. Hero Section (with mode buttons)
   6. About (typography-driven)
   7. Portfolio Grid (3D suspended slates)
   8. Contact Form
   9. Footer & Floating CTA
   10. Responsive & RTL adjustments
===================================================================== */

/* ============ 1. CSS VARIABLES / THEMES ============ */
:root {
  /* Default: Video Mode (cinematic blacks, gold, crimson) */
  --bg: #0a0606;
  --bg-2: #150909;
  --fg: #f5e6c8;
  --fg-muted: rgba(245, 230, 200, 0.55);
  --accent: #d4a347;
  --accent-2: #8b1a1a;
  --card-bg: #140a0a;
  --border: rgba(212, 163, 71, 0.18);
  --shadow-color: rgba(212, 163, 71, 0.25);
  --noise-opacity: 0.09;
  --grain-blend: overlay;

  /* Layout tokens */
  --max-w: 1480px;
  --pad: clamp(20px, 4vw, 80px);
  --radius: 4px;

  /* Typography */
  --font-display: 'Syne', 'Vazirmatn', sans-serif;
  --font-body: 'Space Grotesk', 'Vazirmatn', sans-serif;
  --font-fa: 'Vazirmatn', sans-serif;

  /* Easings — physical, grounded motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);

  --header-h: 80px;
}

/* Photo Mode — minimalist monochrome */
[data-theme="photo"] {
  --bg: #f3f2ef;
  --bg-2: #e6e4df;
  --fg: #0a0a0a;
  --fg-muted: rgba(10, 10, 10, 0.55);
  --accent: #0a0a0a;
  --accent-2: #777;
  --card-bg: #e8e6e1;
  --border: rgba(0, 0, 0, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.18);
  --noise-opacity: 0.04;
  --grain-blend: multiply;
}

/* AI Mode — obsidian + electric cyan/magenta */
[data-theme="ai"] {
  --bg: #040410;
  --bg-2: #0a0a1f;
  --fg: #e4f4ff;
  --fg-muted: rgba(228, 244, 255, 0.6);
  --accent: #00e5ff;
  --accent-2: #ff2e9a;
  --card-bg: #08081a;
  --border: rgba(0, 229, 255, 0.2);
  --shadow-color: rgba(0, 229, 255, 0.35);
  --noise-opacity: 0.1;
  --grain-blend: screen;
}

/* ============ 2. RESET & BASE ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: auto; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  overflow-x: hidden;
  line-height: 1.5;
  font-weight: 400;
  cursor: none; /* hide native cursor (we use a custom one) */
  transition: background 1.2s var(--ease-out), color 1.2s var(--ease-out);
}
body[dir="rtl"] { font-family: var(--font-fa); }
body[dir="rtl"] .font-display { font-family: var(--font-fa); }

a { color: inherit; text-decoration: none; cursor: none; }
button { background: none; border: none; color: inherit; font: inherit; cursor: none; }
input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

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

/* Hide native cursor on touch devices and restore default behavior */
@media (hover: none) {
  body, a, button, input, textarea, select { cursor: auto; }
  .cursor-dot, .cursor-ring { display: none !important; }
}

/* ============ 3. CUSTOM CURSOR & NOISE ============ */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 10000;
  border-radius: 50%;
  mix-blend-mode: difference;
  will-change: transform;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: #fff;
  transform: translate(-50%, -50%);
}
.cursor-ring {
  width: 38px; height: 38px;
  border: 1px solid #fff;
  transform: translate(-50%, -50%);
  transition: width 0.4s var(--ease-out), height 0.4s var(--ease-out),
              border-color 0.4s var(--ease-out), opacity 0.3s;
}
.cursor-ring.hover {
  width: 80px; height: 80px;
  border-color: #fff;
}
.cursor-ring.click { width: 28px; height: 28px; }

/* Cinematic noise/grain overlay */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: var(--grain-blend);
  transition: opacity 1.2s var(--ease-out);
  animation: noiseShift 0.6s steps(4) infinite;
}
@keyframes noiseShift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-2%, 1%); }
  50%  { transform: translate(1%, -2%); }
  75%  { transform: translate(-1%, 2%); }
  100% { transform: translate(0, 0); }
}

/* ============ 4. HEADER ============ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
  mix-blend-mode: difference;
  color: #fff;
}
.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.05em;
  display: flex; align-items: center; gap: 8px;
}
.logo::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 12px var(--accent);
}
.site-nav {
  display: flex; gap: 36px;
}
.site-nav a {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  position: relative;
  padding: 8px 0;
  transition: opacity 0.3s var(--ease-out);
}
.site-nav a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: currentColor;
  transition: width 0.5s var(--ease-out);
}
.site-nav a:hover::after { width: 100%; }

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 100px;
  position: relative;
  overflow: hidden;
}
.lang-toggle .lang-pill {
  position: absolute;
  top: 50%; left: 8px;
  width: calc(50% - 12px);
  height: calc(100% - 16px);
  background: #fff;
  border-radius: 100px;
  transform: translateY(-50%) translateX(0);
  transition: transform 0.5s var(--ease-elastic);
  z-index: -1;
}
body[dir="rtl"] .lang-toggle .lang-pill { transform: translateY(-50%) translateX(calc(100% + 8px)); }
.lang-toggle span { position: relative; z-index: 1; transition: color 0.4s; padding: 0 6px; }
.lang-toggle .lang-active { color: #000; }

/* ============ 5. HERO ============ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 var(--pad);
  padding-top: var(--header-h);
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.5;
  transition: background 1.4s var(--ease-out), opacity 1.4s var(--ease-out);
}
.blob-1 {
  width: 700px; height: 700px;
  top: -250px; left: -200px;
  background: var(--accent);
  animation: blobFloat1 22s ease-in-out infinite;
}
.blob-2 {
  width: 600px; height: 600px;
  bottom: -200px; right: -150px;
  background: var(--accent-2);
  animation: blobFloat2 28s ease-in-out infinite;
}
@keyframes blobFloat1 {
  0%,100% { transform: translate(0,0) scale(1); }
  33%     { transform: translate(100px, 80px) scale(1.1); }
  66%     { transform: translate(-60px, 120px) scale(0.95); }
}
@keyframes blobFloat2 {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(-80px, -100px) scale(1.15); }
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 1200px;
  width: 100%;
}
.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 40px;
}
.hero-meta .meta-line {
  width: 40px; height: 1px;
  background: var(--fg-muted);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(80px, 18vw, 260px);
  line-height: 0.88;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
  background: linear-gradient(180deg, var(--fg) 0%, var(--fg) 60%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  position: relative;
}

.hero-subtitle {
  font-size: clamp(11px, 1.4vw, 14px);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 56px;
  font-weight: 500;
}
body[dir="rtl"] .hero-subtitle { letter-spacing: 0.05em; }

.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 500;
  font-style: italic;
  color: var(--accent);
  max-width: 700px;
  margin: 0 auto 64px;
  line-height: 1.35;
  min-height: 90px;
  transition: opacity 0.5s var(--ease-out);
}

.mode-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.mode-btn {
  position: relative;
  padding: 18px 32px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--fg);
  overflow: hidden;
  transition: border-color 0.5s var(--ease-out), color 0.5s var(--ease-out), transform 0.4s var(--ease-out);
  will-change: transform;
}
.mode-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
  z-index: 0;
}
.mode-btn > * { position: relative; z-index: 1; }
.mode-btn .mode-num {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  transition: color 0.5s var(--ease-out);
}
.mode-btn:hover { border-color: var(--accent); color: var(--bg); }
.mode-btn:hover::before { opacity: 1; }
.mode-btn:hover .mode-num { color: var(--bg); }
.mode-btn.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  box-shadow: 0 8px 40px var(--shadow-color);
}
.mode-btn.active .mode-num { color: var(--bg); }

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fg-muted);
  z-index: 3;
}
.scroll-line {
  width: 1px; height: 50px;
  background: linear-gradient(180deg, var(--fg-muted) 0%, transparent 100%);
  position: relative;
  overflow: hidden;
}
.scroll-line::after {
  content: '';
  position: absolute;
  top: -50%; left: 0;
  width: 100%; height: 50%;
  background: var(--accent);
  animation: scrollDot 2.2s var(--ease-in-out) infinite;
}
@keyframes scrollDot {
  0%   { top: -50%; }
  100% { top: 100%; }
}

/* ============ 6. ABOUT ============ */
.about {
  padding: clamp(120px, 18vh, 220px) var(--pad);
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
}
.section-label {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 60px;
}
.section-label span:first-child {
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
}
.section-label::after {
  content: '';
  flex: 1; height: 1px;
  background: var(--border);
  margin-left: 8px;
  max-width: 200px;
}

.about-statement {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 4.6vw, 68px);
  line-height: 1.18;
  letter-spacing: -0.02em;
  max-width: 1200px;
  margin-bottom: 80px;
}
.about-statement .word {
  display: inline-block;
  opacity: 0.15;
  transition: opacity 0.05s;
  margin-right: 0.18em;
}
.about-statement .word.lit { opacity: 1; }
.about-statement .accent { color: var(--accent); font-style: italic; }

.about-meta {
  display: flex;
  gap: 80px;
  flex-wrap: wrap;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}
.meta-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.meta-num {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.meta-item span:last-child {
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* ============ 7. PORTFOLIO GRID ============ */
.work {
  padding: clamp(80px, 12vh, 140px) var(--pad) clamp(120px, 18vh, 200px);
  max-width: var(--max-w);
  margin: 0 auto;
}
.work-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 7vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 80px;
}
.work-title .accent { color: var(--accent); font-style: italic; }

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}
.card-wrap {
  position: relative;
  perspective: 1400px;
  cursor: none;
}
/* Editorial grid spans */
.card-wrap:nth-child(1) { grid-column: span 7; aspect-ratio: 16 / 10; }
.card-wrap:nth-child(2) { grid-column: span 5; aspect-ratio: 4 / 5; }
.card-wrap:nth-child(3) { grid-column: span 4; aspect-ratio: 1 / 1; }
.card-wrap:nth-child(4) { grid-column: span 4; aspect-ratio: 1 / 1; }
.card-wrap:nth-child(5) { grid-column: span 4; aspect-ratio: 1 / 1; }
.card-wrap:nth-child(6) { grid-column: span 5; aspect-ratio: 4 / 5; }
.card-wrap:nth-child(7) { grid-column: span 7; aspect-ratio: 16 / 10; }

.card-tilt {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s var(--ease-out);
  will-change: transform;
}
.card-flip {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.95s var(--ease-in-out);
}
.card-wrap.flipped .card-flip { transform: rotateY(180deg); }

.card-front, .card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow:
    0 30px 60px -20px rgba(0,0,0,0.5),
    0 0 0 1px var(--border);
}

/* Card front */
.card-front img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.05) brightness(0.85);
  transition: filter 0.9s var(--ease-out), transform 1.2s var(--ease-out);
  transform: scale(1.05);
}
.card-wrap:hover .card-front img {
  filter: grayscale(0%) contrast(1.1) brightness(1);
  transform: scale(1.12);
}
.card-front::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.85) 100%);
  opacity: 0.9;
  transition: opacity 0.6s var(--ease-out);
}
[data-theme="photo"] .card-front::after {
  background: linear-gradient(180deg, transparent 40%, rgba(255,255,255,0.85) 100%);
}
.card-meta {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 28px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}
.card-title-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card-title {
  font-family: var(--font-display);
  font-size: clamp(18px, 1.8vw, 26px);
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
[data-theme="photo"] .card-title { color: var(--fg); }
.card-type {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
}
[data-theme="photo"] .card-type { color: var(--fg-muted); }
.card-num {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.1em;
}
.card-cat-tag {
  position: absolute;
  top: 20px; left: 20px;
  z-index: 2;
  padding: 6px 12px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 100px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
}
[data-theme="photo"] .card-cat-tag {
  background: rgba(255,255,255,0.6);
  color: var(--fg);
  border-color: rgba(0,0,0,0.1);
}

/* Card back */
.card-back {
  transform: rotateY(180deg);
  background: var(--card-bg);
  padding: clamp(24px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}
.card-back::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, var(--shadow-color), transparent 60%);
  opacity: 0.4;
  pointer-events: none;
}
.card-back-content { position: relative; z-index: 1; }
.card-back-year {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--accent);
  margin-bottom: 16px;
}
.card-back-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}
.card-back-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--fg-muted);
  margin-bottom: 24px;
}
.card-back-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.card-back-tags span {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.card-back-flip {
  position: relative; z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.card-back-flip::after {
  content: '↺';
  font-size: 16px;
}

/* ============ 8. CONTACT ============ */
.contact {
  padding: clamp(80px, 12vh, 140px) var(--pad) clamp(100px, 14vh, 160px);
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}
.contact-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 7vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 80px;
}
.contact-title .accent { color: var(--accent); font-style: italic; }

.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px 60px;
}
.form-field {
  position: relative;
  display: flex;
  flex-direction: column;
}
.form-field.full { grid-column: 1 / -1; }
.form-field label {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 18px;
}
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 8px 0 16px;
  font-family: var(--font-body);
  font-size: clamp(16px, 1.4vw, 20px);
  color: var(--fg);
  outline: none;
  transition: border-color 0.4s var(--ease-out);
}
.form-field textarea { resize: vertical; min-height: 80px; }
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus { border-bottom-color: var(--accent); }
.form-field input::placeholder,
.form-field textarea::placeholder { color: transparent; }
.form-field select { appearance: none; -webkit-appearance: none; cursor: none; padding-right: 30px; }
.form-field.select::after {
  content: '↓';
  position: absolute;
  bottom: 16px; right: 0;
  pointer-events: none;
  color: var(--fg-muted);
  font-size: 14px;
}
.form-field select option { background: var(--bg); color: var(--fg); }

.submit-btn {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 30px;
  padding: 22px 48px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 100px;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s var(--ease-out);
  will-change: transform;
}
.submit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-2);
  transform: translateY(100%);
  transition: transform 0.5s var(--ease-out);
  z-index: 0;
}
.submit-btn:hover::before { transform: translateY(0); }
.submit-btn span { position: relative; z-index: 1; }
.submit-btn .arrow {
  position: relative; z-index: 1;
  transition: transform 0.4s var(--ease-out);
}
.submit-btn:hover .arrow { transform: translateX(6px); }

/* ============ 9. FOOTER & FLOATING CTA ============ */
footer {
  padding: 40px var(--pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.footer-social { display: flex; gap: 28px; }
.footer-social a { position: relative; padding: 4px 0; transition: color 0.3s; }
.footer-social a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.4s var(--ease-out);
}
.footer-social a:hover { color: var(--accent); }
.footer-social a:hover::after { width: 100%; }

/* Floating CTA — magnetic, heartbeat glow */
.floating-cta {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 900;
  padding: 18px 28px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 100px;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 40px var(--shadow-color);
  transition: background 0.4s, color 0.4s, box-shadow 0.4s;
  will-change: transform;
  animation: ctaPulse 2.4s var(--ease-in-out) infinite;
}
body[dir="rtl"] .floating-cta { right: auto; left: 32px; }
.floating-cta::before {
  content: '';
  position: absolute;
  inset: -4px;
  border: 1px solid var(--accent);
  border-radius: 100px;
  opacity: 0;
  animation: ctaRing 2.4s var(--ease-out) infinite;
}
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 10px 40px var(--shadow-color), 0 0 0 0 var(--shadow-color); }
  50%      { box-shadow: 0 14px 50px var(--shadow-color), 0 0 0 12px transparent; }
}
@keyframes ctaRing {
  0%   { opacity: 0.6; transform: scale(0.95); }
  100% { opacity: 0; transform: scale(1.25); }
}
.floating-cta .cta-arrow {
  display: inline-block;
  transition: transform 0.4s var(--ease-out);
}
.floating-cta:hover .cta-arrow { transform: translateX(5px); }
body[dir="rtl"] .floating-cta:hover .cta-arrow { transform: translateX(-5px) scaleX(-1); }
body[dir="rtl"] .floating-cta .cta-arrow { transform: scaleX(-1); }

/* ============ 10. RESPONSIVE & RTL ============ */
@media (max-width: 900px) {
  .site-nav { display: none; }
  .hero-title { font-size: clamp(60px, 22vw, 140px); }
  .mode-buttons { flex-direction: column; align-items: stretch; max-width: 320px; margin: 0 auto; }
  .mode-btn { justify-content: center; }
  .about-meta { gap: 40px; }
  .portfolio-grid { gap: 16px; }
  .card-wrap:nth-child(n) { grid-column: span 12; aspect-ratio: 4/3; }
  .contact-form { grid-template-columns: 1fr; gap: 36px; }
  .floating-cta { bottom: 20px; right: 20px; padding: 14px 22px; font-size: 11px; }
  body[dir="rtl"] .floating-cta { left: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .noise-overlay { animation: none; }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 110px;
  right: 32px;
  z-index: 9999;
  background: var(--accent);
  color: var(--bg);
  padding: 16px 24px;
  border-radius: 6px;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
  pointer-events: none;
  max-width: 320px;
}
body[dir="rtl"] .toast { right: auto; left: 32px; }
.toast.show { opacity: 1; transform: translateY(0); }