/* ============================================================
   CrownShift – Shared Design System
   Aesthetic: Luxury dark editorial with gold-crown motif
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,600&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --bg:           #0A0A0F;
  --bg-raised:    #0F0F16;
  --gold:         #D4A017;
  --gold-bright:  #E8B832;
  --gold-dim:     rgba(212, 160, 23, 0.18);
  --gold-border:  rgba(212, 160, 23, 0.22);
  --card-bg:      rgba(255, 255, 255, 0.035);
  --card-border:  rgba(255, 255, 255, 0.07);
  --text-primary: #F0EDE6;
  --text-secondary: #9CA3AF;
  --text-muted:   #6B7280;
  --success:      #10B981;
  --error:        #FCA5A5;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  --radius-sm:    8px;
  --radius-md:    14px;
  --radius-lg:    24px;
  --radius-xl:    36px;

  --shadow-gold:  0 0 48px rgba(212, 160, 23, 0.12), 0 0 120px rgba(212, 160, 23, 0.06);
  --shadow-card:  0 4px 32px rgba(0, 0, 0, 0.48);
  --shadow-deep:  0 24px 64px rgba(0, 0, 0, 0.64);

  --nav-height:   68px;
  --max-width:    1160px;
  --section-pad:  clamp(64px, 10vw, 120px);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Grain overlay for atmospheric depth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.028;
  pointer-events: none;
  z-index: 9999;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

/* ── Typography Scale ──────────────────────────────────────── */
.display-xl {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6.5vw, 5.6rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.display-lg {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 600;
  line-height: 1.1;
}

.display-md {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.2;
}

.label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.body-lg {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.body-md {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* ── Layout Utilities ──────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 48px);
}

.section {
  padding: var(--section-pad) 0;
}

.section-header {
  text-align: center;
  margin-bottom: clamp(48px, 6vw, 80px);
}

.section-header .label {
  display: block;
  margin-bottom: 16px;
}

/* ── Navigation ────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.nav.scrolled {
  background: rgba(10, 10, 15, 0.88);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--card-border);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.nav-crown {
  width: 34px;
  height: 34px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

.nav-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.footer-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-cta {
  padding: 9px 20px;
  background: var(--gold);
  color: #0A0A0F !important;
  border-radius: var(--radius-sm);
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  transition: background 0.2s, transform 0.15s !important;
  letter-spacing: 0.01em;
}

.nav-cta:hover {
  background: var(--gold-bright) !important;
  transform: translateY(-1px);
  color: #0A0A0F !important;
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--gold);
  color: #0A0A0F;
  box-shadow: 0 4px 20px rgba(212, 160, 23, 0.3);
}

.btn-primary:hover {
  background: var(--gold-bright);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(212, 160, 23, 0.4);
}

.btn-secondary {
  background: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--card-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

/* App Store badge button */
.btn-appstore {
  background: var(--text-primary);
  color: var(--bg);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  transition: all 0.2s;
}

.btn-appstore:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

.btn-appstore .appstore-icon {
  font-size: 24px;
  line-height: 1;
}

.btn-appstore .appstore-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
}

.btn-appstore .appstore-sub {
  font-size: 0.68rem;
  font-weight: 400;
  opacity: 0.7;
  margin-bottom: 2px;
}

.btn-appstore .appstore-main {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--bg);
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  border-color: var(--gold-border);
  transform: translateY(-4px);
  box-shadow: var(--shadow-gold), var(--shadow-card);
}

.card-icon {
  width: 52px;
  height: 52px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 20px;
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
}

/* ── Gold Divider ──────────────────────────────────────────── */
.gold-line {
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  margin: 20px 0;
}

.gold-line-center {
  width: 48px;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
  margin: 16px auto 0;
}

/* ── Section Separator ─────────────────────────────────────── */
.sep {
  border: none;
  border-top: 1px solid var(--card-border);
  margin: 0;
}

/* ── Footer ────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--card-border);
  padding: 48px 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
}

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

.footer-links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--gold);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Scroll-reveal animation ───────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── Phone Mockup ──────────────────────────────────────────── */
.phone-frame {
  position: relative;
  width: 260px;
  border-radius: 44px;
  background: #141418;
  padding: 12px 10px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.1), 0 32px 80px rgba(0,0,0,0.7), var(--shadow-gold);
  flex-shrink: 0;
  /* Force GPU compositing at full resolution to prevent transform-induced blur */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
}

.phone-frame::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 6px;
  background: #1e1e24;
  border-radius: 3px;
  z-index: 2;
}

.phone-screen {
  border-radius: 34px;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 9/19.5;
  background: var(--bg);
  /* Prevent image subpixel blurring inside the container */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.phone-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Ensure image is rasterized at native resolution on the GPU layer */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: transform;
}

/* ── Inner page hero (privacy / support) ───────────────────── */
.page-hero {
  padding: calc(var(--nav-height) + 60px) 0 60px;
  border-bottom: 1px solid var(--card-border);
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 600;
  margin-bottom: 12px;
}

.page-hero p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ── Prose (legal / support text) ─────────────────────────── */
.prose {
  max-width: 760px;
  margin: 0 auto;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 48px 0 16px;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--gold);
  margin: 28px 0 10px;
}

.prose p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
}

.prose ul {
  list-style: none;
  margin: 0 0 20px 0;
}

.prose ul li {
  color: var(--text-secondary);
  padding: 4px 0 4px 20px;
  position: relative;
  line-height: 1.7;
}

.prose ul li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--gold);
}

.prose a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose a:hover {
  color: var(--gold-bright);
}

.prose strong {
  color: var(--text-primary);
  font-weight: 600;
}

.prose .effective-date {
  display: inline-block;
  padding: 6px 14px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--gold);
  margin-bottom: 36px;
}

/* ── FAQ / Accordion ───────────────────────────────────────── */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.faq-item {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.3s;
}

.faq-item.open {
  border-color: var(--gold-border);
}

.faq-question {
  width: 100%;
  background: var(--card-bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  padding: 20px 24px;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: background 0.2s;
}

.faq-question:hover {
  background: rgba(255, 255, 255, 0.05);
}

.faq-chevron {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s;
  color: var(--gold);
  font-size: 12px;
  line-height: 1;
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  display: none;
  padding: 0 24px 20px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  background: var(--card-bg);
}

.faq-answer p + p {
  margin-top: 10px;
}

.faq-item.open .faq-answer {
  display: block;
}

/* ── Contact card ──────────────────────────────────────────── */
.contact-card {
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
}

.contact-card h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.contact-card p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--gold);
  color: var(--bg);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.2s, transform 0.2s;
}

.contact-email:hover {
  background: var(--gold-bright);
  transform: translateY(-2px);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --nav-height: 60px;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    gap: 0;
    padding: 16px 0 24px;
    border-bottom: 1px solid var(--card-border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 14px 28px;
    font-size: 1rem;
    width: 100%;
  }

  .nav-cta {
    margin: 8px 28px 0;
    width: calc(100% - 56px);
    text-align: center;
    justify-content: center;
  }

  .nav-toggle {
    display: flex;
  }

  .footer-links {
    gap: 20px;
  }

  .phone-frame {
    width: 200px;
    border-radius: 36px;
  }

  .contact-card {
    padding: 28px 20px;
  }
}
