/* Fontes carregadas de forma assíncrona via <link> no <head> de cada página
   (não use @import aqui — encadeia requisições e atrasa a renderização/LCP). */

/* ============================================
   SÉRGIO CAMARGOS — Design Tokens
   ============================================ */
:root {
  --bg-primary:     #111111;
  --bg-secondary:   #1A1A1A;
  --bg-card:        #161616;
  --bg-hover:       #2E2E2E;

  --text-primary:   #F5F5F5;
  --text-secondary: #CFCFCF;
  --text-muted:     #888888;
  --text-subtle:    #8C8C8C;

  --accent-gold:    #C6A664;
  --accent-gold-dim: rgba(198,166,100,0.15);
  --accent-gold-border: rgba(198,166,100,0.3);
  --accent-blue:    #005F73;
  --accent-blue-dim: rgba(0,95,115,0.15);

  --border:         #2A2A2A;
  --border-mid:     #333333;

  --font-display:   'Manrope', 'Helvetica Neue', sans-serif;
  --font-body:      'Inter', 'Helvetica Neue', sans-serif;
  --font-serif:     'Cormorant Garamond', Georgia, serif;

  --nav-h: 64px;
  --max-w: 1200px;
  --radius: 2px;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(17,17,17,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.nav__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-primary);
  transition: color 200ms;
}
.nav__logo:hover { color: var(--accent-gold); }

.nav__links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.nav__links a {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 200ms;
  position: relative;
}
.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0; right: 0;
  height: 1px;
  background: var(--accent-gold);
  transform: scaleX(0);
  transition: transform 200ms ease;
}
.nav__links a:hover { color: var(--text-primary); }
.nav__links a:hover::after { transform: scaleX(1); }
.nav__links a.active { color: var(--accent-gold); }
.nav__links a.active::after { transform: scaleX(1); }

.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.nav__hamburger span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--text-secondary);
  transition: all 200ms;
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
}

.section {
  padding: 96px 0;
}

.section--sm {
  padding: 64px 0;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 16px;
  display: block;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.section-subtitle {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.6;
}

.divider {
  width: 40px;
  height: 2px;
  background: var(--accent-gold);
  margin: 20px 0 40px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 13px 28px;
  border-radius: var(--radius);
  transition: all 200ms ease;
}

.btn--primary {
  background: var(--accent-gold);
  color: #111111;
}
.btn--primary:hover {
  background: #d4b678;
  transform: translateY(-1px);
}

.btn--outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-mid);
}
.btn--outline:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--accent-gold);
  padding: 0;
  letter-spacing: 0.1em;
  font-size: 10px;
}
.btn--ghost:hover { color: #d4b678; }
.btn--ghost::after { content: ' →'; }

/* ============================================
   METRO TILES
   ============================================ */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2px;
}

.tile {
  background: var(--bg-secondary);
  padding: 36px 32px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: background 250ms ease;
  border: 1px solid var(--border);
}

.tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent-gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 350ms ease;
}

.tile:hover { background: var(--bg-hover); }
.tile:hover::before { transform: scaleX(1); }

.tile--large { grid-column: span 5; min-height: 280px; }
.tile--medium { grid-column: span 4; min-height: 200px; }
.tile--small { grid-column: span 3; min-height: 200px; }
.tile--wide { grid-column: span 7; min-height: 200px; }
.tile--half { grid-column: span 6; min-height: 200px; }

.tile__eyebrow {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 20px;
}

.tile__title {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.5vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.tile__desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 280px;
}

.tile__number {
  position: absolute;
  bottom: 24px;
  right: 28px;
  font-family: var(--font-display);
  font-size: 80px;
  font-weight: 800;
  color: rgba(255,255,255,0.03);
  line-height: 1;
  letter-spacing: -0.04em;
  pointer-events: none;
  user-select: none;
}

.tile__arrow {
  position: absolute;
  bottom: 28px;
  left: 32px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-subtle);
  transition: color 200ms, transform 200ms;
}
.tile:hover .tile__arrow {
  color: var(--accent-gold);
  transform: translateX(4px);
}

/* ============================================
   CARDS
   ============================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 250ms, transform 250ms;
}
.card:hover {
  border-color: var(--accent-gold-border);
  transform: translateY(-3px);
}

.card__thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card__thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.card__body {
  padding: 24px;
}

.card__tag {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 10px;
  display: block;
}

.card__title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.card__excerpt {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.card__cta {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-gold);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 200ms;
}
.card:hover .card__cta { gap: 10px; }

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 60px 0 32px;
}

.footer__top {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.footer__logo {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.footer__tagline {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer__col-title {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 20px;
}

.footer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer__links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 200ms;
}
.footer__links a:hover { color: var(--accent-gold); }

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

.footer__copy {
  font-size: 12px;
  color: var(--text-subtle);
  letter-spacing: 0.06em;
}

/* ============================================
   PAGE HERO (internal pages)
   ============================================ */
.page-hero {
  padding: calc(var(--nav-h) + 80px) 0 80px;
  border-bottom: 1px solid var(--border);
}

.page-hero__eyebrow {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 20px;
  display: block;
}

.page-hero__title {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 80px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.0;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.page-hero__sub {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 500px;
  line-height: 1.65;
}

/* ============================================
   SCROLL FADE ANIMATION
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms ease, transform 600ms ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__hamburger { display: flex; }

  .tile-grid { grid-template-columns: 1fr 1fr; gap: 2px; }
  .tile--large, .tile--medium, .tile--small,
  .tile--wide, .tile--half { grid-column: span 1; }

  .card-grid { grid-template-columns: 1fr 1fr; }

  .footer__top { grid-template-columns: 1fr; gap: 32px; }

  .container { padding: 0 20px; }
  .section { padding: 64px 0; }
}

@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; }
  .tile-grid { grid-template-columns: 1fr; }
}

/* ============================================
   READING PAGES — artigos e trechos de livros
   ============================================ */
.read-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

.read-head { margin-bottom: 56px; }

.read-head__cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-gold);
  display: block;
  margin-bottom: 20px;
}

.read-head__title {
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.read-head__sub {
  font-family: var(--font-serif);
  font-size: 19px;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 28px;
}

.read-head__meta {
  display: flex;
  gap: 20px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  text-transform: uppercase;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.read-body {
  font-size: 17px;
  line-height: 1.85;
  color: var(--text-secondary);
}

.read-body p { margin-bottom: 1.5em; text-wrap: pretty; }

.read-body h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text-primary);
  margin: 2.4em 0 0.9em;
}

.read-body h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 2em 0 0.8em;
}

.read-body blockquote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 21px;
  line-height: 1.6;
  color: var(--text-secondary);
  border-left: 2px solid var(--accent-gold);
  padding-left: 28px;
  margin: 2.2em 0;
}

.read-body blockquote cite {
  display: block;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  margin-top: 12px;
}

.read-body ul, .read-body ol { margin: 0 0 1.5em 1.4em; }
.read-body li { margin-bottom: 0.6em; }
.read-body strong { color: var(--text-primary); }
.read-body em { color: var(--text-secondary); }

.read-body hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 3em auto;
  max-width: 120px;
}

.read-callout {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-gold);
  padding: 24px 28px;
  margin: 2em 0;
  font-size: 15px;
}

.read-sig {
  margin-top: 72px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.read-sig__motto {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 6px;
}

.read-sig__sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.read-sig__author {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 40px;
  transition: color 200ms;
}
.back-link:hover { color: var(--accent-gold); }

/* ── Table of contents (sumário) ── */
.toc {
  margin: 1.5em 0 2.5em;
}

.toc__module {
  margin-bottom: 28px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-gold);
  background: var(--bg-secondary);
}

.toc__module-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}

.toc__module-num {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-gold);
  display: block;
  margin-bottom: 5px;
}

.toc__module-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.25;
}

.toc__module-pages {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
  margin-top: 6px;
  display: block;
}

.toc__chapters {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

.toc__chapters li {
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding: 7px 22px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.toc__chapters li:hover { color: var(--text-secondary); }

.toc__ch-title {
  flex: 1;
  min-width: 0;
}

.toc__leader {
  flex: 1;
  border-bottom: 1px dotted var(--border-mid);
  transform: translateY(-3px);
  min-width: 12px;
}

.toc__page {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-gold);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.toc__ch-num {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-subtle);
  min-width: 28px;
  flex-shrink: 0;
  padding-top: 1px;
}

.toc__part-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin: 8px 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--accent-gold-border);
}

/* ── Book detail hero ── */
.book-hero {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  align-items: center;
  max-width: 980px;
  margin: 0 auto;
  padding: 64px 24px 72px;
}

.book-hero__cover {
  width: 240px;
  aspect-ratio: 2/3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  position: relative;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}

.book-hero__badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #111;
  background: var(--accent-gold);
  padding: 5px 12px;
  margin-bottom: 20px;
  width: fit-content;
}

.book-hero__title {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.5vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.0;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.book-hero__subtitle {
  font-family: var(--font-serif);
  font-size: 17px;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 28px;
  max-width: 520px;
}

.book-hero__ctas { display: flex; gap: 12px; flex-wrap: wrap; }

.sample-label {
  text-align: center;
  margin: 0 auto 48px;
  max-width: 760px;
  padding: 0 24px;
}

.sample-label .eyebrow { display: block; margin-bottom: 8px; }

@media (max-width: 760px) {
  .book-hero { grid-template-columns: 1fr; gap: 36px; text-align: center; padding-top: 40px; }
  .book-hero__cover { margin: 0 auto; }
  .book-hero__ctas { justify-content: center; }
  .book-hero__subtitle { margin-left: auto; margin-right: auto; }
}

/* ============================================
   PWA — INSTALL BANNER
   ============================================ */
.pwa-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-mid);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 14px 18px;
  width: min(480px, calc(100vw - 32px));
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(198,166,100,0.08);
  animation: slideUp 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-banner[hidden] { display: none; }

.pwa-banner__icon img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
}

.pwa-banner__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pwa-banner__text strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.pwa-banner__text span {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.pwa-banner__install {
  font-size: 11px;
  padding: 8px 18px;
  white-space: nowrap;
  flex-shrink: 0;
}

.pwa-banner__close {
  font-size: 13px;
  color: var(--text-subtle);
  padding: 4px 6px;
  flex-shrink: 0;
  transition: color 200ms;
}
.pwa-banner__close:hover { color: var(--text-primary); }

/* ============================================
   PWA — UPDATE TOAST
   ============================================ */
.pwa-toast {
  position: fixed;
  top: calc(var(--nav-h) + 12px);
  right: 20px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-gold-border);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text-secondary);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  animation: slideDown 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-toast[hidden] { display: none; }

.pwa-toast__btn {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-gold);
  transition: color 200ms;
  padding: 0;
}
.pwa-toast__btn:hover { color: #d4b678; }

/* ============================================
   PWA — OFFLINE BADGE
   ============================================ */
.pwa-offline {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 998;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(30,10,10,0.92);
  border: 1px solid rgba(200,80,80,0.3);
  color: rgba(220,120,120,0.9);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.pwa-offline[hidden] { display: none; }

/* ============================================
   PWA — SAFE AREA + STANDALONE MODE
   ============================================ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .pwa-banner {
    bottom: calc(24px + env(safe-area-inset-bottom));
  }
  .pwa-offline {
    bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

/* When running as installed PWA (standalone) */
@media (display-mode: standalone) {
  .nav {
    padding-top: env(safe-area-inset-top);
    height: calc(var(--nav-h) + env(safe-area-inset-top));
  }
  /* Hide install banner when already installed */
  .pwa-banner { display: none !important; }
}

/* Window Controls Overlay (desktop PWA) */
@media (display-mode: window-controls-overlay) {
  .nav__inner {
    padding-top: env(titlebar-area-height, 0);
    padding-left: max(env(titlebar-area-x, 32px), 32px);
    padding-right: max(calc(100vw - env(titlebar-area-x, 0px) - env(titlebar-area-width, 100vw) + 32px), 32px);
    -webkit-app-region: drag;
  }
  .nav__links, .nav__logo, .nav__hamburger {
    -webkit-app-region: no-drag;
  }
}

@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   PWA — INSTALL SECTION
   ============================================ */
.pwa-install-section {
  padding: 96px 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.pwa-install-inner {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 80px;
  align-items: center;
}

/* ── Phone mockup ── */
.pwa-install-visual {
  position: relative;
  height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwa-phone {
  position: absolute;
  border-radius: 28px;
  border: 1.5px solid rgba(255,255,255,0.1);
  background: #0e0e0e;
  box-shadow: 0 24px 60px rgba(0,0,0,0.7), inset 0 0 0 1px rgba(255,255,255,0.04);
  overflow: hidden;
}

.pwa-phone--back {
  width: 160px;
  height: 290px;
  transform: rotate(-8deg) translateX(-60px) translateY(20px);
  opacity: 0.5;
  z-index: 1;
}

.pwa-phone--front {
  width: 180px;
  height: 320px;
  transform: rotate(3deg) translateX(20px);
  z-index: 2;
}

.pwa-phone__notch {
  width: 60px;
  height: 10px;
  background: #0e0e0e;
  border-radius: 0 0 8px 8px;
  margin: 0 auto;
  position: relative;
  z-index: 3;
  margin-top: 8px;
}

.pwa-phone__screen {
  padding: 8px 10px 12px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pwa-phone__bar {
  height: 8px;
  background: rgba(198,166,100,0.15);
  border-radius: 2px;
  width: 60%;
  margin-top: 12px;
}

.pwa-phone__icon-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 8px;
}

.pwa-phone__app-icon img {
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
}

.pwa-phone__app-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.5);
}

.pwa-phone__mini-nav {
  background: rgba(17,17,17,0.95);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin: -8px -10px 0;
}

.pwa-phone__mini-hero {
  padding: 12px 4px 8px;
  flex: 1;
}

.pwa-phone__mini-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin: 0 -10px -12px;
}

.pwa-phone__mini-tile {
  height: 40px;
  opacity: 0.8;
}

.pwa-phone__home-bar {
  width: 50px;
  height: 3px;
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
  margin: 0 auto 6px;
}

.pwa-install-badge {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-gold);
  color: #111;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 7px 16px;
  border-radius: 0;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(198,166,100,0.4);
  animation: floatBadge 3s ease-in-out infinite;
}

@keyframes floatBadge {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(-5px); }
}

/* ── Copy ── */
.pwa-install-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.pwa-install-desc {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 36px;
  max-width: 440px;
}

/* ── Benefits list ── */
.pwa-benefits {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 40px;
}

.pwa-benefit {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.pwa-benefit__icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gold-dim);
  border: 1px solid var(--accent-gold-border);
  color: var(--accent-gold);
}

.pwa-benefit__icon svg {
  width: 16px;
  height: 16px;
}

.pwa-benefit strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.pwa-benefit span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Actions ── */
.pwa-install-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}

.pwa-section-install-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 14px 28px;
}

/* Hide install btn if already installed */
@media (display-mode: standalone) {
  .pwa-section-install-btn { display: none !important; }
  .pwa-install-section { display: none; }
}

.pwa-install-manual {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-subtle);
  flex-wrap: wrap;
}

.pwa-install-manual svg {
  color: var(--text-subtle);
}

/* ── Responsive ── */
/* Platform hints */
.pwa-platform-hint {
  margin-top: 4px;
  width: 100%;
}

.pwa-hint {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: rgba(198,166,100,0.05);
  border: 1px solid var(--accent-gold-border);
  border-left: 3px solid var(--accent-gold);
  animation: slideDown 300ms cubic-bezier(0.16,1,0.3,1);
}

.pwa-hint__step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.pwa-hint__step strong {
  color: var(--text-primary);
}

.pwa-hint__num {
  min-width: 20px;
  height: 20px;
  background: var(--accent-gold);
  color: #111;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

@media (max-width: 900px) {
  .pwa-install-inner {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }
  .pwa-install-visual {
    height: 280px;
  }
  .pwa-phone--back { transform: rotate(-6deg) translateX(-50px) translateY(10px); }
  .pwa-phone--front { transform: rotate(2deg) translateX(15px); }
  .pwa-install-desc { margin-left: auto; margin-right: auto; }
  .pwa-install-actions { align-items: center; }
  .pwa-benefit { text-align: left; }
  .pwa-install-badge { bottom: 8px; }
}
