/* ──────────────────────────────────────────────────────────────
   Charles Marketing Website — Swiss International Typographic Style
   Dramatic scale contrast · heavy rules · flush-left editorial grid
   Design tokens mirror lib/core/theme/charles_theme.dart
   ────────────────────────────────────────────────────────────── */

:root {
  /* Colors — boosted contrast for screen readability */
  --bg: #FFFFFF;
  --text: #0A0A0A;                    /* near-pure black for maximum punch */
  --text-body: #2B2B2B;               /* body copy, higher contrast than the app's textMid */
  --text-dim: #6B6B6B;                /* labels, secondary info */
  --text-ghost: #BFBFBF;              /* placeholder text, tertiary */
  --rule: #E4E4E4;                    /* light dividers */
  --rule-heavy: #0A0A0A;              /* heavy section dividers */
  --surface: #F5F5F5;
  --charles-orange: #E8840E;

  /* Scale — 8px grid */
  --brand-radius: 32px;
  --page-margin: clamp(24px, 6vw, 96px);
  --content-max: 1360px;

  /* Type */
  --font-heading: 'Space Grotesk', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Layout rhythm */
  --section-gap-y: clamp(80px, 10vw, 160px);
  --section-gap-y-half: clamp(40px, 5vw, 80px);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'kern' 1, 'ss01' 1;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-heading);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--text); }

/* ── Layout ─────────────────────────────────────────────────── */

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

.rule-heavy {
  width: 100%;
  max-width: var(--content-max);
  height: 3px;
  background: var(--rule-heavy);
  margin: 0 auto;
}

.rule {
  height: 1px;
  background: var(--rule);
  margin: 0;
}

/* ── Typography — Swiss editorial scale ─────────────────────── */

/* Display: the big hero headline. Huge on desktop, still big on mobile. */
.display {
  font-family: var(--font-heading);
  font-size: clamp(56px, 11vw, 144px);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--text);
}

/* Section titles (one per section, flush-left) */
.section-title {
  font-family: var(--font-heading);
  font-size: clamp(40px, 6vw, 88px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--text);
}

/* Section number label: "01 / METHOD" — big mono, strong presence */
.section-num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
}

/* Column / sub-section heading in mono label style */
.mono-label-big {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
}

/* Small mono label — for tiny metadata */
.mono-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* Body lede — readable, stronger than the app's textMid */
.body-lede {
  font-family: var(--font-heading);
  font-size: clamp(17px, 1.4vw, 20px);
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-body);
}

/* Subtitle / supporting line under a big headline */
.hero-lede {
  font-family: var(--font-heading);
  font-size: clamp(19px, 1.6vw, 24px);
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-body);
  max-width: 30ch;
}

/* ── Section scaffolding ────────────────────────────────────── */

section {
  padding: var(--section-gap-y) 0;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 24px;
  margin-bottom: clamp(40px, 5vw, 80px);
}

.section-header .section-num {
  flex-shrink: 0;
}

.section-header .section-num::after {
  content: '';
  display: inline-block;
  width: clamp(24px, 3vw, 48px);
  height: 2px;
  background: var(--text);
  margin-left: 16px;
  vertical-align: middle;
}

/* ── Hero ───────────────────────────────────────────────────── */

.hero {
  padding: clamp(20px, 2.5vw, 40px) 0 var(--section-gap-y);
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(28px, 4vw, 56px);
}

.hero-logo {
  width: 44px;
  height: 44px;
}

.hero-num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}

.hero-text {
  display: flex;
  flex-direction: column;
}

.hero-title {
  margin-bottom: clamp(32px, 4vw, 56px);
}

.hero-lede {
  margin-bottom: clamp(40px, 5vw, 64px);
}

.hero-phone {
  display: flex;
  justify-content: flex-end;
  padding-top: 20px;
}

/* ── Phone frame ────────────────────────────────────────────── */

.phone-frame {
  width: 280px;
  height: 606px;
  background: var(--surface);
  border: 3px solid var(--text);
  border-radius: 44px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.12);
}

.phone-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.phone-frame-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  position: relative;
}

.phone-frame-placeholder::before {
  content: '';
  position: absolute;
  inset: 20px;
  border: 1px solid var(--rule);
}

.phone-frame-placeholder span {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-ghost);
  position: relative;
  z-index: 1;
}

/* ── Columns (method + process) ─────────────────────────────── */

.columns-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(32px, 4vw, 64px);
  position: relative;
}

.column {
  position: relative;
  padding-top: 24px;
}

/* Thin rule at the top of each column */
.column::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--text);
}

.column-number {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.column-label {
  margin-bottom: 20px;
}

/* ── Screenshot gallery ─────────────────────────────────────── */

.gallery {
  padding: var(--section-gap-y) 0;
}

.gallery-scroll {
  overflow: hidden;
  padding: clamp(24px, 4vw, 48px) 0 8px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%);
}

.gallery-track {
  display: flex;
  gap: clamp(20px, 3vw, 48px);
  width: max-content;
  animation: gallery-marquee 90s linear infinite;
}

.gallery-track:hover {
  animation-play-state: paused;
}

@keyframes gallery-marquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-track { animation: none; }
}

.gallery-item {
  flex: 0 0 260px;
}

.gallery-item .phone-frame {
  width: 240px;
  height: 520px;
  border-radius: 36px;
  border-width: 2.5px;
  box-shadow: none;
}

/* ── CTA ────────────────────────────────────────────────────── */

.cta {
  padding: var(--section-gap-y) 0;
  text-align: center;
}

.cta .section-header {
  justify-content: center;
}

.cta-title {
  font-family: var(--font-heading);
  font-size: clamp(48px, 8vw, 112px);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin-bottom: 32px;
  max-width: 18ch;
  margin-left: auto;
  margin-right: auto;
}

.cta-lede {
  font-family: var(--font-heading);
  font-size: clamp(17px, 1.3vw, 19px);
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-body);
  margin-bottom: 48px;
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
}

/* ── App Store badge ────────────────────────────────────────── */

.badge-group {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.badge-group--centered {
  align-items: center;
}

.badge-coming-soon {
  color: var(--charles-orange);
  font-weight: 600;
  letter-spacing: 0.18em;
}

.appstore-badge {
  height: 52px;
  width: auto;
  display: block;
}

.appstore-link {
  display: inline-block;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.appstore-link:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.appstore-badge--disabled {
  opacity: 0.45;
  filter: grayscale(1);
  cursor: not-allowed;
  user-select: none;
  pointer-events: none;
}

/* ── Footer ─────────────────────────────────────────────────── */

.footer {
  padding: 48px 0 64px;
  border-top: 1px solid var(--rule);
  margin-top: 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-company {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.footer-links {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--text);
  text-transform: uppercase;
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
}

.footer-links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms ease-out;
}

.footer-links a:hover::after {
  transform: scaleX(1);
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero-phone {
    justify-content: center;
    padding-top: 0;
  }

  .hero-lede {
    max-width: 100%;
  }

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

  .section-header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .phone-frame {
    width: 240px;
    height: 520px;
    border-radius: 36px;
  }

  .gallery-item {
    flex: 0 0 200px;
  }

  .gallery-item .phone-frame {
    width: 200px;
    height: 433px;
    border-radius: 32px;
  }

  .hero-top {
    margin-bottom: 48px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Legal pages ────────────────────────────────────────────── */

.legal-content {
  padding: 48px 0 96px;
  max-width: 720px;
}

.legal-content h1 {
  font-family: var(--font-heading);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.0;
  margin-bottom: 12px;
}

.legal-content h2 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 48px;
  margin-bottom: 16px;
  color: var(--text);
}

.legal-content h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  margin-top: 28px;
  margin-bottom: 10px;
  color: var(--text);
}

.legal-content p {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-body);
  margin-bottom: 18px;
}

.legal-content ul, .legal-content ol {
  padding-left: 24px;
  margin-bottom: 18px;
}

.legal-content li {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-body);
  margin-bottom: 6px;
}

.legal-content strong {
  color: var(--text);
  font-weight: 600;
}

.legal-content a {
  color: var(--charles-orange);
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  margin-bottom: 48px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--text-dim);
}

.legal-back:hover {
  color: var(--text);
  border-bottom-color: var(--text);
}
