/* ============================================================
   Pixelift — AI Photo Enhancer Landing Page
   Design language: "Darkroom" — ink-warm black, amber safe-light,
   editorial serif headlines, photography as the hero.
   Mobile-First.
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  --bg: #0e0d0b;
  --surface: #171512;
  --surface-2: #1f1c17;
  --line: rgba(244, 239, 232, 0.1);
  --text: #f4efe8;
  --text-muted: #a79e91;
  --amber: #e8b15c;
  --amber-deep: #c99745;
  --sage: #8fa89e;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 14px;
  --radius-sm: 10px;
  --container: 1120px;
  --header-h: 64px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
video,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

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

ul,
ol {
  list-style: none;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

.container-narrow {
  max-width: 720px;
}

.section {
  padding-block: 72px;
}

.section-alt {
  background: var(--surface);
  border-block: 1px solid var(--line);
}

/* ---------- Typography ---------- */
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 14px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(30px, 7.5vw, 56px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  max-width: 14ch;
  margin-bottom: 18px;
}

.hero-sub {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 34em;
  margin-bottom: 28px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(24px, 5.4vw, 38px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.section-sub {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 36em;
  margin-bottom: 40px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out),
    background 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn:active {
  transform: translateY(1px);
}

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

.btn-primary:hover {
  background: var(--amber-deep);
}

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(244, 239, 232, 0.28);
}

.btn-sm {
  min-height: 44px;
  padding: 10px 20px;
  font-size: 14px;
}

.btn-lg {
  min-height: 52px;
  padding: 14px 30px;
  font-size: 16px;
}

.btn-block {
  width: 100%;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(14, 13, 11, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease-out);
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.desktop-nav {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.desktop-cta {
  display: none;
}

/* ---------- Hamburger ---------- */
.hamburger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.hamburger span {
  width: 18px;
  height: 1.6px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.28s var(--ease-out), opacity 0.28s var(--ease-out);
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.6px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.6px) rotate(-45deg);
}

/* ---------- Mobile Drawer ---------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(8, 7, 6, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}

.drawer-backdrop.is-open {
  opacity: 1;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  padding: calc(var(--header-h) + 16px) 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: translateY(-100%);
  transition: transform 0.3s var(--ease-out);
}

.mobile-drawer.is-open {
  transform: translateY(0);
}

.drawer-link {
  display: flex;
  align-items: center;
  min-height: 48px;
  font-size: 17px;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}

.drawer-link:last-of-type {
  border-bottom: 0;
}

.drawer-cta {
  margin-top: 16px;
}

body.drawer-open {
  overflow: hidden;
}

/* ---------- Guide Overlay ---------- */
.guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 7, 6, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow-y: auto;
}

.guide-overlay[hidden] {
  display: none;
}

.guide-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin-block: auto;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px 24px 24px;
  animation: guide-rise 0.5s var(--ease-out);
}

@keyframes guide-rise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.guide-arrow {
  position: absolute;
  top: -56px;
  right: 28px;
  color: var(--amber);
  animation: guide-nudge 1.8s ease-in-out infinite;
}

@keyframes guide-nudge {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.guide-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 12px;
}

.guide-text {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.guide-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.guide-steps strong {
  color: var(--amber);
  font-weight: 600;
}

.guide-step-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(232, 177, 92, 0.5);
  color: var(--amber);
  font-size: 12px;
  font-weight: 600;
  margin-top: 1px;
}

.guide-dismiss {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Hero ---------- */
.hero {
  padding-top: 52px;
  padding-bottom: 80px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
}

.hero-cta .btn {
  flex: 1 1 auto;
}

.hero-note {
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ---------- Before / After Slider ---------- */
.ba-slider {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.ba-img {
  width: 100%;
  height: auto;
  pointer-events: none;
}

.ba-before {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
  pointer-events: none;
}

.ba-before-img {
  /* Simulated "aged, unrestored" state */
  filter: blur(1.4px) sepia(0.5) saturate(0.55) contrast(0.82) brightness(0.94);
}

.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  background: rgba(244, 239, 232, 0.9);
  transform: translateX(-1px);
  pointer-events: none;
}

.ba-grip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(14, 13, 11, 0.75);
  border: 1px solid rgba(244, 239, 232, 0.85);
  color: var(--text);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.ba-tag {
  position: absolute;
  top: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(14, 13, 11, 0.66);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
}

.ba-tag-before {
  left: 12px;
  color: var(--text-muted);
}

.ba-tag-after {
  right: 12px;
  color: var(--amber);
}

.ba-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
}

.ba-range:focus-visible ~ .ba-handle,
.ba-slider:focus-within .ba-handle {
  box-shadow: 0 0 0 2px var(--amber);
}

.ba-caption {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ---------- Features ---------- */
.feature-grid {
  display: grid;
  gap: 14px;
}

.feature-card {
  padding: 26px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.3s var(--ease-out);
}

.feature-card:hover {
  border-color: rgba(232, 177, 92, 0.35);
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(232, 177, 92, 0.4);
  color: var(--amber);
  margin-bottom: 18px;
}

.feature-card h3 {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 8px;
}

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

/* ---------- Steps ---------- */
.steps {
  display: grid;
  gap: 28px;
  counter-reset: step;
}

.step {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.step-num {
  display: block;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--amber);
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}

.step h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.step p {
  font-size: 14px;
  color: var(--text-muted);
}

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  gap: 26px;
}

.gallery-item figcaption {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

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

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
  padding: 16px 18px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary svg {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.3s var(--ease-out);
}

.faq-item[open] summary svg {
  transform: rotate(180deg);
}

.faq-body {
  padding: 0 18px 18px;
}

.faq-body p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ---------- Final CTA ---------- */
.final-cta {
  padding-block: 88px;
  text-align: center;
  background:
    radial-gradient(90% 120% at 50% 110%, rgba(232, 177, 92, 0.12) 0%, transparent 60%),
    var(--surface);
  border-top: 1px solid var(--line);
}

.final-title {
  font-family: var(--font-serif);
  font-size: clamp(26px, 6vw, 42px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  max-width: 18ch;
  margin-inline: auto;
  margin-bottom: 14px;
}

.final-sub {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.final-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 360px;
  margin-inline: auto;
}

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 44px 36px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.footer-top {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 26px;
}

.footer-tag {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-bottom: 20px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.25s var(--ease-out);
}

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

.footer-copy {
  font-size: 12px;
  color: rgba(167, 158, 145, 0.7);
}

/* ---------- Reveal Animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .guide-arrow {
    animation: none;
  }

  .guide-card {
    animation: none;
  }
}

/* ---------- Tablet ≥768px ---------- */
@media (min-width: 768px) {
  .section {
    padding-block: 96px;
  }

  .hero {
    padding-top: 72px;
    padding-bottom: 96px;
  }

  .hero-cta .btn {
    flex: 0 0 auto;
  }

  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }

  .final-actions {
    flex-direction: row;
    justify-content: center;
    max-width: none;
  }

  .footer-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* ---------- Desktop ≥900px: show inline nav ---------- */
@media (min-width: 900px) {
  .desktop-nav {
    display: flex;
    align-items: center;
    gap: 30px;
  }

  .desktop-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.25s var(--ease-out);
  }

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

  .desktop-cta {
    display: inline-flex;
  }

  .hamburger {
    display: none;
  }
}

/* ---------- Desktop ≥1024px ---------- */
@media (min-width: 1024px) {
  .feature-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .hero {
    padding-top: 88px;
  }
}

/* ---------- Legal pages (privacy.html / terms.html) ---------- */
.legal-main {
  padding-block: 56px 88px;
}

.legal-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 600;
  margin-bottom: 8px;
}

.legal-updated {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 36px;
}

.legal-body h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  margin: 32px 0 10px;
}

.legal-body p,
.legal-body li {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

.legal-body ul {
  list-style: disc;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.legal-body a {
  color: var(--amber);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

.back-link:hover {
  color: var(--text);
}
