@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=Noto+Kufi+Arabic:wght@400;500;600&display=swap');

:root{
  --bg: #FFF4E1;
  --bg-soft: #F5E8CC;
  --ink: #101F1B;
  --ink-soft: #3E6358;
  --sage: #408A71;
  --sage-deep: #1A312C;
  --sand: #89D7B7;
  --card: #FFFFFF;
  --border: rgba(16,31,27,0.14);
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'IBM Plex Sans', sans-serif;
  --arabic: 'Noto Kufi Arabic', sans-serif;
  --glow-color: rgba(64, 138, 113, 0.3);
  --glow-color-2: rgba(137, 215, 183, 0.2);
}

[data-theme="dark"]{
  --bg: #091413;
  --bg-soft: #14231F;
  --ink: #FFF4E1;
  --ink-soft: #B0E4CC;
  --sage: #89D7B7;
  --sage-deep: #B0E4CC;
  --sand: #89D7B7;
  --card: #14231F;
  --border: rgba(255,244,225,0.14);
  --glow-color: rgba(137, 215, 183, 0.25);
  --glow-color-2: rgba(64, 138, 113, 0.15);
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
html[lang="ar"] body{ font-family: var(--arabic); direction: rtl; }

body{
  margin:0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  transition: background .4s ease, color .4s ease;
  overflow-x: hidden;
}

a{ color:inherit; }
.wrap{ max-width: 1000px; margin:0 auto; padding: 0 24px; }
h1,h2,h3{ font-family: var(--mono); font-weight:600; margin:0; }
section{ padding: 90px 0; border-bottom: 1px solid var(--border); scroll-margin-top: 70px; position: relative; }
.eyebrow{
  font-family: var(--mono); font-size:12.5px; letter-spacing:.08em;
  color: var(--sage-deep); text-transform:uppercase; margin-bottom:14px;
}
[data-theme="dark"] .eyebrow{ color: var(--sage); }
.section-title{ font-size:26px; margin-bottom:32px; }

/* ===== SCROLL PROGRESS BAR ===== */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sage), var(--sand));
  z-index: 999;
  width: 0%;
  transition: width 0.1s ease;
  box-shadow: 0 0 20px var(--glow-color);
}

/* ===== LOADING SCREEN ===== */
#loading-screen{
  position:fixed; inset:0; background:var(--bg); z-index:1000;
  display:flex; align-items:center; justify-content:center;
  transition: opacity .6s ease, visibility .6s ease;
}
#loading-screen.hidden{ opacity:0; visibility:hidden; pointer-events:none; }

.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  position: relative;
}

.loader-ring {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--sage);
  animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
.loader-ring:nth-child(2) {
  width: 100px;
  height: 100px;
  border-top-color: var(--sand);
  animation-duration: 1.6s;
  animation-delay: -0.4s;
}
.loader-ring:nth-child(3) {
  width: 80px;
  height: 80px;
  border-top-color: var(--sage-deep);
  animation-duration: 2s;
  animation-delay: -0.8s;
}

.loading-name{
  font-family: var(--mono); font-size: clamp(28px,6vw,44px);
  color: var(--ink); letter-spacing:.02em;
  position: relative;
  z-index: 2;
  animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse-text {
  0%, 100% { opacity: 0.4; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.02); }
}

/* ===== PARTICLES BACKGROUND ===== */
#particles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--sage);
  border-radius: 50%;
  opacity: 0.3;
  animation: float-particle linear infinite;
}
@keyframes float-particle {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% { opacity: 0.3; }
  90% { opacity: 0.3; }
  100% {
    transform: translateY(-10vh) scale(1);
    opacity: 0;
  }
}

/* ===== NAV ===== */
header{
  position:sticky; top:0; z-index:100;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom:1px solid var(--border);
}
.nav{ display:flex; align-items:center; justify-content:space-between; padding:16px 0; }
.nav-logo{ font-family:var(--mono); font-weight:700; font-size:15px; position:relative; }
.nav-logo span{ color: var(--sand); }
.nav-links{ display:flex; gap:20px; list-style:none; margin:0; padding:0; font-family:var(--mono); font-size:12.5px; }
.nav-links a{ text-decoration:none; color:var(--ink-soft); border-bottom:1px solid transparent; padding-bottom:2px; transition: all 0.3s ease; position: relative; }
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--sage);
  transition: width 0.3s ease;
}
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }
.nav-links a:hover,.nav-links a.active{ color:var(--ink); border-color:var(--sage); }
.nav-tools{ display:flex; gap:10px; align-items:center; }
.icon-btn{
  font-family:var(--mono); font-size:12px; background:var(--card); color:var(--ink);
  border:1px solid var(--border); border-radius:4px; padding:7px 10px; cursor:pointer;
  transition: all 0.3s ease;
}
.icon-btn:hover{ border-color:var(--sage); transform: translateY(-2px); box-shadow: 0 4px 15px var(--glow-color); }
@media (max-width:760px){ .nav-links{ display:none; } }

/* ===== HERO ===== */
.hero{ padding-top:60px; position: relative; overflow: hidden; }
.hero-glow {
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--glow-color), transparent 70%);
  border-radius: 50%;
  z-index: 0;
  animation: glow-pulse 4s ease-in-out infinite;
}
[data-theme="dark"] .hero-glow {
  background: radial-gradient(circle, var(--glow-color-2), transparent 70%);
}
@keyframes glow-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
}

.hero h1{ 
  font-size:clamp(32px,5.5vw,48px); line-height:1.1;
  animation: slide-up 1s ease forwards;
  opacity: 0;
}
.hero h1 em{ font-style:normal; color:var(--sand); position: relative; display: inline-block; }
.hero h1 em::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--sand);
  border-radius: 2px;
  animation: underline-glow 2s ease-in-out infinite;
}
@keyframes underline-glow {
  0%, 100% { opacity: 0.3; transform: scaleX(0.8); }
  50% { opacity: 1; transform: scaleX(1); }
}

.hero p.tag{ 
  font-size:17px; color:var(--ink-soft); max-width:56ch; margin-top:16px;
  animation: slide-up 1s ease 0.2s forwards;
  opacity: 0;
}
.fun-fact{
  margin-top:24px; background:var(--card); border:1px solid var(--border);
  border-left:3px solid var(--sage); border-radius:4px; padding:14px 18px; font-size:14.5px; max-width:56ch;
  animation: slide-up 1s ease 0.4s forwards;
  opacity: 0;
}
html[lang="ar"] .fun-fact{ border-left:none; border-right:3px solid var(--sage); }
.quote-box{
  margin-top:22px; font-family:var(--mono); font-size:13.5px; color:var(--ink-soft);
  border-top:1px dashed var(--border); padding-top:14px;
  animation: slide-up 1s ease 0.6s forwards;
  opacity: 0;
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== FLOATING SHAPES ===== */
.floating-shapes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.1;
  animation: float-shape 20s ease-in-out infinite;
}
.shape-1 {
  width: 80px;
  height: 80px;
  background: var(--sage);
  top: 10%;
  left: 5%;
  animation-delay: 0s;
}
.shape-2 {
  width: 120px;
  height: 120px;
  background: var(--sand);
  bottom: 20%;
  right: 5%;
  animation-delay: -5s;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}
.shape-3 {
  width: 60px;
  height: 60px;
  background: var(--sage-deep);
  top: 50%;
  left: 80%;
  animation-delay: -10s;
}
.shape-4 {
  width: 40px;
  height: 40px;
  background: var(--sand);
  bottom: 40%;
  left: 20%;
  animation-delay: -15s;
  border-radius: 50% 50% 0% 50%;
}

@keyframes float-shape {
  0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
  25% { transform: translate(30px, -40px) rotate(90deg) scale(1.1); }
  50% { transform: translate(-20px, 20px) rotate(180deg) scale(0.9); }
  75% { transform: translate(40px, 30px) rotate(270deg) scale(1.05); }
}

/* ===== SECTIONS REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== ABOUT ===== */
.about-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:20px; }
@media (max-width:700px){ .about-grid{ grid-template-columns:1fr; } }
.about-card{ 
  background:var(--card); border:1px solid var(--border); border-radius:4px; padding:20px; 
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}
.about-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 40px var(--glow-color-2);
  border-color: var(--sage);
}
.card-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, var(--glow-color), transparent 60%);
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.about-card:hover .card-glow { opacity: 1; }

.about-card h3{ font-size:14px; color:var(--sage-deep); text-transform:uppercase; letter-spacing:.04em; margin-bottom:8px; }
[data-theme="dark"] .about-card h3{ color: var(--sage); }
.about-card p{ margin:0; color:var(--ink-soft); font-size:14.5px; position: relative; z-index: 1; }
.tag-chip{ display:inline-block; font-family:var(--mono); font-size:12px; background:var(--bg-soft); border:1px solid var(--border); border-radius:3px; padding:4px 9px; margin:3px 4px 0 0; transition: all 0.3s ease; }
.tag-chip:hover { background: var(--sage); color: #fff; transform: scale(1.05); }

/* ===== TIMELINE ===== */
.timeline{ position:relative; padding-left:24px; }
html[lang="ar"] .timeline{ padding-left:0; padding-right:24px; }
.timeline::before{ content:""; position:absolute; left:5px; top:6px; bottom:6px; width:2px; background:var(--border); }
html[lang="ar"] .timeline::before{ left:auto; right:5px; }
.tl-item{ position:relative; padding-bottom:26px; opacity: 0; transform: translateX(-20px); transition: all 0.5s ease; }
.tl-item.visible { opacity: 1; transform: translateX(0); }
.tl-item:last-child{ padding-bottom:0; }
.tl-item::before{ 
  content:""; position:absolute; left:-24px; top:4px; width:12px; height:12px; border-radius:50%; 
  background:var(--sage); border:2px solid var(--bg);
  box-shadow: 0 0 20px var(--glow-color);
  transition: all 0.3s ease;
}
.tl-item:hover::before {
  transform: scale(1.3);
  box-shadow: 0 0 30px var(--glow-color);
}
html[lang="ar"] .tl-item::before{ left:auto; right:-24px; }
.tl-role{ font-weight:600; font-size:15.5px; }
.tl-desc{ color:var(--ink-soft); font-size:13.5px; margin-top:3px; }

/* ===== COUNTERS ===== */
.counters{ display:grid; grid-template-columns:repeat(3,1fr); gap:18px; text-align:center; }
@media (max-width:600px){ .counters{ grid-template-columns:1fr; } }
.counter-card{ 
  background:var(--card); border:1px solid var(--border); border-radius:4px; padding:26px 14px;
  transition: all 0.4s ease;
}
.counter-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 10px 40px var(--glow-color-2);
  border-color: var(--sage);
}
.counter-num{ 
  font-family:var(--mono); font-size:38px; font-weight:700; color:var(--sage-deep);
  transition: all 0.3s ease;
}
.counter-card:hover .counter-num {
  color: var(--sand);
  text-shadow: 0 0 30px var(--glow-color);
}
[data-theme="dark"] .counter-num{ color: var(--sage); }
.counter-label{ font-size:13px; color:var(--ink-soft); margin-top:6px; }

/* ===== SKILLS ===== */
.skill-groups{ display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
@media (max-width:700px){ .skill-groups{ grid-template-columns:1fr 1fr; } }
@media (max-width:480px){ .skill-groups{ grid-template-columns:1fr; } }
.chips{ display:flex; flex-wrap:wrap; gap:8px; }
.chip{ 
  font-family:var(--mono); font-size:12.5px; padding:6px 11px; background:var(--card); border:1px solid var(--border); border-radius:3px;
  transition: all 0.3s ease;
  opacity: 0;
  transform: scale(0.8);
  animation: chip-pop 0.5s ease forwards;
}
@keyframes chip-pop {
  to { opacity: 1; transform: scale(1); }
}
.chip:hover {
  background: var(--sage);
  color: #fff;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 5px 20px var(--glow-color);
}

/* ===== SNAPSHOTS ===== */
.snap-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.snap-card {
  border-radius: 4px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  transition: all 0.5s ease;
  position: relative;
  opacity: 0;
  transform: translateY(30px) scale(0.95);
}
.snap-card.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.snap-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 15px 50px var(--glow-color-2);
  border-color: var(--sage);
}
.snap-photo {
  position: relative;
  overflow: hidden;
}
.snap-photo img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}
.snap-card:hover .snap-photo img {
  transform: scale(1.1);
}
.snap-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.snap-card:hover .snap-overlay {
  opacity: 1;
}

/* ===== GALLERY ===== */
.gallery-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:20px; }
@media (max-width:700px){ .gallery-grid{ grid-template-columns:1fr; } }
.gallery-card{ 
  background:var(--card); border:1px solid var(--border); border-radius:4px; overflow:hidden;
  transition: all 0.4s ease;
}
.gallery-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 40px var(--glow-color-2);
}
.gallery-card img{ 
  width:100%; height:200px; object-fit:cover; display:block; background:var(--bg-soft);
  transition: transform 0.6s ease;
}
.gallery-card:hover img { transform: scale(1.05); }
.gallery-body{ padding:16px; }
.gallery-date{ font-family:var(--mono); font-size:11px; color:var(--sage-deep); }
[data-theme="dark"] .gallery-date{ color: var(--sage); }
.gallery-title{ font-weight:600; margin:6px 0; }
.gallery-desc{ font-size:13.5px; color:var(--ink-soft); }

/* ===== BOOKSHELF ===== */
.book-list{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
@media (max-width:700px){ .book-list{ grid-template-columns:1fr 1fr; } }
@media (max-width:480px){ .book-list{ grid-template-columns:1fr; } }
.book-card{ 
  background:var(--card); border:1px solid var(--border); border-radius:4px; padding:16px;
  transition: all 0.4s ease;
}
.book-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px var(--glow-color-2);
  border-color: var(--sage);
}
.book-title{ font-weight:600; font-size:14.5px; }
.book-author{ font-size:12.5px; color:var(--ink-soft); margin:2px 0 8px; }
.stars{ color:var(--sand); font-size:14px; letter-spacing:2px; }

/* ===== COUNTRIES ===== */
.country-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }
@media (max-width:700px){ .country-grid{ grid-template-columns:repeat(2,1fr); } }
.country-card{ 
  background:var(--card); border:1px solid var(--border); border-radius:4px; padding:16px; text-align:center;
  transition: all 0.4s ease;
}
.country-card:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 10px 30px var(--glow-color-2);
  border-color: var(--sage);
}
.country-flag{ font-size:28px; display: block; transition: transform 0.4s ease; }
.country-card:hover .country-flag { transform: rotate(10deg) scale(1.2); }
.country-name{ font-size:13px; margin-top:6px; font-weight:600; }
.country-note{ font-size:11.5px; color:var(--ink-soft); margin-top:3px; }

/* ===== GUESTBOOK & CONTACT ===== */
.guestbook-form{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
  max-width: 560px;
}
.guestbook-form input, .guestbook-form textarea{
  font-family:var(--sans); font-size:14px; padding:10px 12px; border:1px solid var(--border);
  border-radius:4px; background:var(--card); color:var(--ink); width:100%; min-width:0;
  transition: all 0.3s ease;
}
.guestbook-form input:focus, .guestbook-form textarea:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 20px var(--glow-color);
}
.guestbook-form textarea{
  grid-column: 1 / -1;
  min-height:70px;
  max-height:160px;
  resize:vertical;
}
.guestbook-form button{
  grid-column: 1 / -1;
  justify-self: start;
}
#contact-status{
  grid-column: 1 / -1;
  margin: 0;
}
@media (max-width:480px){
  .guestbook-form{ grid-template-columns: 1fr; }
}
#guestbook-entries{ display:flex; flex-direction:column; gap:10px; }
.gb-entry{ 
  background:var(--card); border:1px solid var(--border); border-radius:4px; padding:12px 14px; font-size:13.5px;
  animation: slide-up 0.5s ease forwards;
}
.gb-name{ font-weight:600; font-family:var(--mono); font-size:12.5px; color:var(--sage-deep); }
[data-theme="dark"] .gb-name{ color: var(--sage); }

.contact-desc {
  font-size: 16px;
  color: var(--ink-soft);
  margin-bottom: 20px;
}
.contact-icons {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}
.contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--ink);
  transition: all 0.4s ease;
  background: var(--card);
  text-decoration: none;
  position: relative;
}
.contact-btn:hover {
  background: var(--sage-deep);
  color: #fff;
  border-color: var(--sage-deep);
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 10px 40px var(--glow-color);
}

/* ===== BUTTONS ===== */
.btn{
  font-family:var(--mono); font-size:13px; padding:11px 20px; border-radius:3px; text-decoration:none;
  display:inline-block; border:1px solid var(--ink); cursor:pointer; background:none; color:var(--ink);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.btn-fill{ background:var(--sage-deep); color:#fff; border-color:var(--sage-deep); }
[data-theme="dark"] .btn-fill{ color: #091413; }
.btn-fill:hover{ 
  opacity:.85; 
  transform: translateY(-3px);
  box-shadow: 0 8px 30px var(--glow-color);
}
.btn-line:hover{ background:var(--ink); color:var(--bg); }

/* ===== FLOATING WIDGETS ===== */
#back-to-top{
  position:fixed; bottom:24px; right:24px; z-index:30;
  width:42px; height:42px; border-radius:50%; border:1px solid var(--border);
  background:var(--card); color:var(--ink); font-size:16px; cursor:pointer;
  opacity:0; pointer-events:none; transition: all 0.3s ease;
}
#back-to-top.show{ opacity:1; pointer-events:auto; }
#back-to-top:hover {
  background: var(--sage-deep);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 8px 30px var(--glow-color);
}
html[lang="ar"] #back-to-top{ right:auto; left:24px; }

.float-btn{
  position:fixed; bottom:24px; z-index:30; font-family:var(--mono); font-size:12px;
  background:var(--sage-deep); color:var(--bg); border:none; border-radius:22px; padding:12px 18px; cursor:pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px var(--glow-color);
}
.float-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 40px var(--glow-color);
}
[data-theme="dark"] .float-btn{ background: var(--sage); color:#091413; }
#terminal-toggle{ right:78px; }
#chat-toggle{ left:24px; }
html[lang="ar"] #terminal-toggle{ right:auto; left:78px; }
html[lang="ar"] #chat-toggle{ left:auto; right:24px; }

/* ===== TERMINAL & CHAT ===== */
#terminal-overlay, #chat-overlay{
  position:fixed; bottom:80px; right:24px; width:340px; max-width:88vw; z-index:35;
  background:#0E1E19; border-radius:6px; box-shadow:0 12px 32px rgba(0,0,0,0.3);
  display:none; flex-direction:column; overflow:hidden;
  animation: slide-up 0.3s ease;
}
html[lang="ar"] #terminal-overlay{ right:auto; left:24px; }
#terminal-overlay.open, #chat-overlay.open{ display:flex; }
.term-bar{ background:#132D24; padding:8px 12px; font-family:var(--mono); font-size:11px; color:#89D7B7; display:flex; justify-content:space-between; }
#terminal-log{ font-family:var(--mono); font-size:12px; color:#EAF6EF; padding:10px 12px; height:200px; overflow-y:auto; white-space:pre-wrap; }
.term-input-row{ display:flex; border-top:1px solid #132D24; }
.term-input-row span{ color:#89D7B7; font-family:var(--mono); font-size:12px; padding:8px 4px 8px 10px; }
#terminal-input{ flex:1; background:transparent; border:none; outline:none; color:#EAF6EF; font-family:var(--mono); font-size:12px; padding:8px 10px 8px 0; }

#chat-overlay{ left:24px; right:auto; background:var(--card); }
html[lang="ar"] #chat-overlay{ left:auto; right:24px; }
.chat-bar{ background:var(--sage-deep); color:#fff; padding:10px 14px; font-family:var(--mono); font-size:12px; }
#chat-log{ padding:10px 12px; height:200px; overflow-y:auto; font-size:13px; display:flex; flex-direction:column; gap:8px; }
.chat-msg{ padding:7px 10px; border-radius:6px; max-width:85%; animation: slide-up 0.3s ease; }
.chat-msg.bot{ background:var(--bg-soft); align-self:flex-start; }
.chat-msg.user{ background:var(--sage); color:#fff; align-self:flex-end; }
.chat-input-row{ display:flex; border-top:1px solid var(--border); }
#chat-input{ flex:1; border:none; background:transparent; outline:none; padding:10px 12px; font-size:13px; color:var(--ink); }
.chat-send{ border:none; background:none; color:var(--sage-deep); font-family:var(--mono); font-size:12px; padding:0 12px; cursor:pointer; transition: all 0.3s ease; }
.chat-send:hover { transform: scale(1.1); color: var(--sage); }
[data-theme="dark"] .chat-send{ color: var(--sage); }

/* ===== EXIT MODAL ===== */
#exit-modal{
  position:fixed; inset:0; background:rgba(0,0,0,.5); backdrop-filter: blur(8px); z-index:90;
  display:none; align-items:center; justify-content:center;
}
#exit-modal.open{ display:flex; animation: fade-in 0.4s ease; }
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.exit-box{ 
  background:var(--card); border-radius:6px; padding:30px; max-width:340px; text-align:center;
  animation: slide-up 0.5s ease;
}
.exit-box h3{ margin-bottom:10px; }
.exit-box p{ color:var(--ink-soft); font-size:14px; margin-bottom:18px; }

footer{ padding:30px 0 50px; font-family:var(--mono); font-size:11.5px; color:var(--ink-soft); text-align:center; }

/* ===== RESPONSIVE ===== */
@media (prefers-reduced-motion: reduce){
  .reveal{ opacity:1; transform:none; transition:none; }
  .snap-card{ opacity:1; transform:none; }
  .tl-item{ opacity:1; transform:none; }
  .chip{ opacity:1; transform:none; animation:none; }
  .shape{ animation:none; }
  .hero h1, .hero p.tag, .fun-fact, .quote-box{ animation:none; opacity:1; }
}


/* ===== HERO CONTAINER ===== */
.hero-container {
  display: flex;
  align-items: center;
  gap: 60px;
  position: relative;
  z-index: 1;
}

.hero-text {
  flex: 1;
}

.hero-image {
  flex-shrink: 0;
  position: relative;
}

.profile-img-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
}

.profile-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--sage);
  box-shadow: 0 0 40px var(--glow-color);
  position: relative;
  z-index: 2;
  transition: all 0.5s ease;
}

.profile-img:hover {
  transform: scale(1.05);
  box-shadow: 0 0 60px var(--glow-color);
}

.profile-ring {
  position: absolute;
  top: -12px;
  left: -12px;
  width: calc(100% + 24px);
  height: calc(100% + 24px);
  border-radius: 50%;
  border: 2px solid var(--sand);
  animation: spin-ring 8s linear infinite;
  z-index: 1;
}

.profile-ring-2 {
  position: absolute;
  top: -24px;
  left: -24px;
  width: calc(100% + 48px);
  height: calc(100% + 48px);
  border-radius: 50%;
  border: 1.5px dashed var(--sage-deep);
  animation: spin-ring-reverse 12s linear infinite;
  z-index: 0;
  opacity: 0.5;
}

@keyframes spin-ring {
  to { transform: rotate(360deg); }
}

@keyframes spin-ring-reverse {
  to { transform: rotate(-360deg); }
}

@media (max-width: 768px) {
  .hero-container {
    flex-direction: column-reverse;
    text-align: center;
    gap: 30px;
  }
  .profile-img-wrapper {
    width: 160px;
    height: 160px;
  }
  .profile-ring {
    top: -8px;
    left: -8px;
    width: calc(100% + 16px);
    height: calc(100% + 16px);
  }
  .profile-ring-2 {
    top: -16px;
    left: -16px;
    width: calc(100% + 32px);
    height: calc(100% + 32px);
  }
}

@media (max-width: 480px) {
  .profile-img-wrapper {
    width: 130px;
    height: 130px;
  }
}