/* ==========================================================================
   MCEngine shared theme — white / silver / modern (vendored locally).
   A self-contained copy of the shared ecosystem theme. The design system is
   documented in DESIGN.md at the root of this repository; do not change tokens
   or component styles without updating that document first.
   ========================================================================== */

/* ---- Design tokens (see DESIGN.md) ---- */
:root {
  --color-bg: #ffffff;
  --color-surface: #f6f7f9;
  --color-border: #e3e6eb;
  --color-silver: #aeb4bf;
  --color-silver-deep: #868d99;
  --color-text: #1c1f26;
  --color-muted: #5b6472;
  --color-accent: #3f4956;
  --gradient-silver: linear-gradient(135deg, #eef0f3 0%, #d7dbe1 55%, #c3c8d0 100%);
  --gradient-steel: linear-gradient(135deg, #565f6d 0%, #7d8694 60%, #a6adb8 100%);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    monospace;

  --radius-card: 14px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(28, 31, 38, 0.04), 0 8px 24px rgba(28, 31, 38, 0.06);
  --shadow-card-hover: 0 2px 4px rgba(28, 31, 38, 0.06), 0 14px 34px rgba(28, 31, 38, 0.10);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;

  --page-max: 68rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

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

/* ---- Page transitions ---- */
@media (prefers-reduced-motion: no-preference) {
  body {
    animation: page-in 0.45s ease-out both;
  }

  body.page-exit {
    animation: page-out 0.22s ease-in both;
  }
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes page-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* ---- Header / navigation ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.site-header .inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0.85rem var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.brand .mark {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 7px;
  background: var(--gradient-steel);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.site-nav {
  display: flex;
  gap: var(--space-2);
  margin-left: auto;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  color: var(--color-muted);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

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

.site-nav a[aria-current="page"] {
  color: var(--color-text);
  background: var(--color-surface);
  border-color: var(--color-border);
}

/* ---- Layout ---- */
main {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--space-4) var(--space-6);
}

section {
  margin-top: var(--space-6);
}

/* ---- Hero ---- */
.hero {
  margin-top: var(--space-6);
  text-align: center;
}

.hero .eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-silver-deep);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.95rem;
  background: var(--color-surface);
}

.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: var(--space-3) 0 var(--space-3);
}

.hero h1 .metallic {
  background: var(--gradient-steel);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  max-width: 44rem;
  margin: 0 auto;
  color: var(--color-muted);
  font-size: 1.15rem;
}

.hero .actions {
  margin-top: var(--space-4);
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  flex-wrap: wrap;
}

/* ---- Buttons ---- */
.button {
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.6rem 1.35rem;
  border-radius: var(--radius-pill);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.button.primary {
  color: #ffffff;
  background: var(--color-accent);
  box-shadow: var(--shadow-card);
}

.button.primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card-hover);
}

.button.ghost {
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
}

.button.ghost:hover {
  background: var(--color-surface);
}

/* ---- Sections & typography ---- */
h2 {
  font-size: 1.7rem;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-2);
}

h3 {
  font-size: 1.15rem;
  margin: 0 0 var(--space-1);
}

.section-intro {
  color: var(--color-muted);
  max-width: 46rem;
  margin: 0 0 var(--space-4);
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.1em 0.4em;
  white-space: nowrap;
}

/* ---- Cards ---- */
.grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
}

.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: var(--space-4);
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.card p {
  color: var(--color-muted);
  margin: 0.35rem 0 0;
  font-size: 0.97rem;
}

.card .tool-name {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 600;
}

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

a.card .more {
  display: inline-block;
  margin-top: var(--space-3);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--color-accent);
}

/* ---- Steps (how it works) ---- */
.steps {
  counter-reset: step;
  display: grid;
  gap: var(--space-3);
  padding: 0;
  margin: 0;
  list-style: none;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: var(--space-3) var(--space-4) var(--space-3) 4.4rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.15rem;
  height: 2.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--color-text);
  background: var(--gradient-silver);
  border: 1px solid var(--color-border);
  border-radius: 50%;
}

.steps h3 {
  margin: 0;
}

.steps p {
  margin: 0.2rem 0 0;
  color: var(--color-muted);
  font-size: 0.97rem;
}

/* ---- Badges ---- */
.badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  padding: 0.18rem 0.7rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.badge.op {
  color: #5b4708;
  background: #faf3dd;
  border: 1px solid #eadfb8;
}

.badge.everyone {
  color: #234a32;
  background: #e7f3ec;
  border: 1px solid #cbe4d4;
}

.badge.platform {
  color: var(--color-accent);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

/* ---- Platform strip ---- */
.platforms {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: center;
  margin-top: var(--space-4);
}

.platforms span {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-muted);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-pill);
}

/* ---- Notice ---- */
.notice {
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-silver);
  background: var(--color-surface);
  border-radius: 10px;
  padding: var(--space-3) var(--space-4);
  color: var(--color-muted);
  font-size: 0.97rem;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.site-footer .inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--space-4);
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  color: var(--color-muted);
  font-size: 0.92rem;
}

.site-footer a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}

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

/* ---- Navigation blocks ---- */
.blocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.block {
  display: block;
  padding: var(--space-4);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.block:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.block-title {
  color: var(--color-accent);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.block p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.97rem;
  line-height: 1.5;
}

/* ---- Small screens ---- */
@media (max-width: 40rem) {
  .site-header .inner {
    padding: 0.75rem var(--space-3);
  }

  main {
    padding: 0 var(--space-3) var(--space-5);
  }

  section,
  .hero {
    margin-top: var(--space-5);
  }
}
