/* Brand fonts */
@font-face {
  font-family: 'Formula1';
  src: url('../fonts/Formula1-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Formula1';
  src: url('../fonts/Formula1-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Formula1 Wide';
  src: url('../fonts/Formula1-Wide.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Banner-inspired palette: deep black with a vivid red accent */
  --f1-red: #FF2A2A;         /* brighter red like the WATCH text */
  --f1-dark: #0C0C0C;        /* near-black background similar to banner */
  /* Derived neutrals from the dark base */
  --f1-light: color-mix(in oklab, var(--f1-dark) 88%, white 12%);
  --f1-silver: color-mix(in oklab, var(--f1-dark) 68%, white 32%);
  --text-primary: #f5f5f5;
  --text-secondary: color-mix(in oklab, white 78%, var(--f1-dark) 22%);
  --shadow: rgba(0,0,0,0.5);

  --radius: 12px;            /* Constants.UI.cornerRadius */
  --radius-sm: 8px;
  --radius-lg: 16px;
  --spacing-xs: 4px;         /* Constants.Spacing */
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-xxl: 48px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
/* Prevent iOS Safari from auto-boosting font sizes on small screens and add fluid base font sizing */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Fluid base font-size: scales down slightly on narrow screens and caps at 16px on desktop */
  font-size: clamp(14px, 1.6vw, 16px);
}
body {
  margin: 0;
  background: var(--f1-dark);
  color: var(--text-primary);
  /* Use system font for body text for better readability and spacing on mobile */
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}

/* Use brand font for headings only */
h1, h2, h3, .brand-name { font-family: 'Formula1 Wide', 'Formula1', sans-serif; }
/* Fluid heading sizes for responsiveness */
h1 { font-size: clamp(1.6rem, 4.2vw, 2.3rem); line-height: 1.15; }
h2 { font-size: clamp(1.35rem, 3.6vw, 2rem); line-height: 1.2; }
h3 { font-size: clamp(1.05rem, 2.8vw, 1.35rem); line-height: 1.25; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: saturate(180%) blur(6px);
  background: color-mix(in oklab, var(--f1-dark) 85%, black 15%);
  border-bottom: 1px solid var(--f1-light);
  z-index: 10;
}
.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) 0;
}
.brand-link { display: inline-flex; align-items: center; gap: var(--spacing-sm); text-decoration: none; color: var(--text-primary); }
.logo-img { height: 36px; width: auto; display: block; border-radius: 6px; }
.brand-name { font-family: 'Formula1 Wide', 'Formula1', sans-serif; font-weight: 700; font-size: clamp(1rem, 2.4vw, 1.25rem); letter-spacing: 0.5px; }
.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--f1-light);
  color: var(--text-secondary);
  text-decoration: none;
  margin-left: var(--spacing-sm);
}
.social a:hover {
  border-color: var(--f1-silver);
  color: var(--text-primary);
}
.social-icon { font-weight: 700; font-size: 0.9rem; }

.hero {
  padding: var(--spacing-xxl) 0 var(--spacing-xl);
  background:
    radial-gradient(1200px 600px at 10% 20%, color-mix(in oklab, var(--f1-red) 18%, transparent 82%), transparent 60%),
    linear-gradient(135deg, color-mix(in oklab, var(--f1-red) 6%, var(--f1-dark) 94%), var(--f1-dark));
  position: relative;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(45deg, transparent 0, transparent 48px, color-mix(in oklab, var(--f1-red) 6%, transparent 94%) 48px, color-mix(in oklab, var(--f1-red) 6%, transparent 94%) 52px);
  opacity: 0.35;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--spacing-xl);
}
.hero-copy h1 {
  margin: 0 0 var(--spacing-sm);
  font-family: 'Formula1 Wide', 'Formula1', sans-serif;
  /* Slightly smaller across all viewports */
  font-size: clamp(1.6rem, 4.2vw, 2.3rem);
}
.tagline { color: var(--text-secondary); margin-bottom: var(--spacing-lg); font-size: clamp(0.95rem, 2.6vw, 1.05rem); }
.feature-highlights {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--spacing-lg);
}
.feature-highlights li {
  margin: 0 0 var(--spacing-sm);
  padding-left: 1.2em;
  position: relative;
  font-size: clamp(0.95rem, 2.6vw, 1.05rem);
}
.feature-highlights li::before {
  content: '\25B6'; /* triangle */
  position: absolute;
  left: 0;
  color: var(--f1-red);
  transform: scale(0.9);
}

.cta { display: flex; gap: var(--spacing-sm); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  font-size: clamp(0.95rem, 2.6vw, 1rem);
  border-radius: var(--radius);
  border: 1px solid var(--f1-light);
  text-decoration: none;
  color: var(--text-primary);
}
.btn-primary { background: var(--f1-red); border-color: var(--f1-red); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-secondary { background: transparent; border-color: var(--f1-silver); }
.btn-secondary:hover { border-color: var(--f1-red); }

.hero-art .app-card {
  border-radius: var(--radius-lg);
  background: var(--f1-light);
  border: 1px solid var(--f1-silver);
  box-shadow: 0 10px 24px var(--shadow);
  overflow: hidden;
}
.hero-art img { width: 100%; height: auto; display: block; }

/* Single transparent hero image replacement */
.hero-art .hero-image {
  width: clamp(220px, 32vw, 420px);
  height: auto;
  display: block;
  margin-left: auto; /* align to the right column edge like the previous device stack */
  filter: drop-shadow(0 18px 30px rgba(0,0,0,0.55));
}

/* Device stack inspired by app landing pages */
.device-stack { position: relative; width: clamp(220px, 32vw, 380px); aspect-ratio: 1 / 1; margin-left: auto; }
.device { position: absolute; width: 100%; height: 100%; object-fit: contain; }
.device-back { transform: rotate(12deg) translate(-22px, 18px) scale(0.94); filter: drop-shadow(0 16px 24px rgba(0,0,0,0.5)); opacity: 0.85; z-index: 1; }
.device-front { transform: rotate(-3deg) translate(10px, 6px); filter: drop-shadow(0 18px 30px rgba(0,0,0,0.65)); z-index: 3; }
.device-screen { position: absolute; top: 10%; left: 10%; width: 80%; height: 80%; object-fit: cover; border-radius: 22px; box-shadow: 0 10px 24px rgba(0,0,0,0.45); z-index: 2; }

.features { padding: var(--spacing-xxl) 0; }
.features h2 { margin-top: 0; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-lg);
}
.feature-card {
  background: var(--f1-light);
  border: 1px solid var(--f1-silver);
  border-radius: var(--radius);
  padding: var(--spacing-lg);
}
.feature-card p { font-size: clamp(0.95rem, 2.8vw, 1.05rem); }
.feature-card h3 { margin-top: 0; }

.screenshots { padding: var(--spacing-xxl) 0; }
.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-lg);
}
.screenshots-grid img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--f1-silver);
  box-shadow: 0 6px 16px var(--shadow);
}
.note { color: var(--text-secondary); }

.newsletter { padding: var(--spacing-xxl) 0; background: linear-gradient(180deg, transparent, rgba(64,64,64,0.3)); }
.subscribe-form {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  margin-top: var(--spacing-md);
}
.subscribe-form input[type="email"] {
  flex: 1 1 360px;
  /* Trim vertical size for a sleeker field */
  padding: 8px 12px;
  height: 40px; /* enforce a compact height on mobile */
  line-height: 1.2;
  -webkit-appearance: none;
  appearance: none;
  font-size: 16px; /* prevents iOS input zoom while keeping height compact */
  border-radius: var(--radius);
  border: 1px solid var(--f1-silver);
  background: #303030;
  color: var(--text-primary);
}
.subscribe-form button { min-height: 40px; }
.subscribe-form input::placeholder { color: #9e9e9e; }
.form-message { margin-top: var(--spacing-sm); min-height: 1.2em; }
.privacy { color: var(--text-secondary); font-size: 0.9rem; }

.web-demo { padding: var(--spacing-xxl) 0; }

.site-footer {
  border-top: 1px solid var(--f1-light);
  padding: var(--spacing-lg) 0;
}
.footer-content { display: flex; align-items: center; justify-content: space-between; }
.footer-link { color: var(--text-secondary); text-decoration: none; }
.footer-link:hover { color: var(--text-primary); }
.divider { color: var(--f1-silver); margin: 0 var(--spacing-sm); }
.disclaimer { margin-top: var(--spacing-sm); color: var(--text-secondary); font-size: 0.85rem; line-height: 1.4; }

/* Banner strip (no text image, only gradient using the two brand colors) */
.brand-banner {
  height: 96px;
  border-bottom: 1px solid var(--f1-light);
  background: linear-gradient(90deg, color-mix(in oklab, var(--f1-red) 30%, transparent 70%), var(--f1-dark) 55%, color-mix(in oklab, var(--f1-red) 15%, var(--f1-dark) 85%) 100%);
}

.visually-hidden { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* Responsive */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .features-grid { grid-template-columns: 1fr; }
  .screenshots-grid { grid-template-columns: 1fr; }
}

/* --- Custom adjustments (banner, header nav, newsletter elevation) --- */
/* Right-side primary navigation */
.primary-nav { display: inline-flex; gap: var(--spacing-md); }
.primary-nav a { color: var(--text-secondary); text-decoration: none; padding-bottom: 2px; border-bottom: 2px solid transparent; font-size: clamp(0.95rem, 2.4vw, 1rem); }
.primary-nav a:hover { color: var(--text-primary); border-bottom-color: var(--f1-red); }

/* Adapt banner to container and soften corners */
.brand-banner .container { padding: 0 var(--spacing-lg); }
.brand-banner img { border-radius: var(--radius-sm); }

/* Elevated newsletter card */
.newsletter-card { background: #303030; border: 1px solid var(--f1-light); border-radius: var(--radius-lg); padding: var(--spacing-xl); box-shadow: 0 12px 28px var(--shadow); }

/* Social links below newsletter */
.newsletter-social { margin-top: var(--spacing-md); display: flex; gap: var(--spacing-sm); }
.social-pill { display: inline-flex; align-items: center; justify-content: center; height: 34px; padding: 0 var(--spacing-md); border-radius: 18px; background: #262626; border: 1px solid var(--f1-light); color: var(--text-secondary); text-decoration: none; }
.social-pill:hover { color: var(--text-primary); border-color: var(--f1-red); }

/* --- Mobile optimizations (override defaults below 640px and 380px) --- */
@media (max-width: 640px) {
  .container { padding: 0 var(--spacing-md); }
  .header-content { flex-wrap: wrap; gap: var(--spacing-sm); }
  .logo-img { height: 30px; }
  .brand-name { display: none; }
  .primary-nav { width: 100%; justify-content: center; flex-wrap: wrap; gap: var(--spacing-sm); }
  .hero { padding: var(--spacing-xl) 0 var(--spacing-lg); }
  .hero-copy h1 { font-size: clamp(1.45rem, 5.6vw, 2rem); }
  .cta { flex-direction: column; }
  .btn { width: 100%; }
  .hero-art .hero-image { width: clamp(200px, 60vw, 360px); max-width: 100%; margin: var(--spacing-md) auto 0; }
  .newsletter-card { padding: var(--spacing-lg); }
  .subscribe-form { flex-direction: column; }
  /* Make the newsletter title significantly smaller on phones */
  .newsletter-card h2 { font-family: 'Formula1', sans-serif; font-size: clamp(1.1rem, 5vw, 1.3rem); letter-spacing: 0.3px; }
  .subscribe-form input[type="email"],
  .subscribe-form button { width: 100%; }
  .subscribe-form input[type="email"] { height: 38px; padding: 8px 12px; }
  .subscribe-form button { height: 38px; padding: 8px 12px; }
  .features-grid { grid-template-columns: 1fr; }
  .feature-card { padding: var(--spacing-md); }
  .screenshots-grid { grid-template-columns: 1fr; }
  .footer-content { flex-direction: column; gap: var(--spacing-sm); text-align: center; }
  .disclaimer { text-align: center; }
}

@media (max-width: 380px) {
  .hero { padding: var(--spacing-lg) 0; }
  .hero-copy h1 { font-size: clamp(1.3rem, 6.4vw, 1.8rem); }
  .feature-highlights li { margin: 0 0 var(--spacing-xs); }
  .primary-nav a { padding: 6px 2px 2px; }
}

/* FAQ section styles */
.faq { padding: var(--spacing-xxl) 0; }
.faq h2 { margin-top: 0; }
.faq-list { display: grid; gap: var(--spacing-md); }
.faq-item { background: var(--f1-light); border: 1px solid var(--f1-silver); border-radius: var(--radius); overflow: hidden; }
.faq-item summary { cursor: pointer; list-style: none; padding: var(--spacing-md) var(--spacing-lg); font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--f1-red); font-weight: 700; }
.faq-item[open] summary::after { content: '−'; }
.faq-item .answer { padding: 0 var(--spacing-lg) var(--spacing-lg); color: var(--text-secondary); }

/* Ensure all media are responsive by default */
img, svg, video { max-width: 100%; height: auto; }