/* ============================================================
   Polarly landing — style.css
   Plain CSS, no preprocessor, no build step (spec 032 §3).
   Palette mirrors the mobile app (mobile/lib/core/theme/app_colors.dart).
   Light is the base; dark is a bonus via prefers-color-scheme.
   ============================================================ */

:root {
  /* Brand */
  --primary: #6366f1;
  --primary-dark: #4338ca;
  --primary-light: #818cf8;
  --teal: #0d9488;
  --success: #10b981;

  --grad: linear-gradient(135deg, #0d9488 0%, #6366f1 100%);
  --grad-star: linear-gradient(135deg, #3d96b2 0%, #536acd 65%, #6a3de8 100%);

  /* Light surfaces / text */
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;

  /* Placeholder + phone */
  --placeholder-bg: #e9edf3;
  --placeholder-bar: #d4dbe6;
  --bezel: #14141b;
  --bezel-edge: #2a2a3a;

  /* Geometry (AppRadius) */
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  --maxw: 1080px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-phone: 0 24px 60px -16px rgba(15, 23, 42, 0.28);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0f;
    --surface: #14141b;
    --surface-2: #1f1f2e;
    --border: #2a2a3a;
    --text: #f1f5f9;
    --text-2: #94a3b8;
    --text-3: #64748b;

    --placeholder-bg: #1f1f2e;
    --placeholder-bar: #2a2a3a;
    --bezel: #05050a;
    --bezel-edge: #2a2a3a;

    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-phone: 0 24px 60px -16px rgba(0, 0, 0, 0.6);
  }
}

/* ----------------------------- reset ----------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: clip; /* stray glow / wide children never cause horizontal scroll */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
figure,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

img,
svg {
  display: block;
}

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

a:hover {
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: 20px;
}

.section-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: clamp(24px, 4vw, 40px);
}

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

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand__logo {
  width: 32px;
  height: 32px;
}

.brand__name {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

/* Header brand reads as a real mark; footer keeps the base (utility) size. */
.site-header .brand__logo {
  width: 52px;
  height: 52px;
}

.site-header .brand__name {
  font-size: 1.45rem;
}

/* language switch */
.lang-switch {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
}

.lang-switch__btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  color: var(--text-2);
  background: transparent;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.lang-switch__btn:hover {
  color: var(--text);
}

.lang-switch__btn.is-active {
  color: #fff;
  background: var(--primary);
}

/* ------------------------------ hero ----------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(48px, 9vw, 104px);
}

/* soft brand glow behind hero, top-right */
.hero::before {
  content: "";
  position: absolute;
  top: -180px;
  right: -120px;
  width: 620px;
  height: 620px;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--primary) 26%, transparent) 0%,
    transparent 62%
  );
  pointer-events: none;
  z-index: 0;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(40px, 7vw, 64px);
  align-items: center;
}

.hero__copy {
  min-width: 0; /* allow the grid item to shrink so text wraps, not overflows */
}

.hero__visual {
  display: flex;
  justify-content: center;
}

.hero__title {
  font-size: clamp(2rem, 4.6vw, 2.75rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  max-width: 22ch;
}

.hero__sub {
  margin-top: 20px;
  font-size: clamp(1rem, 2.2vw, 1.18rem);
  color: var(--text-2);
  max-width: 46ch;
}

.hero__cta {
  margin-top: 32px;
}

.hero__note {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--text-3);
}

.hero__works {
  margin-top: 28px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-3);
}

/* ----------------------------- buttons --------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  padding: 14px 24px;
  border-radius: var(--r-lg);
  border: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn--primary {
  color: #fff;
  background: var(--grad);
  box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--primary) 70%, transparent);
}

.btn--primary:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px -8px color-mix(in srgb, var(--primary) 75%, transparent);
}

/* "coming soon" state — still on-brand, but clearly not yet active */
.btn--soon {
  cursor: default;
  opacity: 0.85;
}

.btn__badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* ------------------------- phone mockups ------------------------- */
.phone {
  position: relative;
  width: 100%;
  max-width: 250px;
  margin-inline: auto;
  padding: 10px;
  background: var(--bezel);
  border: 1px solid var(--bezel-edge);
  border-radius: 38px;
  box-shadow: var(--shadow-phone);
}

.phone__notch {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 78px;
  height: 22px;
  background: #000;
  border-radius: var(--r-pill);
  z-index: 2;
}

.phone__screen {
  position: relative;
  aspect-ratio: 9 / 19.5;
  border-radius: 28px;
  overflow: hidden;
  background: var(--placeholder-bg);
}

.phone--hero {
  max-width: clamp(220px, 30vw, 280px);
}

/* placeholder content inside the screen (replaced by real screenshots) */
.placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 56px 18px 18px;
  background: var(--placeholder-bg);
}

.placeholder__bar {
  height: 44px;
  border-radius: var(--r);
  background: var(--placeholder-bar);
}

.placeholder__bar--lg {
  height: 72px;
}

.placeholder__bar--sm {
  height: 44px;
  width: 70%;
}

.placeholder__tag {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--r-pill);
}

/* ---------------------------- features --------------------------- */
.features {
  padding-block: clamp(48px, 8vw, 88px);
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.feature {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
}

.feature__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-lg);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  margin-bottom: 16px;
}

.feature__icon svg {
  width: 22px;
  height: 22px;
}

.feature__title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.feature__desc {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 0.95rem;
}

/* --------------------------- screenshots ------------------------- */
.screens {
  padding-block: clamp(48px, 8vw, 88px);
  background: var(--surface-2);
  border-block: 1px solid var(--border);
}

.screens-row {
  display: flex;
  gap: clamp(16px, 4vw, 36px);
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.screen-item {
  flex: 0 0 auto;
  width: 200px;
  scroll-snap-align: center;
}

.screen-item .phone {
  max-width: 200px;
}

.screen-item__cap {
  margin-top: 16px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
}

/* ----------------------------- footer ---------------------------- */
.site-footer {
  padding-block: clamp(32px, 5vw, 48px);
  border-top: 1px solid var(--border);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-footer__tagline {
  font-size: 0.85rem;
  color: var(--text-3);
}

.site-footer__contact {
  font-size: 0.95rem;
  color: var(--text-2);
}

.site-footer__copy {
  font-size: 0.85rem;
  color: var(--text-3);
}

/* --------------------------- breakpoints ------------------------- */
@media (min-width: 600px) {
  .feature-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 860px) {
  .hero__inner {
    grid-template-columns: 1.05fr 0.95fr;
  }

  .hero__visual {
    justify-content: flex-end;
  }

  .screens-row {
    justify-content: center;
    overflow-x: visible;
  }

  .site-footer__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }
}

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

  .btn {
    transition: none;
  }
}
