/* ── Dude, Where's My Package? — Landing Page ── */

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #242736;
  --border: #2e3145;
  --text: #e1e4ed;
  --text-dim: #8b8fa3;
  --accent: #6c5ce7;
  --accent-hover: #7c6df7;
  --green: #00b894;
  --yellow: #fdcb6e;
  --orange: #e17055;
  --red: #d63031;
  --blue: #74b9ff;
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Navigation ──────────────────────────────── */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(15, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}

.nav-brand img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.nav-links {
  display: flex;
  gap: 6px;
  list-style: none;
}

.nav-links a {
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  transition: all 0.2s;
}

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

.nav-github {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-github svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ── Hero ────────────────────────────────────── */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(108, 92, 231, 0.08) 0%, transparent 60%),
    var(--bg);
}

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

.hero-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  margin-bottom: 28px;
  box-shadow: 0 8px 32px rgba(108, 92, 231, 0.2);
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.hero h1 .highlight { color: var(--accent); }

.hero-tagline {
  font-size: 1.25rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.hero-carriers {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.carrier-pill {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 5px 12px;
  border-radius: 20px;
}

.carrier-pill.amazon { background: #ff990020; color: #ffad42; }
.carrier-pill.postnl { background: #ff6b0020; color: #ff8a50; }
.carrier-pill.dhl { background: #ffcc0020; color: #ffd93d; }
.carrier-pill.dpd { background: #dc143c20; color: #ff6b81; }
.carrier-pill.gls { background: #003e7e20; color: #4a90d9; }

.hero-ctas {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 28px;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.3);
}

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

.btn-outline:hover {
  color: var(--text);
  border-color: var(--text-dim);
  background: var(--surface);
}

.btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ── Section shared ──────────────────────────── */

.section {
  padding: 100px 0;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-desc {
  font-size: 1rem;
  color: var(--text-dim);
  max-width: 560px;
  line-height: 1.7;
}

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

.section-header .section-desc {
  margin: 0 auto;
}

/* ── Features ────────────────────────────────── */

.features-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

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

.feature-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #6c5ce715;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.feature-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

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

/* ── Screenshots / Mockups ───────────────────── */

.mockup-tabs {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.mockup-tab {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.mockup-tab:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

.mockup-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.mockup-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  max-width: 960px;
  margin: 0 auto;
}

.mockup-titlebar {
  background: #1e2028;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.mockup-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.mockup-dot.red { background: #ff5f57; }
.mockup-dot.yellow { background: #febc2e; }
.mockup-dot.green { background: #28c840; }

.mockup-url {
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.mockup-viewport {
  display: none;
}

.mockup-viewport.active {
  display: block;
}

.mockup-viewport iframe {
  width: 100%;
  border: none;
  display: block;
  background: var(--bg);
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

/* Extension mockup gets special treatment — centered narrow frame */
.mockup-frame.extension-frame {
  max-width: 420px;
}

.extension-mini-frame iframe {
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

/* ── Carrier Grid ────────────────────────────── */

.carriers-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.carrier-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  transition: border-color 0.2s;
}

.carrier-card:hover {
  border-color: var(--accent);
}

.carrier-card .carrier-pill {
  font-size: 0.8rem;
  padding: 6px 16px;
  display: inline-block;
  margin-bottom: 12px;
}

.carrier-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.carrier-card .carrier-auth {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.carrier-card .carrier-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ── Installation ────────────────────────────── */

.install-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.install-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  justify-content: center;
}

.install-tab {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.install-tab:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

.install-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.install-panel {
  display: none;
  max-width: 720px;
  margin: 0 auto;
}

.install-panel.active {
  display: block;
}

.code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.copy-btn {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.copy-btn:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

.copy-btn.copied {
  color: var(--green);
  border-color: var(--green);
}

.code-block pre {
  padding: 16px 20px;
  overflow-x: auto;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text);
}

.code-block .comment { color: var(--text-dim); }
.code-block .flag { color: var(--accent); }
.code-block .string { color: var(--green); }

.install-steps {
  max-width: 600px;
  margin: 0 auto;
}

.install-step {
  display: flex;
  gap: 16px;
  padding: 16px 0;
}

.install-step:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.step-text {
  font-size: 0.9rem;
  line-height: 1.6;
}

.step-text code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ── Extension CTA ───────────────────────────── */

.extension-cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  max-width: 960px;
  margin: 0 auto;
}

.extension-info h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.extension-features {
  list-style: none;
  margin-bottom: 28px;
}

.extension-features li {
  padding: 6px 0;
  font-size: 0.9rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 10px;
}

.extension-features li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.extension-note {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 12px;
  line-height: 1.5;
}

.extension-preview {
  display: flex;
  justify-content: center;
}

.extension-mini-frame {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  width: 380px;
}

.extension-mini-frame .mockup-titlebar {
  padding: 8px 12px;
}

.extension-mini-frame .mockup-dot {
  width: 10px;
  height: 10px;
}

.extension-mini-frame iframe {
  width: 100%;
  border: none;
  display: block;
  background: var(--bg);
}

/* ── Footer ──────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-dim);
  flex-wrap: wrap;
}

.footer-content a {
  color: var(--text-dim);
  transition: color 0.2s;
}

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

.footer-sep { color: var(--border); }

.version-badge {
  font-size: 0.7rem;
  color: var(--accent);
  background: #6c5ce715;
  border: 1px solid #6c5ce730;
  padding: 2px 10px;
  border-radius: 20px;
}

/* ── Scroll animations ───────────────────────── */

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ──────────────────────────────── */

@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .carriers-grid { grid-template-columns: repeat(3, 1fr); }
  .extension-cta { grid-template-columns: 1fr; text-align: center; }
  .extension-features { display: inline-block; text-align: left; }
  .extension-preview { order: -1; }
}

@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .hero-tagline { font-size: 1rem; }
  .hero-desc { font-size: 0.9rem; }
  .section { padding: 56px 0; }
  .section-title { font-size: 1.5rem; }
  .section-desc { font-size: 0.9rem; }
  .section-header { margin-bottom: 36px; }
  .mockup-frame { border-radius: 8px; }

  /* Nav: hide section links on tablet, keep brand + GitHub */
  .nav-links li:not(:last-child) { display: none; }
  .nav-links a { padding: 6px 8px; font-size: 0.8rem; }

  /* Carrier grid: 2 + 3 on tablet */
  .carriers-grid { grid-template-columns: repeat(3, 1fr); }

  /* Code blocks: smaller text to avoid horizontal scroll */
  .code-block pre { font-size: 0.72rem; padding: 12px 14px; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .hero { padding: 80px 16px 48px; min-height: auto; }
  .hero h1 { font-size: 1.7rem; }
  .hero-icon { width: 72px; height: 72px; border-radius: 16px; margin-bottom: 20px; }
  .hero-desc { font-size: 0.85rem; margin-bottom: 24px; }
  .hero-carriers { gap: 6px; margin-bottom: 28px; }
  .carrier-pill { font-size: 0.6rem; padding: 4px 10px; }
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .hero-ctas .btn { justify-content: center; }

  /* Nav: just icon + GitHub */
  .nav-brand span { display: none; }
  .nav-links li:not(:last-child) { display: none; }

  /* Features: single column */
  .features-grid { grid-template-columns: 1fr; }
  .feature-card { padding: 20px; }

  /* Mockup tabs: wrap tighter */
  .mockup-tabs { gap: 4px; }
  .mockup-tab { padding: 6px 14px; font-size: 0.78rem; }

  /* Scale down mockup iframes so they render at ~700px but fit mobile.
     The wrapper clips the overflow; transform shrinks visually. */
  .mockup-viewport iframe {
    width: 200%;
    transform: scale(0.5);
    transform-origin: top left;
  }
  /* Compensate height: the iframe is rendered at 2x then scaled 0.5,
     so actual displayed height is half the iframe's pixel height.
     Use a wrapper to contain the visual height. */
  .mockup-viewport {
    overflow: hidden;
  }
  .mockup-viewport.active {
    /* Heights are halved by the scale transform */
    max-height: 380px;
  }
  /* Extension mockup: narrower source, less scaling needed */
  .mockup-frame.extension-frame .mockup-viewport iframe {
    width: 150%;
    transform: scale(0.667);
  }
  .mockup-frame.extension-frame .mockup-viewport.active {
    max-height: 360px;
  }

  /* Extension mini-frame in CTA section */
  .extension-mini-frame iframe {
    width: 150%;
    transform: scale(0.667);
    transform-origin: top left;
  }
  .extension-mini-frame {
    overflow: hidden;
    max-height: 380px;
  }

  /* Carrier grid: 2 columns */
  .carriers-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .carrier-card { padding: 16px 12px; }
  .carrier-card .carrier-desc { font-size: 0.72rem; }
  .carrier-card h4 { font-size: 0.85rem; }

  /* Install tabs */
  .install-tabs { gap: 4px; }
  .install-tab { padding: 6px 14px; font-size: 0.78rem; }
  .code-block pre { font-size: 0.68rem; padding: 12px; white-space: pre-wrap; word-break: break-all; }

  /* Extension CTA */
  .extension-info h3 { font-size: 1.2rem; }
  .extension-features li { font-size: 0.82rem; }
  .extension-mini-frame { width: 100%; max-width: 340px; }

  /* Section spacing */
  .section { padding: 48px 0; }
  .section-header { margin-bottom: 28px; }
}
