/* Two-column shell, sticky sidebar, vertical nav, language switcher,
   theme switcher, social row. Index page only. */

.shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 48px;
  display: grid;
  grid-template-columns: minmax(280px, 30%) 1fr;
  gap: 0;
  min-height: 100vh;
}

/* Left panel (sticky) */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 56px 48px 32px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.name {
  font-size: 32px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 12px;
  opacity: 0;
  animation: fadeUp 0.6s 0s ease-out forwards;
}
.title {
  font-size: 17px;
  font-weight: 500;
  color: var(--ink-body);
  margin: 0 0 24px;
  line-height: 1.4;
  opacity: 0;
  animation: fadeUp 0.6s 0.15s ease-out forwards;
}
.tagline {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-muted);
  margin: 0 0 32px;
  max-width: 340px;
  opacity: 0;
  animation: fadeUp 0.6s 0.30s ease-out forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Vertical nav */
.nav {
  list-style: none;
  margin: 0 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
  color: var(--ink-muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.2s ease;
  width: max-content;
}
.nav a::before {
  content: "";
  display: block;
  height: 1px;
  width: 32px;
  background: currentColor;
  transition: width 0.25s ease, background 0.25s ease;
}
.nav a:hover { color: var(--ink); }
.nav a:hover::before { width: 56px; }
.nav a.active { color: var(--ink); }
.nav a.active::before { width: 56px; height: 1px; background: var(--accent); }

/* Bottom utility row: lang + social */
.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 24px;
}
.lang {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  user-select: none;
}
.lang button {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 6px 10px;
  color: inherit;
  font: inherit;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: color 0.15s ease;
}
.lang button:hover { color: var(--ink); }
.lang button.active { color: var(--accent); font-weight: 600; }
.lang .sep { color: var(--sep-pipe); padding: 0 2px; }

/* Theme switcher — three-state: light / auto / dark */
.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 12px;
  padding: 3px;
  background: var(--bg-tag);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: fit-content;
  transition: background 0.4s ease, border-color 0.4s ease;
}
.theme-switch button {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  color: var(--ink-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background 0.3s ease;
  position: relative;
}
.theme-switch button:hover { color: var(--ink); }
.theme-switch button.active {
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
:root[data-theme="dark"] .theme-switch button.active { box-shadow: 0 1px 3px rgba(0,0,0,0.4); }
.theme-switch svg { width: 14px; height: 14px; display: block; }
.theme-switch button[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--tooltip-bg);
  color: var(--tooltip-fg);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.theme-switch button:hover[data-tip]::after { opacity: 1; }

.socials {
  display: flex;
  gap: 18px;
}
.socials a {
  color: var(--ink-muted);
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-flex;
  position: relative;
}
.socials a:hover { color: var(--ink); transform: translateY(-2px); }
.socials svg { width: 22px; height: 22px; display: block; }
.socials a[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--tooltip-bg);
  color: var(--tooltip-fg);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.socials a:hover::after { opacity: 1; }

/* Right panel (content) */
.content {
  padding: 56px 0 96px 48px;
  min-width: 0;
}
section {
  margin-bottom: 96px;
  scroll-margin-top: 96px;
}
section:last-child { margin-bottom: 48px; }

.section-label {
  display: none; /* mobile reveals */
}
h2.section-heading {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
h2.section-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Responsive — collapse sidebar */
@media (max-width: 1023px) {
  .shell {
    grid-template-columns: 1fr;
    padding: 0 32px;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 48px 0 24px;
  }
  .tagline { margin-bottom: 32px; }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 4px 24px; margin-bottom: 24px; }
  .nav a::before { display: none; }
  .nav a { padding: 6px 0; }
  .nav a.active { color: var(--accent); }
  .sidebar-bottom {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
  }
  .sidebar-bottom .lang { margin-right: auto; }
  .sidebar-bottom .theme-switch { margin-top: 0; }
  .sidebar-bottom .socials { margin-left: auto; }
  .content { padding: 32px 0 64px; }
}
@media (max-width: 640px) {
  .shell { padding: 0 20px; }
  .name { font-size: 28px; }
  section { margin-bottom: 64px; }
  .sidebar-bottom .socials { margin-left: 0; }
}
