/* ============================================================
   Picturan — styles.css
   Order: fonts → tokens → reset → base → utilities → components
          → responsive → dark mode
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT@0,9..144,400..700,30..100;1,9..144,400..700,30..100&family=Manrope:wght@400;600;700&display=swap');

/* Custom brand font (drop DMSheriffDisplay.woff2 into /assets to enable). */
@font-face {
  font-family: 'DMSheriffDisplay';
  src: local('DM Sheriff Display'), local('DMSheriffDisplay'),
       url('DMSheriffDisplay.woff2') format('woff2'),
       url('DMSheriffDisplay.woff') format('woff');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Color (light mode) — exact values from compliance spec */
  --primary:        #FF6B35;
  --secondary:      #4F7FFF;
  --accent:         #B84FFF;
  --success:        #00D9A3;
  --warning:        #FFB84D;
  --bg:             #FFFFFF;
  --bg-subtle:      #F0F5FF;
  --text:           #111111;
  --text-secondary: #555555;
  --border:         rgba(0,0,0,0.1);

  /* Spacing (4px grid) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;
  --s-16: 64px; --s-20: 80px;

  /* Radius */
  --r-button: 14px;
  --r-card:   20px;
  --r-pill:   999px;

  /* Type families */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:    'Manrope', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-brand:   'DMSheriffDisplay', 'Fraunces', Georgia, serif;

  /* Sticker shadow */
  --shadow-sticker:       4px 4px 0 var(--text);
  --shadow-sticker-hover: 6px 6px 0 var(--text);
  --shadow-sticker-card:  6px 6px 0 var(--text);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, ul, ol, figure { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;       /* 17px from spec */
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
}

h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-family: var(--font-body); font-size: 1.25rem; font-weight: 700; line-height: 1.3; letter-spacing: 0; }

p { color: var(--text); }
p + p { margin-top: var(--s-4); }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* Layout container */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--s-4);
}
@media (min-width: 768px) {
  .container { padding: 0 var(--s-6); }
}

.container-legal {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 var(--s-4);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ============================================================
   Components
   ============================================================ */

/* Button — sticker style */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 14px 22px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--text);
  border-radius: var(--r-button);
  box-shadow: var(--shadow-sticker);
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out;
  text-decoration: none;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-sticker-hover); }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--text); }
.btn--primary { background: var(--primary); color: var(--text); }
.btn--secondary { background: var(--bg); }

/* App Store badge (official Apple artwork — kept unmodified) */
.appstore-badge { display: inline-block; margin-top: var(--s-2); transition: transform 0.15s ease-out; }
.appstore-badge:hover { transform: translateY(-2px); }
.appstore-badge img { height: 56px; width: auto; }

/* Sticker card */
.sticker-card {
  background: var(--bg);
  border: 1.5px solid var(--text);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-sticker-card);
  padding: var(--s-8);
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}
.sticker-card--subtle  { background: var(--bg-subtle); }
.sticker-card .eyebrow { display: block; margin-bottom: var(--s-3); }
.sticker-card h3 { margin-bottom: var(--s-2); }

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; padding-top: var(--s-4); padding-bottom: var(--s-4); }
.nav__logo { display: flex; align-items: center; gap: var(--s-2); font-family: var(--font-brand); font-weight: 700; font-size: 1.5rem; letter-spacing: 0.01em; color: var(--text); }
.nav__logo img { height: 32px; width: auto; }
.nav__links { display: flex; align-items: center; gap: var(--s-6); list-style: none; }
.nav__links a {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  padding: var(--s-2) 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease;
}
.nav__links a:hover { border-bottom-color: var(--primary); }

/* Footer */
.site-footer {
  background: #1B04AB;
  color: #fff;
  padding: var(--s-16) 0 var(--s-10);
  margin-top: var(--s-20);
  border-top: 1.5px solid var(--text);
}
.site-footer .container {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-8);
  align-items: end;
}
.site-footer a { color: #fff; border-bottom: 1px solid rgba(255,255,255,0.4); }
.site-footer a:hover { border-bottom-color: #fff; }
.site-footer__col h4 {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--s-3);
  opacity: 0.8;
}
.site-footer__wordmark {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.01em;
}
@media (min-width: 768px) {
  .site-footer .container { grid-template-columns: 1fr 1fr 1fr; }
}

/* Legal pages */
.legal { padding: var(--s-16) 0 var(--s-20); }
.legal h1 { margin-bottom: var(--s-4); }
.legal .eyebrow { display: block; margin-bottom: var(--s-2); }
.legal__meta { color: var(--text-secondary); margin-bottom: var(--s-8); }
.legal h2 {
  margin-top: var(--s-12);
  margin-bottom: var(--s-3);
  padding-top: var(--s-6);
  border-top: 1px solid var(--border);
}
.legal h2:first-of-type { border-top: none; padding-top: 0; }
.legal p, .legal ul, .legal ol { line-height: 1.75; color: var(--text); }
.legal ul, .legal ol { padding-left: var(--s-6); margin-top: var(--s-3); }
.legal li { margin-bottom: var(--s-2); }
.legal a { color: var(--text); border-bottom: 2px solid var(--secondary); }
.legal a:hover { background: var(--bg-subtle); }

/* ============================================================
   Home page sections
   ============================================================ */

/* Hero */
.hero { padding: var(--s-16) 0 var(--s-20); }
.hero__grid { display: grid; grid-template-columns: 1fr; gap: var(--s-12); align-items: center; }
.hero__copy { text-align: center; }
.hero__copy h1 { font-size: clamp(2.5rem, 6.5vw, 5rem); font-weight: 600; margin-bottom: var(--s-6); }
.hero__copy h1 em { font-style: italic; color: var(--primary); font-variation-settings: 'opsz' 144, 'SOFT' 100; }
.hero__sub { font-size: 1.125rem; color: var(--text-secondary); max-width: 38ch; margin-bottom: var(--s-8); margin-left: auto; margin-right: auto; }
@media (min-width: 960px) {
  .hero__copy { text-align: left; }
  .hero__sub { margin-left: 0; margin-right: 0; }
}

/* Hero device visual */
.hero__visual { position: relative; min-height: 380px; display: flex; justify-content: center; align-items: center; }
.hero-device {
  position: relative;
  width: 100%;
  max-width: 320px;
  transform: rotate(-2deg);
  transition: transform 0.15s ease-out;
}
.hero-device:hover {
  transform: rotate(-2deg) translate(-2px, -2px);
}
.hero-device__frame {
  border-radius: var(--r-card);
  border: 2.5px solid var(--text);
  box-shadow: var(--shadow-sticker-card);
  overflow: hidden;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  transition: box-shadow 0.15s ease-out;
}
.hero-device:hover .hero-device__frame {
  box-shadow: var(--shadow-sticker-hover);
}
.hero-device__screen {
  display: block;
  width: 100%;
  height: auto;
}

/* Stagger reveal */
.reveal { opacity: 0; transform: translateY(8px); animation: reveal 0.55s 0.05s ease-out forwards; }
.reveal--1 { animation-delay: 0.08s; }
.reveal--2 { animation-delay: 0.16s; }
.reveal--3 { animation-delay: 0.24s; }
@keyframes reveal { to { opacity: 1; transform: translateY(0); } }

@media (min-width: 960px) {
  .hero__grid { grid-template-columns: 1.2fr 1fr; gap: var(--s-16); }
  .hero__visual { min-height: 480px; }
  .hero-device { max-width: 380px; }
}

/* How It Works */
.how {
  background: var(--bg-subtle);
  padding: var(--s-16) 0;
  border-top: 1.5px solid var(--text);
  border-bottom: 1.5px solid var(--text);
}
.how__head { text-align: center; margin-bottom: var(--s-12); }
.how__head .eyebrow { display: block; margin-bottom: var(--s-2); }
.how__grid { display: grid; grid-template-columns: 1fr; gap: var(--s-8); }
.how__num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.25rem;
  color: var(--primary);
  line-height: 1;
  margin-bottom: var(--s-3);
}
@media (min-width: 768px) {
  .how__grid { grid-template-columns: repeat(3, 1fr); gap: var(--s-6); }
}

/* Pricing */
.pricing { padding: var(--s-20) 0 var(--s-12); }
.pricing__head { text-align: center; margin-bottom: var(--s-12); max-width: 640px; margin-left: auto; margin-right: auto; }
.pricing__head .eyebrow { display: block; margin-bottom: var(--s-2); }
.pricing__sub { color: var(--text-secondary); margin-top: var(--s-3); }

.pricing__grid { display: grid; grid-template-columns: 1fr; gap: var(--s-8); align-items: stretch; }

.tier {
  position: relative;
  padding: var(--s-10) var(--s-8);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}
.tier__name { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; margin-bottom: var(--s-2); }
.tier__price { font-family: var(--font-display); font-weight: 600; font-size: 3rem; line-height: 1; margin-bottom: var(--s-1); }
.tier__price small { font-family: var(--font-body); font-size: 1rem; font-weight: 400; color: var(--text-secondary); margin-left: var(--s-1); }
.tier__transforms { color: var(--text-secondary); margin-bottom: var(--s-8); }

.tier--standard { background: var(--accent); color: #fff; }
.tier--standard .tier__transforms,
.tier--standard .tier__price small { color: rgba(255,255,255,0.85); }

.tier__badge {
  position: absolute;
  top: -14px;
  right: -10px;
  background: var(--success);
  color: var(--text);
  border: 1.5px solid var(--text);
  border-radius: var(--r-button);
  padding: 6px 12px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(-6deg);
  box-shadow: 3px 3px 0 var(--text);
}

@media (min-width: 768px) {
  .pricing__grid { grid-template-columns: repeat(3, 1fr); gap: var(--s-6); }
}
@media (min-width: 960px) {
  .tier--standard { transform: rotate(-2deg); }
}

.tier:hover { transform: translate(-3px, -3px); box-shadow: 10px 10px 0 var(--text); }
@media (min-width: 960px) {
  .tier--standard:hover { transform: rotate(-2deg) translate(-3px, -3px); }
}

/* Auto-renewal disclosure */
.disclosure {
  max-width: 720px;
  margin: var(--s-10) auto 0;
  padding: var(--s-6);
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--bg-subtle);
}
.disclosure a { color: var(--text); border-bottom: 1.5px solid var(--secondary); }

/* ============================================================
   Dark mode (exact spec values)
   ============================================================ */
@media (prefers-color-scheme: dark) {
  :root {
    --primary:        #FF7B45;
    --secondary:      #5A8FFF;
    --accent:         #C75FFF;
    --bg:             #0A0E1A;
    --bg-subtle:      #1A1420;
    --text:           #F5F5F5;
    --text-secondary: #AAAAAA;
    --border:         rgba(255,255,255,0.1);
  }
  .nav { background: rgba(10, 14, 26, 0.85); }
  .btn--secondary { background: var(--bg); }
  .sticker-card { background: var(--bg-subtle); }
}

/* 404 / error page */
.error-page {
  padding: var(--s-20) 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 60vh;
}
.error-page .eyebrow { display: block; margin-bottom: var(--s-3); }
.error-page__code {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 600;
  line-height: 1.05;
  margin-bottom: var(--s-6);
}
.error-page__code em {
  font-style: italic;
  color: var(--primary);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
}
.error-page__sub {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 44ch;
  margin: 0 auto var(--s-8);
}
.error-page__actions {
  display: flex;
  gap: var(--s-4);
  justify-content: center;
  flex-wrap: wrap;
}
.error-page__actions .btn {
  font-size: 1.125rem;
  padding: var(--s-4) var(--s-8);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
