/* ============================================================
   SAMMY HAIDAR HASSAN — Portfolio CSS
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0a0a0a;
  --surface:  #111111;
  --card:     #161616;
  --border:   #222222;
  --border2:  #2e2e2e;
  --text:     #f0f0f0;
  --muted:    #737373;
  --dim:      #2a2a2a;
  --sans:     'Space Grotesk', sans-serif;
  --mono:     'Space Mono', monospace;
  --ease:     cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --t:        0.35s var(--ease);
  --t-fast:   0.18s ease;
}

html { scroll-behavior: smooth; cursor: none; font-size: 16px; }
*, *::before, *::after { cursor: none !important; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  overflow-x: hidden;
  line-height: 1.6;
}

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); }
::selection { background: #fff; color: #000; }

/* ============================================================ LOADER */
#loader {
  position: fixed; inset: 0; background: var(--bg);
  z-index: 9999; display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.loader-content {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.loader-name {
  font-family: var(--mono); font-size: 2.5rem; font-weight: 700;
  letter-spacing: 0.4em; color: #fff;
}
.loader-bar {
  width: 180px; height: 1px; background: var(--border2); overflow: hidden;
}
.loader-fill { height: 100%; width: 0%; background: #fff; transition: width 0.04s linear; }
.loader-percent {
  font-family: var(--mono); font-size: 0.75rem; color: var(--muted); letter-spacing: 0.1em;
}

/* ============================================================ CURSOR */
#cursor {
  position: fixed; width: 7px; height: 7px; background: #fff; border-radius: 50%;
  pointer-events: none; z-index: 10001; transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, box-shadow 0.25s ease;
}
#cursor-follower {
  position: fixed; width: 34px; height: 34px;
  border: 1px solid rgba(255,255,255,0.35); border-radius: 50%;
  pointer-events: none; z-index: 10000; transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
}
body.c-hover #cursor {
  width: 11px; height: 11px;
  box-shadow: 0 0 10px 4px rgba(255,255,255,0.55);
}
body.c-hover #cursor-follower { width: 48px; height: 48px; border-color: rgba(255,255,255,0.7); }

@media (pointer: coarse) {
  html { cursor: auto; }
  #cursor, #cursor-follower { display: none; }
}

/* ============================================================ SCROLL PROGRESS */
#scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; background: #fff;
  z-index: 9000; width: 0%; transition: width 0.08s linear;
}

/* ============================================================ NAV */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 28px 48px; display: flex; align-items: center; gap: 40px;
  transition: padding var(--t), background var(--t), border-color var(--t);
  border-bottom: 1px solid transparent;
}
#navbar.scrolled {
  padding: 16px 48px;
  background: rgba(10,10,10,0.88);
  backdrop-filter: blur(20px);
  border-color: var(--border);
}
.nav-logo {
  font-family: var(--mono); font-size: 1rem; font-weight: 700;
  letter-spacing: 0.2em; color: #fff; flex-shrink: 0; text-decoration: none;
}
.nav-links {
  display: flex; list-style: none; gap: 28px; margin-left: auto;
}
.nav-links a {
  color: var(--muted); text-decoration: none; font-size: 0.875rem;
  letter-spacing: 0.04em; transition: color var(--t-fast); position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -3px; left: 0;
  width: 0; height: 1px; background: #fff; transition: width var(--t);
}
.nav-links a:hover { color: #fff; }
.nav-links a:hover::after { width: 100%; }
.nav-cta {
  background: #fff; color: #000; text-decoration: none; font-size: 0.82rem;
  font-weight: 600; padding: 9px 22px; border-radius: 100px;
  letter-spacing: 0.05em; flex-shrink: 0;
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.nav-cta:hover { opacity: 0.85; }
.lang-toggle {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.lang-btn {
  background: none; border: none; font-family: var(--mono); font-size: 0.72rem;
  font-weight: 700; letter-spacing: 0.12em; color: var(--muted);
  cursor: pointer; padding: 5px 2px; transition: color var(--t-fast);
  line-height: 1;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active { color: var(--text); }
.lang-sep {
  font-family: var(--mono); font-size: 0.65rem; color: var(--border2);
}

.nav-toggle {
  display: none; flex-direction: column; gap: 6px; background: none;
  border: none; cursor: pointer; padding: 4px; margin-left: auto;
}
.nav-toggle span {
  width: 22px; height: 1.5px; background: #fff; display: block;
  transition: transform var(--t), opacity var(--t);
  transform-origin: center;
}
.nav-toggle.open span:first-child { transform: rotate(45deg) translate(4px, 5px); }
.nav-toggle.open span:last-child  { transform: rotate(-45deg) translate(4px, -5px); }

#mobileMenu {
  position: fixed; inset: 0; background: var(--bg); z-index: 999;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity var(--t), visibility var(--t);
}
#mobileMenu.open { opacity: 1; visibility: visible; }
#mobileMenu ul { list-style: none; text-align: center; }
#mobileMenu ul li { margin: 12px 0; }
.mobile-link {
  font-size: 2.2rem; font-weight: 700; color: var(--text); text-decoration: none;
  letter-spacing: -0.01em; transition: color var(--t-fast);
}
.mobile-link:hover { color: var(--muted); }

/* ============================================================ HERO */
#hero {
  min-height: 100vh; display: flex; flex-direction: column;
  justify-content: center; position: relative; overflow: hidden;
  padding: 140px 48px 100px;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 75%);
}
.hero-content {
  position: relative; z-index: 1;
  max-width: 1200px; margin: 0 auto; width: 100%;
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border2); padding: 7px 16px; border-radius: 100px;
  font-size: 0.8rem; color: var(--muted); margin-bottom: 36px;
  letter-spacing: 0.04em;
}
.dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  animation: pulse-dot 2.2s ease-in-out infinite;
}
.dot.green { background: #4ade80; }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.75); }
}
.hero-name {
  display: flex; flex-direction: column;
  font-size: clamp(3.5rem, 8vw, 8.5rem);
  font-weight: 700; line-height: 1.02; letter-spacing: -0.025em;
  margin-bottom: 28px;
}
.name-line { display: block; }
.name-line.outline {
  color: transparent;
  -webkit-text-stroke: 2px rgba(255,255,255,0.85);
}
.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem); color: var(--muted);
  margin-bottom: 44px; font-weight: 300; letter-spacing: 0.02em;
  min-height: 1.6em;
}
.cursor-blink { animation: blink 1s step-end infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.hero-cta-group { display: flex; gap: 14px; flex-wrap: wrap; }

.btn-primary {
  background: #fff; color: #000; text-decoration: none; font-size: 0.88rem;
  font-weight: 600; padding: 13px 26px; border-radius: 100px;
  letter-spacing: 0.05em; display: inline-flex; align-items: center; gap: 8px;
  transition: opacity var(--t-fast), transform 0.3s var(--ease);
  border: none; cursor: pointer; font-family: var(--sans);
}
.btn-primary:hover { opacity: 0.88; }

.btn-secondary {
  border: 1px solid var(--border2); color: var(--text); text-decoration: none;
  font-size: 0.88rem; font-weight: 400; padding: 13px 26px; border-radius: 100px;
  letter-spacing: 0.05em; display: inline-flex; align-items: center; gap: 8px;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.btn-secondary:hover { border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.04); }

.btn-outline {
  border: 1px solid var(--border2); color: var(--text); text-decoration: none;
  font-size: 0.84rem; padding: 11px 22px; border-radius: 100px;
  display: inline-flex; align-items: center; gap: 10px; margin-top: 28px;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.btn-outline:hover { border-color: rgba(255,255,255,0.45); background: rgba(255,255,255,0.04); }

.hero-scroll {
  position: absolute; left: 48px; bottom: 48px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.hero-scroll span {
  font-family: var(--mono); font-size: 0.65rem; color: var(--muted);
  letter-spacing: 0.2em; text-transform: uppercase; writing-mode: vertical-rl;
}
.scroll-line {
  width: 1px; height: 56px;
  background: linear-gradient(to bottom, var(--muted), transparent);
  animation: scroll-animate 2s ease-in-out infinite;
}
@keyframes scroll-animate {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 1; }
  50%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
  50.001% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

.hero-stats {
  position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; width: 100%;
  display: flex; align-items: center; gap: 0;
  padding-top: 48px; margin-top: 56px; border-top: 1px solid var(--border);
}
.stat-item { display: flex; flex-direction: column; gap: 4px; padding: 0 40px 0 0; }
.stat-item:first-child { padding-left: 0; }
.stat-num {
  font-family: var(--mono); font-size: 2.2rem; font-weight: 700; line-height: 1;
}
.stat-label { font-size: 0.78rem; color: var(--muted); letter-spacing: 0.04em; }
.infinity-icon {
  width: 2.2rem; height: 2.2rem; object-fit: contain; display: block;
  filter: invert(1);
  animation: infinity-appear 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
[data-theme="light"] .infinity-icon { filter: none; }
@keyframes infinity-appear {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}
.stat-divider { width: 1px; height: 40px; background: var(--border); margin-right: 40px; }

/* ============================================================ MARQUEE */
.marquee-wrapper {
  overflow: hidden; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 14px 0; background: var(--surface);
}
.marquee-track {
  display: flex; white-space: nowrap;
  animation: marquee-scroll 28s linear infinite; width: max-content;
}
.marquee-inner {
  display: flex; align-items: center; gap: 32px;
  padding-right: 32px;
}
.marquee-track span {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.1em;
  color: var(--muted); text-transform: uppercase;
}
.marquee-track .sep { color: var(--border2); }
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-25%); }
}

/* ============================================================ SECTIONS */
.section { padding: 120px 48px; }
.section-dark { background: var(--surface); }
.container { max-width: 1200px; margin: 0 auto; width: 100%; }
.section-header { margin-bottom: 64px; }
.section-tag {
  display: block; font-family: var(--mono); font-size: 0.72rem;
  color: var(--muted); letter-spacing: 0.18em; text-transform: uppercase;
  margin-bottom: 14px;
}
.section-header h2 {
  font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 700;
  letter-spacing: -0.025em; line-height: 1.08;
}
.section-desc { color: var(--muted); font-size: 1rem; margin-top: 14px; line-height: 1.7; }

/* ============================================================ REVEAL */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============================================================ ABOUT */
.about-grid {
  display: grid; grid-template-columns: 1fr 1.65fr; gap: 80px; align-items: start;
}
.about-image { position: relative; }
.img-placeholder {
  background: var(--card); border: 1px dashed var(--border2); border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; color: var(--muted); font-size: 0.82rem; line-height: 1.6;
}
.img-placeholder.portrait { aspect-ratio: 3/4; width: 100%; }
.img-placeholder.landscape { aspect-ratio: 16/10; width: 100%; }
.img-placeholder.photo { width: 100%; height: 100%; min-height: 120px; border-radius: 8px; }
.placeholder-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.img-placeholder svg { opacity: 0.3; }
.img-placeholder small { font-size: 0.72rem; opacity: 0.6; }

/* When real images are added */
.about-image img,
.photo-item img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: inherit; display: block;
}
.about-image > img {
  border-radius: 14px;
  mask-image: linear-gradient(to bottom, black 65%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 90%, transparent 100%);
}
.photo-item > img { border-radius: 8px; height: 100%; }

.speech-bubble {
  position: absolute; top: 48px; left: -30px;
  background: #fff; color: #000;
  font-size: 0.78rem; font-weight: 600; line-height: 1.45;
  padding: 12px 16px; border-radius: 14px;
  max-width: 175px; text-decoration: none; text-align: left;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), background 0.18s ease;
  cursor: pointer;
  animation: bubble-float 3.5s ease-in-out infinite;
  z-index: 2;
}
.speech-bubble::before {
  content: '';
  position: absolute; right: -11px; top: auto; bottom: 14px;
  border: 6px solid transparent;
  border-left-color: #fff;
}
.speech-bubble:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  background: #f0f0f0;
  animation-play-state: paused;
}
.speech-bubble:hover::before {
  border-left-color: #f0f0f0;
}
@keyframes bubble-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

.about-badge {
  position: absolute; bottom: -16px; right: -16px;
  width: 76px; height: 76px; border-radius: 50%;
  background: #fff; color: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 0 0 4px var(--bg);
}
.badge-num { font-family: var(--mono); font-size: 1.5rem; font-weight: 700; line-height: 1; }
.about-badge small { font-size: 0.55rem; font-weight: 500; letter-spacing: 0.06em; margin-top: 2px; }

.about-text h3 {
  font-size: 1.75rem; font-weight: 700; margin-bottom: 20px; letter-spacing: -0.02em;
}
.about-text p {
  color: var(--muted); line-height: 1.85; margin-bottom: 14px; font-size: 0.97rem;
}
.about-text strong { color: var(--text); font-weight: 600; }
.about-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.about-chips span {
  border: 1px solid var(--border2); padding: 6px 14px; border-radius: 100px;
  font-size: 0.78rem; color: var(--muted); letter-spacing: 0.04em;
}

/* ============================================================ SKILLS */
.skills-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; margin-bottom: 48px;
}
.skill-category h3 {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.18em;
  color: var(--muted); text-transform: uppercase; margin-bottom: 24px;
}
.skill-list { display: flex; flex-direction: column; gap: 18px; }
.skill-info {
  display: flex; justify-content: space-between;
  font-size: 0.88rem; margin-bottom: 7px;
}
.skill-info span:last-child {
  font-family: var(--mono); font-size: 0.75rem; color: var(--muted);
}
.skill-bar { height: 1.5px; background: var(--border2); border-radius: 1px; overflow: hidden; }
.skill-fill {
  height: 100%; width: 0%; background: #fff; border-radius: 1px;
  transition: width 1.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.tech-tags { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 48px; border-top: 1px solid var(--border); }
.tech-tag {
  background: var(--card); border: 1px solid var(--border); padding: 8px 16px;
  border-radius: 6px; font-size: 0.78rem; font-family: var(--mono); color: var(--muted);
  letter-spacing: 0.05em; transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.tech-tag:hover { background: #fff; color: #000; border-color: #fff; cursor: default; }

/* ============================================================ TIMELINE */
.timeline { position: relative; display: flex; flex-direction: column; gap: 0; }
.timeline::before {
  content: ''; position: absolute; left: 120px; top: 0; bottom: 0;
  width: 1px; background: var(--border);
}
.timeline-item {
  display: grid; grid-template-columns: 120px 1fr;
  gap: 0 48px; padding: 0 0 48px 0; position: relative;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: 115px; top: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--border2);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.timeline-item:hover .timeline-dot { border-color: #fff; background: #fff; }
.timeline-year {
  font-family: var(--mono); font-size: 0.72rem; color: var(--muted);
  letter-spacing: 0.08em; padding-top: 4px; text-align: right; padding-right: 32px;
  line-height: 1.4;
}
.timeline-content { padding-left: 16px; }
.timeline-content h3 {
  font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; letter-spacing: -0.01em;
}
.timeline-company {
  display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 10px;
  letter-spacing: 0.03em;
}
.timeline-content p { font-size: 0.88rem; color: var(--muted); line-height: 1.75; }

/* ============================================================ PROJECTS */
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.project-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; transition: transform var(--t), border-color var(--t), box-shadow var(--t);
  display: flex; flex-direction: column;
}
.project-card:hover {
  transform: translateY(-6px); border-color: var(--border2);
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
}
.project-image { position: relative; overflow: hidden; aspect-ratio: 16/9; background: var(--card); display: flex; align-items: center; justify-content: center; }
.proj-img { width: 100%; height: 100%; object-fit: contain; padding: 28px; display: block; }
.project-image .proj-img-light { display: none; }
[data-theme="light"] .project-image .proj-img-dark  { display: none; }
[data-theme="light"] .project-image .proj-img-light { display: block; }

.project-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.project-body p { flex: 1; }
.project-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.project-tags span {
  font-size: 0.7rem; font-family: var(--mono); color: var(--muted);
  border: 1px solid var(--border); padding: 3px 9px; border-radius: 4px; letter-spacing: 0.04em;
}
.project-body h3 {
  font-size: 1.05rem; font-weight: 600; margin-bottom: 8px; letter-spacing: -0.01em;
}
.project-body p { font-size: 0.84rem; color: var(--muted); line-height: 1.7; margin-bottom: 14px; }
.project-body p a { color: #fff; text-decoration: underline; }
[data-theme="light"] .project-body p a { color: #111; }
.project-year {
  font-family: var(--mono); font-size: 0.7rem; color: #666;
  letter-spacing: 0.1em;
}
[data-theme="light"] .project-year { color: #333; }

/* ============================================================ PHOTOGRAPHY */
.photo-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  grid-template-rows: 280px 280px;
  gap: 10px; margin-bottom: 40px;
}
.photo-item {
  overflow: hidden; border-radius: 10px; position: relative;
  background: var(--card);
}
.photo-item.large { grid-column: 1; grid-row: 1 / 3; }
.photo-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.5s ease, filter 0.4s ease;
}
.photo-item:hover img { transform: scale(1.05); filter: brightness(1.08); }
.photo-cta { text-align: center; padding-top: 8px; }

/* ============================================================ HOBBIES */
.hobbies-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.hobby-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 30px 26px; transition: transform var(--t), border-color var(--t);
}
.hobby-card:hover { transform: translateY(-4px); border-color: var(--border2); }
.hobby-icon { display: block; margin-bottom: 14px; }
.hobby-icon img { width: 32px; height: 32px; object-fit: contain; display: block; }
.hobby-icon img.icon-light { display: none; }
[data-theme="light"] .hobby-icon img.icon-dark  { display: none; }
[data-theme="light"] .hobby-icon img.icon-light { display: block; }
.hobby-card h3 { font-size: 0.97rem; font-weight: 600; margin-bottom: 8px; }
.hobby-card p { font-size: 0.83rem; color: var(--muted); line-height: 1.7; }

/* ============================================================ CONTACT */
.contact-grid {
  display: grid; grid-template-columns: 1fr 1.5fr; gap: 80px; align-items: start;
}
.contact-item { display: flex; flex-direction: column; gap: 5px; margin-bottom: 28px; }
.contact-label {
  font-family: var(--mono); font-size: 0.66rem; color: var(--dim);
  letter-spacing: 0.18em; text-transform: uppercase;
}
.contact-item a, .contact-item span {
  font-size: 0.93rem; color: var(--muted); text-decoration: none;
  transition: color var(--t-fast);
}
.contact-item a:hover { color: #fff; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
}
.contact-socials {
  display: flex; gap: 20px; flex-wrap: wrap;
  padding-top: 24px; border-top: 1px solid var(--border);
}
.social-link {
  font-size: 0.84rem; color: var(--muted); text-decoration: none;
  letter-spacing: 0.04em; transition: color var(--t-fast);
}
.social-link:hover { color: #fff; }

.contact-form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; }
.form-group input,
.form-group textarea {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 18px; color: var(--text); font-family: var(--sans); font-size: 0.9rem;
  outline: none; transition: border-color var(--t-fast); resize: vertical;
  -webkit-appearance: none;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--dim); }
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea { color: #ffffff; }
[data-theme="dark"] .form-group input::placeholder,
[data-theme="dark"] .form-group textarea::placeholder { color: #666666; }
.form-group input:focus,
.form-group textarea:focus { border-color: rgba(255,255,255,0.4); }

.btn-submit {
  background: #fff; color: #000; border: none; border-radius: 10px;
  padding: 16px 28px; font-family: var(--sans); font-size: 0.88rem; font-weight: 600;
  letter-spacing: 0.05em; cursor: pointer; display: flex; align-items: center;
  justify-content: center; gap: 10px; margin-top: 4px;
  transition: opacity var(--t-fast), transform 0.3s var(--ease);
}
.btn-submit:hover { opacity: 0.88; }
.btn-submit.sent { background: var(--card); color: #4ade80; border: 1px solid #4ade80; }

/* ============================================================ FOOTER */
footer {
  background: var(--bg); border-top: 1px solid var(--border); padding: 28px 48px;
}
.footer-inner {
  display: flex; align-items: center; gap: 32px;
}
.footer-logo {
  font-family: var(--mono); font-weight: 700; letter-spacing: 0.22em; font-size: 0.9rem;
}
footer p { font-size: 0.78rem; color: var(--muted); flex: 1; text-align: center; }
.footer-top {
  font-size: 0.78rem; color: var(--muted); text-decoration: none;
  letter-spacing: 0.05em; transition: color var(--t-fast);
}
.footer-top:hover { color: #fff; }

/* ============================================================ STAGGER DELAYS */
.projects-grid .project-card:nth-child(2) { transition-delay: 0.1s; }
.projects-grid .project-card:nth-child(3) { transition-delay: 0.2s; }
.hobbies-grid .hobby-card:nth-child(2) { transition-delay: 0.06s; }
.hobbies-grid .hobby-card:nth-child(3) { transition-delay: 0.12s; }
.hobbies-grid .hobby-card:nth-child(4) { transition-delay: 0.18s; }
.hobbies-grid .hobby-card:nth-child(5) { transition-delay: 0.24s; }
.hobbies-grid .hobby-card:nth-child(6) { transition-delay: 0.30s; }
.skills-grid .skill-category:nth-child(2) { transition-delay: 0.1s; }
.skills-grid .skill-category:nth-child(3) { transition-delay: 0.2s; }
.photo-item:nth-child(2) { transition-delay: 0.08s; }
.photo-item:nth-child(3) { transition-delay: 0.16s; }
.photo-item:nth-child(4) { transition-delay: 0.08s; }
.photo-item:nth-child(5) { transition-delay: 0.16s; }
.timeline-item:nth-child(2) { transition-delay: 0.1s; }
.timeline-item:nth-child(3) { transition-delay: 0.2s; }
.timeline-item:nth-child(4) { transition-delay: 0.3s; }

/* ============================================================ RESPONSIVE */
@media (max-width: 1024px) {
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .projects-grid { grid-template-columns: 1fr 1fr; }
  .about-grid { gap: 48px; }
  .speech-bubble { top: -24px; left: -30px; right: auto; max-width: 112px;}
  .speech-bubble::before {
    top: auto; left: auto;
    right: -11px; bottom: 14px;
    border-left-color: #fff;
    border-top-color: transparent;
  }
}

@media (max-width: 768px) {
  #hero, .section { padding: 100px 24px 60px; }
  #navbar, #navbar.scrolled { padding: 18px 24px; }
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: flex; }

  .hero-stats { flex-direction: column; align-items: flex-start; gap: 20px; }
  .stat-divider { display: none; }
  .stat-item { padding: 0; }

  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-image { max-width: 260px; margin: 0 auto; }

  .speech-bubble { top: -24px; left: -51px; right: auto; max-width: 112px;}
  .speech-bubble::before {
    top: auto; left: auto;
    right: -11px; bottom: 14px;
    border-left-color: #fff;
    border-top-color: transparent;
  }
  .speech-bubble:hover::before { border-left-color: #f0f0f0; border-top-color: transparent; }

  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }

  .timeline::before { left: 0; }
  .timeline-item { grid-template-columns: 1fr; gap: 6px; padding-left: 20px; }
  .timeline-dot { left: -5px; }
  .timeline-year { text-align: left; padding-right: 0; font-size: 0.68rem; }
  .timeline-content { padding-left: 0; }

  .photo-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }
  .photo-item.large { grid-column: 1 / -1; grid-row: auto; }

  .hobbies-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .form-row { grid-template-columns: 1fr; }

  .hero-scroll { display: none; }
  footer { padding: 24px; }
  .footer-inner { flex-direction: column; text-align: center; gap: 10px; }
}

@media (max-width: 480px) {
  .hero-name { font-size: clamp(2.6rem, 13vw, 4rem); }
  .hobbies-grid { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: 1fr; }
}

/* ============================================================ THEME TOGGLE BUTTON */
.theme-toggle {
  background: none; border: none; cursor: pointer; padding: 6px;
  color: var(--muted); display: flex; align-items: center; justify-content: center;
  border-radius: 6px; flex-shrink: 0;
  transition: color var(--t-fast), background var(--t-fast);
}
.theme-toggle:hover { color: var(--text); background: rgba(128,128,128,0.1); }
.icon-sun, .icon-moon { display: block; pointer-events: none; }
[data-theme="dark"]  .icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: none; }

/* ============================================================ LIGHT MODE VARIABLES */
[data-theme="light"] {
  --bg:      #f7f7f7;
  --surface: #eeeeee;
  --card:    #ffffff;
  --border:  #dedede;
  --border2: #cccccc;
  --text:    #0f0f0f;
  --muted:   #565656;
  --dim:     #b5b5b5;
}

/* ============================================================ THEME TRANSITION */
body, #navbar, .section, footer, .marquee-wrapper,
.project-card, .hobby-card, .skill-bar,
.contact-form input, .contact-form textarea,
.about-chips span, .tech-tag, .timeline-content {
  transition: background-color 0.35s ease, color 0.35s ease,
              border-color 0.35s ease, box-shadow 0.35s ease !important;
}

/* Loader stays permanently dark */
#loader                         { background: #0a0a0a !important; }
.loader-name                    { color: #ffffff !important; }
.loader-percent                 { color: #666 !important; }
.loader-bar                     { background: #222 !important; }
.loader-fill                    { background: #ffffff !important; }

/* ============================================================ LIGHT MODE OVERRIDES */
[data-theme="light"] ::selection { background: #000; color: #fff; }

[data-theme="light"] #scroll-progress { background: #000; }
[data-theme="light"] #cursor { background: #000; }
[data-theme="light"] #cursor-follower { border-color: rgba(0,0,0,0.28); }
[data-theme="light"] body.c-hover #cursor-follower { border-color: rgba(0,0,0,0.65); }
[data-theme="light"] body.c-hover #cursor { box-shadow: 0 0 10px 4px rgba(0,0,0,0.25); }

[data-theme="light"] .hero-grid {
  background-image:
    linear-gradient(rgba(0,0,0,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.045) 1px, transparent 1px);
}
[data-theme="light"] .name-line.outline { -webkit-text-stroke: 2px rgba(0,0,0,0.82); }
[data-theme="light"] .scroll-line { background: linear-gradient(to bottom, #777, transparent); }
[data-theme="light"] .cursor-blink { color: var(--muted); }

[data-theme="light"] #navbar.scrolled       { background: rgba(255,255,255,0.92); }
[data-theme="light"] .nav-logo             { color: #000; }
[data-theme="light"] .nav-links a:hover    { color: #000; }
[data-theme="light"] .nav-links a::after   { background: #000; }
[data-theme="light"] .nav-toggle span      { background: #000; }
[data-theme="light"] .about-image > img { mask-image: none; -webkit-mask-image: none; }

[data-theme="light"] .nav-cta     { background: #000; color: #fff; }
[data-theme="light"] .btn-primary { background: #000; color: #fff; }
[data-theme="light"] .btn-submit  { background: #000; color: #fff; }
[data-theme="light"] .btn-submit.sent { background: #f0f0f0; color: #16a34a; border-color: #16a34a; }

[data-theme="light"] .skill-fill { background: #000; }

[data-theme="light"] .about-badge { background: #000; color: #fff; box-shadow: 0 0 0 4px var(--bg); }
[data-theme="light"] .badge-num   { color: #fff; }
[data-theme="light"] .about-badge small { color: rgba(255,255,255,0.75); }

[data-theme="light"] .timeline-dot { background: var(--bg); }
[data-theme="light"] .timeline-item:hover .timeline-dot { border-color: #000; background: #000; }
[data-theme="light"] .timeline::before { background: var(--border); }

[data-theme="light"] .tech-tag:hover { background: #000; color: #fff; border-color: #000; }


[data-theme="light"] .img-placeholder       { background: #e8e8e8; border-color: #c8c8c8; }
[data-theme="light"] .img-placeholder.dark  { background: #dcdcdc; }
[data-theme="light"] .img-placeholder.photo { background: #dcdcdc; }
[data-theme="light"] .img-placeholder svg   { opacity: 0.2; }

[data-theme="light"] .social-link:hover { color: #000; }

[data-theme="light"] .marquee-track span { color: #888; }

/* ============================================================ 3D TILT */
.tilt-card {
  transform-style: preserve-3d;
  will-change: transform;
}
.project-card.tilt-card:hover { transform: none; }
.hobby-card.tilt-card:hover   { transform: none; }

.tilt-glare {
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 5;
}

/* ============================================================ LIGHTBOX */
.photo-item[data-lightbox] { cursor: pointer; }

.lightbox {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox.active { opacity: 1; visibility: visible; }

.lightbox-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(6px);
}

.lightbox-img-wrap {
  position: relative; z-index: 1;
  max-width: 90vw; max-height: 90vh;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-img {
  max-width: 90vw; max-height: 88vh;
  object-fit: contain; border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  transform: scale(0.94);
  transition: transform 0.35s cubic-bezier(.22,.68,0,1.2);
  display: block;
}
.lightbox.active .lightbox-img { transform: scale(1); }

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute; z-index: 2;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff; cursor: pointer; border-radius: 50%;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; line-height: 1;
  transition: background 0.2s, transform 0.2s;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255,255,255,0.18);
  transform: scale(1.1);
}
.lightbox-close { top: 20px; right: 20px; font-size: 1rem; }
.lightbox-prev  { left: 20px; top: 50%; translate: 0 -50%; font-size: 1.6rem; }
.lightbox-next  { right: 20px; top: 50%; translate: 0 -50%; font-size: 1.6rem; }

/* ============================================================ UNDER CONSTRUCTION */
.uc-section { display: block; }
.uc-container {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 16px; padding: 80px 48px;
}
.uc-tag {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.16em;
  color: var(--muted); text-transform: uppercase;
  border: 1px solid var(--border2); padding: 6px 14px; border-radius: 100px;
}
.uc-msg {
  font-family: var(--sans); font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700; letter-spacing: -0.02em; color: var(--text);
}
.uc-sub { font-size: 0.95rem; color: var(--muted); }

.site-maintenance {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px;
  font-family: 'Space Grotesk', sans-serif; background: #0a0a0a; color: #f0f0f0;
  text-align: center; padding: 48px;
}
.maintenance-tag {
  font-family: 'Space Mono', monospace; font-size: 0.72rem;
  letter-spacing: 0.2em; color: #737373; text-transform: uppercase;
}
.site-maintenance h1 { font-size: clamp(2rem, 5vw, 4rem); font-weight: 700; letter-spacing: -0.02em; }
.site-maintenance p  { color: #737373; font-size: 1rem; }
