/* Vikunja for iOS — marketing site styles
   No external fonts, no CDNs. System font stack only. */

:root {
  --blue: #007AFF;
  --blue-ink: #0060cc;
  --purple: #5E5CE6;
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f0f0f3;
  --text: #1d1d1f;
  --text-muted: #6e6e73;
  --border: rgba(0, 0, 0, 0.08);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lift: 0 4px 8px rgba(0, 0, 0, 0.06), 0 16px 40px rgba(0, 0, 0, 0.10);
  --header-bg: rgba(245, 245, 247, 0.72);
  --radius-l: 28px;
  --radius-m: 20px;
  --radius-s: 12px;
  --max-w: 1120px;
  --focus-ring: 0 0 0 3px rgba(0, 122, 255, 0.5);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --blue: #0A84FF;
    --blue-ink: #58a6ff;
    --purple: #7D7AFF;
    --bg: #000000;
    --bg-elevated: #1c1c1e;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --text: #f5f5f7;
    --text-muted: #98989d;
    --border: rgba(255, 255, 255, 0.10);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 4px 8px rgba(0, 0, 0, 0.3), 0 16px 40px rgba(0, 0, 0, 0.45);
    --header-bg: rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

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

/* Hide content until the i18n pass has run, to avoid a flash of the wrong
   language. app.js removes this class in a finally-block, and this rule
   self-cancels after a moment in case JS never runs. */
html.i18n-loading body {
  visibility: hidden;
}
noscript ~ * {
  visibility: visible;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--blue);
}

h1, h2, h3, h4 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
  color: var(--text-muted);
}

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

/* Skip link */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--blue);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-s);
  z-index: 1000;
  transition: top 0.2s ease;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  top: 12px;
}

/* Focus styles */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-s);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}
.site-header.is-scrolled {
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
}
.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.main-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.8;
}
.main-nav a:hover {
  opacity: 1;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lang-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}
.lang-toggle button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-weight: 600;
  font-size: 12px;
  padding: 6px 12px;
  cursor: pointer;
}
.lang-toggle button[aria-pressed="true"] {
  background: var(--blue);
  color: #fff;
}

@media (max-width: 760px) {
  .main-nav { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-primary:hover {
  box-shadow: var(--shadow-lift);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--surface-2);
}

/* App Store badge (drawn, no image dependency) */
.badge-appstore {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #000;
  color: #fff;
  padding: 10px 18px;
  border-radius: 12px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.badge-appstore:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lift);
}
.badge-appstore svg {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}
.badge-appstore .badge-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.badge-appstore .badge-sub {
  font-size: 10px;
  opacity: 0.85;
}
.badge-appstore .badge-main {
  font-size: 18px;
  font-weight: 600;
  font-family: -apple-system, "SF Pro Display", sans-serif;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 64px;
}
.hero-bg {
  position: absolute;
  inset: -20% -10%;
  z-index: -1;
  background:
    radial-gradient(45% 35% at 15% 20%, rgba(10, 132, 255, 0.35), transparent 60%),
    radial-gradient(40% 40% at 85% 15%, rgba(94, 92, 230, 0.30), transparent 60%),
    radial-gradient(50% 40% at 50% 100%, rgba(10, 132, 255, 0.18), transparent 60%);
  filter: blur(40px);
  background-size: 200% 200%;
  animation: heroDrift 22s ease-in-out infinite alternate;
}
@keyframes heroDrift {
  0% { background-position: 0% 0%, 100% 0%, 50% 100%; }
  100% { background-position: 20% 20%, 80% 30%, 40% 80%; }
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-mockup-wrap {
    order: -1;
  }
}
.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-ink);
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(34px, 5.5vw, 56px);
  margin-bottom: 20px;
}
.hero-subtitle {
  font-size: clamp(16px, 2vw, 19px);
  max-width: 46ch;
}
@media (max-width: 900px) {
  .hero-subtitle { margin-left: auto; margin-right: auto; }
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
  align-items: center;
}
@media (max-width: 900px) {
  .hero-ctas { justify-content: center; }
}

/* iPhone mockup, drawn in CSS */
.hero-mockup-wrap {
  display: flex;
  justify-content: center;
  perspective: 1200px;
}
.phone-frame {
  position: relative;
  width: 260px;
  aspect-ratio: 260 / 534;
  background: #111;
  border-radius: 46px;
  padding: 12px;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.2),
    0 30px 60px rgba(0, 0, 0, 0.35),
    inset 0 0 0 2px rgba(255, 255, 255, 0.08);
  transform: rotateY(-8deg) rotateX(4deg);
  transition: transform 0.4s ease;
  will-change: transform;
}
.phone-frame::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 50%;
  translate: -50% 0;
  width: 84px;
  height: 22px;
  background: #111;
  border-radius: 14px;
  z-index: 3;
}
.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 34px;
  overflow: hidden;
  background: var(--bg-elevated);
}
.phone-screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.phone-screen img.is-active {
  opacity: 1;
}

/* Task check micro-animation, floating over the hero mockup */
.hero-check-chip {
  position: absolute;
  right: -14px;
  bottom: 64px;
  background: var(--surface);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-lift);
  padding: 10px 14px 10px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  animation: chipFloat 5s ease-in-out infinite;
}
@media (max-width: 900px) {
  .hero-check-chip { right: 6px; }
}
@keyframes chipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.check-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #34C759;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.check-circle svg {
  width: 13px;
  height: 13px;
}
.check-path {
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
  animation: drawCheck 0.6s ease forwards 1.4s infinite;
  animation-iteration-count: 1;
}
.hero-check-chip {
  animation-delay: 0s;
}
.hero-check-chip .check-path {
  animation: drawCheck 0.5s ease-out 0.6s both, drawCheck 0.5s ease-out 4.6s both;
}
@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

/* Sections */
section {
  padding: 88px 0;
}
.section-head {
  max-width: 640px;
  margin: 0 auto 48px;
  text-align: center;
}
.section-head h2 {
  font-size: clamp(26px, 3.4vw, 38px);
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-stagger > * {
  transition-delay: calc(var(--i, 0) * 70ms);
}

/* Feature cards */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 900px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .feature-grid { grid-template-columns: 1fr; }
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 26px 24px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift);
}
.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--blue) 16%, transparent);
  color: var(--blue-ink);
  margin-bottom: 16px;
}
.feature-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}
.feature-card h3 {
  font-size: 17px;
  margin-bottom: 8px;
}
.feature-card p {
  font-size: 14.5px;
  margin: 0;
}

/* Screenshots carousel */
.screens-wrap {
  display: flex;
  justify-content: center;
}
.carousel {
  position: relative;
  width: 280px;
}
.carousel-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 260 / 534;
  background: #111;
  border-radius: 46px;
  padding: 12px;
  box-shadow: var(--shadow-lift);
}
.carousel-frame::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 50%;
  translate: -50% 0;
  width: 84px;
  height: 22px;
  background: #111;
  border-radius: 14px;
  z-index: 3;
}
.carousel-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 34px;
  overflow: hidden;
  background: var(--bg-elevated);
}
.carousel-screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.carousel-screen img.is-active {
  opacity: 1;
}
.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}
.carousel-controls button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.carousel-controls button:hover {
  background: var(--surface-2);
}
.carousel-dots {
  display: flex;
  gap: 8px;
}
.carousel-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: var(--border);
  cursor: pointer;
}
.carousel-dots button[aria-current="true"] {
  background: var(--blue);
  width: 18px;
  border-radius: 4px;
}

[data-gallery-play] .icon-play {
  display: none;
}

/* Connect steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  counter-reset: step;
}
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
}
.step {
  text-align: center;
  padding: 8px;
}
.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin: 0 auto 16px;
}
.step h3 {
  font-size: 17px;
}
.step p {
  font-size: 14.5px;
}

/* About / support cards */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 48px;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}
.panel p {
  font-size: 16px;
}
.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 20px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
}
.footer-links a:hover {
  color: var(--text);
}
.footer-copy {
  color: var(--text-muted);
  font-size: 13px;
}

/* Legal pages */
.legal-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 96px;
}
.legal-main h1 {
  font-size: clamp(28px, 4vw, 38px);
  margin-bottom: 32px;
}
.legal-main h2 {
  font-size: 20px;
  margin-top: 36px;
}
.legal-main h3 {
  font-size: 16px;
  margin-top: 24px;
  color: var(--text);
}
.legal-main p, .legal-main li {
  color: var(--text-muted);
  font-size: 15px;
}
.legal-main a {
  color: var(--blue);
}
.legal-note {
  background: var(--surface-2);
  border-radius: var(--radius-s);
  padding: 16px 18px;
  font-size: 13.5px;
  margin-bottom: 32px;
  color: var(--text-muted);
}
.contact-box {
  background: var(--surface-2);
  border-radius: var(--radius-s);
  padding: 18px 20px;
  margin: 16px 0;
}
.contact-box p {
  margin: 0;
  color: var(--text);
}
[data-lang] + [data-lang] {
  margin-top: 8px;
}

/* 404 */
.error-main {
  max-width: 560px;
  margin: 0 auto;
  padding: 120px 24px;
  text-align: center;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .hero-bg { animation: none; }
  .phone-frame { transform: none; }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --border: rgba(0, 0, 0, 0.4);
  }
}
