/* ==========================================================================
   Nexiv — System Light / Dark Design System
   Light bg: #ffffff | Dark bg: #0E0E0E
   Homepage accent: inverse surface
   WinFinder: #006E2A (light) / #3FE56C (dark)
   AiWon:     #1C6585 (light) / #8FCEF3 (dark)
   ========================================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
}

:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --bg-elevated: #f5f5f5;
  --surface: #f7f7f7;
  --surface-hover: #efefef;
  --header-bg: rgba(255, 255, 255, 0.84);
  --nav-mobile-bg: rgba(255, 255, 255, 0.97);

  --border: rgba(14, 14, 14, 0.09);
  --border-strong: rgba(14, 14, 14, 0.18);

  --text: #0e0e0e;
  --text-muted: #595959;
  --text-subtle: #767676;

  /* Homepage accent = inverse surface */
  --inverse-surface: #0e0e0e;
  --on-inverse: #ffffff;
  --accent: var(--inverse-surface);
  --on-accent: var(--on-inverse);
  --accent-soft: rgba(14, 14, 14, 0.07);
  --accent-glow: rgba(14, 14, 14, 0.045);

  --pill-bg: rgba(14, 14, 14, 0.045);
  --badge-border: rgba(14, 14, 14, 0.08);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

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

  --transition: 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-app="winfinder"] {
  --accent: #006e2a;
  --icon-bg: #006e2a;
  --on-accent: #ffffff;
  --accent-soft: rgba(0, 110, 42, 0.1);
  --accent-glow: rgba(0, 110, 42, 0.09);
}

[data-app="aiwon"] {
  --accent: #1c6585;
  --icon-bg: #1c6585;
  --on-accent: #ffffff;
  --accent-soft: rgba(28, 101, 133, 0.1);
  --accent-glow: rgba(28, 101, 133, 0.09);
}

@media (prefers-color-scheme: dark) {
  @font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
}

:root {
    --bg: #0e0e0e;
    --bg-elevated: #151515;
    --surface: #171717;
    --surface-hover: #1f1f1f;
    --header-bg: rgba(14, 14, 14, 0.84);
    --nav-mobile-bg: rgba(14, 14, 14, 0.97);

    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.18);

    --text: #f4f4f4;
    --text-muted: #a3a3a3;
    --text-subtle: #737373;

    --inverse-surface: #ffffff;
    --on-inverse: #0e0e0e;
    --accent: var(--inverse-surface);
    --on-accent: var(--on-inverse);
    --accent-soft: rgba(255, 255, 255, 0.1);
    --accent-glow: rgba(255, 255, 255, 0.05);

    --pill-bg: rgba(255, 255, 255, 0.05);
    --badge-border: rgba(255, 255, 255, 0.08);
  }

  [data-app="winfinder"] {
    --accent: #3fe56c;
    --on-accent: #0e0e0e;
    --accent-soft: rgba(63, 229, 108, 0.14);
    --accent-glow: rgba(63, 229, 108, 0.11);
  }

  [data-app="aiwon"] {
    --accent: #8fcef3;
    --on-accent: #0e0e0e;
    --accent-soft: rgba(143, 206, 243, 0.14);
    --accent-glow: rgba(143, 206, 243, 0.11);
  }
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

main {
  flex: 1;
}

.main-centered {
  display: flex;
  flex-direction: column;
}

.section {
  padding-block: 72px;
}

.section-tight {
  padding-block: 48px;
}

.divider {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

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

.nav a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color var(--transition);
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
}

.nav-cta {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text) !important;
}

.nav-cta:hover {
  border-color: var(--text-muted);
  background: var(--surface-hover);
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
}

/* Typography helpers */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

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

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero-title {
  margin-top: 18px;
  font-size: clamp(2.25rem, 5vw, 3.6rem);
  font-weight: 700;
  max-width: 16ch;
}

.hero-subtitle {
  margin-top: 20px;
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  color: var(--text-muted);
  max-width: 54ch;
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 36px;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  font-weight: 650;
}

.section-desc {
  margin: 0;
  color: var(--text-muted);
  max-width: 54ch;
}

/* Hero */
.hero {
  padding-top: 84px;
  padding-bottom: 64px;
}

.hero-actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 550;
  border: 1px solid transparent;
  transition: transform var(--transition), background var(--transition),
    border-color var(--transition), color var(--transition),
    opacity var(--transition);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--inverse-surface);
  color: var(--on-inverse);
}

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

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

.btn-accent:hover {
  opacity: 0.9;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

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

/* Unified Homepage Showcase */
.apps-showcase {
  margin-block: auto;
  padding-block: 48px 56px;
}

.showcase-header {
  margin-bottom: 36px;
}

.showcase-title {
  margin-top: 14px;
  font-size: clamp(2rem, 4.2vw, 3rem);
  font-weight: 700;
  text-wrap: balance;
}

.showcase-subtitle {
  margin: 12px 0 0;
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  color: var(--text-muted);
}

/* Apps Grid (scales cleanly as new apps are added) */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

@property --border-reveal {
  syntax: "<percentage>";
  initial-value: -18%;
  inherits: false;
}

.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  background-image: linear-gradient(var(--surface), var(--surface)),
    radial-gradient(
      circle at 50% 0%,
      var(--accent) var(--border-reveal),
      var(--border) calc(var(--border-reveal) + 18%)
    );
  background-origin: border-box;
  background-clip: padding-box, border-box;
  overflow: hidden;
  cursor: pointer;
  transition: --border-reveal 480ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.app-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 170px;
  background: radial-gradient(
    320px 140px at 50% 0%,
    var(--accent-glow),
    transparent 70%
  );
  opacity: 0.55;
  transition: opacity 320ms ease;
  pointer-events: none;
}

.app-card:hover,
.app-card:focus-visible {
  --border-reveal: 105%;
  box-shadow: 0 12px 32px -12px color-mix(in srgb, var(--accent) 32%, transparent);
}

.app-card:hover::before,
.app-card:focus-visible::before {
  opacity: 1;
}

.app-card-top {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.app-icon {
  width: 48px;
  height: 48px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--icon-bg, var(--accent));
  object-fit: contain;
  flex-shrink: 0;
}

.app-icon-lg {
  width: 72px;
  height: 72px;
  padding: 12px;
  border-radius: 18px;
}

.app-icon-full {
  padding: 0;
  object-fit: cover;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 550;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--badge-border);
}

.app-title {
  font-size: 1.3rem;
  font-weight: 650;
}

.app-tagline {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 14.5px;
}

.app-card-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 2px;
}

.app-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
}

/* App Landing Subpages */
.app-hero {
  padding-top: 56px;
  padding-bottom: 56px;
  background: radial-gradient(
    720px 360px at 20% 0%,
    var(--accent-glow),
    transparent 70%
  );
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

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

.app-hero-header {
  display: flex;
  align-items: flex-start;
  gap: 22px;
}

.app-hero-title {
  font-size: clamp(2rem, 4.2vw, 3rem);
  font-weight: 700;
  margin-top: 8px;
}

.app-hero-desc {
  margin: 16px 0 0;
  font-size: 1.08rem;
  color: var(--text-muted);
  max-width: 58ch;
}

.store-buttons {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.store-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  background-image: linear-gradient(var(--surface), var(--surface)),
    radial-gradient(
      circle at 50% 0%,
      var(--accent) var(--border-reveal),
      var(--border-strong) calc(var(--border-reveal) + 18%)
    );
  background-origin: border-box;
  background-clip: padding-box, border-box;
  overflow: hidden;
  transition: --border-reveal 480ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.store-btn::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 100%;
  background: radial-gradient(
    180px 70px at 50% 0%,
    var(--accent-glow),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 320ms ease;
  pointer-events: none;
}

.store-btn svg,
.store-btn-meta {
  position: relative;
}

.store-btn:hover,
.store-btn:focus-visible {
  --border-reveal: 105%;
  box-shadow: 0 10px 26px -10px color-mix(in srgb, var(--accent) 32%, transparent);
}

.store-btn:hover::before,
.store-btn:focus-visible::before {
  opacity: 0.9;
}

.store-btn-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
}

.store-btn-sub {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.store-btn-name {
  font-size: 15px;
  font-weight: 600;
}

/* Features Grid (4 -> 2 -> 1, never 3/1) */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.feature-card {
  padding: 22px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 14px;
}

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

.feature-card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

/* Screenshots Gallery */
.screens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.screen-frame {
  margin: 0;
  padding: 12px;
  border-radius: 38px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.screen-frame img {
  width: 100%;
  border-radius: 26px;
  aspect-ratio: 9 / 19;
  object-fit: cover;
  background: var(--bg);
}

.screen-frame figcaption {
  margin-top: 10px;
  padding-inline: 4px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* Legal Prose Pages */
.prose-wrap {
  max-width: 74ch;
}

.prose-header {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.prose-header h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  margin-top: 10px;
}

.prose-meta {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-muted);
}

.prose h2 {
  font-size: 1.25rem;
  margin-top: 32px;
  margin-bottom: 10px;
}

.prose p,
.prose ul {
  color: var(--text-muted);
  margin: 0 0 14px;
}

.prose ul {
  padding-left: 20px;
}

.prose li {
  margin-bottom: 6px;
}

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

.notice-box {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* Minimal App Legal Links */
.app-legal-bar {
  padding-bottom: 40px;
}

.app-legal-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
}

.app-legal-inner a {
  transition: color var(--transition);
}

.app-legal-inner a:hover {
  color: var(--text);
}

/* Minimal Single-Row Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

/* Responsive */
@media (max-width: 960px) {
  .features-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .apps-showcase {
    padding-block: 36px 48px;
  }

  .hero {
    padding-top: 56px;
    padding-bottom: 48px;
  }

  .section {
    padding-block: 52px;
  }

  .app-hero-header {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
}
