/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --bg:           #F7F7F5;
  --surface:      #FFFFFF;
  --text-primary: #111111;
  --text-secondary:#555555;
  --text-tertiary:#999999;
  --accent:       #111111;
  --rule:         #E0E0E0;
  --rule-light:   #EBEBEB;

  --radius-sm:    4px;
  --radius-md:    8px;

  --nav-h:        56px;
  --nav-mobile-bg: rgba(247, 247, 245, 0.72);

  --font: 'DM Sans', system-ui, -apple-system, sans-serif;

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

  --card-body-bg: rgba(255, 255, 255, 0.78);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:            #141414;
    --surface:       #1C1C1C;
    --text-primary:  #EFEFED;
    --text-secondary:#999999;
    --text-tertiary: #555555;
    --accent:        #EFEFED;
    --rule:          #2A2A2A;
    --rule-light:    #222222;
    --nav-mobile-bg: rgba(0, 0, 0, 0.85);
    --card-body-bg:  rgba(20, 20, 20, 0.82);
  }

  .project-card__body::after {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .project-card__body::before {
    opacity: 0.5;
    filter: blur(18px) saturate(1.4) brightness(0.6);
  }

  .project-card__image {
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.04);
  }
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.display {
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

/* Section heading — large, clear hierarchy */
.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 2rem;
}

.label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.body-lg {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.body-sm {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}

.nav__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
}

.nav__logo img {
  display: block;
  border-radius: 4px;
}

.nav__links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav__links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color 0.15s;
}

.nav__links a:hover,
.nav__links a.active { color: var(--text-primary); }

.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.nav__hamburger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text-primary);
  transition: transform 0.25s, opacity 0.25s;
}

.nav__hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__hamburger.open span:nth-child(2) { opacity: 0; }
.nav__hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav__mobile {
  display: none;
  position: fixed;
  top: calc(var(--nav-h) + 0.75rem);
  left: 0.75rem;
  right: 0.75rem;
  background: var(--nav-mobile-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 99;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.nav__mobile.open { display: flex; }
.nav__mobile a {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--rule-light);
}
.nav__mobile a:last-child {
  border-bottom: none;
}
.nav__mobile a.active { color: var(--text-primary); }

/* ============================================================
   LAYOUT
   ============================================================ */
.page-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Each section separated by a rule */
.section {
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.section:last-of-type { border-bottom: none; }

/* ============================================================
   EXPANDABLE SECTIONS  (<details> / <summary>)
   ============================================================ */
details { border-bottom: 1px solid var(--rule); }
details:last-of-type { border-bottom: none; }

details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

details summary::-webkit-details-marker { display: none; }

details summary .summary-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

details summary .summary-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-tertiary);
  transition: transform 0.25s var(--ease-out);
}

details[open] summary .summary-icon {
  transform: rotate(180deg);
}

.details-body {
  padding-bottom: 2.5rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  border: 1px solid transparent;
  -webkit-appearance: none;
  appearance: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  -webkit-appearance: none;
  appearance: none;
}
.btn-primary:hover { background: #333; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--rule);
}
.btn-ghost:hover { border-color: #999; color: var(--text-primary); }

/* ============================================================
   SOCIAL LINKS
   ============================================================ */
.social-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  transition: color 0.15s, border-color 0.15s;
}

.social-link:hover { color: var(--text-primary); border-color: #999; }
.social-link svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer p { font-size: 0.8125rem; color: var(--text-tertiary); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .nav__links { display: none; }
  .nav__hamburger { display: flex; }
  .page-wrap { padding: 0 1.25rem; }
  details summary { padding: 1.5rem 0; }
}
