/* Ink & Dawn — chrome: header, drawer, footer, buttons */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.header .container {
  width: min(100% - 1.5rem, var(--container));
}

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--header-h);
  width: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 0.15rem;
  margin-left: auto;
}

.nav-links a {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
  background: var(--bg-muted);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.nav-links + .nav-actions {
  margin-left: 0.5rem;
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--ink);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.icon-btn:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.nav-toggle {
  order: 3;
}

.nav-toggle-bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 18px;
}

.nav-toggle-bars span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 46px;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease-out), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  color: inherit;
}

.btn-primary,
.btn-play {
  background: linear-gradient(135deg, var(--accent-soft), var(--accent) 45%, var(--accent-deep));
  color: #1a120c;
  box-shadow: 0 10px 28px var(--glow);
}

.btn-primary:hover,
.btn-play:hover {
  color: #1a120c;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-outline {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent-deep);
}

[data-theme="dark"] .btn-outline {
  color: var(--accent-soft);
}

.btn img {
  width: 20px;
  height: 20px;
}

.btn-sm {
  min-height: 38px;
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
}

.header .btn-primary {
  display: none;
}

/* Drawer — must live outside .header (backdrop-filter traps fixed children) */
.scrim {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 400;
}

.scrim.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(92vw, 360px);
  height: 100dvh;
  background: var(--bg-elevated);
  border-left: 1px solid var(--line);
  z-index: 410;
  transform: translateX(105%);
  transition: transform 0.3s var(--ease-out), visibility 0.3s;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  gap: 1rem;
  visibility: hidden;
  pointer-events: none;
}

.drawer.is-open {
  transform: none;
  visibility: visible;
  pointer-events: auto;
}

.drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.drawer-title span {
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.drawer-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  overflow: auto;
}

.drawer-links a {
  text-decoration: none;
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  color: var(--ink);
}

.drawer-links a:hover {
  background: var(--bg-muted);
}

.drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* Footer */
.footer {
  border-top: 1px solid var(--line);
  padding: 3.5rem 0 2rem;
  background: color-mix(in srgb, var(--bg-muted) 55%, transparent);
}

.footer-main {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

.footer-brand {
  max-width: 22rem;
}

.footer-brand img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  margin-bottom: 0.85rem;
}

.footer-brand h3 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.footer-brand p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.footer-column h4 {
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.85rem;
}

.footer-column ul {
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.footer-column a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.footer-column a:hover {
  color: var(--ink);
}

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  color: var(--ink-faint);
  font-size: 0.85rem;
}

@media (min-width: 900px) {
  .nav-links {
    display: flex;
  }

  .nav-toggle {
    display: none;
  }

  .nav-actions {
    margin-left: 0;
  }

  .header .btn-primary {
    display: inline-flex;
  }

  .footer-main {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 2.5rem;
  }
}
