:root {
  --bg: #000000;
  --bg-card: #0d0d0d;
  --bg-elevated: #141414;
  --red: #e10600;
  --red-glow: rgba(225, 6, 0, 0.35);
  --text: #ffffff;
  --text-muted: #a0a0a0;
  --border: #222;
  --radius: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ========== HEADER ========== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-wrap img {
  height: 34px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.logo-text {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
}

.logo-text span {
  color: var(--red);
}

.install-btn {
  background: var(--red);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: none;
}

.install-btn.show {
  display: block;
}

/* ========== HERO ========== */
.hero {
  position: relative;
  height: 52vh;
  min-height: 320px;
  max-height: 520px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #000 0%, transparent 55%, rgba(0,0,0,0.4) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 24px 20px 28px;
  width: 100%;
}

.hero-content h1 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 6px;
}

.hero-content .tagline {
  color: var(--red);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.5px;
}

/* ========== MAIN CONTENT ========== */
.main {
  flex: 1;
  padding: 20px 16px 100px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
  font-weight: 600;
}

/* Cards */
.cards {
  display: grid;
  gap: 12px;
  margin-bottom: 32px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.card:active {
  transform: scale(0.98);
  background: var(--bg-elevated);
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--red);
  opacity: 0;
  transition: opacity 0.2s;
}

.card:hover::before,
.card:active::before {
  opacity: 1;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
  border: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.card-body {
  flex: 1;
  min-width: 0;
}

.card-body h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 3px;
}

.card-body p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.35;
}

.card-arrow {
  color: var(--text-muted);
  font-size: 18px;
}

/* Quotes */
.quotes {
  margin-bottom: 28px;
}

.quote {
  background: var(--bg-card);
  border-left: 3px solid var(--red);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 18px;
  margin-bottom: 12px;
}

.quote p {
  font-size: 14.5px;
  line-height: 1.5;
  font-style: italic;
  margin-bottom: 8px;
}

.quote cite {
  font-size: 12px;
  color: var(--text-muted);
  font-style: normal;
}

/* Principles */
.principles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 28px;
}

.principle {
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
}

.principle strong {
  color: var(--red);
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.principle span {
  font-size: 13px;
  color: var(--text-muted);
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 calc(8px + var(--safe-bottom));
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 10px;
  transition: color 0.15s;
}

.nav-item.active,
.nav-item:active {
  color: var(--red);
}

.nav-item svg {
  width: 22px;
  height: 22px;
}

/* Offline banner */
.offline-banner {
  display: none;
  background: #1a1a1a;
  color: #ffcc00;
  text-align: center;
  padding: 8px;
  font-size: 13px;
  border-bottom: 1px solid #333;
}

.offline-banner.show {
  display: block;
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 20px 16px 30px;
  color: var(--text-muted);
  font-size: 12px;
}

.app-footer a {
  color: var(--red);
  text-decoration: none;
}

/* Responsive */
@media (min-width: 600px) {
  .hero-content h1 {
    font-size: 34px;
  }
  .cards {
    grid-template-columns: 1fr 1fr;
  }
  .principles {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* Install prompt toast */
.install-toast {
  position: fixed;
  bottom: 80px;
  left: 16px;
  right: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: none;
  z-index: 200;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

.install-toast.show {
  display: block;
  animation: slideUp 0.3s ease;
}

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

.install-toast p {
  font-size: 14px;
  margin-bottom: 12px;
}

.install-toast .actions {
  display: flex;
  gap: 10px;
}

.install-toast button {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.install-toast .btn-primary {
  background: var(--red);
  color: white;
}

.install-toast .btn-secondary {
  background: #222;
  color: var(--text);
}
