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

:root {
  --bg-primary:     #0a0d14;
  --bg-secondary:   #111520;
  --accent-gold:    #c8a96e;
  --accent-gold-lt: #e0c99a;
  --text-primary:   #f0ece4;
  --text-muted:     #8a8fa8;
  --border:         #1e2435;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Libre Baskerville', serif;
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}

/* ── HEADER ─────────────────────────────── */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
}

.menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 8px;
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
  touch-action: manipulation;
}

.menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--text-muted);
  transition: background-color 0.2s;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.logo-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.logo-beta {
  font-family: 'DM Mono', monospace;
  font-size: 0.55rem;
  font-weight: 500;
  color: var(--accent-gold);
  letter-spacing: 0.15em;
  border: 1px solid var(--accent-gold);
  padding: 2px 5px;
  border-radius: 3px;
  vertical-align: middle;
}

.search-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
}

/* hover apenas em dispositivos que suportam */
@media (hover: hover) {
  .menu-btn:hover span  { background-color: var(--accent-gold); }
  .search-btn:hover     { color: var(--accent-gold); }
}

/* ── SIDEBAR ─────────────────────────────── */

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: min(300px, 85vw);
  height: 100%;
  height: 100dvh;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border);
  z-index: 300;
  padding: 28px 20px;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sidebar.active {
  transform: translateX(0);
}

.sidebar-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  position: absolute;
  top: 12px;
  right: 12px;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.sidebar-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 20px;
  margin-top: 8px;
}

.sidebar-nav ul {
  list-style: none;
}

.sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.sidebar-link {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.badge-construction {
  font-family: 'DM Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 3px 6px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── SEARCH OVERLAY ─────────────────────── */

.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  z-index: 400;
  padding: 8px 16px;
  transform: translateY(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-overlay.active {
  transform: translateY(0);
}

.search-container {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 700px;
  margin: 0 auto;
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-family: 'Libre Baskerville', serif;
  font-size: 1rem; /* >= 16px — evita zoom no iOS */
  padding: 10px 4px;
  outline: none;
  min-height: 44px;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-bottom-color: var(--accent-gold);
}

.search-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  touch-action: manipulation;
}

/* ── MAIN ────────────────────────────────── */

main {
  padding-top: 60px;
}

/* ── HERO — mobile base ─────────────────── */

.hero {
  min-height: calc(100vh - 60px);
  min-height: calc(100dvh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: 620px;
  width: 100%;
  text-align: center;
}

.beta-tag {
  display: inline-block;
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
  padding: 4px 12px;
  border-radius: 3px;
  margin-bottom: 32px;
  text-transform: uppercase;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.6rem, 11vw, 5rem);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin-bottom: 16px;
}

.hero-tagline {
  font-family: 'Playfair Display', serif;
  font-size: clamp(0.95rem, 3.5vw, 1.15rem);
  font-style: italic;
  color: var(--accent-gold-lt);
  margin-bottom: 28px;
  line-height: 1.45;
}

.hero-description {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.85;
  max-width: 520px;
  margin: 0 auto;
}

/* ── CALCULADORAS — mobile base ─────────── */

.calculadoras-section {
  padding: 48px 20px;
  max-width: 900px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.section-line {
  flex: 1;
  height: 1px;
  background-color: var(--border);
}

/* mobile: 1 coluna */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.card {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s;
  -webkit-user-select: none;
  user-select: none;
}

/* active state para toque mobile */
.card:active:not(.card--dev) {
  border-color: var(--accent-gold);
  opacity: 0.9;
}

.card--dev {
  opacity: 0.5;
  cursor: default;
}

.card-icon {
  font-family: 'DM Mono', monospace;
  font-size: 1.1rem;
  color: var(--accent-gold);
  margin-bottom: 14px;
  line-height: 1;
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.3;
}

.card-desc {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 16px;
}

.card-cta {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent-gold);
  letter-spacing: 0.04em;
}

.card-dev-badge {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 3px;
  width: fit-content;
  text-transform: uppercase;
}

/* ── DEV SECTION ─────────────────────────── */

.dev-section {
  margin-top: 48px;
}

.dev-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 400;
  font-style: italic;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── FOOTER — mobile base ────────────────── */

.footer {
  border-top: 1px solid var(--border);
  padding: 44px 20px;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.footer-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 10px;
}

.disclaimer-text {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.8;
  font-style: italic;
}

.footer-email {
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  display: inline-block;
  min-height: 44px;
  line-height: 44px;
}

.footer-copy {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  opacity: 0.4;
}

/* ── TABLET / DESKTOP ────────────────────── */

@media (min-width: 480px) {
  /* 2 colunas a partir de telas mais largas */
  .cards-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 768px) {
  .header {
    padding: 0 24px;
  }

  .hero {
    padding: 60px 32px;
  }

  .calculadoras-section {
    padding: 72px 32px;
  }

  .footer {
    padding: 56px 32px;
  }

  /* hover apenas em dispositivos com mouse */
  .card:hover:not(.card--dev) {
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    transition: border-color 0.25s, transform 0.25s;
  }

  .footer-email:hover {
    color: var(--accent-gold);
  }
}
