:root {
  /* Surfaces – soft cool gradient that mirrors Theme.appBackground */
  --bg-1: #fafcff;
  --bg-2: #e6edff;
  --bg-elev: rgba(255, 255, 255, 0.62);
  --bg-elev-strong: rgba(255, 255, 255, 0.85);

  --fg: #11122a;            /* near Theme.kerfInk */
  --fg-muted: #555670;
  --fg-subtle: #5f6178;

  /* Brand palette – mirrors Theme.swift */
  --violet: #7063f0;        /* primaryAccent */
  --violet-2: #947fff;      /* violetAccent */
  --ice: #59bcf5;
  --rose: #ff75a8;
  --teal: #56d1d4;
  --amber: #ffb35a;

  --accent: #4d3fca;
  --accent-hover: #372b9f;
  --brand-gradient: linear-gradient(135deg, var(--violet) 0%, var(--ice) 100%);

  --border: rgba(17, 18, 42, 0.08);
  --border-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.32));

  --shadow-sm: 0 1px 2px rgba(17, 18, 42, 0.05);
  --shadow-md: 0 18px 40px rgba(17, 18, 42, 0.08);
  --shadow-lg: 0 30px 80px rgba(17, 18, 42, 0.14);

  --radius-sm: 14px;
  --radius-md: 22px;        /* Theme.cardCornerRadius */
  --radius-lg: 26px;        /* Theme.tileCornerRadius */
  --radius-xl: 44px;

  --max-w: 1080px;

  /* SF Rounded matches the app's roundedHeadlineFont */
  --font: ui-rounded, -apple-system, BlinkMacSystemFont, "SF Pro Rounded",
    "SF Pro Display", "Inter", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-1: #07091a;
    --bg-2: #141738;
    --bg-elev: rgba(255, 255, 255, 0.06);
    --bg-elev-strong: rgba(255, 255, 255, 0.1);

    --fg: #f4f5fb;
    --fg-muted: #b0b3cd;
    --fg-subtle: #7d80a0;

    --accent: var(--violet-2);
    --accent-hover: #b3a4ff;

    --border: rgba(255, 255, 255, 0.1);
    --border-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.04));

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.7);
  }
}

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

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

body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  color: var(--fg);
  background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
}

/* Soft brand blobs across the page – mirror AppBackground */
body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(110px);
}

body::before {
  width: 520px;
  height: 520px;
  background: var(--ice);
  opacity: 0.22;
  top: -180px;
  left: -160px;
}

body::after {
  width: 480px;
  height: 480px;
  background: var(--rose);
  opacity: 0.18;
  bottom: -180px;
  right: -140px;
}

@media (prefers-color-scheme: dark) {
  body::before { opacity: 0.28; }
  body::after { opacity: 0.24; }
}

main,
.site-header,
.site-footer {
  position: relative;
  z-index: 1;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--fg);
  color: var(--bg-1);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

:where(a, button, select):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 75%, white);
  outline-offset: 3px;
}

/* ──────────────────────────────────────────── header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  background: color-mix(in srgb, var(--bg-1) 72%, transparent);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--fg);
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  box-shadow: var(--shadow-sm);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  margin-right: 8px;
}

.nav-link {
  position: relative;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-muted);
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand-gradient);
  opacity: 0;
  transform: scaleX(0.4);
  transform-origin: center;
  transition: opacity 0.2s ease, transform 0.25s ease;
}

.nav-link:hover {
  color: var(--fg);
  background: color-mix(in srgb, var(--fg) 5%, transparent);
}

.nav-link:hover::after,
.nav-link[aria-current="true"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.nav-link[aria-current="true"] {
  color: var(--fg);
}

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

.lang-switcher {
  position: relative;
}

.lang-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg-elev);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.lang-button:hover {
  background: var(--bg-elev-strong);
  transform: translateY(-1px);
}

.lang-button svg {
  width: 12px;
  height: 12px;
  opacity: 0.6;
}

.lang-select {
  min-height: 44px;
  max-width: 190px;
  padding: 8px 34px 8px 14px;
  border: 1px solid color-mix(in srgb, var(--fg) 20%, transparent);
  border-radius: 999px;
  background: var(--bg-elev-strong);
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 6px;
  display: none;
  flex-direction: column;
  z-index: 200;
}

.lang-menu[data-open="true"] {
  display: flex;
}

.lang-menu button {
  text-align: left;
  background: transparent;
  border: 0;
  padding: 9px 12px;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  color: var(--fg);
  cursor: pointer;
}

.lang-menu button:hover {
  background: color-mix(in srgb, var(--fg) 6%, transparent);
}

.lang-menu button[aria-current="true"] {
  color: var(--accent);
  font-weight: 600;
}

/* ──────────────────────────────────────────── hero */

.hero {
  padding: 96px 24px 80px;
  text-align: center;
}

.hero-inner {
  max-width: 760px;
  margin: 0 auto;
}

.hero-icon {
  width: 132px;
  height: 132px;
  margin: 0 auto 32px;
  border-radius: 30px;
  box-shadow:
    0 30px 80px rgba(112, 99, 240, 0.35),
    0 10px 30px rgba(89, 188, 245, 0.25);
}

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
  color: var(--accent);
}

.hero h1 {
  font-size: clamp(52px, 9vw, 96px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--fg) 0%, color-mix(in srgb, var(--violet) 70%, var(--fg)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.35;
  color: var(--fg-muted);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 36px;
}

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

.app-store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 26px;
  background: var(--brand-gradient);
  color: #fff;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  cursor: default;
  box-shadow:
    0 14px 36px rgba(112, 99, 240, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.app-store-badge svg {
  width: 22px;
  height: 22px;
}

.app-store-badge small {
  display: block;
  font-size: 11px;
  opacity: 0.7;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.release-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid color-mix(in srgb, var(--fg) 20%, transparent);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--fg-muted);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* ──────────────────────────────────────────── story */

.story {
  padding: 80px 24px 96px;
  text-align: center;
  position: relative;
}

.story-inner {
  max-width: 720px;
  margin: 0 auto;
}

.story-marks {
  width: 220px;
  max-width: 70%;
  height: auto;
  margin: 0 auto 28px;
  display: block;
  color: var(--violet);
}

.story .eyebrow {
  margin-bottom: 14px;
}

.story h2 {
  font-size: clamp(32px, 4.2vw, 48px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 28px;
  background: linear-gradient(135deg, var(--fg) 0%, color-mix(in srgb, var(--violet) 60%, var(--fg)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.story-lead {
  font-size: clamp(17px, 1.8vw, 20px);
  line-height: 1.65;
  color: var(--fg-muted);
  letter-spacing: -0.005em;
  max-width: 620px;
  margin: 0 auto 18px;
}

.story-lead:last-child {
  margin-bottom: 0;
}

/* ──────────────────────────────────────────── sections */

section {
  padding: 80px 24px;
}

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 64px;
}

.section-head h2 {
  font-size: clamp(34px, 4.4vw, 52px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--fg) 0%, color-mix(in srgb, var(--violet) 60%, var(--fg)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-head p {
  font-size: 19px;
  color: var(--fg-muted);
  line-height: 1.5;
}

/* ──────────────────────────────────────────── features */

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

/* Glass card – mirrors LuxeCardBackground (ultraThinMaterial + white border + soft shadow) */
.feature {
  position: relative;
  background: var(--bg-elev);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-md);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
  isolation: isolate;
}

/* The white gradient border (Theme cardBorder) */
.feature::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--border-glass);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

.feature:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* Gradient-filled rounded-square badge with white SF Symbol – CategoryIconBadge */
.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  margin-bottom: 22px;
  background: linear-gradient(135deg, var(--violet), var(--violet-2));
  box-shadow: 0 10px 22px rgba(112, 99, 240, 0.42);
}

.feature-icon {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.feature-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

/* Per-feature accent – each card gets its own gradient + glow */
.feature:nth-child(1) .feature-icon {
  background: linear-gradient(135deg, var(--violet), var(--ice));
  box-shadow: 0 10px 22px rgba(89, 188, 245, 0.4);
}
.feature:nth-child(2) .feature-icon {
  background: linear-gradient(135deg, var(--rose), #ff9a5a);
  box-shadow: 0 10px 22px rgba(255, 117, 168, 0.45);
}
.feature:nth-child(3) .feature-icon {
  background: linear-gradient(135deg, var(--ice), var(--teal));
  box-shadow: 0 10px 22px rgba(86, 209, 212, 0.4);
}
.feature:nth-child(4) .feature-icon {
  background: linear-gradient(135deg, var(--teal), #6dd4a5);
  box-shadow: 0 10px 22px rgba(86, 209, 212, 0.4);
}
.feature:nth-child(5) .feature-icon {
  background: linear-gradient(135deg, var(--violet-2), var(--violet));
  box-shadow: 0 10px 22px rgba(148, 127, 255, 0.42);
}
.feature:nth-child(6) .feature-icon {
  background: linear-gradient(135deg, var(--amber), var(--rose));
  box-shadow: 0 10px 22px rgba(255, 179, 90, 0.4);
}

.feature h3 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
  color: var(--fg);
}

.feature p {
  font-size: 15px;
  color: var(--fg-muted);
  line-height: 1.55;
}

/* Kerf Plus */
.plus-section {
  padding-top: 64px;
  padding-bottom: 64px;
}

.plus-card {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
  padding: clamp(32px, 5vw, 64px);
  border: 1px solid color-mix(in srgb, var(--fg) 12%, transparent);
  border-radius: var(--radius-xl);
  background: var(--bg-elev-strong);
  box-shadow: var(--shadow-lg);
}

.plus-card h2 {
  max-width: 680px;
  margin-bottom: 16px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.plus-card p,
.plus-list {
  color: var(--fg-muted);
}

.plus-list {
  display: grid;
  gap: 14px;
  padding: 0;
  list-style: none;
}

.plus-list li {
  position: relative;
  padding-left: 30px;
}

.plus-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 800;
}

/* ──────────────────────────────────────────── screenshots */

.screenshots {
  background:
    radial-gradient(ellipse at top, color-mix(in srgb, var(--violet) 10%, transparent), transparent 60%),
    radial-gradient(ellipse at bottom right, color-mix(in srgb, var(--ice) 10%, transparent), transparent 55%);
}

.shots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
  align-items: end;
}

.shot {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.shot-frame {
  position: relative;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 9 / 19.5;
  border-radius: 42px;
  padding: 6px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.15));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 30px 70px rgba(112, 99, 240, 0.22),
    0 10px 24px rgba(17, 18, 42, 0.12);
  overflow: hidden;
  margin-bottom: 20px;
  display: grid;
  place-items: stretch;
  color: var(--fg-subtle);
  font-size: 13px;
}

.shot-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--border-glass);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

.shot-frame img {
  border-radius: 36px;
}

.shot-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shot h3,
.shot h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

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

/* ──────────────────────────────────────────── footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  font-size: 13px;
  color: var(--fg-subtle);
}

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

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--fg-muted);
}

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

/* ──────────────────────────────────────────── privacy page */

.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: 80px 24px 100px;
}

.legal h1 {
  font-size: clamp(36px, 5vw, 52px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.legal .updated {
  color: var(--fg-subtle);
  font-size: 14px;
  margin-bottom: 48px;
}

.legal h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 40px 0 12px;
}

.legal p,
.legal li {
  color: var(--fg-muted);
  font-size: 17px;
  line-height: 1.6;
  margin-bottom: 12px;
}

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

.legal strong {
  color: var(--fg);
  font-weight: 600;
}

.legal a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.legal-intro {
  font-size: 19px !important;
  color: var(--fg) !important;
}

.contact-card {
  margin-top: 48px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elev-strong);
}

.contact-card h2 {
  margin-top: 0;
}

/* ──────────────────────────────────────────── responsive */

@media (max-width: 640px) {
  .hero {
    padding: 64px 20px 56px;
  }
  section {
    padding: 56px 20px;
  }
  .nav {
    padding: 12px 20px;
  }
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
  .nav-actions {
    gap: 10px;
  }
  .nav-actions > a {
    font-size: 14px;
  }
  .lang-select {
    max-width: 132px;
    min-height: 44px;
  }
  .plus-card {
    grid-template-columns: 1fr;
    gap: 28px;
    border-radius: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .feature:hover,
  .lang-button:hover {
    transform: none;
  }
}
