/* ── CSS Variables ── */
:root {
  --bg: #0A0A0A;
  --surface: #141414;
  --surface-hover: #1c1c1c;
  --border: #2A2A2A;
  --text-primary: #F0EDE8;
  --text-secondary: #999490;
  --text-muted: #66625e;
  --brand: #FF5C00;
  --brand-hover: #ff7526;
}

html.light {
  --bg: #F9F8F6;
  --surface: #FFFFFF;
  --surface-hover: #F2EFEA;
  --border: #E2DDD6;
  --text-primary: #191816;
  --text-secondary: #5E5A55;
  --text-muted: #8F8A83;
  --brand: #E64E00;
  --brand-hover: #d14600;
}

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

body {
  background-color: var(--bg);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* ── Nav blur ── */
.nav-blur {
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ── Nav links ── */
.nav-link {
  color: var(--text-secondary);
  transition: color 0.2s;
}
.nav-link:hover { color: var(--text-primary); }

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Orbital animations ── */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes spin-slow-reverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}
@keyframes float-gentle {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.animate-spin-slow { animation: spin-slow 35s linear infinite; }
.animate-spin-slow-reverse { animation: spin-slow-reverse 45s linear infinite; }
.animate-float { animation: float-gentle 5s ease-in-out infinite; }

/* ── Typed cursor ── */
.typed-cursor {
  color: #FF5C00;
  animation: blink 1s step-end infinite;
}
html.light .typed-cursor { color: #E64E00; }

/* ── Stat cards ── */
.stat-card {
  transition: border-color 0.2s, transform 0.2s;
}
.stat-card:hover {
  border-color: var(--brand) !important;
  transform: translateY(-2px);
}

/* ── Journey cards ── */
.journey-card {
  transition: background-color 0.2s;
}
.journey-card:hover { background-color: var(--surface-hover) !important; }

/* ── Skill filter buttons ── */
.skill-filter-btn {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-secondary);
  transition: all 0.2s;
}
.skill-filter-btn:hover {
  border-color: var(--brand);
  color: var(--text-primary);
}
.skill-filter-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #0A0A0A;
}

/* ── Skill items ── */
.skill-item:hover {
  border-color: var(--brand) !important;
}

/* ── Project cards ── */
.project-card:hover {
  border-color: rgba(255, 92, 0, 0.4) !important;
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(255, 92, 0, 0.08);
}

/* ── Contact links ── */
.contact-link:hover {
  border-color: rgba(255, 92, 0, 0.4) !important;
  background-color: var(--surface-hover) !important;
}

/* ── Footer icons ── */
.footer-icon:hover {
  color: var(--brand) !important;
  border-color: rgba(255, 92, 0, 0.4) !important;
}

/* ── Form inputs ── */
.form-input {
  display: block;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.875rem;
  padding: 0.625rem 0.875rem;
  outline: none;
  border-radius: 0.5rem;
  transition: border-color 0.2s ease;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus { border-color: var(--brand); }
.form-textarea { resize: vertical; min-height: 110px; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand); }

/* ── Selection ── */
::selection { background: rgba(255, 92, 0, 0.25); }

/* ── Photo grayscale effect ── */
.photo-img {
  filter: grayscale(100%);
  transition: filter 0.4s ease;
}
.photo-ring:hover .photo-img {
  filter: grayscale(0%);
}

/* ── Floating tag animations ── */
@keyframes float-gentle {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}
@keyframes float-delayed {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}
.animate-float { animation: float-gentle 4s ease-in-out infinite; }
.animate-float-delayed { animation: float-delayed 4s ease-in-out 2s infinite; }

/* ── Theme toggle pill ── */
.theme-toggle-pill { cursor: pointer; }
.theme-sun, .theme-moon {
  transition: background 0.2s, opacity 0.2s;
  opacity: 0.5;
}
/* Dark mode: sun is active */
html:not(.light) .theme-sun {
  background: var(--surface-hover, #1c1c1c);
  opacity: 1;
}
/* Light mode: moon is active */
html.light .theme-moon {
  background: var(--surface-hover, #F2EFEA);
  opacity: 1;
}
html.light .theme-sun { opacity: 0.4; }
html:not(.light) .theme-moon { opacity: 0.4; }