/* style.css — PaperNest design tokens + components
   Palette derived from the app icon: deep blue → cyan → teal gradient mark
   on a near-white cyan-tinted surface. Calm, organized, trustworthy — a
   finance/productivity utility for freelancers and small business owners. */

/* ---------- Design Tokens ---------- */
:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 4.5rem);

  /* Spacing (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --content-narrow: 640px;
  --content-default: 980px;
  --content-wide: 1240px;

  --font-display: 'Cabinet Grotesk', 'General Sans', 'Segoe UI', sans-serif;
  --font-body: 'General Sans', 'Segoe UI', sans-serif;
}

/* ---------- Light mode (default) ---------- */
:root,
[data-theme='light'] {
  --color-bg: #f5f9fb;
  --color-surface: #ffffff;
  --color-surface-2: #fbfdfe;
  --color-surface-offset: #eaf3f6;
  --color-surface-offset-2: #dfedf1;
  --color-surface-dynamic: #d3e7ec;
  --color-divider: #dbe8ec;
  --color-border: #c9dde3;

  --color-text: #0e2430;
  --color-text-muted: #4c6a75;
  --color-text-faint: #54707b;
  --color-text-inverse: #f5fbfd;

  /* Primary accent — deep blue from icon core */
  --color-primary: #0f6ba8;
  --color-primary-hover: #0a4f80;
  --color-primary-active: #083c62;
  --color-primary-highlight: #d3e8f3;

  /* Secondary accent — cyan/teal from icon rim */
  --color-accent: #14b8a6;
  --color-accent-hover: #0a6d63;
  --color-accent-highlight: #d1f2ee;

  --color-success: #2f8f5b;
  --color-success-highlight: #d7ecdf;
  --color-warning: #b06a1a;
  --color-warning-highlight: #f0ddc4;
  --color-error: #b83b4b;
  --color-error-highlight: #f2d6da;

  --shadow-sm: 0 1px 2px oklch(0.25 0.05 220 / 0.06);
  --shadow-md: 0 6px 20px oklch(0.25 0.06 220 / 0.09);
  --shadow-lg: 0 18px 48px oklch(0.25 0.07 220 / 0.14);

  --gradient-brand: linear-gradient(135deg, #1560c4 0%, #17a3c0 55%, #17c3a6 100%);
}

/* ---------- Dark mode ---------- */
[data-theme='dark'] {
  --color-bg: #0a161d;
  --color-surface: #101f28;
  --color-surface-2: #13252f;
  --color-surface-offset: #162933;
  --color-surface-offset-2: #1a2f3a;
  --color-surface-dynamic: #1f3945;
  --color-divider: #1e343f;
  --color-border: #274454;

  --color-text: #e4f1f5;
  --color-text-muted: #9ab5bf;
  --color-text-faint: #75949d;
  --color-text-inverse: #0a161d;

  --color-primary: #5aa8e0;
  --color-primary-hover: #7fbeeb;
  --color-primary-active: #3d8cc7;
  --color-primary-highlight: #16374a;

  --color-accent: #3fd2bd;
  --color-accent-hover: #62ddca;
  --color-accent-highlight: #123833;

  --color-success: #5fbf8a;
  --color-success-highlight: #143627;
  --color-warning: #d99a4e;
  --color-warning-highlight: #3a2a15;
  --color-error: #e3798a;
  --color-error-highlight: #3a1c22;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.35);
  --shadow-md: 0 6px 20px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 20px 52px oklch(0 0 0 / 0.5);

  --gradient-brand: linear-gradient(135deg, #2f74c9 0%, #22a7c2 55%, #22c4a4 100%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0a161d;
    --color-surface: #101f28;
    --color-surface-2: #13252f;
    --color-surface-offset: #162933;
    --color-surface-offset-2: #1a2f3a;
    --color-surface-dynamic: #1f3945;
    --color-divider: #1e343f;
    --color-border: #274454;
    --color-text: #e4f1f5;
    --color-text-muted: #9ab5bf;
    --color-text-faint: #5f818c;
    --color-text-inverse: #0a161d;
    --color-primary: #5aa8e0;
    --color-primary-hover: #7fbeeb;
    --color-primary-active: #3d8cc7;
    --color-primary-highlight: #16374a;
    --color-accent: #3fd2bd;
    --color-accent-hover: #62ddca;
    --color-accent-highlight: #123833;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.35);
    --shadow-md: 0 6px 20px oklch(0 0 0 / 0.4);
    --shadow-lg: 0 20px 52px oklch(0 0 0 / 0.5);
    --gradient-brand: linear-gradient(135deg, #2f74c9 0%, #22a7c2 55%, #22c4a4 100%);
  }
}

/* ---------- Layout primitives ---------- */
.wrap {
  width: 100%;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: clamp(var(--space-5), 4vw, var(--space-10));
}
.wrap--narrow {
  max-width: var(--content-narrow);
}
.wrap--default {
  max-width: var(--content-default);
}

section {
  padding-block: clamp(var(--space-16), 9vw, var(--space-32));
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--color-bg) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-divider);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-4);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}
.brand img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.nav-inline {
  display: flex;
  gap: var(--space-6);
  list-style: none;
}
.nav-inline a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
}
.nav-inline a:hover {
  color: var(--color-text);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  background: var(--color-surface);
}
.theme-toggle:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
}
.btn-ghost {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}
.btn-ghost:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ---------- Badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}
.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-highlight);
  flex-shrink: 0;
}

/* ---------- Hero ---------- */
.hero {
  padding-block-start: clamp(var(--space-16), 10vw, var(--space-24));
  padding-block-end: clamp(var(--space-12), 6vw, var(--space-20));
  position: relative;
  overflow: clip;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(var(--space-8), 5vw, var(--space-16));
  align-items: center;
}
.hero-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-6);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: var(--space-5);
  max-width: 16ch;
}
.hero h1 .accent-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lede {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 46ch;
  margin-bottom: var(--space-8);
}
.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.price-note {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.price-note strong {
  color: var(--color-text);
  font-weight: 700;
}
.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-divider);
}
.hero-fact {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 600;
}
.hero-fact svg {
  width: 16px;
  height: 16px;
  color: var(--color-accent);
  flex-shrink: 0;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
}
.hero-visual .phone-frame {
  width: min(280px, 62vw);
  border-radius: 2.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 6px solid var(--color-surface);
  background: var(--color-surface);
  position: relative;
  z-index: 2;
}
.hero-visual .phone-frame img {
  width: 100%;
  display: block;
}
.hero-visual .phone-frame.phone-back {
  position: absolute;
  z-index: 1;
  top: 8%;
  right: -8%;
  width: min(230px, 50vw);
  opacity: 0.7;
  filter: saturate(0.9);
  transform: rotate(6deg);
}
.hero-visual-inner {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}
.hero-glow {
  position: absolute;
  inset: -10% -10% -10% -10%;
  background: radial-gradient(
    ellipse at 55% 40%,
    color-mix(in oklab, var(--color-accent) 20%, transparent) 0%,
    transparent 65%
  );
  z-index: 0;
  pointer-events: none;
}

/* ---------- Section headings ---------- */
.section-head {
  max-width: 60ch;
  margin-bottom: clamp(var(--space-10), 5vw, var(--space-14));
}
.eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent-hover);
  margin-bottom: var(--space-3);
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-4);
}
.section-head p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
}

/* ---------- Features: magazine grid ---------- */
.feature-section {
  background: var(--color-surface);
  border-block: 1px solid var(--color-divider);
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 1fr;
  gap: clamp(var(--space-5), 2.5vw, var(--space-8));
}
.feature-card {
  border-radius: var(--radius-lg);
  background: var(--color-surface-2);
  border: 1px solid var(--color-divider);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.feature-card.-hero {
  grid-column: span 4;
}
.feature-card.-tall {
  grid-column: span 2;
}
.feature-card.-wide {
  grid-column: span 2;
}
.feature-card.-third {
  grid-column: span 2;
}
.feature-card .shot {
  position: relative;
  background: var(--color-surface-offset);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  flex: 1;
  min-height: 220px;
}
.feature-card .shot img {
  width: 74%;
  border-radius: 1rem 1rem 0 0;
  box-shadow: 0 -8px 30px oklch(0.2 0.05 220 / 0.12);
  transform: translateY(6%);
}
.feature-card.-third .shot img {
  width: 62%;
}
.feature-card .copy {
  padding: var(--space-6);
}
.feature-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
  letter-spacing: -0.01em;
}
.feature-card p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.feature-tag {
  display: inline-flex;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-2);
}

.feature-list-row {
  margin-top: clamp(var(--space-8), 4vw, var(--space-12));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  padding-top: clamp(var(--space-8), 4vw, var(--space-12));
  border-top: 1px solid var(--color-divider);
}
.mini-feature {
  display: flex;
  gap: var(--space-3);
}
.mini-feature svg {
  width: 20px;
  height: 20px;
  color: var(--color-accent-hover);
  flex-shrink: 0;
  margin-top: 2px;
}
.mini-feature h4 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-1);
}
.mini-feature p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ---------- Callout: why one-time / on-device ---------- */
.callout-section .wrap {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(var(--space-10), 6vw, var(--space-20));
  align-items: start;
}
.callout-visual {
  border-radius: var(--radius-xl);
  padding: clamp(var(--space-8), 4vw, var(--space-10));
  background: var(--gradient-brand);
  color: #f4fbfd;
  position: relative;
  overflow: hidden;
}
.callout-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 110%, oklch(1 0 0 / 0.14), transparent 60%);
}
.callout-visual .stat {
  position: relative;
  z-index: 1;
}
.callout-visual .stat + .stat {
  margin-top: var(--space-8);
  padding-top: var(--space-8);
  border-top: 1px solid oklch(1 0 0 / 0.22);
}
.callout-visual .stat-num {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  display: block;
  margin-bottom: var(--space-1);
}
.callout-visual .stat-label {
  font-size: var(--text-sm);
  opacity: 0.92;
}

.compare-table {
  display: grid;
  gap: var(--space-3);
}
.compare-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
}
.compare-row.-head {
  background: transparent;
  border: none;
  padding-block: 0 var(--space-1);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-faint);
}
.compare-row .col-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}
.compare-row .col-val {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.compare-row .col-val.-yes {
  color: var(--color-success);
  font-weight: 600;
}
.compare-row .col-val.-no {
  color: var(--color-text-faint);
}
.compare-row .col-val svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.callout-text > p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  max-width: 60ch;
}

/* ---------- Notify section ---------- */
.notify-section {
  background: var(--color-surface-offset);
  border-block: 1px solid var(--color-divider);
}
.notify-card {
  max-width: var(--content-narrow);
  margin-inline: auto;
  text-align: center;
}
.notify-card h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 650;
  margin-bottom: var(--space-3);
  letter-spacing: -0.01em;
}
.notify-card > p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
}
.notify-form {
  display: flex;
  gap: var(--space-3);
  max-width: 460px;
  margin-inline: auto;
}
.notify-form input[type='email'] {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-sm);
}
.notify-form input[type='email']:focus-visible {
  border-color: var(--color-primary);
}
.notify-status {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  min-height: 1.4em;
}
.notify-status.-active {
  color: var(--color-success);
  font-weight: 600;
}
.notify-privacy {
  margin-top: var(--space-5);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

/* ---------- Footer ---------- */
.site-footer {
  padding-block: var(--space-12);
  border-top: 1px solid var(--color-divider);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.footer-brand img {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
}
.footer-brand-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.footer-brand-text strong {
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: 650;
}
.footer-meta {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-align: right;
}
.footer-meta a {
  color: var(--color-text-muted);
  text-decoration: none;
}
.footer-meta a:hover {
  color: var(--color-primary);
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  z-index: 100;
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 600;
  transition: top var(--transition-interactive);
}
.skip-link:focus {
  top: var(--space-4);
}

/* ---------- Scroll reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1fr;
  }
  .hero-visual {
    order: -1;
    margin-bottom: var(--space-4);
  }
  .hero h1 {
    max-width: none;
  }
  .callout-section .wrap {
    grid-template-columns: 1fr;
  }
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto;
  }
  .feature-card.-hero,
  .feature-card.-tall,
  .feature-card.-wide,
  .feature-card.-third {
    grid-column: span 2;
    grid-row: auto;
  }
  .feature-list-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .nav-inline {
    display: none;
  }
  .hero-cta-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .feature-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }
  .feature-card.-hero,
  .feature-card.-tall,
  .feature-card.-wide,
  .feature-card.-third {
    grid-column: span 1;
  }
  .feature-list-row {
    grid-template-columns: 1fr;
  }
  .notify-form {
    flex-direction: column;
  }
  .compare-row {
    grid-template-columns: 1.1fr 1fr 1fr;
    padding: var(--space-3) var(--space-4);
  }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
  .footer-meta {
    text-align: left;
  }
  .hero-visual .phone-frame.phone-back {
    display: none;
  }
}
