/* ============================================
   zangl.one – Shared Stylesheet
   ============================================ */

/* --- Custom Properties --- */
:root {
  --color-primary: #007aff;
  --color-primary-dark: #005ecb;
  --color-accent: #5856d6;
  --color-bg: #f5f5f7;
  --color-surface: #ffffff;
  --color-surface-glass: rgba(255, 255, 255, 0.72);
  --color-text: #1d1d1f;
  --color-text-secondary: #6e6e73;
  --color-border: rgba(0, 0, 0, 0.08);
  --color-shadow: rgba(0, 0, 0, 0.06);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, system-ui, sans-serif;
  --max-width: 960px;
  --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #000000;
    --color-surface: #1c1c1e;
    --color-surface-glass: rgba(28, 28, 30, 0.72);
    --color-text: #f5f5f7;
    --color-text-secondary: #98989d;
    --color-border: rgba(255, 255, 255, 0.1);
    --color-shadow: rgba(0, 0, 0, 0.3);
  }
}

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

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

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  opacity: 0.8;
}

img {
  max-width: 100%;
  height: auto;
}

/* --- Layout --- */
.page-wrapper {
  flex: 1;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-surface-glass);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-border);
}

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

.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition);
}

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

/* --- Hero Section --- */
.hero {
  text-align: center;
  padding: 6rem 1.5rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(0, 122, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  .hero::before {
    background: radial-gradient(circle, rgba(0, 122, 255, 0.15) 0%, transparent 70%);
  }
}

.hero-badge {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  background: var(--color-surface-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
}

.hero h1,
.hero-content h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
  position: relative;
}

.hero h1 .gradient-text,
.hero-content h1 .gradient-text {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p,
.hero-content p {
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  color: var(--color-text-secondary);
  max-width: 540px;
  margin: 0 0 2.5rem;
  line-height: 1.5;
}

.hero p {
  margin: 0 auto 2.5rem;
}

/* --- Buttons --- */
.btn-group {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.6rem;
  border-radius: 100px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

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

.btn-primary:hover {
  opacity: 0.85;
}

.btn-secondary {
  background: var(--color-surface-glass);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: var(--color-surface);
  opacity: 1;
}

.btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* --- Section --- */
.section {
  padding: 5rem 1.5rem;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section-header p {
  color: var(--color-text-secondary);
  font-size: 1.05rem;
  max-width: 500px;
  margin: 0 auto;
}

/* --- Feature Cards --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--color-shadow);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.feature-icon.blue { background: rgba(0, 122, 255, 0.1); color: #007aff; }
.feature-icon.purple { background: rgba(88, 86, 214, 0.1); color: #5856d6; }
.feature-icon.green { background: rgba(52, 199, 89, 0.1); color: #34c759; }
.feature-icon.orange { background: rgba(255, 149, 0, 0.1); color: #ff9500; }

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

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

/* --- App Card (for index portfolio grid) --- */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.app-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  color: inherit;
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--color-shadow);
  opacity: 1;
}

.app-card-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: white;
}

.app-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.app-card p {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex: 1;
}

.app-card-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-ios {
  background: rgba(0, 122, 255, 0.1);
  color: #007aff;
}

.badge-android {
  background: rgba(52, 199, 89, 0.1);
  color: #34c759;
}

.badge-soon {
  background: rgba(255, 149, 0, 0.1);
  color: #ff9500;
}

/* --- App Icon Light/Dark Switch --- */
.icon-light { display: inline-block; }
.icon-dark { display: none; }

@media (prefers-color-scheme: dark) {
  .icon-light { display: none; }
  .icon-dark { display: inline-block; }
}

/* App card icon with image instead of SVG */
.app-card-icon-img {
  background: none !important;
  padding: 0;
  overflow: hidden;
}

.app-card-icon-img img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
}

/* Hero app icon (product page) */
.hero-app-icon {
  margin-bottom: 1.25rem;
}

.hero-app-icon img {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  box-shadow: 0 8px 30px var(--color-shadow);
}

/* --- Phone Mockup --- */
.phone-mockup {
  max-width: 280px;
  margin: 0 auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 36px;
  padding: 12px;
  box-shadow: 0 20px 60px var(--color-shadow);
}

.phone-screen {
  background: var(--color-bg);
  border-radius: 26px;
  overflow: hidden;
}

.phone-screen img {
  width: 100%;
  display: none;
}

.phone-screen img.screenshot-light {
  display: block;
}

.phone-screen img.screenshot-dark {
  display: none;
}

.phone-screen-placeholder {
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}

/* --- Screenshot Showcase --- */
.screenshot-showcase {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.screenshot-showcase .phone-mockup {
  flex: 0 0 auto;
}

.screenshot-showcase-label {
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-top: 0.75rem;
  font-weight: 500;
}

/* Show dark screenshots in dark mode, light in light mode */
@media (prefers-color-scheme: dark) {
  .phone-screen img.screenshot-light { display: none; }
  .phone-screen img.screenshot-dark { display: block; }
}

/* --- Hero Screenshots (side by side with text) --- */
.hero-with-screenshots {
  display: flex;
  align-items: center;
  gap: 3rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 6rem 1.5rem 4rem;
  position: relative;
}

.hero-with-screenshots::before {
  content: "";
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(0, 122, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  .hero-with-screenshots::before {
    background: radial-gradient(circle, rgba(0, 122, 255, 0.15) 0%, transparent 70%);
  }
}

.hero-with-screenshots .hero-content {
  flex: 1;
  text-align: left;
  position: relative;
}

.hero-with-screenshots .hero-phones {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
  position: relative;
  align-items: flex-start;
}

.hero-with-screenshots .phone-mockup {
  width: 180px;
}

.hero-with-screenshots .phone-mockup:nth-child(2) {
  margin-top: 2rem;
}

/* --- Platform Section --- */
.platforms {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.platform-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.75rem;
  min-width: 220px;
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition), box-shadow var(--transition);
}

a.platform-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--color-shadow);
  opacity: 1;
}

.platform-icon {
  font-size: 1.5rem;
}

.platform-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.platform-info p {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

/* --- Content Pages (Datenschutz, Impressum, Support) --- */
.content-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.content-page h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.content-page h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.content-page p {
  margin-bottom: 1rem;
  color: var(--color-text-secondary);
}

.content-page ul {
  margin-bottom: 1rem;
  padding-left: 1.25rem;
}

.content-page li {
  margin-bottom: 0.5rem;
  color: var(--color-text-secondary);
}

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

.content-page a {
  color: var(--color-primary);
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem 1.5rem;
  margin-top: auto;
}

.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

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

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

.footer-copy {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

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

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

/* Staggered fade-in for screenshot items */
.screenshot-showcase > div {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.screenshot-showcase.visible > div:nth-child(1) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.1s;
}

.screenshot-showcase.visible > div:nth-child(2) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.25s;
}

.screenshot-showcase.visible > div:nth-child(3) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.4s;
}

/* Interactive screenshot phones */
.screenshot-showcase > div {
  perspective: 600px;
}

.screenshot-showcase .phone-mockup {
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease;
}

.screenshot-showcase > div:hover .phone-mockup {
  transform: scale(1.05) rotateY(-3deg) rotateX(2deg);
  box-shadow: 0 30px 60px var(--color-shadow), 0 0 40px rgba(0, 122, 255, 0.08);
}

.screenshot-showcase .screenshot-showcase-label {
  transition: color 0.3s ease, transform 0.3s ease;
}

.screenshot-showcase > div:hover .screenshot-showcase-label {
  color: var(--color-primary);
  transform: translateY(2px);
}

/* Middle phone offset for visual rhythm */
.screenshot-showcase.visible > div:nth-child(2) .phone-mockup {
  transform: translateY(-12px);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease;
}

.screenshot-showcase > div:nth-child(2):hover .phone-mockup {
  transform: translateY(-12px) scale(1.05) rotateY(3deg) rotateX(2deg);
  box-shadow: 0 30px 60px var(--color-shadow), 0 0 40px rgba(0, 122, 255, 0.08);
}

/* Subtle floating animation for hero phones */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes float-offset {
  0%, 100% { transform: translateY(2rem); }
  50% { transform: translateY(calc(2rem - 8px)); }
}

/* Hero intro animation (plays once on load) */
@keyframes hero-fade-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hero-phone-in {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hero-phone-in-offset {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(2rem); }
}

.hero-with-screenshots .hero-content {
  animation: hero-fade-in 0.8s ease forwards;
}

.hero-with-screenshots .hero-phones .phone-mockup:nth-child(1) {
  opacity: 0;
  animation: hero-phone-in 0.7s ease 0.2s forwards, float 4s ease-in-out 1.5s infinite;
}

.hero-with-screenshots .hero-phones .phone-mockup:nth-child(2) {
  opacity: 0;
  animation: hero-phone-in-offset 0.7s ease 0.4s forwards, float-offset 4s ease-in-out 2s infinite;
}

/* --- Product Hero Animations (staggered cascade) --- */
@keyframes product-hero-in {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes icon-pop {
  0% { opacity: 0; transform: scale(0.5) rotate(-10deg); }
  60% { transform: scale(1.08) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes float-icon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.hero-product .hero-anim {
  opacity: 0;
  animation: product-hero-in 0.7s ease forwards;
}

.hero-product .hero-anim-1 { animation-delay: 0s; }
.hero-product .hero-anim-2 {
  animation: icon-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s forwards, float-icon 3s ease-in-out 1.5s infinite;
  opacity: 0;
}
.hero-product .hero-anim-3 { animation-delay: 0.25s; }
.hero-product .hero-anim-4 { animation-delay: 0.4s; }
.hero-product .hero-anim-5 { animation-delay: 0.55s; }

/* Animated glow behind product hero */
.hero-product::after {
  content: "";
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0, 122, 255, 0.08) 0%, transparent 70%);
  pointer-events: none;
  animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.15); }
}

@media (prefers-color-scheme: dark) {
  .hero-product::after {
    background: radial-gradient(circle, rgba(0, 122, 255, 0.12) 0%, transparent 70%);
  }
}

/* Feature cards staggered entrance */
.features-grid .feature-card.fade-in {
  transition-duration: 0.6s;
}

.features-grid .feature-card.fade-in:nth-child(1) { transition-delay: 0s; }
.features-grid .feature-card.fade-in:nth-child(2) { transition-delay: 0.1s; }
.features-grid .feature-card.fade-in:nth-child(3) { transition-delay: 0.2s; }
.features-grid .feature-card.fade-in:nth-child(4) { transition-delay: 0.3s; }

/* --- Responsive --- */
@media (max-width: 640px) {
  .hero {
    padding: 4rem 1.25rem 3rem;
  }

  .section {
    padding: 3rem 1.25rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .nav-links a {
    font-size: 0.8rem;
  }

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

  .app-grid {
    grid-template-columns: 1fr;
  }

  .platform-card {
    min-width: unset;
    flex: 1;
  }

  .screenshot-showcase .phone-mockup {
    max-width: 220px;
  }

  .hero-with-screenshots {
    flex-direction: column;
    text-align: center;
    padding: 3rem 1.25rem 2rem;
  }

  .hero-with-screenshots .hero-content {
    text-align: center;
  }

  .hero-with-screenshots .phone-mockup {
    width: 140px;
  }

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

  .footer-links {
    justify-content: center;
  }

  .btn-group {
    flex-direction: column;
    align-items: center;
  }
}
