/* ============================================================
   base.css — Resets, globals, layout shell
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-rose-light);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

ul, ol { list-style: none; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(220, 20, 60, 0.3);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(220, 20, 60, 0.55);
}

/* ── Selection ── */
::selection {
  background: rgba(220, 20, 60, 0.3);
  color: var(--color-white);
}

/* ── Layout shell ── */
#app {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--color-sidebar);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  padding: var(--space-10) var(--space-6);
  z-index: var(--z-sidebar);
  overflow-y: auto;
}

.sidebar__brand {
  margin-bottom: var(--space-10);
}

.sidebar__name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  font-style: italic;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.sidebar__tagline {
  display: block;
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.5;
}

.sidebar__divider {
  height: 1px;
  background: var(--color-border);
  margin-bottom: var(--space-6);
}

/* ── Sidebar nav ── */
.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
}

.sidebar__nav-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  padding-left: var(--space-3);
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--size-sm);
  font-weight: 400;
  color: var(--text-secondary);
  transition:
    color var(--duration-base) var(--ease-out),
    background var(--duration-base) var(--ease-out);
  cursor: pointer;
  border: none;
  background: none;
  text-align: left;
  width: 100%;
}

.sidebar__link::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: background var(--duration-base), transform var(--duration-base);
}

.sidebar__link:hover {
  color: var(--text-primary);
  background: var(--color-surface);
}

.sidebar__link:hover::before {
  background: var(--color-rose-light);
  transform: scale(1.4);
}

.sidebar__link.active {
  color: var(--text-primary);
  background: var(--color-surface);
}

.sidebar__link.active::before {
  background: var(--color-crimson);
  transform: scale(1.4);
}

/* ── Main content ── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
}

/* ── Section ── */
.section {
  padding: var(--space-16) var(--space-12);
  border-bottom: 1px solid var(--color-border);
}

.section__header {
  margin-bottom: var(--space-10);
}

.section__label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-crimson);
  display: block;
  margin-bottom: var(--space-3);
  opacity: 0.8;
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  font-style: italic;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.05;
}

.section__subtitle {
  margin-top: var(--space-3);
  font-size: var(--size-sm);
  font-weight: 300;
  color: var(--text-secondary);
  max-width: 480px;
}

/* ── Reveal on scroll ── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity var(--duration-slower) var(--ease-out),
    transform var(--duration-slower) var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Keyframes ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Mobile: sidebar collapses to top bar ── */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    overflow-x: auto;
    overflow-y: hidden;
    gap: var(--space-4);
  }

  .sidebar__brand {
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .sidebar__tagline { display: none; }

  .sidebar__divider { display: none; }

  .sidebar__nav {
    flex-direction: row;
    gap: var(--space-1);
    flex: 1;
  }

  .sidebar__nav-label { display: none; }

  .sidebar__link {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .main-content {
    margin-left: 0;
    margin-top: 60px;
  }

  .section {
    padding: var(--space-10) var(--space-4);
  }
}
