:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --card-bg: #f5f5f7;
  --hairline: rgba(0, 0, 0, 0.08);
  --header-bg: rgba(255, 255, 255, 0.8);
  --accent: #0071e3;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-alt: #161617;
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --card-bg: #1c1c1e;
    --hairline: rgba(255, 255, 255, 0.12);
    --header-bg: rgba(0, 0, 0, 0.7);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

img { max-width: 100%; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 48px;
  display: flex;
  align-items: center;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--hairline);
}

.site-header .header-inner {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}

.brand .brand-icon {
  width: 20px;
  height: 20px;
  border-radius: 22.37%;
}

nav.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
}

nav.site-nav a {
  text-decoration: none;
  color: var(--text-secondary);
}

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

nav.site-nav .lang-switch {
  border: 1px solid var(--hairline);
  border-radius: 980px;
  padding: 4px 12px;
  color: var(--text);
}

/* Hero */
.hero {
  padding: 96px 16px 64px;
  text-align: center;
}

.hero .icon {
  width: 120px;
  height: 120px;
  border-radius: 22.37%;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 12px;
  line-height: 1.05;
}

.hero p.subhead {
  font-size: clamp(18px, 2.4vw, 24px);
  color: var(--text-secondary);
  margin: 0 auto 32px;
  max-width: 600px;
  font-weight: 400;
}

.pill-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.pill {
  display: inline-block;
  border-radius: 980px;
  padding: 12px 26px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.pill.primary {
  background: var(--accent);
  color: var(--on-accent, #fff);
}

.pill.secondary {
  background: var(--card-bg);
  color: var(--text);
}

/* Sections */
.section {
  padding: 64px 16px;
}

.section.alt { background: var(--bg-alt); }

.section-inner {
  max-width: 980px;
  margin: 0 auto;
}

.section h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  margin: 0 0 40px;
}

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

.card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 28px 24px;
}

.card .card-icon {
  width: 64px;
  height: 64px;
  border-radius: 22.37%;
  margin-bottom: 16px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.card h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 8px;
}

.card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

a.card-link {
  color: inherit;
  text-decoration: none;
  display: block;
}

/* Screenshot row */
.shot-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 8px 4px 16px;
  -webkit-overflow-scrolling: touch;
}

.shot-row img {
  border-radius: 12%;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
  height: 420px;
  width: auto;
  flex-shrink: 0;
}

/* Platform / contact note */
.note {
  text-align: center;
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 600px;
  margin: 0 auto;
}

/* Legal / support reading layout */
.doc {
  max-width: 700px;
  margin: 0 auto;
  padding: 56px 16px 96px;
  font-size: 17px;
  line-height: 1.6;
}

.doc h1 {
  font-size: clamp(30px, 5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 32px;
}

.doc h2 {
  font-size: 24px;
  font-weight: 600;
  margin: 48px 0 16px;
}

.doc h3 {
  font-size: 19px;
  font-weight: 600;
  margin: 32px 0 12px;
}

.doc p { margin: 0 0 16px; }

.doc ul, .doc ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

.doc ul ul, .doc ol ul, .doc ul ol, .doc ol ol {
  margin: 6px 0;
}

.doc li { margin: 0 0 8px; }

.doc hr {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 40px 0;
}

.doc code {
  background: var(--card-bg);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 15px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

/* Footer */
footer.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 32px 16px 48px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
}

footer.site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

footer.site-footer a:hover { text-decoration: underline; }

footer.site-footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* 404 */
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 16px;
}

.error-page h1 {
  font-size: clamp(32px, 6vw, 56px);
  margin: 0 0 12px;
}

.error-page p {
  color: var(--text-secondary);
  margin: 0 0 24px;
}

@media (max-width: 600px) {
  nav.site-nav { gap: 12px; }
  .shot-row img { height: 320px; }
}

/* Per-site accent colors */
body.site-mipatrimonio { --accent: #1f8a5b; }
body.site-minegocito { --accent: #c2410c; }
body.site-calcula { --accent: #4c5fd5; }
body.site-local-apps { --accent: #0071e3; }
@media (prefers-color-scheme: dark) {
  body.site-mipatrimonio { --accent: #30d158; }
  body.site-minegocito { --accent: #ff9f0a; }
  body.site-calcula { --accent: #7d8cff; }
  body.site-local-apps { --accent: #2997ff; }
  body { --on-accent: #000; }
}
