/* ===================================================================
   Design tokens
=================================================================== */
:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --max-width: 1200px;
  --max-width-narrow: 760px;

  --accent: #5b8def;
  --accent-2: #9b7bf0;
  --accent-grad: linear-gradient(120deg, var(--accent), var(--accent-2));

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.18);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg: #f7f8fb;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-muted: #eef1f7;
  --text: #11151c;
  --text-muted: #5a6472;
  --border: #e4e8f0;
  --header-bg: rgba(247, 248, 251, 0.78);
  --scrollbar-track: #eef1f7;
  --scrollbar-thumb: #c7cedb;
}

[data-theme="dark"] {
  --bg: #0b0f17;
  --bg-elevated: #111624;
  --surface: #131a29;
  --surface-muted: #0f1420;
  --text: #edf0f5;
  --text-muted: #96a0b3;
  --border: #212a3b;
  --header-bg: rgba(11, 15, 23, 0.72);
  --scrollbar-track: #0f1420;
  --scrollbar-thumb: #2a3448;
}

/* ===================================================================
   Reset & base
=================================================================== */
* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 999px; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.container--narrow { max-width: var(--max-width-narrow); }

.muted { color: var(--text-muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-3);
}
.eyebrow.center { display: block; text-align: center; }

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 600;
  margin-bottom: var(--space-5);
  letter-spacing: -0.01em;
}
.section-title.center { text-align: center; }
.section-intro {
  max-width: 560px;
  margin: 0 auto var(--space-7);
}

.section { padding: var(--space-9) 0; }

/* ===================================================================
   Buttons
=================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s var(--ease), color 0.2s var(--ease);
  white-space: nowrap;
}
.btn--primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 10px 24px -8px rgba(91, 141, 239, 0.55);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -10px rgba(91, 141, 239, 0.6); }
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover { background: var(--surface-muted); transform: translateY(-2px); }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* ===================================================================
   Header / Nav
=================================================================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--header-bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--border); }

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
}

.nav-links {
  display: flex;
  gap: var(--space-6);
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-links a { color: var(--text-muted); transition: color 0.2s; position: relative; }
.nav-links a:hover { color: var(--text); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--accent-grad);
  transition: width 0.25s var(--ease);
}
.nav-links a:hover::after { width: 100%; }

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform 0.2s var(--ease), border-color 0.2s;
}
.icon-btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.icon-btn img { width: 16px; height: 16px; object-fit: contain; }
.icon-btn--social {
  background: #10131c;
  border-color: #10131c;
}
.icon-btn--social:hover { border-color: var(--accent); }

.menu-toggle {
  display: none;
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.menu-toggle span {
  width: 16px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.menu-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-nav {
  display: none;
  flex-direction: column;
  padding: 0 var(--space-6) var(--space-5);
  gap: var(--space-1);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s var(--ease);
}
.mobile-nav.open { max-height: 300px; }
.mobile-nav a {
  padding: var(--space-3) var(--space-2);
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: var(--text);
}
.mobile-nav a:hover { background: var(--surface-muted); }
.mobile-nav__socials {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .menu-toggle { display: flex; }
  .mobile-nav { display: flex; }
}

/* ===================================================================
   Hero
=================================================================== */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-9) var(--space-6) var(--space-7);
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 18% 18%, rgba(91, 141, 239, 0.16), transparent 60%),
    radial-gradient(50% 45% at 85% 20%, rgba(155, 123, 240, 0.16), transparent 60%);
}
.hero__content { max-width: 760px; }
.hero__eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-4);
}
.hero__title {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-5);
}
.hero__subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto var(--space-7);
}
.hero__ctas {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.scroll-cue {
  position: absolute;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 42px;
  border: 2px solid var(--border);
  border-radius: 999px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}
.scroll-cue span {
  width: 4px; height: 8px;
  border-radius: 2px;
  background: var(--accent);
  animation: scroll-cue 1.8s ease-in-out infinite;
}
@keyframes scroll-cue {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(10px); opacity: 0; }
  100% { opacity: 0; }
}

/* ===================================================================
   Fade / reveal animations
=================================================================== */
.fade-up {
  opacity: 0;
  transform: translateY(16px);
  animation: fade-up 0.8s var(--ease) forwards;
}
@keyframes fade-up {
  to { opacity: 1; transform: translateY(0); }
}

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

/* ===================================================================
   About
=================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-9);
  align-items: center;
}
.about-text p { margin-bottom: var(--space-4); color: var(--text-muted); }
.about-text p:last-child { margin-bottom: 0; }

.about-media { display: flex; justify-content: center; }
.selfie-carousel {
  position: relative;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.selfie-carousel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s var(--ease);
}
.selfie-carousel img.active { opacity: 1; }
.selfie-dots {
  position: absolute;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}
.selfie-dots button {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.45);
  transition: transform 0.2s, background 0.2s;
  padding: 0;
}
.selfie-dots button.active { background: #fff; transform: scale(1.3); }

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: var(--space-7); }
  .about-media { order: -1; }
  .selfie-carousel { max-width: 300px; }
}

/* ===================================================================
   Timeline
=================================================================== */
.timeline-marker { text-align: center; margin: var(--space-5) 0; }
.pill {
  display: inline-block;
  padding: var(--space-2) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 600;
}
.pill--muted { color: var(--text-muted); font-weight: 500; }

.timeline { position: relative; padding: var(--space-6) 0; }
.timeline::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 20px;
  width: 1px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  padding-left: 52px;
  margin-bottom: var(--space-6);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.timeline-item.is-visible { opacity: 1; transform: translateY(0); }
.timeline-item::before {
  content: "";
  position: absolute;
  left: 15px; top: 22px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}
.timeline-item.is-grad::before { background: #eab308; box-shadow: 0 0 0 2px #eab308; }

.timeline-card {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.timeline-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.timeline-logo {
  flex-shrink: 0;
  width: 48px; height: 48px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--border);
}
.timeline-logo img { width: 100%; height: 100%; object-fit: cover; }
.timeline-logo.contain img { width: 70%; height: 70%; object-fit: contain; }
.timeline-logo.raw { background: transparent; border: none; }
.timeline-body p.period {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}
.timeline-body h3 { font-family: var(--font-sans); font-size: 1rem; font-weight: 600; margin-bottom: var(--space-1); }
.timeline-body p.desc { font-size: 0.875rem; font-style: italic; color: var(--text-muted); }

@media (min-width: 860px) {
  .timeline::before { left: 50%; transform: translateX(-50%); }
  .timeline-item {
    padding-left: 0;
    display: grid;
    grid-template-columns: 1fr 40px 1fr;
    align-items: center;
    gap: var(--space-5);
  }
  .timeline-item::before { left: 50%; transform: translateX(-50%); top: 50%; margin-top: -5.5px; }
  .timeline-item .timeline-slot { grid-column: 1; }
  .timeline-item.is-right .timeline-slot { grid-column: 3; }
  .timeline-item .timeline-spacer { grid-column: 3; }
  .timeline-item.is-right .timeline-spacer { grid-column: 1; }
}

/* ===================================================================
   Project grid + modal
=================================================================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-6);
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s;
  box-shadow: var(--shadow-sm);
}
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.project-card__media {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, rgba(91, 141, 239, 0.12), rgba(155, 123, 240, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.project-card__media img { max-width: 60%; max-height: 60%; object-fit: contain; }
.project-card__body { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.project-card__body h3 { font-family: var(--font-sans); font-size: 1.1rem; font-weight: 600; }
.project-card__body p { font-size: 0.9rem; color: var(--text-muted); flex: 1; }
.project-card__tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-pill);
  background: rgba(91, 141, 239, 0.12);
  color: var(--accent);
}
.project-card__link {
  margin-top: var(--space-3);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}
.modal.is-open { display: flex; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 15, 0.6);
  backdrop-filter: blur(6px);
}
.modal__panel {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 760px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.25s var(--ease);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal__close {
  position: absolute;
  top: var(--space-4); right: var(--space-4);
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
}
.modal__body { padding: var(--space-7) var(--space-6) var(--space-6); }

.carousel { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); }
.carousel__viewport {
  width: 100%;
  min-height: 260px;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: var(--space-4);
}
.carousel__viewport img { max-width: 100%; max-height: 320px; object-fit: contain; }
.carousel__viewport iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: var(--radius-sm); }
.carousel__controls { display: flex; align-items: center; gap: var(--space-4); }
.carousel__controls button {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.carousel__dots { display: flex; gap: 6px; }
.carousel__dots button {
  width: 7px; height: 7px;
  border-radius: 50%;
  border: none;
  background: var(--border);
  padding: 0;
}
.carousel__dots button.active { background: var(--accent); }

.modal-project-title { font-family: var(--font-sans); font-size: 1.5rem; font-weight: 700; margin: var(--space-6) 0 var(--space-3); }
.modal-project-desc { color: var(--text-muted); margin-bottom: var(--space-4); }

/* ===================================================================
   Contact
=================================================================== */
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  box-shadow: var(--shadow-md);
}
.contact-form { display: flex; flex-direction: column; gap: var(--space-5); margin-top: var(--space-5); }
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field label { font-size: 0.85rem; font-weight: 600; }
.field input, .field textarea {
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.18);
}
.form-status { font-size: 0.9rem; text-align: center; min-height: 1.2em; }
.form-status.success { color: #22c55e; }
.form-status.error { color: #ef4444; }

/* ===================================================================
   Footer
=================================================================== */
.site-footer {
  text-align: center;
  padding: var(--space-7) var(--space-6);
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}
.site-footer p { margin-bottom: var(--space-2); }
.site-footer p:last-child { margin-bottom: 0; }

@media (max-width: 600px) {
  .section { padding: var(--space-8) 0; }
  .contact-card { padding: var(--space-5); }
}
