/* ========================================
   Penlock — Editorial Journal Aesthetic
   ======================================== */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,800;1,400;1,600&family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* --- Custom Properties --- */
:root {
  --primary: #4351d9;
  --primary-soft: #4351d920;
  --accent: #f29933;
  --accent-soft: #f2993320;
  --bg-cream: #f9f4ea;
  --bg-dark: #1e2126;
  --text-dark: #1a1a2e;
  --text-light: #f0ece4;
  --text-muted: #6b6b7b;
  --border-light: #e0d8cb;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --max-width: 1120px;
  --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

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

body {
  font-family: var(--sans);
  color: var(--text-dark);
  background-color: var(--bg-cream);
  line-height: 1.7;
  font-size: 17px;
  overflow-x: hidden;
}

/* Paper grain texture overlay */
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)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent);
}

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

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
}

p {
  max-width: 640px;
}

.text-muted {
  color: var(--text-muted);
}

/* --- Layout --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 100px 0;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 20px 0;
  transition: background var(--transition), box-shadow var(--transition), padding var(--transition);
}

.nav.scrolled {
  background: rgba(249, 244, 234, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--border-light);
  padding: 14px 0;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--text-dark);
  text-decoration: none;
}

.nav-logo:hover {
  color: var(--text-dark);
}

.nav-logo svg {
  width: 32px;
  height: 32px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

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

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  border-radius: 14px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--text-dark);
  color: var(--text-light);
}

.btn-primary:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(67, 81, 217, 0.3);
}

.btn-primary svg {
  width: 20px;
  height: 20px;
}

.btn-outline {
  background: transparent;
  color: var(--text-dark);
  border: 1.5px solid var(--border-light);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* --- App Store Badge --- */
.app-store-badge {
  display: inline-block;
  transition: transform var(--transition), opacity var(--transition);
}

.app-store-badge:hover {
  transform: translateY(-2px);
  opacity: 0.85;
}

.app-store-badge img {
  display: block;
  height: 54px;
  width: auto;
}

/* --- Hero --- */
.hero {
  padding: 180px 0 120px;
  text-align: center;
  position: relative;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: var(--accent);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 100px;
  border: 1px solid var(--border-light);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 36px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-badge svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.hero h1 {
  margin-bottom: 24px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.hero h1 em {
  font-style: italic;
  color: var(--primary);
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 48px;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* --- Device Mockup --- */
.device-mockups {
  margin: 80px auto 0;
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}

.device-mockup {
  max-width: 240px;
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 280px;
}

.device-frame {
  background: var(--bg-dark);
  border-radius: 40px;
  padding: 16px;
  box-shadow:
    0 40px 80px rgba(30, 33, 38, 0.18),
    0 0 0 1px rgba(30, 33, 38, 0.08);
}

.device-screen {
  background: linear-gradient(160deg, #2a2d35, #1a1c22);
  border-radius: 28px;
  aspect-ratio: 9 / 17;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.device-screen::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 28px;
  background: var(--bg-dark);
  border-radius: 0 0 20px 20px;
}

.device-screen .lock-icon {
  width: 48px;
  height: 48px;
  color: var(--accent);
  opacity: 0.9;
}

.device-screen .screen-text {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--text-light);
  opacity: 0.6;
  text-align: center;
  line-height: 1.6;
}

/* --- Privacy Section --- */
.privacy-section {
  background: var(--bg-dark);
  color: var(--text-light);
  position: relative;
}

.privacy-section::before {
  content: '';
  position: absolute;
  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.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
}

.privacy-section .section-label {
  color: var(--accent);
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-label {
  display: block;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 16px;
}

.section-header h2 {
  margin-bottom: 16px;
}

.section-header p {
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.privacy-section .section-header p {
  color: #9a9aaa;
}

/* Privacy Cards */
.privacy-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.privacy-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 36px 28px;
  text-align: center;
  transition: all var(--transition);
}

.privacy-card:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-4px);
}

.privacy-card-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--accent-soft);
}

.privacy-card-icon svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.privacy-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.privacy-card p {
  font-size: 0.9rem;
  color: #8a8a9a;
  line-height: 1.6;
  margin: 0 auto;
}

/* --- Features Section --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  padding: 36px 28px;
  border-radius: 20px;
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.4);
  transition: all var(--transition);
}

.feature-card:hover {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.7);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(67, 81, 217, 0.08);
}

.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 16px;
  display: block;
}

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --- Pricing Section --- */
.pricing-section {
  text-align: center;
}

.pricing-card {
  max-width: 440px;
  margin: 0 auto;
  background: #fff;
  border-radius: 28px;
  padding: 56px 48px;
  border: 1px solid var(--border-light);
  box-shadow: 0 20px 60px rgba(30, 33, 38, 0.06);
  position: relative;
  overflow: hidden;
}

.pricing-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.pricing-amount {
  font-family: var(--serif);
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.pricing-period {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.pricing-features {
  list-style: none;
  text-align: left;
  margin-bottom: 36px;
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 0.95rem;
  color: var(--text-dark);
}

.pricing-features li svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex-shrink: 0;
}

.pricing-card .btn {
  width: 100%;
  justify-content: center;
}

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

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

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

.footer-left span {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--text-dark);
}

.footer-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.footer-links a {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
}

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

/* --- Scroll Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.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.35s; }
.reveal-delay-5 { transition-delay: 0.4s; }
.reveal-delay-6 { transition-delay: 0.45s; }

/* --- Legal Pages --- */
.legal-page {
  padding: 160px 0 100px;
}

.legal-page h1 {
  margin-bottom: 12px;
}

.legal-page .last-updated {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 48px;
}

.legal-content {
  max-width: 720px;
}

.legal-content h2 {
  font-size: 1.4rem;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-top: 32px;
  border-top: 1px solid var(--border-light);
}

.legal-content h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.legal-content p {
  margin-bottom: 16px;
  color: var(--text-muted);
  max-width: none;
}

.legal-content ul {
  margin-bottom: 16px;
  padding-left: 24px;
}

.legal-content li {
  margin-bottom: 8px;
  color: var(--text-muted);
  line-height: 1.7;
}

.legal-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

/* --- Responsive --- */
@media (max-width: 900px) {
  .privacy-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  section {
    padding: 80px 0;
  }

  .hero {
    padding: 150px 0 100px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .nav-links {
    display: none;
  }

  .hero {
    padding: 130px 0 80px;
  }

  .hero-subtitle {
    font-size: 1.05rem;
  }

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

  .privacy-card {
    padding: 28px 24px;
  }

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

  .pricing-card {
    padding: 40px 28px;
  }

  .pricing-amount {
    font-size: 2.6rem;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .legal-page {
    padding: 120px 0 80px;
  }
}

/* --- Dark Mode --- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-cream: #141518;
    --bg-dark: #0c0d0f;
    --text-dark: #f0ece4;
    --text-light: #f0ece4;
    --text-muted: #9a9aaa;
    --border-light: #2a2d35;
    --primary-soft: #4351d930;
    --accent-soft: #f2993330;
  }

  body {
    background-color: var(--bg-cream);
    color: var(--text-dark);
  }

  body::before {
    opacity: 0.02;
  }

  .nav.scrolled {
    background: rgba(20, 21, 24, 0.92);
    box-shadow: 0 1px 0 var(--border-light);
  }

  .nav-logo {
    color: var(--text-light);
  }

  .nav-logo:hover {
    color: var(--text-light);
  }

  .hero h1 em {
    color: #7b86ef;
  }

  .privacy-section {
    background: var(--bg-dark);
  }

  .feature-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-light);
  }

  .feature-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: #7b86ef;
    box-shadow: 0 12px 40px rgba(67, 81, 217, 0.15);
  }

  .pricing-card {
    background: #1e2126;
    border-color: var(--border-light);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  }

  .pricing-amount {
    color: var(--text-light);
  }

  .pricing-features li {
    color: var(--text-light);
  }

  .btn-primary {
    background: var(--primary);
    color: #fff;
  }

  .btn-primary:hover {
    background: #5a66e8;
    box-shadow: 0 8px 30px rgba(67, 81, 217, 0.4);
  }

  .footer-left span {
    color: var(--text-light);
  }

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

  .legal-content h2 {
    border-top-color: var(--border-light);
  }

  .legal-content strong {
    color: var(--text-light);
  }

  .legal-content a {
    color: #7b86ef;
  }

  .app-store-badge img {
    filter: invert(1);
  }
}
