/* ─── Custom Properties ─────────────────────────────────────────────────── */
:root {
  --bg:          #212E21;
  --bg-dark:     #1a261a;
  --bg-card:     #2a3a2a;
  --accent:      #AEC0AB;
  --accent-dark: #EBFC72;
  --text:        #F4F3E8;
  --text-muted:  #E6DCC8;
  --border:      rgba(174, 192, 171, 0.18);
  --radius:      14px;
  --radius-sm:   8px;
  --nav-h:       68px;
  --section-gap: 80px;
  --card-gap:    56px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

/* ─── Nav ───────────────────────────────────────────────────────────────── */
#nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  gap: 24px;
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-dark);
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent-dark);
  transition: color 0.2s;
  white-space: nowrap;
}

.nav-links a:hover { color: var(--text); }

.nav-social {
  display: flex;
  align-items: center;
  gap: 8px;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 3px solid var(--accent-dark);
  border-radius: 50%;
  color: var(--accent-dark);
  transition: color 0.2s, border-color 0.2s;
}

.social-icon:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.4);
}

.social-icon svg { width: 18px; height: 18px; }

.btn-resume {
  display: inline-flex;
  align-items: center;
  padding: 9px 22px;
  border: 2px solid var(--accent-dark);
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--accent-dark);
  color: var(--bg-dark);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.btn-resume:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-dark);
}

/* Hamburger — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 24px 56px;
  gap: 32px;
}

.hero-video {
  width: 100%;
  max-width: 840px;
}

.hero-social {
  display: flex;
  gap: 12px;
  align-items: center;
}

.hero-social .social-icon {
  width: 44px;
  height: 44px;
}

.hero-social .social-icon svg { width: 20px; height: 20px; }

/* ─── Video Embed ───────────────────────────────────────────────────────── */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-dark);
}

.video-wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 16px;
}

.video-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.4;
}

/* ─── Section Banner ────────────────────────────────────────────────────── */
.page-section {
  margin-bottom: var(--section-gap);
}

.section-banner {
  background: var(--accent-dark);
  padding: 28px 40px;
  border-radius: 16px;
  margin: 0 24px 56px;
  text-align: center;
}

.section-banner h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--bg-dark);
  letter-spacing: -0.02em;
}

/* ─── Projects List ─────────────────────────────────────────────────────── */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 40px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ─── Project Card ──────────────────────────────────────────────────────── */
.project-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
  padding: calc(var(--card-gap) / 2) 0;
}

.project-card + .project-card {
  border-top: 1px solid var(--border);
}

.project-card.card-flip {
  direction: rtl;
}

.project-card.card-flip > * {
  direction: ltr;
}

.project-card.card-solo {
  grid-template-columns: 1fr;
  max-width: 680px;
}

.card-text {}

.card-title {
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  font-weight: 700;
  color: var(--accent-dark);
  line-height: 1.25;
  margin-bottom: 18px;
  letter-spacing: -0.02em;
}

.card-body p {
  color: var(--text-muted);
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.card-body p:last-child { margin-bottom: 0; }

.card-body strong { color: var(--text); font-weight: 600; }

.accent-link {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.accent-link:hover { color: var(--text); }

.card-bullets {
  list-style: none;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-bullets li {
  color: var(--text-muted);
  font-size: 0.93rem;
  padding-left: 18px;
  position: relative;
}

.card-bullets li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent-dark);
  font-size: 1.1em;
  line-height: 1;
  top: 3px;
}

.card-bullets strong { color: var(--text); font-weight: 600; }

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.btn-accent {
  display: inline-flex;
  align-items: center;
  padding: 10px 22px;
  background: var(--accent-dark);
  color: var(--bg-dark);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 999px;
  transition: background 0.2s, transform 0.15s;
}

.btn-accent:hover {
  background: var(--accent);
  transform: translateY(-1px);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  padding: 10px 22px;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 999px;
  transition: color 0.2s, border-color 0.2s;
}

.btn-outline:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.4);
}

/* ─── About Section ─────────────────────────────────────────────────────── */
.about-section {
  background: var(--bg-dark);
  padding: var(--section-gap) 40px;
  margin-bottom: 0;
}

.about-content {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 60px;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
}

.about-photo-wrap {
  position: relative;
}

.about-photo {
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
  aspect-ratio: 3/4;
  display: block;
}

.about-photo-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1.5px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 24px;
}

.about-text h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 14px;
  font-size: 0.97rem;
}

.about-text p:last-of-type { margin-bottom: 0; }

.about-text strong { color: var(--text); font-weight: 600; }

.about-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-top: 32px;
}

.about-social {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ─── Detail Page ───────────────────────────────────────────────────────── */
.detail-hero {
  padding: 64px 40px 0;
  max-width: 1200px;
  margin: 0 auto;
}

.detail-hero .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 40px;
  transition: color 0.2s;
}

.detail-hero .back-link:hover { color: var(--text); }

.detail-hero .back-link svg { width: 16px; height: 16px; }

.detail-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--accent-dark);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 48px;
}

.detail-body {
  padding: 40px 40px 80px;
  max-width: 1200px;
  margin: 0 auto;
}

.detail-body p {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 0.97rem;
  max-width: 680px;
}

.detail-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin: 32px 0 12px;
}

.detail-body ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.detail-body ul li {
  color: var(--text-muted);
  font-size: 0.93rem;
  padding-left: 18px;
  position: relative;
  max-width: 680px;
}

.detail-body ul li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent-dark);
}

/* ─── Detail Page — Light Nav Theme ────────────────────────────────────── */
body.detail-light #nav {
  background: var(--accent-dark);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.detail-light .nav-logo,
body.detail-light .nav-links a {
  color: var(--bg-dark);
}

body.detail-light .nav-links a:hover { color: rgba(0, 0, 0, 0.55); }

body.detail-light .social-icon {
  color: var(--bg-dark);
  border-color: rgba(0, 0, 0, 0.2);
}

body.detail-light .social-icon:hover {
  color: rgba(0, 0, 0, 0.55);
  border-color: rgba(0, 0, 0, 0.4);
}

body.detail-light .btn-resume {
  border-color: var(--bg-dark);
  color: var(--bg-dark);
}

body.detail-light .btn-resume:hover {
  background: var(--bg-dark);
  color: var(--accent);
}

body.detail-light .nav-toggle span { background: var(--bg-dark); }

body.detail-light .nav-right {
  background: var(--accent-dark);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.detail-light .nav-links { border-bottom-color: rgba(0, 0, 0, 0.12); }

/* ─── Detail Page — Hero ────────────────────────────────────────────────── */
.dl-hero {
  background: var(--accent-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-height: 52vh;
}

.dl-hero-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 72px 40px 48px;
  max-width: 760px;
}

.dl-hero-content h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  color: var(--bg-dark);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.dl-hero-content p {
  font-size: 1.05rem;
  color: rgba(0, 0, 0, 0.6);
  margin-top: 14px;
  max-width: 500px;
}

.dl-hero-wave {
  width: 100%;
  display: block;
  flex-shrink: 0;
}

/* ─── Detail Page — Content Sections ───────────────────────────────────── */
.dl-section {
  padding: 56px 0 48px;
}

.dl-section:last-child { padding-bottom: 80px; }

.dl-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 40px;
}

.dl-section h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 700;
  color: var(--accent-dark);
  text-align: center;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.dl-disclaimer {
  border-left: 3px solid var(--accent-dark);
  padding-left: 16px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-style: italic;
  margin-bottom: 28px;
}

.dl-section p {
  color: var(--text-muted);
  font-size: 0.97rem;
  margin-bottom: 14px;
}

.dl-section p:last-child { margin-bottom: 0; }

.dl-section strong { color: var(--text); font-weight: 600; }

.dl-bullets {
  list-style: none;
  margin: 14px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dl-bullets li {
  color: var(--text-muted);
  font-size: 0.95rem;
  padding-left: 20px;
  position: relative;
}

.dl-bullets li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent-dark);
}

.dl-bullets strong { color: var(--text); font-weight: 600; }

/* ─── Detail Page — Media / GIF ─────────────────────────────────────────── */
.dl-media-wrap {
  max-width: 960px;
  margin: 36px auto 0;
  padding: 0 40px;
}

.dl-media {
  border-radius: var(--radius);
}

.dl-media img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius);
}

/* In side-by-side pairs both images should fill their column equally */
.dl-media-pair .dl-media img {
  width: 100%;
}

.dl-media.media-missing {
  background: var(--bg-card);
  border: 1.5px dashed var(--border);
  padding: 56px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 220px;
  border-radius: var(--radius);
}

/* ─── Detail Page — Two-column row (text + image side by side) ────────── */
.dl-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px;
}

.dl-row h2 { text-align: left; margin-bottom: 16px; }

.dl-placeholder-label {
  display: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

.dl-placeholder-label code {
  color: var(--accent-dark);
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.dl-media.media-missing .dl-placeholder-label { display: block; }

/* ─── Detail Page — Two-image pair (Probability Controls) ───────────────── */
.dl-media-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 760px) {
  .dl-media-pair { grid-template-columns: 1fr; }
}

/* ─── Detail Page — Section Divider ─────────────────────────────────────── */
.dl-divider {
  height: 4px;
  background: var(--accent-dark);
  margin: 0 40px;
}

@media (max-width: 768px) {
  .dl-divider { margin: 0 20px; }
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .project-card {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .project-card.card-flip {
    direction: ltr;
  }

  .about-content {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .about-photo, .about-photo-placeholder {
    max-width: 360px;
    aspect-ratio: 1/1;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  :root { --section-gap: 56px; --card-gap: 40px; }

  #nav { padding: 0 20px; }

  .nav-toggle { display: flex; }

  .nav-right {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 16px 20px 20px;
  }

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

  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
  }

  .nav-links a {
    display: block;
    padding: 8px 0;
    font-size: 1rem;
    width: 100%;
  }

  .section-banner { margin: 0 16px 40px; padding: 22px 24px; }

  .projects-list { padding: 0 16px; }

  .about-section { padding: var(--section-gap) 16px; }

  .detail-hero { padding: 40px 16px 0; }
  .detail-body { padding: 24px 16px 60px; }
  .dl-hero-content { padding: 56px 20px 36px; }
  .dl-container { padding: 0 20px; }
  .dl-media-wrap { padding: 0 20px; }
  .dl-row { grid-template-columns: 1fr; padding: 0 20px; }
  .dl-row h2 { text-align: center; }
  .dl-section { padding: 40px 0 32px; }
  .dl-section:last-child { padding-bottom: 60px; }
}

@media (max-width: 600px) {
  .nav-logo-sub { display: none; }
}

@media (max-width: 480px) {
  .hero { padding: 40px 16px 40px; }
  .nav-logo { font-size: 0.88rem; }
  .section-banner { padding: 18px 20px; }
  .card-title { font-size: 1.2rem; }
}
