/* ============================================
   MagicPaletteStudios — design tokens
   Procreate-inspired: high-contrast black & white,
   bold confident type, sharp geometry, generous space.
   Color is reserved for the app's own content.
   ============================================ */

:root {
  /* Color: strict black & white chrome */
  --black: #0A0A0A;
  --white: #FFFFFF;
  --off-white: #F4F4F2;
  --gray-900: #171717;
  --gray-700: #4A4A4A;
  --gray-500: #8A8A8A;
  --gray-300: #D4D4D2;
  --gray-100: #ECECEA;
  --line-dark: #2B2B2B;
  --line-light: #DEDEDC;

  /* Type */
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;

  /* Layout */
  --max-w: 1180px;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

.wrap-wide {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.8rem, 6vw, 5.2rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }

p { margin: 0 0 1em; color: var(--gray-700); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-700);
  margin-bottom: 20px;
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 15px 30px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid var(--black); outline-offset: 3px; }

.btn-primary { background: var(--black); color: var(--white); }
.btn-primary:hover { background: var(--gray-900); }

.btn-invert { background: var(--white); color: var(--black); }
.btn-invert:hover { background: var(--off-white); }

.btn-ghost {
  background: transparent;
  color: inherit;
  border-color: currentColor;
}
.btn-ghost:hover { background: rgba(0,0,0,0.05); }

/* ---------- Nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-light);
}

.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--black);
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-links a {
  text-decoration: none;
  color: var(--gray-700);
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--black);
  border-bottom-color: var(--black);
}

@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-cta .btn-ghost { display: none; }
}

/* ---------- Hero: full-bleed black block ---------- */
.hero {
  background: var(--black);
  color: var(--white);
  padding: 120px 0 100px;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 64px;
  align-items: center;
}

.hero .eyebrow { color: var(--gray-300); }
.hero h1 { color: var(--white); }
.hero h1 .accent { color: var(--gray-500); }

.hero-sub {
  font-size: 1.15rem;
  color: var(--gray-300);
  max-width: 48ch;
}

.hero-ctas {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.store-badges {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.store-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 1.5px solid var(--line-dark);
  color: var(--white);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-family: var(--font-body);
}
.store-badge:hover { border-color: var(--white); }
.store-badge small { display: block; font-size: 0.65rem; opacity: 0.65; }
.store-badge strong { display: block; font-size: 0.92rem; font-family: var(--font-display); font-weight: 700; }

/* On light sections, store badges need dark styling */
.section .store-badge { border-color: var(--line-light); color: var(--black); }
.section .store-badge:hover { border-color: var(--black); }

/* ---------- Interactive doodle pad ---------- */
.doodle-card {
  background: var(--gray-900);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-dark);
  padding: 18px;
}

.doodle-label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

#doodle {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  background: #fff;
  touch-action: none;
  cursor: crosshair;
  border: 1px solid var(--line-dark);
}

.doodle-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  gap: 12px;
  flex-wrap: wrap;
}

.swatches { display: flex; gap: 8px; }

.swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--gray-900);
  outline: 1px solid var(--line-dark);
  cursor: pointer;
  padding: 0;
}
.swatch[aria-pressed="true"] { outline: 2px solid var(--white); }

.doodle-clear {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: none;
  border: 1.5px solid var(--line-dark);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  color: var(--gray-300);
}
.doodle-clear:hover { border-color: var(--white); color: var(--white); }

/* ---------- Sections ---------- */
.section { padding: 110px 0; }
.section-invert { background: var(--black); color: var(--white); }
.section-invert h2, .section-invert h3 { color: var(--white); }
.section-invert p { color: var(--gray-300); }
.section-alt { background: var(--off-white); }
.section-head { max-width: 640px; margin-bottom: 56px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* Feature cards */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-light);
  border: 1px solid var(--line-light);
}

.card {
  background: #fff;
  padding: 34px 30px;
  transition: background 0.15s ease;
}
.card:hover { background: var(--off-white); }

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--off-white);
  border: 1px solid var(--line-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.card p { margin-bottom: 0; font-size: 0.96rem; }

/* ---------- Trust band (full-bleed inverted block) ---------- */
.trust-band {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.trust-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.trust-list li { display: flex; gap: 12px; align-items: flex-start; font-family: var(--font-body); color: var(--white); }
.trust-list svg { flex-shrink: 0; margin-top: 3px; }

/* Footer */
.site-footer {
  background: var(--black);
  color: var(--gray-300);
  padding: 56px 0 40px;
}
.site-footer .brand { color: var(--white); }
.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-links {
  display: flex;
  gap: 30px;
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.footer-links a { text-decoration: none; color: var(--gray-300); }
.footer-links a:hover { color: var(--white); }
.footer-fine {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--line-dark);
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--gray-500);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .trust-band { grid-template-columns: 1fr; }
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Studio home: about / creator ---------- */
.creator-band {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  align-items: center;
}

.creator-avatar {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-light);
}

.creator-avatar span {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.4rem;
  color: var(--white);
  letter-spacing: -0.02em;
}

.creator-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.creator-tag {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: transparent;
  border: 1.5px solid var(--line-light);
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--gray-700);
}

/* ---------- App gallery cards ---------- */
.app-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.app-card {
  background: #fff;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-md);
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  color: var(--black);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.app-card:not(.is-live):not(.is-soon):hover { border-color: var(--black); transform: translateY(-3px); }

.app-card.is-live {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}
.app-card.is-live h3, .app-card.is-live p { color: var(--white); }
.app-card.is-live p { color: var(--gray-300); }
.app-card.is-live:hover { transform: translateY(-3px); }

.app-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--off-white);
  border: 1px solid var(--line-light);
}
.app-card.is-live .app-card-icon { background: var(--gray-900); border-color: var(--line-dark); }

.app-card h3 { margin-bottom: 2px; }
.app-card p { font-size: 0.92rem; margin-bottom: 0; color: var(--gray-700); }

.app-card-status {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
}
.app-card.is-live .app-card-status { color: var(--gray-300); }

.app-card.is-soon {
  border: 1px dashed var(--line-light);
  background: transparent;
  align-items: flex-start;
  justify-content: center;
  min-height: 190px;
  color: var(--gray-500);
}

/* ---------- Coins / ads / purchase economy ---------- */
.economy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 44px;
}

.economy-card {
  background: #fff;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-md);
  padding: 32px 28px;
}

.economy-step {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  display: block;
}

.economy-card h3 { margin-bottom: 8px; }
.economy-card p { font-size: 0.94rem; margin-bottom: 0; }

.economy-card.is-purchase {
  background: var(--black);
  border-color: var(--black);
}
.economy-card.is-purchase h3 { color: var(--white); }
.economy-card.is-purchase .economy-step { color: var(--gray-500); }
.economy-card.is-purchase p { color: var(--gray-300); }

/* ---------- Privacy hub ---------- */
.privacy-hub-list {
  display: grid;
  gap: 16px;
  margin-top: 8px;
}

.privacy-hub-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #fff;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-md);
  padding: 26px 30px;
  text-decoration: none;
  color: var(--black);
  transition: border-color 0.15s ease;
}
.privacy-hub-item:hover { border-color: var(--black); }
.privacy-hub-item h3 { margin-bottom: 4px; }
.privacy-hub-item p { margin-bottom: 0; font-size: 0.92rem; }
.privacy-hub-item .arrow { font-size: 1.4rem; color: var(--gray-500); flex-shrink: 0; }

.privacy-hub-item.is-soon {
  border-style: dashed;
  color: var(--gray-500);
  cursor: default;
}

@media (max-width: 900px) {
  .creator-band { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .app-grid { grid-template-columns: 1fr; }
  .economy-grid { grid-template-columns: 1fr; }
  .privacy-hub-item { flex-direction: column; align-items: flex-start; }
}

/* ---------- Product page: page hero ---------- */
.page-hero {
  background: var(--black);
  color: var(--white);
  padding: 96px 0 60px;
  text-align: center;
}
.page-hero .eyebrow { color: var(--gray-300); margin-left: auto; margin-right: auto; justify-content: center; }
.page-hero h1 { max-width: 22ch; margin-left: auto; margin-right: auto; color: var(--white); }
.page-hero p { max-width: 56ch; margin-left: auto; margin-right: auto; color: var(--gray-300); }

.device-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-top: 52px;
}

.device {
  aspect-ratio: 16/9;
  border-radius: 12px;
  border: 1px solid var(--line-dark);
  padding: 6px;
  background: var(--gray-900);
}

.device-screen {
  width: 100%;
  height: 100%;
  border-radius: 7px;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  font-family: var(--font-display);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
}

/* ---------- Bento showcase (Apple-style: mixed tiles, slow auto-crossfade) ---------- */
.bento-grid {
  margin-top: 60px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(200px, 1fr);
  gap: 18px;
}

.bento-tile {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1.5px solid rgba(255,255,255,0.16);
  background: var(--gray-900);
}
.bento-tile.is-large { grid-column: span 7; grid-row: span 2; min-height: 600px; }
.bento-tile.is-medium { grid-column: span 5; grid-row: span 1; min-height: 291px; }
.bento-tile.is-wide { grid-column: span 12; grid-row: span 1; min-height: 340px; }

.bento-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: bento-crossfade 12s ease-in-out infinite;
}
.bento-grid:hover .bento-slide { animation-play-state: paused; }

.bento-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: var(--gray-900);
}
.bento-slide::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}
.bento-caption {
  position: absolute;
  left: 18px;
  bottom: 16px;
  z-index: 2;
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

@keyframes bento-crossfade {
  0%, 42% { opacity: 1; }
  50%, 92% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes bento-crossfade-3 {
  0%, 28% { opacity: 1; }
  33%, 95% { opacity: 0; }
  100% { opacity: 1; }
}
.bento-slide.of-three { animation-name: bento-crossfade-3; animation-duration: 18s; }

@media (max-width: 900px) {
  .bento-tile.is-large,
  .bento-tile.is-medium,
  .bento-tile.is-wide { grid-column: span 12; grid-row: span 1; min-height: 280px; }
}

.feature-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 40px;
  margin-top: 12px;
}

.feature-row {
  display: flex;
  gap: 16px;
  padding: 24px 0;
  border-top: 1px solid var(--line-light);
}

.feature-row .card-icon { margin-bottom: 0; flex-shrink: 0; }
.feature-row h3 { margin-bottom: 6px; }
.feature-row p { margin-bottom: 0; }

.faq-item {
  border-top: 1px solid var(--line-light);
  padding: 24px 0;
}
.faq-item:last-child { border-bottom: 1px solid var(--line-light); }
.faq-item h3 { margin-bottom: 8px; font-size: 1.05rem; }
.faq-item p { margin-bottom: 0; }

@media (max-width: 900px) { .device-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .device-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .feature-list { grid-template-columns: 1fr; } }

/* ---------- Privacy / legal page ---------- */
.legal-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  padding: 60px 0 110px;
  align-items: start;
}

.legal-toc {
  position: sticky;
  top: 100px;
  background: #fff;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-md);
  padding: 22px 18px;
}
.legal-toc-title {
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-500);
  margin-bottom: 14px;
  font-size: 0.66rem;
  padding: 0 8px;
}
.legal-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 2px;
  counter-reset: toc;
}
.legal-toc li { counter-increment: toc; }
.legal-toc a {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--gray-700);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.86rem;
  padding: 9px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
}
.legal-toc a::before {
  content: counter(toc);
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--off-white);
  color: var(--gray-700);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.68rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.legal-toc a:hover { background: var(--off-white); color: var(--black); }
.legal-toc a.active { background: var(--black); color: var(--white); }
.legal-toc a.active::before { background: var(--white); color: var(--black); }

.legal-body h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-top: 2.2em;
  scroll-margin-top: 100px;
}
.legal-body h2:first-child { margin-top: 0; }
.legal-body p, .legal-body li { color: var(--gray-700); }
.legal-body ul { padding-left: 1.2em; }
.legal-body strong { color: var(--black); }

.legal-meta {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-bottom: 40px;
}

.callout {
  background: var(--off-white);
  border: 1px solid var(--line-light);
  border-left: 3px solid var(--black);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin: 28px 0;
}
.callout p { margin-bottom: 0; color: var(--black); font-size: 0.95rem; }

@media (max-width: 860px) {
  .legal-layout { grid-template-columns: 1fr; }
  .legal-toc { position: static; }
}
