/* ============================================================
   Monawang Apps — Noir design language
   Layout & typography restored from the Noir canvas design:
   dark-first surfaces, accent-tinted hero bands, 2x2 feature
   grid, compact type ladder, pill controls, quiet footer.
   ============================================================ */

:root {
  color-scheme: dark;

  /* Accent (Noir violet by default; each app overrides --accent inline) */
  --primary: #7c5cff;
  --primary-focus: #6b4bef;
  --accent: #7c5cff;

  /* Ink & surfaces — dark first */
  --ink: #f5f5f7;
  --body: #f5f5f7;
  --muted: #9a9aa8;
  --faint: #6f6f7c;
  --divider: rgba(255, 255, 255, .09);
  --canvas: #0e0e11;
  --canvas-soft: #16161b;
  --surface: #1c1c22;
  --on-accent: #ffffff;

  --shadow-image: 0 30px 70px rgba(0, 0, 0, .55);
  --shadow-card: 0 18px 44px rgba(0, 0, 0, .35);

  --radius: 16px;
  --radius-lg: 26px;
  --radius-pill: 999px;
  --max: 1080px;

  --font-ui: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
}

/* Light theme (opt-in via toggle) */
:root[data-theme="light"] {
  color-scheme: light;
  --ink: #1d1d1f;
  --body: #1d1d1f;
  --muted: #6e6e73;
  --faint: #8a8a90;
  --divider: #e8e8ed;
  --canvas: #ffffff;
  --canvas-soft: #f5f5f7;
  --surface: #fafafc;
  --shadow-image: 0 30px 70px rgba(0, 0, 0, .14);
  --shadow-card: 0 18px 44px rgba(0, 0, 0, .10);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--canvas);
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  color: var(--body);
  background: var(--canvas);
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
}

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

/* ============================================================
   Global nav — slim translucent bar
   ============================================================ */
.global-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 max(20px, calc((100vw - var(--max)) / 2));
  background: color-mix(in srgb, var(--canvas) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--divider);
  color: var(--ink);
  font-size: 13px;
}

.brand,
.nav-tools,
.site-footer nav,
.related-icons,
.contact-grid {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  min-width: max-content;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 70%, #fff 0%), color-mix(in srgb, var(--accent) 90%, #000 20%));
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.nav-tools {
  gap: 22px;
}

.locale-menu {
  position: relative;
}

.locale-menu summary,
.theme-toggle {
  cursor: pointer;
  list-style: none;
  border: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  transition: color .15s ease;
}

.locale-menu summary:hover,
.theme-toggle:hover {
  color: var(--accent);
}

.locale-menu summary::-webkit-details-marker {
  display: none;
}

.locale-list {
  position: absolute;
  right: 0;
  top: 32px;
  display: grid;
  min-width: 150px;
  padding: 8px;
  border: 1px solid var(--divider);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.locale-list a {
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
}

.locale-list a:hover {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}

/* ============================================================
   Shared centered blocks
   ============================================================ */
.intro-band,
.feature-section,
.showcase-list,
.privacy-panel,
.related-strip,
.text-page,
.app-grid,
.site-footer {
  width: min(var(--max), calc(100vw - 40px));
  margin-inline: auto;
}

/* ============================================================
   HERO (home) & APP-HERO — full-bleed accent-tinted band
   ============================================================ */
.hero,
.app-hero {
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  padding: clamp(56px, 8vw, 104px) max(20px, calc((100vw - var(--max)) / 2));
  display: grid;
  align-items: center;
  gap: clamp(32px, 6vw, 72px);
  background:
    radial-gradient(130% 120% at 82% 0%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 58%),
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 20%, var(--canvas)), color-mix(in srgb, var(--accent) 9%, var(--canvas)));
  border-bottom: 1px solid var(--divider);
}

.hero {
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr);
}

.app-hero {
  grid-template-columns: minmax(280px, .92fr) minmax(340px, 1.08fr);
}

/* Titles */
.hero-copy h1,
.app-hero h1,
.text-page h1 {
  margin: 0;
  max-width: 15ch;
  font-size: clamp(34px, 5vw, 48px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.app-hero h1 {
  color: color-mix(in srgb, var(--accent) 55%, var(--ink));
}

/* Leads / paragraphs */
.hero-copy p,
.app-hero > div > p,
.text-page > section p {
  max-width: 52ch;
  color: var(--muted);
  font-size: clamp(17px, 1.9vw, 20px);
  line-height: 1.6;
}

.hero-copy p {
  margin: 16px 0 28px;
}

/* Eyebrow */
.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 13px !important;
  line-height: 1.3 !important;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Primary button — pill */
.button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 26px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform .15s ease, filter .15s ease;
}

.button-primary:hover {
  filter: brightness(1.08);
}

.button-primary:active {
  transform: scale(0.96);
}

/* ============================================================
   APP DOCK — rounded accent tiles (hero visual on home)
   ============================================================ */
.app-dock {
  display: grid;
  grid-template-columns: repeat(3, minmax(84px, 1fr));
  gap: 14px;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--canvas) 78%, transparent);
  box-shadow: var(--shadow-card);
}

.app-dock a {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 108px;
  padding: 14px;
  border-radius: var(--radius);
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: transform .18s ease, background .18s ease;
}

.app-dock a:hover {
  transform: translateY(-3px);
  background: color-mix(in srgb, var(--accent) 20%, var(--surface));
}

.app-dock img {
  width: 52px;
  height: 52px;
  border-radius: 22%;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .3);
}

/* ============================================================
   INTRO band + section headings
   ============================================================ */
.intro-band {
  padding: clamp(56px, 8vw, 88px) 0 8px;
}

.intro-band h2,
.feature-section h2,
.section-head h2,
.showcase-copy h2,
.privacy-panel h2,
.privacy-policy h2 {
  max-width: 22ch;
  margin: 0;
  font-size: clamp(24px, 3.2vw, 32px);
  line-height: 1.14;
  font-weight: 680;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.intro-band h2 {
  color: var(--muted);
  max-width: 30ch;
  font-weight: 600;
}

h3 {
  margin: 0;
  font-size: clamp(18px, 2vw, 20px);
  line-height: 1.25;
  font-weight: 620;
  letter-spacing: -0.01em;
}

/* ============================================================
   APP GRID — catalog cards
   ============================================================ */
.app-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 0 auto clamp(56px, 8vw, 96px);
}

.catalog-card {
  display: grid;
  gap: 22px;
  align-content: space-between;
  min-height: 400px;
  padding: clamp(24px, 3.5vw, 36px);
  overflow: hidden;
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  background: var(--canvas-soft);
  transition: transform .2s ease, border-color .2s ease;
}

.catalog-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--divider));
}

.catalog-card-alt {
  background: var(--surface);
}

.catalog-card .tile-copy h2 {
  margin: 14px 0 10px;
  max-width: 24ch;
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.16;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.catalog-card .tile-copy p {
  margin: 0 0 16px;
  max-width: 46ch;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.55;
}

.app-icon {
  width: 64px;
  height: 64px;
  border-radius: 22%;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .3);
}

.app-icon-large {
  width: 88px;
  height: 88px;
}

/* Platform chips */
.platform-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.platform-row span {
  padding: 5px 11px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--divider));
  border-radius: var(--radius-pill);
  color: color-mix(in srgb, var(--accent) 70%, var(--ink));
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  font-size: 12px;
  font-weight: 600;
}

/* Card feature list (short bullets) */
.core-feature-list {
  display: grid;
  gap: 9px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.core-feature-list li {
  position: relative;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}

.core-feature-list li::before {
  position: absolute;
  top: .62em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.text-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 16px;
  font-weight: 550;
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============================================================
   APP HERO screenshot + store badge
   ============================================================ */
.hero-screenshot {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
  object-position: top left;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-image);
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  color: var(--faint);
  text-decoration: none;
  font-size: 13px;
}

.store-badge img {
  width: 180px;
  display: block;
}

/* ============================================================
   FEATURE SECTION — Noir 2x2 icon grid
   ============================================================ */
.feature-section,
.showcase-list,
.privacy-panel,
.related-strip {
  padding: clamp(56px, 8vw, 88px) 0;
}

.feature-section {
  display: grid;
  gap: clamp(32px, 4vw, 52px);
}

.section-head {
  max-width: 640px;
}

.section-head p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 1.7vw, 18px);
  line-height: 1.6;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px 48px;
}

.feature-cell {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.feature-chip {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, transparent);
}

.feature-chip svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.feature-cell p {
  margin: 0;
  padding-top: 8px;
  color: var(--body);
  font-size: 16px;
  line-height: 1.55;
}

/* legacy feature list (kept harmless) */
.feature-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-list li,
.privacy-panel li {
  padding: 16px 0;
  border-bottom: 1px solid var(--divider);
  color: var(--body);
  font-size: 16px;
  line-height: 1.5;
}

/* ============================================================
   SHOWCASE — alternating image + copy
   ============================================================ */
.showcase-list {
  display: grid;
  gap: clamp(28px, 4vw, 48px);
}

.showcase-item {
  display: grid;
  grid-template-columns: minmax(260px, .82fr) minmax(340px, 1.18fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  background: var(--canvas-soft);
}

.showcase-item-reverse {
  grid-template-columns: minmax(340px, 1.18fr) minmax(260px, .82fr);
}

.showcase-item-reverse .showcase-copy {
  order: 2;
}

.showcase-item img {
  width: 100%;
  max-height: 540px;
  object-fit: cover;
  object-position: top left;
  border-radius: var(--radius);
  box-shadow: var(--shadow-image);
}

.showcase-copy h2 {
  margin: 12px 0 0;
}

.showcase-copy p {
  max-width: 52ch;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.6;
}

/* ============================================================
   PRIVACY / TEXT pages
   ============================================================ */
.privacy-panel {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: clamp(28px, 5vw, 64px);
  border-top: 1px solid var(--divider);
}

.privacy-panel ul {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.text-page {
  max-width: 900px;
}

.text-page > section:first-child {
  padding: clamp(48px, 8vw, 96px) 0 clamp(24px, 4vw, 40px);
}

.text-page h1 {
  max-width: 20ch;
}

.privacy-policy {
  display: grid;
  gap: 8px;
  padding: clamp(10px, 3vw, 24px) 0 clamp(48px, 8vw, 80px);
}

.privacy-policy article {
  padding-top: 26px;
  margin-top: 26px;
  border-top: 1px solid var(--divider);
}

.privacy-policy h2 {
  font-size: clamp(20px, 2.2vw, 24px);
}

.privacy-policy p {
  max-width: 78ch;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.privacy-policy a {
  color: var(--accent);
}

.fine-print {
  color: var(--faint);
  font-size: 14px !important;
}

/* ============================================================
   RELATED / CONTACT chip rows
   ============================================================ */
.related-icons,
.contact-grid {
  flex-wrap: wrap;
  gap: 14px;
}

.contact-grid {
  padding-bottom: clamp(48px, 8vw, 80px);
}

.related-icons a,
.contact-grid a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-pill);
  color: var(--ink);
  background: var(--canvas-soft);
  text-decoration: none;
  font-size: 15px;
  font-weight: 550;
  transition: border-color .18s ease, transform .18s ease;
}

.related-icons a:hover,
.contact-grid a:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--divider));
}

.related-icons img,
.contact-grid img {
  width: 32px;
  height: 32px;
  border-radius: 22%;
}

/* ============================================================
   FOOTER — quiet
   ============================================================ */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  padding: 40px 0 60px;
  margin-top: clamp(24px, 5vw, 48px);
  border-top: 1px solid var(--divider);
  color: var(--faint);
}

.site-footer strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.site-footer p {
  max-width: 48ch;
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.55;
}

.site-footer nav {
  gap: 24px;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--faint);
  text-decoration: none;
  font-size: 14px;
  transition: color .15s ease;
}

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

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .hero,
  .app-hero,
  .app-grid,
  .catalog-card,
  .feature-grid,
  .privacy-panel,
  .showcase-item,
  .showcase-item-reverse {
    grid-template-columns: 1fr;
  }

  .app-dock {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .catalog-card {
    min-height: auto;
  }

  .showcase-item-reverse .showcase-copy {
    order: 0;
  }

  .site-footer {
    flex-direction: column;
    gap: 24px;
  }
}

@media (max-width: 520px) {
  .global-nav {
    height: auto;
    min-height: 52px;
    flex-wrap: wrap;
    padding-block: 10px;
  }

  .app-dock {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-copy h1,
  .app-hero h1 {
    font-size: clamp(30px, 8vw, 38px);
  }
}

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

  * {
    transition: none !important;
  }
}
