@import url(fontawesome-all.min.css);
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&family=Tajawal:wght@400;500;700;800&display=swap');

:root {
  /* Warm cream + clay — Anthropic-inspired editorial theme */
  --bg: #faf6ee;
  --panel: rgba(250, 244, 232, 0.82);
  --ink: #14110d;
  --muted: #6b6357;
  --accent: #c2603d;          /* clay/terracotta — links, primary buttons */
  --accent-strong: #8b3f26;   /* deep clay — hover states */
  --accent-2: #8a6d4a;        /* muted bronze — subtle gradient warmth */
  --on-accent: #faf6ee;       /* text/cream on accent backgrounds */
  --border: rgba(20, 17, 13, 0.16);
  --shadow: 0 18px 60px rgba(20, 17, 13, 0.10);
  --radius: 8px;
  --transition: 0.25s ease;
  --max-width: 1140px;
  --body-bg: radial-gradient(circle at 20% 20%, rgba(138, 109, 74, 0.06), transparent 30%),
    radial-gradient(circle at 80% 0%, rgba(20, 17, 13, 0.04), transparent 25%),
    linear-gradient(120deg, #faf7ef, #f4ecdc);
  --card-bg: rgba(251, 245, 233, 0.94);
  --input-bg: #f8f1e2;
}

* {
  box-sizing: border-box;
}

*,
*::before,
*::after {
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--body-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Three.js Background WebGL Layer */
#three-ambient-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
  transition: opacity 0.5s ease;
}

.theme-dark #three-ambient-canvas {
  opacity: 1;
}

/* Only lock scroll when nav is open */
body.nav-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}

img {
  max-width: 100%;
  display: block;
  border-radius: calc(var(--radius) - 4px);
}

p {
  color: var(--muted);
  line-height: 1.65;
  margin: 0 0 1.25rem;
}

h1, h2, h3, h4 {
  margin: 0 0 0.6rem;
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-optical-sizing: auto;
  letter-spacing: -0.01em;
}

h3 {
  font-weight: 700;
}

.hero p,
.project-card p,
.meta-item strong {
  line-height: 1.55;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 24px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Typing animation */
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.typing-text {
  display: inline;
}

.typing-cursor {
  display: inline-block;
  color: var(--accent);
  font-weight: 400;
  animation: blink 0.8s infinite;
  margin-left: 2px;
  vertical-align: baseline;
}

.typing-cursor.done {
  display: none;
}

.hero h1.is-typing-stable {
  position: relative;
}

.hero h1.is-typing-stable .typing-line {
  display: inline;
}

.animate-fade-up {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
  will-change: opacity, transform;
}

.animate-fade {
  opacity: 0;
  animation: fadeIn 0.4s ease forwards;
  will-change: opacity;
}

.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }
.delay-5 { animation-delay: 0.25s; }
.delay-6 { animation-delay: 0.3s; }

/* Scroll-triggered reveal */
.reveal-on-scroll {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition: opacity 0.4s ease, transform 0.4s ease;
  will-change: opacity, transform;
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.page-shell {
  position: relative;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 8px;
  font-weight: 700;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* Scroll progress indicator */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 100;
  transition: width 0.1s linear;
}

.surface-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 15% 50%, rgba(138, 109, 74, 0.08), transparent 25%),
    radial-gradient(circle at 85% 20%, rgba(138, 109, 74, 0.08), transparent 28%);
  z-index: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-radius: 18px;
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  background: linear-gradient(
    135deg,
    rgba(253, 248, 236, 0.7) 0%,
    rgba(253, 248, 236, 0.4) 50%,
    rgba(253, 248, 236, 0.6) 100%
  );
  border-bottom: 1px solid rgba(253, 248, 236, 0.5);
  box-shadow: 
    0 4px 24px rgba(0, 0, 0, 0.06),
    inset 0 -1px 0 rgba(253, 248, 236, 0.2);
  will-change: transform;
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.brand .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px rgba(20, 17, 13, 0.30);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.nav-links a {
  padding: 0.4rem 0.2rem;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  transform: scaleX(1);
}

.nav-links a.active {
  color: var(--accent-strong);
}

.nav-links a.active::after {
  transform: scaleX(1);
}

/* ── Toolkit dropdown ──────────────────────────── */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: inherit;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: inherit;
  padding: 0.4rem 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  position: relative;
}
.nav-dropdown-toggle i {
  font-size: 0.6rem;
  transition: transform 0.2s;
  pointer-events: none;
}
.nav-dropdown-toggle::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}
.nav-dropdown:hover .nav-dropdown-toggle::after,
.nav-dropdown:focus-within .nav-dropdown-toggle::after {
  transform: scaleX(1);
}
.nav-dropdown:hover .nav-dropdown-toggle i,
.nav-dropdown:focus-within .nav-dropdown-toggle i {
  transform: rotate(180deg);
}
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;              /* no gap — padding inside bridges it */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(253, 248, 236, 0.97);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
  min-width: 160px;
  overflow: hidden;
  z-index: 300;
  flex-direction: column;
  padding-top: 12px;      /* invisible hover bridge over the gap */
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: flex;
}
.nav-dropdown-menu a {
  padding: 0.65rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  display: block;
  color: inherit;
  transition: background 0.15s, color 0.15s;
}
.nav-dropdown-menu a:hover {
  background: var(--accent);
  color: #fff;
}
.nav-dropdown-menu a::after { display: none; }
.theme-dark .nav-dropdown-menu {
  background: rgba(13, 22, 38, 0.97);
  border-color: var(--border);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lang-toggle {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.4rem !important;
  width: auto !important;
  height: 36px !important;
  min-width: 68px !important;
  padding: 0 0.65rem !important;
  border-radius: 18px !important;
  border: 1px solid var(--border, rgba(20,17,13,0.16)) !important;
  background: var(--card-bg, #faf5e9) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
  color: var(--ink, #14110d) !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  outline: none !important;
  white-space: nowrap !important;
  transition: all 0.2s ease !important;
}

.lang-toggle:hover,
.lang-toggle:focus-visible {
  transform: translateY(-1px) !important;
  border-color: var(--accent, #c2603d) !important;
  background: var(--bg, #faf6ee) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
  outline: none;
}

.lang-flag {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: rgba(253, 248, 236, 0.2);
  border: 1px solid rgba(253, 248, 236, 0.45);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(20, 17, 13, 0.14);
  padding: 0.35rem;
  min-width: 170px;
  display: none;
  z-index: 10;
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
}

.lang-switch.open .lang-menu {
  display: block;
}

.lang-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.65rem;
  border: none;
  background: transparent;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
}

.lang-menu button:hover,
.lang-menu button:focus-visible {
  background: rgba(138, 109, 74, 0.08);
  outline: none;
}

.socials {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.socials a {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(253, 248, 236, 0.4);
  border-radius: 12px;
  background: rgba(253, 248, 236, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(253, 248, 236, 0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.socials a:hover {
  transform: translateY(-2px);
  background: rgba(253, 248, 236, 0.7);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(253, 248, 236, 0.8);
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: #fbf5e9;
  border-radius: 12px;
  padding: 0.75rem;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  transition: background var(--transition), border-color var(--transition);
  align-items: center;
  justify-content: center;
}

.nav-toggle .hamburger {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  position: relative;
  transition: background 0.2s ease;
}

.nav-toggle .hamburger::before,
.nav-toggle .hamburger::after {
  content: '';
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.2s ease;
}

.nav-toggle .hamburger::before {
  top: -6px;
}

.nav-toggle .hamburger::after {
  top: 6px;
}

/* Hamburger to X animation when nav is open */
.nav-toggle.active .hamburger {
  background: transparent;
}

.nav-toggle.active .hamburger::before {
  transform: rotate(45deg) translate(4px, 4px);
}

.nav-toggle.active .hamburger::after {
  transform: rotate(-45deg) translate(4px, -4px);
}

.nav-toggle:active {
  background: rgba(138, 109, 74, 0.1);
}

.theme-dark .nav-toggle {
  background: var(--card-bg);
}

/* Mobile overlay when nav is open */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 25;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-overlay.visible {
  display: block;
  opacity: 1;
}

.page {
  position: relative;
  z-index: 1;
}

section {
  position: relative;
  padding: 3rem 0;
}

section:not(:first-of-type)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(138, 109, 74, 0.25), rgba(138, 109, 74, 0.12), rgba(138, 109, 74, 0.2));
  opacity: 0.6;
  pointer-events: none;
}

.hero {
  padding: 3.5rem 0 2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2.5rem;
  align-items: flex-start;
}

.hero-copy {
  max-width: 640px;
  display: grid;
  gap: 1rem;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.24em;
  color: var(--accent-strong);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.hero h1 {
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  line-height: 1.1;
  min-height: 2.4em;
  margin-bottom: 0.7rem;
}

.hero p {
  font-size: 1.05rem;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.25rem 0 1.75rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  background: linear-gradient(135deg, rgba(138, 109, 74, 0.12), rgba(138, 109, 74, 0.12));
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 16px 32px rgba(20, 17, 13, 0.08);
}

/* Open to Work status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  margin-bottom: 0.75rem;
}

.status-badge.open-to-work {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(16, 185, 129, 0.15));
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #16a34a;
}

.status-badge.open-to-work i {
  font-size: 0.5rem;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.theme-dark .status-badge.open-to-work {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(16, 185, 129, 0.2));
  border-color: rgba(34, 197, 94, 0.4);
  color: #4ade80;
}


.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.9rem 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
}

.btn.primary {
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  box-shadow: 0 18px 42px rgba(20, 17, 13, 0.28), 0 0 0 1px rgba(253, 248, 236, 0.12) inset;
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 48px rgba(20, 17, 13, 0.36), 0 0 0 1px rgba(253, 248, 236, 0.18) inset;
}

.btn.ghost {
  background: var(--card-bg);
  border-color: rgba(20, 17, 13, 0.1);
}

.theme-toggle {
  border: 1px solid rgba(253, 248, 236, 0.4);
  background: rgba(253, 248, 236, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(253, 248, 236, 0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-2px);
  background: rgba(253, 248, 236, 0.7);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(253, 248, 236, 0.8);
}

.theme-toggle .theme-track {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: transparent;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.theme-toggle .theme-icon {
  font-size: 1.05rem;
  color: #0f172a;
  opacity: 1;
  transition: opacity var(--transition), color var(--transition);
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.theme-toggle .theme-icon.sun {
  opacity: 0;
  color: #f8fafc;
}

.theme-toggle .theme-knob {
  display: none;
}

.theme-toggle[aria-pressed="true"] .theme-track {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.theme-toggle[aria-pressed="true"] .theme-icon.sun {
  opacity: 1;
  color: #f8fafc;
}

.theme-toggle[aria-pressed="true"] .theme-icon.moon {
  opacity: 0;
}

.theme-toggle[aria-pressed="true"] .theme-knob {
  transform: translateX(28px);
  background: radial-gradient(circle at 30% 30%, #0f2d3f, #123c52);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(253, 248, 236, 0.32) inset,
    0 10px 20px rgba(17, 24, 39, 0.34);
}

.theme-toggle:focus-visible .theme-track,
.theme-toggle:hover .theme-track {
  box-shadow: none;
}

.theme-dark .theme-toggle .theme-track {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.theme-dark .theme-toggle[aria-pressed="true"] .theme-track {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.hero-full-meta {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100% !important;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-top: 1.75rem;
}

.meta-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.25rem 1.35rem;
  background: rgba(253, 248, 236, 0.9);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(20, 17, 13, 0.07);
  backdrop-filter: blur(8px);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.meta-item:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 14px 36px rgba(20, 17, 13, 0.12);
}

.meta-item span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.meta-item strong {
  display: block;
  width: 100%;
  margin-top: 0.2rem;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--ink);
}

.meta-icon {
  width: 1.1rem;
  color: var(--accent);
  text-align: center;
  flex: 0 0 1.1rem;
}

.hero-visual {
  position: relative;
  align-self: flex-start;
}

@media (max-width: 1024px) {
  .hero-full-meta {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 580px) {
  .hero-full-meta {
    grid-template-columns: 1fr;
  }
}

.hero-card {
  background: rgba(253, 248, 236, 0.9);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: 0 14px 40px rgba(20, 17, 13, 0.12);
  backdrop-filter: blur(8px);
  max-width: 540px;
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  inset: -12%;
  background: radial-gradient(circle at 50% 30%, rgba(138, 109, 74, 0.22), rgba(138, 109, 74, 0.12), transparent 55%);
  z-index: 0;
}

.hero-card > * {
  position: relative;
  z-index: 1;
}

.hero-card img {
  width: 100%;
  border-radius: 14px;
  margin-bottom: 0;
  /* Warm sepia wash so the illustration harmonizes with the ink + cream palette */
  filter: sepia(0.45) saturate(0.7) hue-rotate(-6deg) brightness(1.03) contrast(0.96);
  transition: filter var(--transition);
}

/* ==========================================================================
   CINEMATIC AI AVATAR ASSISTANT STYLES
   ========================================================================== */

/* 1. Hero Card Initial State */
.avatar-stage {
  position: relative;
  overflow: visible;
  border-radius: 16px;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  min-height: 220px;
}

.avatar-stage img {
  width: auto;
  max-width: 100%;
  max-height: 340px;
  display: block;
  border-radius: 16px;
  margin: 0 auto;
  object-fit: contain;
  filter: none !important;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Premium Large Cinematic Trigger Button Below Avatar */
.btn-avatar-cinematic-trigger {
  position: relative;
  width: 100%;
  margin: 0.75rem 0 1.25rem 0;
  padding: 0.85rem 1.25rem;
  background: linear-gradient(135deg, #c2603d 0%, #e07a5f 50%, #c2603d 100%);
  background-size: 200% auto;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(194, 96, 61, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  text-decoration: none;
}

.btn-avatar-cinematic-trigger:hover {
  transform: translateY(-3px) scale(1.015);
  box-shadow: 0 18px 36px rgba(194, 96, 61, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  background-position: right center;
}

.btn-avatar-cinematic-trigger:active {
  transform: translateY(0) scale(0.99);
}

.btn-avatar-cinematic-trigger .btn-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  animation: sparkle-float 3s ease-in-out infinite;
}

.btn-avatar-cinematic-trigger .btn-icon-wrap i,
.btn-avatar-cinematic-trigger .btn-icon-wrap svg {
  color: #ffffff !important;
  font-size: 1.15rem;
  line-height: 1;
  display: block;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.7));
}

.btn-avatar-cinematic-trigger .btn-text-content {
  display: flex;
  flex-direction: column;
  text-align: left;
  flex: 1;
}

[dir="rtl"] .btn-avatar-cinematic-trigger .btn-text-content {
  text-align: right;
}

.btn-avatar-cinematic-trigger .btn-text-content strong {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.btn-avatar-cinematic-trigger .btn-text-content small {
  font-size: 0.78rem;
  opacity: 0.92;
  font-weight: 500;
  margin-top: 0.15rem;
}

.btn-avatar-cinematic-trigger .btn-arrow-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.btn-avatar-cinematic-trigger:hover .btn-arrow-icon {
  transform: translateX(4px);
}

[dir="rtl"] .btn-avatar-cinematic-trigger:hover .btn-arrow-icon {
  transform: translateX(-4px);
}

/* 2. Cinematic Full-Viewport Stage */
.avatar-cinematic-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(10, 15, 26, 0.40);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
}

.avatar-cinematic-stage.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Ambient Floating Glow Orbs */
.cinematic-ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.4;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.ambient-orb-1 {
  width: 550px;
  height: 550px;
  top: -10%;
  right: -5%;
  background: radial-gradient(circle, rgba(194, 96, 61, 0.45) 0%, rgba(223, 122, 95, 0) 70%);
  animation: orb-float-1 12s ease-in-out infinite alternate;
}

.ambient-orb-2 {
  width: 600px;
  height: 600px;
  bottom: -15%;
  left: -5%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, rgba(99, 102, 241, 0) 70%);
  animation: orb-float-2 14s ease-in-out infinite alternate;
}

.avatar-cinematic-stage.is-speaking .cinematic-ambient-orb {
  opacity: 0.75;
  transform: scale(1.15);
}

/* 3. Cinematic Modal Shell */
.cinematic-stage-modal {
  position: relative;
  width: 94vw;
  max-width: 1240px;
  height: 86vh;
  max-height: 820px;
  background: rgba(253, 248, 236, 0.94);
  border: 1px solid rgba(194, 96, 61, 0.25);
  border-radius: 28px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  overflow: hidden;
  transform: scale(0.94) translateY(24px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}

.theme-dark .cinematic-stage-modal {
  background: rgba(18, 26, 43, 0.95);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.avatar-cinematic-stage.active .cinematic-stage-modal {
  transform: scale(1) translateY(0);
}

/* 4. Left Column: Conversation Area */
.cinematic-chat-column {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 2rem 2.25rem;
  border-right: 1px solid rgba(194, 96, 61, 0.15);
  overflow: hidden;
  position: relative;
}

[dir="rtl"] .cinematic-chat-column {
  border-right: none;
  border-left: 1px solid rgba(194, 96, 61, 0.15);
}

.theme-dark .cinematic-chat-column {
  border-color: rgba(255, 255, 255, 0.08);
}

/* Top Header Bar */
.cinematic-chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

.theme-dark .cinematic-chat-topbar {
  border-color: rgba(255, 255, 255, 0.08);
}

.cinematic-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid rgba(16, 185, 129, 0.25);
  transition: all 0.3s ease;
}

.avatar-cinematic-stage.is-speaking .cinematic-status-pill {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.35);
}

.cinematic-status-pill .pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: pulse-dot 1.8s infinite;
}

.cinematic-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c2603d 0%, #df7a5f 50%, #c2603d 100%);
  background-size: 200% auto;
  border: 2px solid rgba(255, 255, 255, 0.45);
  color: #ffffff !important;
  font-size: 1.15rem;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(194, 96, 61, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  animation: close-btn-float 3.5s ease-in-out infinite;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  outline: none;
}

.cinematic-close-btn i {
  color: #ffffff !important;
  font-size: 1.15rem;
  line-height: 1;
  display: block;
  transition: transform 0.3s ease;
}

.cinematic-close-btn:hover {
  transform: translateY(-4px) scale(1.12);
  box-shadow: 0 14px 30px rgba(194, 96, 61, 0.65), 0 0 20px rgba(223, 122, 95, 0.5);
  border-color: rgba(255, 255, 255, 0.85);
  animation-play-state: paused;
}

.cinematic-close-btn:hover i {
  transform: rotate(90deg);
}

.cinematic-close-btn:active {
  transform: translateY(0) scale(0.95);
}

@keyframes close-btn-float {
  0% {
    transform: translateY(0px) rotate(0deg);
    box-shadow: 0 8px 22px rgba(194, 96, 61, 0.42), 0 2px 6px rgba(0, 0, 0, 0.1);
  }
  50% {
    transform: translateY(-6px) rotate(3deg);
    box-shadow: 0 16px 28px rgba(194, 96, 61, 0.55), 0 4px 12px rgba(0, 0, 0, 0.15);
  }
  100% {
    transform: translateY(0px) rotate(0deg);
    box-shadow: 0 8px 22px rgba(194, 96, 61, 0.42), 0 2px 6px rgba(0, 0, 0, 0.1);
  }
}


/* Chat Stream Body */
.cinematic-chat-stream {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  scroll-behavior: smooth;
}

/* Custom Clean Scrollbar */
.cinematic-chat-stream::-webkit-scrollbar {
  width: 6px;
}
.cinematic-chat-stream::-webkit-scrollbar-thumb {
  background: rgba(194, 96, 61, 0.2);
  border-radius: 4px;
}

/* Message Bubbles */
.cinematic-msg-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cinematic-msg-card.user-msg {
  align-self: flex-end;
  max-width: 80%;
}

.cinematic-msg-card.user-msg .msg-bubble {
  background: var(--accent, #c2603d);
  color: #ffffff;
  padding: 0.85rem 1.2rem;
  border-radius: 18px 18px 4px 18px;
  font-size: 0.95rem;
  line-height: 1.5;
  box-shadow: 0 4px 16px rgba(194, 96, 61, 0.25);
}

[dir="rtl"] .cinematic-msg-card.user-msg .msg-bubble {
  border-radius: 18px 18px 18px 4px;
}

.cinematic-msg-card.ai-msg {
  align-self: flex-start;
  width: 100%;
}

.cinematic-msg-card.ai-msg .msg-bubble {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(194, 96, 61, 0.2);
  padding: 1.25rem 1.4rem;
  border-radius: 20px;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ink);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
  position: relative;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.theme-dark .cinematic-msg-card.ai-msg .msg-bubble {
  background: rgba(26, 38, 62, 0.85);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.avatar-cinematic-stage.is-speaking .cinematic-msg-card.ai-msg .msg-bubble {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 10px 35px rgba(99, 102, 241, 0.18);
}

/* Chat Typing Cursor Animation */
.avatar-cinematic-stage .typing-cursor,
.msg-bubble .typing-cursor {
  display: inline-block;
  width: 7px;
  height: 18px;
  background: var(--accent, #c2603d);
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 0.9s infinite;
  border-radius: 2px;
}

/* Starter Quick Chips */
.cinematic-prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.cinematic-chip-btn {
  background: rgba(194, 96, 61, 0.08);
  border: 1px solid rgba(194, 96, 61, 0.22);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.theme-dark .cinematic-chip-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.cinematic-chip-btn:hover {
  background: var(--accent, #c2603d);
  color: #ffffff !important;
  border-color: var(--accent, #c2603d);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(194, 96, 61, 0.3);
}

/* Bottom Input Dock */
.cinematic-input-dock {
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

.theme-dark .cinematic-input-dock {
  border-color: rgba(255, 255, 255, 0.08);
}

.cinematic-input-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #ffffff;
  border: 2px solid rgba(194, 96, 61, 0.25);
  border-radius: 20px;
  padding: 0.55rem 0.75rem 0.55rem 1.25rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-dark .cinematic-input-bar {
  background: rgba(26, 38, 62, 0.95);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.cinematic-input-bar:focus-within {
  border-color: var(--accent, #c2603d);
  box-shadow: 0 12px 35px rgba(194, 96, 61, 0.25);
}

.cinematic-input-bar input {
  flex: 1;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  font-size: 1rem !important;
  color: var(--ink) !important;
  padding: 0.4rem 0 !important;
}

.cinematic-send-btn {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #c2603d, #df7a5f);
  color: #ffffff;
  font-size: 1.1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(194, 96, 61, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.cinematic-send-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 22px rgba(194, 96, 61, 0.5);
}

.cinematic-send-btn:active {
  transform: scale(0.95);
}

.cinematic-input-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.5rem;
  padding: 0 0.5rem;
}

/* 5. Right Column: Cinematic Avatar Showcase */
.cinematic-avatar-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  position: relative;
  background: radial-gradient(circle at center, rgba(194, 96, 61, 0.08) 0%, transparent 70%);
  overflow: hidden;
}

.theme-dark .cinematic-avatar-column {
  background: radial-gradient(circle at center, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
}

/* Three.js Canvases for Cinematic Stage */
.three-cinematic-stage-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.9;
}

.three-avatar-halo-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 440px;
  height: 440px;
  pointer-events: none;
  z-index: 1;
  border-radius: 50%;
}

/* Glowing Halo & Voice Reactive Pulse Rings */
.cinematic-avatar-halo {
  position: relative;
  width: 320px;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cinematic-avatar-img {
  position: relative;
  z-index: 2;
}

.voice-ripple-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(194, 96, 61, 0.3);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.avatar-cinematic-stage.is-speaking .voice-ripple-ring {
  opacity: 1;
}

.avatar-cinematic-stage.is-speaking .voice-ripple-ring.ring-1 {
  width: 330px;
  height: 330px;
  animation: voice-pulse-wave 2.2s ease-out infinite;
}

.avatar-cinematic-stage.is-speaking .voice-ripple-ring.ring-2 {
  width: 370px;
  height: 370px;
  animation: voice-pulse-wave 2.2s ease-out infinite 0.7s;
}

.avatar-cinematic-stage.is-speaking .voice-ripple-ring.ring-3 {
  width: 410px;
  height: 410px;
  animation: voice-pulse-wave 2.2s ease-out infinite 1.4s;
}

.cinematic-avatar-img {
  position: relative;
  max-height: 340px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  border-radius: 24px;
  z-index: 2;
  filter: none !important;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.avatar-cinematic-stage.is-speaking .cinematic-avatar-img {
  transform: scale(1.03);
}

/* Soundwave Frequency Equalizer */
.audio-visualizer-bars {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1.5rem;
  height: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.avatar-cinematic-stage.is-speaking .audio-visualizer-bars {
  opacity: 1;
}

.audio-visualizer-bars span {
  width: 4px;
  height: 6px;
  background: var(--accent, #c2603d);
  border-radius: 3px;
  transition: height 0.15s ease;
}

.avatar-cinematic-stage.is-speaking .audio-visualizer-bars span:nth-child(1) { animation: sound-bounce 0.8s ease infinite 0.1s; }
.avatar-cinematic-stage.is-speaking .audio-visualizer-bars span:nth-child(2) { animation: sound-bounce 0.8s ease infinite 0.3s; }
.avatar-cinematic-stage.is-speaking .audio-visualizer-bars span:nth-child(3) { animation: sound-bounce 0.8s ease infinite 0.2s; }
.avatar-cinematic-stage.is-speaking .audio-visualizer-bars span:nth-child(4) { animation: sound-bounce 0.8s ease infinite 0.4s; }
.avatar-cinematic-stage.is-speaking .audio-visualizer-bars span:nth-child(5) { animation: sound-bounce 0.8s ease infinite 0.25s; }
.avatar-cinematic-stage.is-speaking .audio-visualizer-bars span:nth-child(6) { animation: sound-bounce 0.8s ease infinite 0.35s; }
.avatar-cinematic-stage.is-speaking .audio-visualizer-bars span:nth-child(7) { animation: sound-bounce 0.8s ease infinite 0.15s; }

/* Avatar Info Card */
.cinematic-avatar-info {
  margin-top: 1rem;
  text-align: center;
  z-index: 2;
}

.cinematic-avatar-info h4 {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
  color: var(--ink);
}

.cinematic-avatar-info p {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.2rem 0 0 0;
}

/* Keyframe Animations */
@keyframes voice-pulse-wave {
  0% { transform: scale(0.9); opacity: 0.75; border-color: rgba(194, 96, 61, 0.6); }
  50% { border-color: rgba(99, 102, 241, 0.5); }
  100% { transform: scale(1.35); opacity: 0; border-color: rgba(99, 102, 241, 0); }
}

@keyframes sound-bounce {
  0%, 100% { height: 6px; }
  50% { height: 22px; }
}

@keyframes sparkle-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(6deg); }
}

@keyframes orb-float-1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-40px, 40px) scale(1.1); }
}

@keyframes orb-float-2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, -40px) scale(1.15); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Responsive adjustments for mobile & tablet */
@media (max-width: 992px) {
  .cinematic-stage-modal {
    grid-template-columns: 1fr;
    height: 92vh;
    max-height: 92vh;
    border-radius: 20px;
  }
  .cinematic-avatar-column {
    display: none; /* Hide large avatar showcase on smaller viewports to give chat 100% space */
  }
  .cinematic-chat-column {
    padding: 1.5rem;
    border: none !important;
  }
  .avatar-cinematic-stage {
    padding: 1rem;
  }
}

.hero-card .note {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.8rem;
  background: rgba(138, 109, 74, 0.12);
  color: var(--accent-strong);
  border-radius: 12px;
  font-weight: 600;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.pillar-card {
  background: rgba(253, 248, 236, 0.9);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 14px 30px rgba(20, 17, 13, 0.08);
}

.section-header {
  max-width: 760px;
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.6rem);
}

.discovery-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.discovery-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.discovery-search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--input-bg);
}

.discovery-search i {
  color: var(--muted);
}

.discovery-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  color: var(--ink);
  outline: none;
}

.discovery-search input::placeholder {
  color: var(--muted);
}

.discovery-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.discovery-tag-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.discovery-tag-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.discovery-tag-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.discovery-results {
  margin-top: 1.5rem;
}

.discovery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.discovery-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform var(--transition), box-shadow var(--transition);
}

.discovery-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.discovery-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.discovery-type {
  font-weight: 700;
}

.discovery-card h3 {
  font-size: 1.1rem;
}

.discovery-card p {
  font-size: 0.95rem;
  margin-bottom: 0;
}

.discovery-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(138, 109, 74, 0.12);
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 600;
}

.discovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: auto;
}

.discovery-actions .btn {
  padding: 0.6rem 1rem;
}

.discovery-empty {
  text-align: center;
  color: var(--muted);
  padding: 1.5rem 0 0.5rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 1.6rem;
}

.project-card {
  background: rgba(253, 248, 236, 0.95);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  box-shadow: var(--shadow);
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow var(--transition);
  transform-style: preserve-3d;
  perspective: 1000px;
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-6px) rotateX(2deg);
  box-shadow: 0 24px 56px rgba(20, 17, 13, 0.14);
}

.project-card .project-thumb {
  transition: transform 0.35s ease;
}

.project-card:hover .project-thumb {
  transform: scale(1.02);
}

.project-card .date {
  font-size: 0.9rem;
  color: var(--muted);
  order: -1;
  position: relative;
  z-index: 2;
}

.project-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(20, 17, 13, 0.12);
  box-shadow: 0 14px 32px rgba(20, 17, 13, 0.08);
}

.project-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.25rem;
}

.project-card .project-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-card .tags,
.project-card .tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  background: linear-gradient(135deg, rgba(138, 109, 74, 0.1), rgba(138, 109, 74, 0.1));
  color: var(--ink);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid rgba(20, 17, 13, 0.08);
}

.tag .tag-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.9rem;
  height: 0.9rem;
  font-size: 0.9rem;
  line-height: 1;
  opacity: 0.85;
}

.tag img.tag-icon {
  filter: grayscale(1) contrast(1.1);
}

.project-card .actions,
.project-card .project-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 1rem;
}

.project-card .actions .btn,
.project-card .project-actions .btn {
  width: fit-content;
  padding: 0.65rem 1.15rem;
}

.project-card .actions.compact,
.project-card .actions:has(.btn:nth-child(3)),
.project-card .project-actions:has(.btn:nth-child(3)) {
  gap: 0.6rem;
}

.project-card .actions.compact .btn,
.project-card .actions:has(.btn:nth-child(3)) .btn,
.project-card .project-actions:has(.btn:nth-child(3)) .btn {
  padding: 0.6rem 0.95rem;
  font-size: 0.875rem;
}

/* What I Can Do For You Section */
.for-you-section {
  padding: 4rem 0;
}

.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.persona-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: 0 16px 40px rgba(20, 17, 13, 0.08);
  transition: transform var(--transition), box-shadow var(--transition);
}

.persona-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 50px rgba(20, 17, 13, 0.12);
}

.persona-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(138, 109, 74, 0.15), rgba(138, 109, 74, 0.15));
  font-size: 1.75rem;
  color: var(--accent);
}

.persona-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.persona-card p {
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.persona-card .btn {
  width: 100%;
}

.theme-dark .persona-card {
  background: rgba(30, 41, 59, 0.6);
}

.theme-dark .persona-icon {
  background: linear-gradient(135deg, rgba(138, 109, 74, 0.25), rgba(138, 109, 74, 0.25));
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.75rem 1.5rem;
  margin-top: 1.25rem;
}

.skill-card,
.skills-col {
  background: rgba(253, 248, 236, 0.92);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.skill-card:hover,
.skills-col:hover {
  transform: translateY(-3px);
  border-color: rgba(194, 96, 61, 0.35);
  box-shadow: 0 14px 40px rgba(20, 17, 13, 0.08);
}

.skill-card h3,
.skills-col h3 {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.25rem;
  line-height: 1.35;
}

.chip-group,
.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(253, 248, 236, 0.95);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.86rem;
  line-height: 1.3;
  border: 1px solid var(--border);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.chip .chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.9rem;
  height: 0.9rem;
  font-size: 0.9rem;
  line-height: 1;
  opacity: 0.85;
}

.chip img.chip-icon {
  filter: grayscale(1) contrast(1.1);
}

.contact-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.contact-card {
  background: rgba(253, 248, 236, 0.92);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.contact-card ul {
  padding: 0;
  margin: 0;
  list-style: none;
}

.contact-card li + li {
  margin-top: 0.65rem;
}

.contact-form {
  background: rgba(253, 248, 236, 0.92);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.field {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f8f1e2;
  font-family: inherit;
  font-size: 1rem;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

textarea {
  resize: vertical;
  min-height: 140px;
}

.actions {
  display: flex;
  gap: 0.75rem;
}

.footer {
  padding: 3.5rem 0 2rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  background: rgba(253, 248, 236, 0.82);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.75rem;
}

.footer-brand .brand {
  font-size: 1.1rem;
  margin-bottom: 0.65rem;
  display: inline-flex;
}

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 1.1rem;
  max-width: 260px;
}

.footer-col h4 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin: 0 0 0.85rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.footer-col ul li a {
  font-size: 0.92rem;
  color: var(--muted);
  transition: color var(--transition);
}

.footer-col ul li a:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-bottom .copyright {
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #16a34a;
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(22, 163, 74, 0.25);
  border-radius: 50px;
  padding: 0.3rem 0.85rem;
}

.footer-status i {
  font-size: 0.5rem;
  color: #10b981;
  filter: drop-shadow(0 0 4px #10b981);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* Story Share Section */
.story-share {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
}
.story-share .share-label {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.story-share .share-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  border: 2px solid var(--border);
  border-radius: 50px;
  background: var(--card-bg);
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
}
.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.share-btn.linkedin:hover {
  background: #0077b5;
  border-color: #0077b5;
  color: #fff;
}
.share-btn.facebook:hover {
  background: #1877f2;
  border-color: #1877f2;
  color: #fff;
}
.share-btn.twitter:hover {
  background: #1da1f2;
  border-color: #1da1f2;
  color: #fff;
}
.share-btn.copy:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

@media (max-width: 480px) {
  .story-share .share-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  .share-btn {
    justify-content: center;
  }
}

/* Comments Section */
.comments-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.comments-section h3 {
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
}
.comments-section h3 i {
  color: var(--accent);
}

/* Share Dropdown */
.share-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

button.btn.ghost.share-btn {
  font-family: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  padding: 0.5rem;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--muted);
  transition: color 0.2s ease, transform 0.2s ease;
}

button.btn.ghost.share-btn:hover {
  color: var(--accent);
  transform: scale(1.1);
  background: transparent;
  box-shadow: none;
}

button.btn.ghost.share-btn i {
  margin: 0;
}

.share-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(253, 248, 236, 0.95);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.5rem;
  min-width: 160px;
  box-shadow: 0 18px 50px rgba(20, 17, 13, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 20;
}

.share-dropdown.open .share-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.share-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
  border: none;
  background: transparent;
  width: 100%;
  cursor: pointer;
  transition: background 0.15s ease;
}

.share-option:hover {
  background: rgba(138, 109, 74, 0.1);
}

.share-option i {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
}

.share-option .fa-linkedin { color: #0077b5; }
.share-option .fa-twitter { color: #1da1f2; }
.share-option .fa-facebook { color: #1877f2; }
.share-option .fa-envelope { color: var(--accent); }
.share-option .fa-link { color: var(--muted); }

.theme-dark .share-menu {
  background: rgba(30, 41, 59, 0.95);
  border-color: var(--border);
}

.page-hero {
  padding: 3.5rem 0 1.5rem;
}

.page-hero h1 {
  font-size: clamp(2.2rem, 4vw, 3rem);
}

.page-hero p {
  max-width: 760px;
}

.blog-grid, .resume-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.post-card, .resume-card {
  background: rgba(253, 248, 236, 0.94);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-top: 1.25rem;
}

.post-card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.post-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.post-card button {
  border: none;
  background: none;
  color: var(--accent-strong);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

/* Featured post card */
.post-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto auto auto;
  gap: 0.5rem 1.5rem;
  padding: 1.75rem;
  background: linear-gradient(135deg, rgba(138, 109, 74, 0.08), rgba(176, 138, 92, 0.04));
  border: 1px solid rgba(138, 109, 74, 0.2);
}
.post-card.featured .post-badge {
  grid-column: 2;
  grid-row: 1;
}
.post-card.featured h3 {
  grid-column: 2;
  grid-row: 2;
  font-size: 1.5rem;
}
.post-card.featured .post-thumb {
  grid-column: 1;
  grid-row: 1 / 6;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
}
.post-card.featured .short-content {
  grid-column: 2;
  grid-row: 3;
}
.post-card.featured .post-meta {
  grid-column: 2;
  grid-row: 4;
}
.post-card.featured .btn {
  grid-column: 2;
  grid-row: 5;
  justify-self: start;
}
.post-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: fit-content;
}
.post-meta {
  display: flex;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.post-meta span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
@media (max-width: 700px) {
  .post-card.featured {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .post-card.featured .post-badge,
  .post-card.featured h3,
  .post-card.featured .post-thumb,
  .post-card.featured .short-content,
  .post-card.featured .post-meta,
  .post-card.featured .btn {
    grid-column: 1;
    grid-row: auto;
  }
}

.resume-card ul,
.resume-card ol {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.resume-hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 280px;
  align-items: center;
  gap: 1.5rem;
}

.resume-photo {
  width: 100%;
  max-width: 280px;
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 18px 40px rgba(20, 17, 13, 0.1);
}

.resume-sections {
  display: grid;
  gap: 2.5rem;
}

.resume-section {
  background: rgba(253, 248, 236, 0.94);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.resume-section a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px dotted rgba(138, 109, 74, 0.35);
  transition: color var(--transition), border-color var(--transition);
}

.resume-section a:hover,
.resume-section a:focus-visible {
  color: var(--accent-2);
  border-color: rgba(138, 109, 74, 0.6);
}

.resume-section h3 {
  margin-bottom: 0.35rem;
}

.section-hint {
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.timeline {
  display: grid;
  gap: 1.25rem;
}

.timeline-item {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
}

.timeline-item strong {
  display: block;
  margin-bottom: 0.1rem;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.35rem 0 0.65rem;
}

.pill {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #eef2ff;
  font-weight: 600;
  font-size: 0.95rem;
}

.resume-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.badge-stack {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.resume-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.credential-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.credential-card img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.resume-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.resume-list li + li {
  margin-top: 0.35rem;
}

.resume-card li + li {
  margin-top: 0.35rem;
}

.form-toast {
  display: none;
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  background: #16a34a;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 16px 40px rgba(22, 163, 74, 0.25);
  z-index: 40;
}

.form-toast.show {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(138, 109, 74, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--accent);
  border: 1px solid rgba(138, 109, 74, 0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 4px 16px rgba(138, 109, 74, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.2s ease;
  z-index: 50;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.back-to-top:hover {
  background: rgba(138, 109, 74, 0.25);
  transform: translateX(-50%) translateY(-2px);
}

.theme-dark .back-to-top {
  background: rgba(176, 138, 92, 0.15);
  border-color: rgba(176, 138, 92, 0.3);
  color: var(--accent);
  box-shadow: 0 4px 16px rgba(176, 138, 92, 0.2);
}

.theme-dark .back-to-top:hover {
  background: rgba(176, 138, 92, 0.25);
}

/* Dark theme overrides */
.theme-dark {
  /* Ink black + warm cream */
  --bg: #14110d;
  --panel: rgba(26, 22, 16, 0.85);
  --ink: #efe7d7;
  --muted: #a99e8a;
  --accent: #e8a87c;          /* warm clay — links, primary buttons */
  --accent-strong: #f0c4a0;
  --accent-2: #b08a5c;        /* bronze */
  --on-accent: #14110d;       /* ink text on clay backgrounds */
  --border: rgba(239, 231, 215, 0.14);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(239, 231, 215, 0.05);
  --body-bg: radial-gradient(circle at 15% 50%, rgba(176, 138, 92, 0.10), transparent 32%),
    radial-gradient(circle at 85% 15%, rgba(239, 231, 215, 0.05), transparent 28%),
    linear-gradient(135deg, #14110d, #211b13 50%, #14110d);
  --card-bg: rgba(33, 27, 19, 0.78);
  --input-bg: #211b13;
}

.theme-dark body {
  color: var(--ink);
  background: var(--body-bg);
}

.theme-dark p {
  color: var(--muted);
}

.theme-dark .surface-glow {
  background: radial-gradient(circle at 20% 60%, rgba(176, 138, 92, 0.08), transparent 28%),
    radial-gradient(circle at 80% 15%, rgba(176, 138, 92, 0.06), transparent 32%);
}

.theme-dark .site-header {
  background: linear-gradient(
    135deg,
    rgba(30, 41, 59, 0.7) 0%,
    rgba(30, 41, 59, 0.4) 50%,
    rgba(30, 41, 59, 0.6) 100%
  );
  border-bottom: 1px solid rgba(253, 248, 236, 0.1);
  box-shadow: 
    0 4px 24px rgba(0, 0, 0, 0.2),
    inset 0 -1px 0 rgba(253, 248, 236, 0.05);
}

.theme-dark .footer {
  background: rgba(12, 20, 36, 0.9);
  border-color: var(--border);
}

.theme-dark .footer-col ul li a,
.theme-dark .footer-bottom .copyright {
  color: var(--muted);
}

.theme-dark .footer-col ul li a:hover {
  color: var(--accent);
}

.theme-dark .nav-links a {
  color: rgba(253, 248, 236, 0.85);
}

.theme-dark .nav-links a:hover {
  color: #fff;
}

.theme-dark .nav-links a.active {
  color: var(--accent);
}

.theme-dark .nav-toggle,
.theme-dark .theme-toggle,
.theme-dark .lang-toggle,
.theme-dark .socials a {
  background: rgba(253, 248, 236, 0.1);
  border-color: rgba(253, 248, 236, 0.15);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(253, 248, 236, 0.1);
}

.theme-dark .lang-flag {
  filter: grayscale(1) saturate(0.2) brightness(1.15);
}

.theme-dark .nav-toggle:hover,
.theme-dark .theme-toggle:hover,
.theme-dark .lang-toggle:hover,
.theme-dark .socials a:hover {
  background: rgba(253, 248, 236, 0.15);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(253, 248, 236, 0.15);
}

.theme-dark .meta-item,
.theme-dark .hero-card,
.theme-dark .pillar-card,
.theme-dark .project-card,
.theme-dark .skill-card,
.theme-dark .contact-card,
.theme-dark .contact-form,
.theme-dark .post-card,
.theme-dark .resume-card,
.theme-dark .resume-section {
  background: var(--card-bg);
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.theme-dark .project-thumb,
.theme-dark .post-thumb,
.theme-dark .resume-photo {
  border-color: rgba(241, 245, 249, 0.1);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(176, 138, 92, 0.08);
}

.theme-dark .tag,
.theme-dark .chip,
.theme-dark .badge,
.theme-dark .hero-card .note {
  background: linear-gradient(135deg, rgba(176, 138, 92, 0.18), rgba(176, 138, 92, 0.14));
  border-color: rgba(241, 245, 249, 0.15);
  color: var(--ink);
}

.theme-dark .project-card:hover {
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(176, 138, 92, 0.12);
}

.theme-dark .pill {
  background: rgba(176, 138, 92, 0.18);
}

.theme-dark .btn.ghost {
  border-color: var(--border);
  color: #fff;
}

.theme-dark input[type="text"],
.theme-dark input[type="email"],
.theme-dark select,
.theme-dark textarea {
  background: var(--input-bg);
  color: var(--ink);
  border-color: var(--border);
}

.theme-dark select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
}

.theme-dark .footer .meta div:first-child div {
  color: var(--muted);
}

@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .resume-hero-grid {
    grid-template-columns: 1fr;
    text-align: left;
    justify-items: start;
  }

  .nav-links {
    position: absolute;
    top: 66px;
    right: 1.25rem;
    background: rgba(253, 248, 236, 0.98);
    padding: 1.25rem 1rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 16px 40px rgba(20, 17, 13, 0.16);
    flex-direction: column;
    align-items: stretch;
    min-width: 210px;
    display: none;
    z-index: 1000;
  }

  [dir="rtl"] .nav-links {
    right: auto;
    left: 1.25rem;
    text-align: right;
  }

  .theme-dark .nav-links {
    background: rgba(13, 22, 38, 0.98);
    border-color: var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .hero {
    padding-top: 3rem;
  }
}

@media (max-width: 640px) {
  section {
    padding: 2.25rem 0;
  }

  .hero {
    padding: 2.5rem 0 1.5rem;
  }

  .hero h1 {
    min-height: 2.8em;
  }

  .hero-card {
    padding: 1.15rem;
  }

  .hero-visual .meta-grid {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .site-header {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(253, 248, 236, 0.96);
    border-radius: 0 0 16px 16px;
  }

  .site-header .inner {
    padding: 0.6rem 0.8rem;
    gap: 0.35rem;
  }

  .brand {
    font-size: 0.9rem;
    gap: 0.4rem;
    min-width: 0;
    max-width: 140px;
    flex-shrink: 1;
  }

  .brand span:last-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
  }

  .brand .dot {
    width: 9px;
    height: 9px;
    flex-shrink: 0;
  }

  .header-actions {
    gap: 0.25rem;
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  /* Hide social icons in header on mobile to prevent squishing */
  .site-header .socials {
    display: none !important;
  }

  .lang-toggle {
    padding: 0.3rem 0.45rem;
    font-size: 0.78rem;
    gap: 0.25rem;
    border-radius: 8px;
  }

  .lang-flag svg {
    width: 15px;
    height: 10px;
  }

  .theme-toggle {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 8px;
  }

  .nav-toggle {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0.4rem;
    border-radius: 8px;
  }

  .container {
    padding: 0 0.85rem;
  }

  .nav-links {
    top: 60px;
    left: 0.85rem;
    right: 0.85rem;
    max-height: calc(100vh - 75px);
    overflow-y: auto;
  }

  .nav-mobile-socials {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border);
  }

  .nav-mobile-socials .icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(253, 248, 236, 0.8);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .btn {
    width: 100%;
  }

  .cta-row {
    flex-direction: column;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }

  /* Fix project card on mobile */
  .project-card {
    padding: 1rem;
  }

  .project-card .date {
    margin-bottom: 0.25rem;
  }

  .project-thumb {
    margin: 0;
    border-radius: 12px;
  }

  .blog-grid, .resume-grid {
    grid-template-columns: 1fr;
  }

  .footer .meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    right: 1.5rem;
  }

  /* Mobile-first hero typography */
  h1 {
    font-size: 1.75rem;
    line-height: 1.2;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.15rem;
  }

  .eyebrow {
    font-size: 0.75rem;
  }

  .hero p {
    font-size: 0.95rem;
  }

  /* Improved badge row for mobile */
  .badge-row {
    gap: 0.5rem;
  }

  .badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.7rem;
  }

  /* Better touch targets */
  .btn {
    min-height: 48px;
    font-size: 0.95rem;
  }

  .nav-links a {
    padding: 0.75rem 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Mobile nav improvements */
  .nav-links {
    top: 64px;
    left: 1rem;
    right: 1rem;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }

  /* Persona cards stack better */
  .persona-grid {
    gap: 1rem;
  }

  .persona-card {
    padding: 1.5rem 1.25rem;
  }

  .persona-icon {
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
    margin-bottom: 1rem;
  }

  /* Skills grid mobile */
  .skills-grid {
    gap: 0.75rem;
  }

  .skill-card {
    padding: 1rem;
  }

  .chip {
    font-size: 0.85rem;
    padding: 0.35rem 0.6rem;
  }

  .chip .chip-icon {
    width: 0.8rem;
    height: 0.8rem;
    font-size: 0.8rem;
  }

  /* Contact section mobile */
  .contact-section {
    gap: 1rem;
  }

  .contact-form {
    padding: 1.25rem;
  }

  .contact-card {
    padding: 1rem;
  }

  /* Project cards mobile */
  .project-card {
    padding: 1.25rem;
  }

  .project-thumb {
    margin: -1.25rem -1.25rem 1rem;
    width: calc(100% + 2.5rem);
    border-radius: 16px 16px 0 0;
  }

  .tags {
    gap: 0.4rem;
  }

  .tag {
    font-size: 0.75rem;
    padding: 0.3rem 0.55rem;
  }

  .tag .tag-icon {
    width: 0.75rem;
    height: 0.75rem;
    font-size: 0.75rem;
  }

  /* Share dropdown mobile */
  .share-dropdown {
    width: 100%;
  }

  .share-menu {
    left: 0;
    right: 0;
    transform: translateY(8px);
    min-width: 100%;
  }

  .share-dropdown.open .share-menu {
    transform: translateY(0);
  }

  /* Back to top on mobile - centered */
  .back-to-top {
    width: 40px;
    height: 40px;
    bottom: 1rem;
    font-size: 0.9rem;
  }

  /* Toast notification mobile */
  .form-toast {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    text-align: center;
  }

  /* Footer mobile */
  .footer {
    padding: 1.5rem 0;
  }

  .footer .meta {
    gap: 1rem;
  }

  .footer .socials {
    margin-top: 0.5rem;
  }

  /* Status badge mobile */
  .status-badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.7rem;
  }

  /* Section headers mobile */
  .section-header {
    margin-bottom: 1.5rem;
  }

  .section-header p {
    font-size: 0.9rem;
  }
}

/* Extra small devices (phones in portrait) */
@media (max-width: 375px) {
  h1 {
    font-size: 1.5rem;
  }

  .container {
    padding: 0 0.9rem;
  }

  .badge-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .badge {
    width: 100%;
    justify-content: center;
  }

  .hero-card .note {
    font-size: 0.85rem;
  }

  .persona-card h3 {
    font-size: 1.1rem;
  }

  .persona-card p {
    font-size: 0.85rem;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects that don't work well on touch */
  .project-card:hover {
    transform: none;
  }

  .persona-card:hover {
    transform: none;
  }

  .btn:hover {
    transform: none;
  }

  /* Larger tap targets */
  .socials a {
    width: 44px;
    height: 44px;
  }

  /* Better active states for touch */
  .btn:active {
    transform: scale(0.98);
    opacity: 0.9;
  }

  .project-card:active {
    transform: scale(0.99);
  }

  .nav-links a:active {
    background: rgba(138, 109, 74, 0.1);
  }
}

/* Landscape phone optimization */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    padding: 1.5rem 0;
  }

  .nav-links {
    max-height: calc(100vh - 60px);
  }

  section {
    padding: 1.5rem 0;
  }
}

/* Safe area insets for notched phones */
@supports (padding: max(0px)) {
  .site-header .inner {
    padding-left: max(1.1rem, env(safe-area-inset-left));
    padding-right: max(1.1rem, env(safe-area-inset-right));
  }

  .container {
    padding-left: max(1.1rem, env(safe-area-inset-left));
    padding-right: max(1.1rem, env(safe-area-inset-right));
  }

  .footer {
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }

  .back-to-top {
    bottom: max(1rem, env(safe-area-inset-bottom));
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .animate-fade-up,
  .animate-fade {
    opacity: 1;
    transform: none;
  }

  .reveal-on-scroll {
    opacity: 1;
    transform: none;
  }
}

/* ================= RTL & Multi-Language Support ================= */
.lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--card-bg, #faf5e9);
  border: 1px solid var(--border, rgba(20,17,13,0.16));
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink, #14110d);
  cursor: pointer;
  outline: none;
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
  user-select: none;
}

.lang-toggle:hover, .lang-toggle:focus-visible {
  border-color: var(--accent, #c2603d);
  background: var(--bg, #faf6ee);
  transform: translateY(-1px);
}

.lang-chevron {
  font-size: 0.6rem;
  opacity: 0.65;
  transition: transform 0.2s ease;
  margin-left: 0.15rem;
}

.lang-switch.open .lang-chevron {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--card-bg, #faf5e9);
  border: 1px solid var(--border, rgba(20,17,13,0.16));
  border-radius: 12px;
  padding: 0.35rem;
  box-shadow: 0 10px 30px rgba(20,17,13,0.14);
  z-index: 1000;
  min-width: 135px;
  display: none;
  flex-direction: column;
  gap: 0.2rem;
}

[dir="rtl"] .lang-dropdown {
  right: auto;
  left: 0;
}

.lang-dropdown.show {
  display: flex !important;
  animation: fadeInUp 0.18s ease-out;
}

.lang-opt {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  background: transparent;
  border: none;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink, #14110d);
  text-align: left;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
  outline: none;
}

[dir="rtl"] .lang-opt {
  text-align: right;
}

.lang-opt:hover, .lang-opt.active {
  background: rgba(194, 96, 61, 0.12);
  color: var(--accent, #c2603d);
}

.flag-icon {
  flex-shrink: 0;
  border-radius: 2px;
  display: inline-block;
  vertical-align: middle;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* RTL Styles */
[dir="rtl"], body.rtl {
  direction: rtl;
  text-align: right;
  font-family: 'Tajawal', 'Cairo', 'Inter', system-ui, -apple-system, sans-serif;
}
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4 {
  font-family: 'Cairo', 'Fraunces', Georgia, serif;
}
[dir="rtl"] .brand .dot {
  margin-right: 0;
  margin-left: 0.55rem;
}
[dir="rtl"] .tag-icon,
[dir="rtl"] .chip-icon,
[dir="rtl"] .meta-icon {
  margin-right: 0;
  margin-left: 0.45rem;
}
[dir="rtl"] .nav-links {
  margin-right: 0;
  margin-left: auto;
}
[dir="rtl"] .hero-grid,
[dir="rtl"] .resume-hero-grid {
  direction: rtl;
}
[dir="rtl"] .typing-line {
  direction: rtl;
  text-align: right;
  display: inline-block;
}
[dir="rtl"] .typing-text {
  font-family: 'Cairo', 'Fraunces', Georgia, serif;
  letter-spacing: normal;
}
[dir="rtl"] .typing-cursor {
  margin-left: 0;
  margin-right: 2px;
}
[dir="rtl"] .btn i.fa-arrow-right {
  transform: scaleX(-1);
}
[dir="rtl"] .btn i.fa-arrow-left {
  transform: scaleX(-1);
}
[dir="rtl"] .footer-grid {
  direction: rtl;
}
[dir="rtl"] .discovery-search i {
  left: auto;
  right: 1.25rem;
}
[dir="rtl"] .discovery-search input {
  padding-left: 1.25rem;
  padding-right: 3.2rem;
}


