/* === Layout === */

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  width: 100%;
}

/* Full viewport layout — no scrolling */
body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Navigation */
.nav {
  flex-shrink: 0;
  z-index: 100;
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
  transition: background-color var(--transition), border-color var(--transition);
  position: relative;
}

[data-theme="dark"] .nav {
  border-image: none;
  border-bottom-color: rgba(255,255,255,0.06);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Nav brand — logo + name */
.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  min-width: 0;
}

.nav-brand:hover {
  text-decoration: none;
}

.nav-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* Theme-aware logo switching */
.nav-logo-dark {
  display: none;
}

.nav-logo-light {
  display: block;
}

[data-theme="dark"] .nav-logo-dark {
  display: block;
}

[data-theme="dark"] .nav-logo-light {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav-logo-dark {
    display: block;
  }
  :root:not([data-theme="light"]) .nav-logo-light {
    display: none;
  }
}

.nav-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex-shrink: 0;
}

.nav-links a {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: color var(--transition);
}

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

/* Nav tabs — active state */
.nav-tab {
  position: relative;
  cursor: pointer;
}

.nav-tab::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--text-primary);
  transform: scaleX(0);
  transition: transform 250ms ease;
}

.nav-tab.nav-active {
  color: var(--text-primary) !important;
}

.nav-tab.nav-active::after {
  transform: scaleX(1);
}

.theme-toggle {
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: var(--text-base);
  padding: var(--space-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color var(--transition), background-color var(--transition);
  width: 32px;
  height: 32px;
}

.theme-toggle:hover {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}

/* Main — fills remaining viewport */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* Hero — compact, fixed at top of main */
.hero {
  flex-shrink: 0;
  padding: var(--space-xl) 0 var(--space-lg);
}

.hero-name {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-xs);
}

.hero-title {
  font-size: var(--text-base);
  color: var(--text-secondary);
  font-weight: var(--weight-normal);
  margin-bottom: var(--space-md);
}

.hero-bio {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
  max-width: 520px;
  margin-bottom: var(--space-md);
}

.hero-social {
  display: flex;
  gap: var(--space-lg);
}

.hero-social a {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  transition: color var(--transition);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.hero-social a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.hero-social svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Panels — section switching container */
.panels {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 300ms ease, transform 300ms ease, visibility 0ms 300ms;
  overflow-y: auto;
  padding-bottom: var(--space-xl);
}

/* Hide scrollbar but keep functionality */
.panel {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.panel::-webkit-scrollbar {
  width: 4px;
}

.panel::-webkit-scrollbar-track {
  background: transparent;
}

.panel::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.panel-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 300ms ease, transform 300ms ease, visibility 0ms 0ms;
}

/* Sections inside panels */
.section-header {
  margin-bottom: var(--space-lg);
}

.section-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin-top: var(--space-sm);
}

/* Footer — pinned at bottom */
.footer {
  flex-shrink: 0;
  padding: var(--space-md) 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

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

/* Responsive */
@media (max-width: 640px) {
  body {
    min-height: 100dvh;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    display: block;
  }

  .container {
    padding: 0 var(--space-md);
  }

  .nav {
    position: sticky;
    top: 0;
    height: auto;
  }

  .nav-inner {
    flex-direction: column;
    min-height: 56px;
    height: auto;
    padding: var(--space-md) 0;
    gap: var(--space-sm);
  }

  .nav-brand {
    justify-content: center;
    max-width: 100%;
  }

  .nav-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-links {
    justify-content: center;
    gap: var(--space-md);
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links a {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
  }

  .theme-toggle {
    min-width: 40px;
    width: 40px;
    height: 40px;
  }

  main {
    display: block;
    overflow: visible;
    min-height: 0;
  }

  .hero-name {
    font-size: var(--text-xl);
  }

  .hero {
    padding: var(--space-lg) 0 var(--space-md);
  }

  .hero-bio {
    font-size: var(--text-sm);
    max-width: none;
    margin-bottom: var(--space-lg);
  }

  .hero-social {
    gap: var(--space-sm) var(--space-lg);
  }

  .hero-social a {
    min-height: 32px;
  }

  .panels {
    position: static;
    overflow: visible;
    min-height: 0;
  }

  .panel {
    display: none;
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
    overflow: visible;
    padding-bottom: var(--space-xl);
  }

  .panel-active {
    display: block;
    transform: none;
    transition: none;
  }

  .section-header {
    margin-bottom: var(--space-md);
  }

  .footer {
    padding: var(--space-md) 0 calc(var(--space-md) + env(safe-area-inset-bottom));
  }
}
