/* ========================================
   Simple.app Design System — KYC Help Center
   Inspired by help.simple.app / simple.app
   Mobile-first, single file
   ======================================== */

/* --- Design Tokens --- */
:root {
  --color-primary: #0099CC;
  --color-accent: #334BFA;
  --color-text: #1a1a1a;
  --color-text-secondary: #737373;
  --color-text-muted: #a3a3a3;
  --color-border: rgb(230, 230, 230);
  --color-bg: #ffffff;
  --color-bg-subtle: #fafafa;
  --color-bg-muted: rgb(242, 242, 242);
  --color-header-bg: #000000;
  --color-header-text: #ffffff;

  --font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;

  --leading-tight: 1.25;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.07), 0 1px 2px -1px rgb(0 0 0 / 0.07);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.07), 0 4px 6px -4px rgb(0 0 0 / 0.07);

  --max-width: 720px;
  --max-width-wide: 960px;

  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
}

/* --- Reset / Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

::selection {
  background: rgba(0, 153, 204, 0.15);
}

/* --- Typography --- */
h1 {
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

h2 {
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.4;
  margin-top: var(--space-8);
  margin-bottom: var(--space-2);
  color: var(--color-text);
}

p {
  margin-bottom: var(--space-4);
}

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

a:hover {
  color: #007aa3;
  text-decoration: underline;
}

strong {
  font-weight: 600;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-bg-muted);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

blockquote {
  border-left: 3px solid var(--color-primary);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-6) 0;
  background: var(--color-bg-subtle);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-text-secondary);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}

blockquote p:last-child {
  margin-bottom: 0;
}

ul,
ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
}

li {
  margin-bottom: var(--space-2);
  line-height: var(--leading-normal);
}

li + li {
  margin-top: var(--space-1);
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}

/* --- Layout: Header --- */
.page-header {
  background: var(--color-header-bg);
  color: var(--color-header-text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.logo {
  color: var(--color-header-text);
  font-weight: 700;
  font-size: var(--text-lg);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: opacity var(--transition-fast);
}

.logo:hover {
  text-decoration: none;
  opacity: 0.85;
  color: var(--color-header-text);
}

/* --- Language Switcher --- */
.lang-switch a {
  display: inline-flex;
  align-items: center;
  color: var(--color-header-text);
  font-size: var(--text-xs);
  font-weight: 500;
  text-decoration: none;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  transition: background var(--transition-fast), border-color var(--transition-fast);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.lang-switch a:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
  text-decoration: none;
  color: var(--color-header-text);
}

/* --- Breadcrumb --- */
.breadcrumb {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.breadcrumb-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.01em;
}

.breadcrumb a {
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--color-text-secondary);
  text-decoration: none;
}

/* --- Content Wrapper --- */
.content-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

/* --- Footer --- */
.page-footer {
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-16);
  background: var(--color-bg-subtle);
}

.footer-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.01em;
}

/* --- Cards (generic) --- */
.card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  box-shadow: var(--shadow-xs);
  transition:
    box-shadow var(--transition-base),
    border-color var(--transition-base),
    transform var(--transition-base);
  text-decoration: none;
  color: var(--color-text);
  display: block;
  background: var(--color-bg);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: #d4d4d4;
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--color-text);
}

.card h3 {
  margin-top: 0;
  margin-bottom: var(--space-2);
  font-size: var(--text-base);
}

.card p {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  margin-bottom: 0;
  line-height: var(--leading-normal);
}

/* --- Article Content --- */
.article {
  line-height: var(--leading-relaxed);
  font-size: var(--text-base);
}

.article h1:first-child {
  margin-top: 0;
}

.article h2 {
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-10);
}

.article h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.article h3 {
  margin-top: var(--space-8);
}

.article img {
  border-radius: var(--radius-md);
  margin: var(--space-6) 0;
  box-shadow: var(--shadow-sm);
}

.article ul,
.article ol {
  margin-bottom: var(--space-6);
  padding-left: var(--space-6);
}

.article li {
  margin-bottom: var(--space-3);
  padding-left: var(--space-1);
}

.article p + ul,
.article p + ol {
  margin-top: calc(-1 * var(--space-2));
}

.article a {
  text-decoration: underline;
  text-decoration-color: rgba(0, 153, 204, 0.3);
  text-underline-offset: 2px;
  transition: text-decoration-color var(--transition-fast), color var(--transition-fast);
}

.article a:hover {
  text-decoration-color: currentColor;
}

/* --- Landing Page: Hero --- */
.landing-hero {
  text-align: center;
  padding: var(--space-12) var(--space-4) var(--space-8);
}

.landing-hero h1 {
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

.landing-hero p {
  color: var(--color-text-secondary);
  font-size: var(--text-lg);
  margin-bottom: 0;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  line-height: var(--leading-normal);
}

/* --- Landing Page: Sections (h2 + ul/li/a) styled as card collections --- */
.content-wrapper > h2 {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
  margin-top: var(--space-10);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: none;
}

.content-wrapper > h2:first-of-type {
  margin-top: var(--space-2);
}

.content-wrapper > ul {
  list-style: none;
  padding-left: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.content-wrapper > ul > li {
  margin-bottom: 0;
  padding-left: 0;
}

.content-wrapper > ul > li > a {
  display: block;
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  box-shadow: var(--shadow-xs);
  color: var(--color-text);
  font-weight: 500;
  font-size: var(--text-base);
  text-decoration: none;
  transition:
    box-shadow var(--transition-base),
    border-color var(--transition-base),
    transform var(--transition-base);
  position: relative;
}

.content-wrapper > ul > li > a::after {
  content: "\2192";
  position: absolute;
  right: var(--space-5);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.content-wrapper > ul > li > a:hover {
  box-shadow: var(--shadow-md);
  border-color: #d4d4d4;
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--color-text);
}

.content-wrapper > ul > li > a:hover::after {
  color: var(--color-primary);
  transform: translateY(-50%) translateX(2px);
}

/* --- Card Grid (explicit) --- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-top: var(--space-4);
  margin-bottom: var(--space-6);
}

/* --- Embed Mode --- */
body.embed {
  background: var(--color-bg);
}

.embed-content {
  padding: var(--space-8) var(--space-5);
  max-width: var(--max-width);
  margin: 0 auto;
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}

.embed-content .article {
  font-size: var(--text-base);
}

/* --- Responsive: Tablet (480px+) --- */
@media (min-width: 480px) {
  .content-wrapper > ul {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Responsive: Desktop (768px+) --- */
@media (min-width: 768px) {
  h1 {
    font-size: var(--text-3xl);
  }

  h2 {
    font-size: var(--text-2xl);
  }

  .header-inner {
    padding: var(--space-5) var(--space-8);
  }

  .logo {
    font-size: var(--text-lg);
  }

  .content-wrapper {
    padding: var(--space-12) var(--space-6);
  }

  .content-wrapper > ul {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
  }

  .card-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
  }

  .landing-hero {
    padding: var(--space-16) var(--space-4) var(--space-10);
  }

  .landing-hero h1 {
    font-size: 2.5rem;
  }

  .landing-hero p {
    font-size: var(--text-xl);
  }

  .embed-content {
    padding: var(--space-10) var(--space-6);
  }

  .article h2 {
    margin-top: var(--space-12);
  }
}

/* --- Responsive: Large desktop (1024px+) --- */
@media (min-width: 1024px) {
  .header-inner {
    padding: var(--space-5) var(--space-8);
  }

  .logo {
    font-size: var(--text-lg);
  }
}

/* --- Print --- */
@media print {
  .page-header,
  .breadcrumb,
  .page-footer,
  .lang-switch {
    display: none;
  }

  .content-wrapper {
    padding: 0;
    max-width: 100%;
  }

  body {
    font-size: 12pt;
    color: #000;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}
