/* =========================================
   RallyCAP — V3 Stylesheet
   Yellow rally · petro.ad typography
   ========================================= */

:root {
  /* Palette — Yellow-first rally identity */
  --bg: #FFFF00;
  --bg-light: #ffffff;
  --bg-section: #f8f8f6;
  --bg-card: #ffffff;
  --bg-dark: #0a0a0a;
  --bg-elevated: #1a1a1a;
  --text: #0a0a0a;
  --text-muted: rgba(10, 10, 10, 0.5);
  --text-on-dark: #f5f5f0;
  --text-muted-on-dark: rgba(245, 245, 240, 0.45);
  --accent: #FFFF00;
  --accent-hover: #e6e600;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.12);
  --border-on-dark: rgba(255, 255, 255, 0.08);
  --border-strong-on-dark: rgba(255, 255, 255, 0.15);
  --danger: #FF2020;
  --orange: #FF8C00;

  /* Typography */
  --font-display: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', 'Consolas', monospace;

  /* Radii */
  --radius-card: 16px;
  --radius-btn: 12px;
  --radius-pill: 999px;
  --radius-input: 10px;

  /* Layout */
  --nav-height: 64px;
  --max-width: 1200px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 1rem);
}

body {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.65;
  background: var(--bg-light);
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* --- Typography — Title Case, tight kerning --- */
.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 3.5rem;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1rem;
}

.section-subtitle {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 3rem;
}

.label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* =========================================
   NAVIGATION — Dark bar
   ========================================= */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-on-dark);
}

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

.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav__logo img {
  height: 24px;
  width: auto;
  filter: invert(1);
}

.nav__hamburger {
  display: none;
  padding: 0.5rem;
  color: var(--text-on-dark);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav__link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted-on-dark);
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-pill);
  transition: color 0.2s, background 0.2s;
}

.nav__link:hover {
  color: var(--text-on-dark);
  background: rgba(255, 255, 255, 0.06);
}

.nav__lang {
  display: flex;
  gap: 0.125rem;
  margin-left: 0.75rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border-on-dark);
}

.nav__lang-btn {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: rgba(245, 245, 240, 0.3);
  padding: 0.3rem 0.4rem;
  border-radius: var(--radius-pill);
  transition: color 0.2s, background 0.2s;
  letter-spacing: 0.05em;
}

.nav__lang-btn:hover { color: var(--text-muted-on-dark); }
.nav__lang-btn.active {
  color: var(--accent);
  background: rgba(255, 255, 0, 0.08);
}

/* =========================================
   HERO — Yellow background
   ========================================= */
.hero {
  min-height: 100vh;
  padding-top: var(--nav-height);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.hero__content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 2rem;
  display: flex;
  align-items: flex-start;
  width: 100%;
}

.hero__left {
  flex: 1;
}

.hero__bearing {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(8rem, 18vw, 20rem);
  line-height: 0.85;
  color: var(--bg-dark);
  letter-spacing: -0.04em;
  cursor: default;
  user-select: none;
}

.hero__tagline {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.3rem;
  color: rgba(10, 10, 10, 0.55);
  margin-top: 1.5rem;
  letter-spacing: -0.01em;
}

.hero__cta {
  display: inline-block;
  margin-top: 2.5rem;
}

.hero__cta img {
  height: 54px;
  width: auto;
  transition: opacity 0.2s;
}

.hero__cta:hover img { opacity: 0.8; }

.hero__sub {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: rgba(10, 10, 10, 0.45);
  letter-spacing: 0.05em;
}

.hero__right {
  position: absolute;
  top: calc(var(--nav-height) + 2rem);
  right: 2rem;
}

/* Blue navigation arrow — matches RallyCAP app */
.hero__arrow-wrap {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: #fff;
  border: 3px dashed #007AFF;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  opacity: 0;
  animation: arrowFadeIn 0.8s ease-out 4s forwards;
}

@keyframes arrowFadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.hero__arrow {
  width: 100px;
  height: 135px;
  transition: transform 0.08s ease-out;
}

/* =========================================
   SECTION COMMON
   ========================================= */
section {
  padding: 6rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

/* =========================================
   SCREENSHOTS — Horizontal scroll gallery
   ========================================= */
.screenshots {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  overflow: hidden;
}

.screenshots .section-title {
  color: var(--text-on-dark);
}

.screenshots .section-subtitle {
  color: var(--text-muted-on-dark);
}

.screenshots__track {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.screenshots__track::-webkit-scrollbar {
  display: none;
}

.screenshots__scroll {
  display: flex;
  gap: 1.5rem;
  padding: 0 max(2rem, calc((100vw - var(--max-width)) / 2 + 2rem));
  padding-bottom: 1rem;
}

.screenshots__item {
  flex: 0 0 auto;
  width: 260px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease;
}

.screenshots__item:hover {
  transform: translateY(-4px);
}

.screenshots__item img {
  width: 100%;
  height: auto;
  display: block;
}

/* =========================================
   GUIDE — Light section
   ========================================= */
.guide {
  background: var(--bg-light);
  border-top: 1px solid var(--border);
}

.guide__grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.guide__card {
  background: var(--bg-section);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-card);
  padding: 2rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.guide__card:hover {
  border-color: rgba(0, 0, 0, 0.2);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

.guide__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(10, 10, 10, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.guide__icon svg {
  width: 20px;
  height: 20px;
}

.guide__card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.guide__card p {
  font-size: 0.8rem;
  line-height: 1.7;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.guide__card p:last-child { margin-bottom: 0; }

/* =========================================
   WAYPOINT REFERENCE — Dark section
   ========================================= */
.waypoints {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  border-top: none;
}

.waypoints .section-title {
  color: var(--text-on-dark);
}

.waypoints .section-subtitle {
  color: var(--text-muted-on-dark);
}

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

.wp-table-group__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.2rem;
  color: var(--text-on-dark);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.wp-table-wrap {
  overflow-x: auto;
}

.wp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.wp-table thead th {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted-on-dark);
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-strong-on-dark);
  white-space: nowrap;
}

.wp-table tbody tr {
  border-bottom: 1px solid var(--border-on-dark);
  transition: background 0.15s;
}

.wp-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.wp-table td {
  padding: 0.65rem 0.75rem;
  vertical-align: top;
  color: var(--text-on-dark);
  white-space: nowrap;
}

.wp-table td:nth-child(2) {
  white-space: normal;
  min-width: 140px;
}

.wp-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.75rem;
  line-height: 1;
}

.wp-code {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-on-dark);
  display: block;
  margin-bottom: 0.15rem;
}

.wp-desc {
  font-size: 0.7rem;
  color: var(--text-muted-on-dark);
  line-height: 1.5;
  display: block;
}

/* =========================================
   MAP CTA — Yellow accent
   ========================================= */
.map-cta {
  background: var(--bg-section);
  border-top: 1px solid var(--border);
}

.map-cta__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.map-cta__card {
  background: var(--bg);
  border: none;
  border-radius: 24px;
  padding: 4rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.map-cta__icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(10, 10, 10, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.map-cta__card h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 2rem;
  letter-spacing: -0.03em;
  color: var(--bg-dark);
}

.map-cta__card p {
  font-size: 0.85rem;
  color: rgba(10, 10, 10, 0.55);
  max-width: 500px;
  line-height: 1.6;
}

.map-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.875rem 2rem;
  background: var(--bg-dark);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: var(--radius-btn);
  transition: background 0.2s, transform 0.15s;
}

.map-cta__btn:hover {
  background: #1a1a1a;
  transform: translateY(-1px);
}

.map-cta__btn svg {
  width: 18px;
  height: 18px;
}

/* =========================================
   MADE BY — Dark section
   ========================================= */
.made-by {
  background: var(--bg-dark);
  border-top: none;
}

.made-by__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 3rem;
}

.made-by__brand {
  flex: 0 0 auto;
  text-align: center;
}

.made-by__logo {
  height: 40px;
  width: auto;
  filter: invert(1);
  opacity: 0.9;
  margin-bottom: 0.5rem;
}

.made-by__tagline {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted-on-dark);
}

.made-by__bio {
  flex: 1;
}

.made-by__bio p {
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-muted-on-dark);
}

.made-by__bio strong {
  color: var(--text-on-dark);
  font-weight: 500;
}

.made-by__email {
  display: inline-block;
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.02em;
  transition: opacity 0.2s;
}

.made-by__email:hover { opacity: 0.7; }

.made-by__cta {
  flex: 0 0 auto;
}

.made-by__appstore img {
  height: 44px;
  width: auto;
  transition: opacity 0.2s;
}

.made-by__appstore:hover img { opacity: 0.8; }
  transition: color 0.2s;
}

.contact__credit:hover { color: var(--text-muted); }

/* =========================================
   FOOTER — Dark
   ========================================= */
.footer {
  background: var(--bg-dark);
  border-top: none;
  padding: 2rem 0;
}

.footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer__brand img { height: 20px; width: auto; opacity: 0.5; filter: invert(1); }

.footer__copy {
  font-size: 0.7rem;
  color: var(--text-muted-on-dark);
}

.footer__links {
  display: flex;
  gap: 1.5rem;
}

.footer__links a {
  font-size: 0.7rem;
  color: var(--text-muted-on-dark);
  transition: color 0.2s;
}

.footer__links a:hover { color: var(--text-on-dark); }

.footer__lang {
  display: flex;
  gap: 0.125rem;
}

/* =========================================
   RESPONSIVE — Tablet (768px)
   ========================================= */
@media (max-width: 768px) {
  .nav__hamburger { display: block; }

  .nav__links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 999;
  }

  .nav__links--open { display: flex; }

  .nav__link {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
  }

  .nav__lang {
    margin-left: 0;
    border-left: none;
    padding-left: 0;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-on-dark);
  }

  .hero__content { flex-direction: column; }
  .hero__left { flex: none; width: 100%; }
  .hero__right { top: calc(var(--nav-height) + 1.5rem); right: 1.5rem; }

  .hero__arrow-wrap { width: 140px; height: 140px; }
  .hero__arrow { width: 70px; height: 94px; }

  .screenshots__item { width: 220px; }
  .screenshots__scroll { gap: 1rem; }

  .guide__grid { grid-template-columns: 1fr; padding: 0 1.5rem; }

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

  .made-by__inner { flex-direction: column; text-align: center; gap: 2rem; padding: 0 1.5rem; }

  .map-cta__card { padding: 3rem 2rem; }
  .map-cta__inner { padding: 0 1.5rem; }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 1.5rem;
  }

  section { padding: 4rem 0; }
  .section-title { font-size: 2.5rem; }
}

/* =========================================
   RESPONSIVE — Mobile (480px)
   ========================================= */
@media (max-width: 480px) {
  .section-title { font-size: 2rem; }

  .hero__bearing { font-size: clamp(5rem, 28vw, 10rem); }
  .hero__tagline { font-size: 1rem; }

  .hero__right { top: calc(var(--nav-height) + 1rem); right: 1rem; }
  .hero__arrow-wrap { width: 110px; height: 110px; }
  .hero__arrow { width: 55px; height: 74px; }

  .wp-table { font-size: 0.7rem; }
  .wp-badge { width: 26px; height: 26px; font-size: 0.65rem; }
  .wp-desc { display: none; }

  .map-cta__card { padding: 2.5rem 1.5rem; }
  .map-cta__card h2 { font-size: 1.5rem; }

  section { padding: 3rem 0; }
}
