/* Shared styles for /tools/ pages. Tokens, nav, buttons and footer are copied
   from site/index.html so the pages match the homepage. The build script copies
   this file to site/tools/tools.css. */
:root {
  --bg: #f3f5f4;
  --surface: #ffffff;
  --ink: #1a2230;
  --muted: #5b6575;
  --line: #d9dee3;
  --brand: #5b4cf0;
  --brand-dark: #4537d6;
  --brand-tint: #eceafe;
  --ok: #1f7a4d;
  --warn: #9a5b00;

  --display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;

  --wrap: 1120px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

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

h1, h2, h3 {
  font-family: var(--display);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}

h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }

p { margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  padding: 14px 24px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }

.btn-quiet {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface);
}
.btn-quiet:hover { border-color: var(--ink); }

/* Official Microsoft Store badge (same markup as the homepage): keep its own
   size and aspect ratio. */
.store-badge { display: inline-block; line-height: 0; }
.store-badge img { display: block; max-width: 100%; height: auto; }

/* Secondary "download the installer directly" link under a badge. */
.alt-dl { margin-top: 12px; font-size: 0.85rem; color: var(--muted); }
.alt-dl a { color: var(--muted); }
.alt-dl a:hover { color: var(--ink); }
.final .alt-dl { margin-top: 14px; color: rgba(255, 255, 255, 0.75); }
.final .alt-dl a { color: #fff; }

/* ---------- Nav ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--brand);
  display: grid;
  place-items: center;
}

.logo-mark svg { width: 16px; height: 16px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.95rem;
}

.nav-links a { text-decoration: none; color: var(--muted); }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--ink); }
.nav-links .btn { color: #fff; padding: 9px 16px; font-size: 0.9rem; }

@media (max-width: 640px) {
  .nav-links { gap: 18px; }
  .nav-links .hide-sm { display: none; }
}

/* ---------- Tool page hero ---------- */
.crumbs {
  font-size: 0.88rem;
  color: var(--muted);
  padding-top: 24px;
}
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); }

.hero { padding: 20px 0 0; }

/* Two columns when there is a visual: text left, visual right. */
.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.2rem, 4.6vw, 3.5rem);
  max-width: 20ch;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.hero:not(.hero-split) h1 { font-size: clamp(2.3rem, 5.6vw, 4rem); max-width: 18ch; }

.hero-lead {
  margin-top: 22px;
  max-width: 36em;
  font-size: 1.15rem;
  color: var(--muted);
}

.hero-pain {
  margin-top: 16px;
  max-width: 38em;
  padding-left: 14px;
  border-left: 2px solid var(--line);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
}

.hero-actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.hero-note {
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--muted);
}

.hero-visual { margin: 0; min-width: 0; }

.demo {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 30px 60px -30px rgba(26, 34, 48, 0.35);
  overflow: hidden;
}

.demo video,
.demo img {
  display: block;
  width: 100%;
  height: auto; /* ratio comes from the width/height attributes */
  object-fit: contain;
  background: #f8f9fa;
}

/* ---------- Hero illustrations (HTML/CSS only) ---------- */
.illo {
  --illo-bg: #f7f6ff;
  --illo-border: #e3e0fb;
  --illo-sheet: #ffffff;
  --illo-line: #e3e6ea;
  --illo-accent: var(--brand);
  --illo-ink: var(--ink);
  --illo-muted: #9aa3ae;
  --illo-added: #1f7a4d;
  --illo-removed: #b4323c;
  --illo-changed: var(--brand);

  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 3vw, 28px);
  min-height: 340px;
  padding: clamp(28px, 4vw, 48px) clamp(16px, 3vw, 40px);
  background: var(--illo-bg);
  border: 1px solid var(--illo-border);
  border-radius: 14px;
  color: var(--illo-ink);
}

.illo-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.sheet {
  display: flex;
  flex-direction: column;
  width: clamp(64px, 16vw, 84px);
  aspect-ratio: 4 / 3;
  background: var(--illo-sheet);
  border: 1px solid var(--illo-line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 24px -16px rgba(26, 34, 48, 0.35);
}

.sheet-head { height: 10px; flex: none; background: var(--illo-accent); }
.head-1 .sheet-head { opacity: 0.4; }
.head-2 .sheet-head { opacity: 0.65; }

.sheet-rows {
  flex: 1;
  background:
    repeating-linear-gradient(to bottom, transparent 0 9px, var(--illo-line) 9px 10px),
    repeating-linear-gradient(to right, transparent 0 25px, var(--illo-line) 25px 26px);
}

.sheet-lg { width: clamp(100px, 26vw, 140px); aspect-ratio: 4 / 5; }
.sheet-lg .sheet-head { height: 14px; }

.sheet-tab { width: clamp(92px, 24vw, 120px); aspect-ratio: 5 / 2; border-top-left-radius: 0; }

.tabbed { display: flex; flex-direction: column; align-items: flex-start; }

.tab {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 6px 6px 0 0;
  background: var(--illo-accent);
  color: #fff;
}

.tabbed-muted .tab { background: var(--illo-muted); }
.tabbed-muted .sheet-head { background: var(--illo-muted); }

/* Arrow between the two columns */
.flow {
  position: relative;
  flex: none;
  width: clamp(28px, 6vw, 48px);
  height: 2px;
  background: var(--illo-accent);
  border-radius: 2px;
}
.flow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-top: 2px solid var(--illo-accent);
  border-right: 2px solid var(--illo-accent);
  transform: translateY(-50%) rotate(45deg);
}

/* Compare result labels */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  background: var(--illo-sheet);
  border: 1px solid var(--illo-line);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 10px 24px -18px rgba(26, 34, 48, 0.35);
}
.pill-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1;
  color: #fff;
}
.pill-added .pill-mark { background: var(--illo-added); }
.pill-removed .pill-mark { background: var(--illo-removed); }
.pill-changed .pill-mark { background: var(--illo-changed); }

/* ---------- Sections ---------- */
.section { padding: 104px 0 0; }

.section-head { max-width: 680px; margin-bottom: 40px; }
.section-head p { margin-top: 14px; color: var(--muted); font-size: 1.08rem; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  border-top: 2px solid var(--ink);
  padding-top: 20px;
}

.step-n {
  font-family: var(--display);
  font-weight: 700;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--brand);
  margin-bottom: 18px;
}

.step p { margin-top: 10px; color: var(--muted); font-size: 0.98rem; }

/* "What it handles" beside the comparison block */
.pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.pair-col { display: grid; gap: 24px; align-content: start; }

.fact {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px;
}

.fact h2 { font-size: 1.45rem; }
.fact ul { margin: 16px 0 0; padding: 0; list-style: none; }
.fact li { position: relative; padding: 6px 0 6px 28px; color: var(--muted); }
.fact li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.95em;
  width: 12px;
  height: 7px;
  border-left: 2.2px solid var(--ok);
  border-bottom: 2.2px solid var(--ok);
  transform: translateY(-60%) rotate(-45deg);
}
.fact p { margin-top: 12px; color: var(--muted); }
.fact.limits li::before {
  width: 10px;
  height: 0;
  top: 1.05em;
  border-left: none;
  border-bottom: 2px solid var(--muted);
  transform: none;
}

/* Comparison */
.comparison {
  background: var(--brand-tint);
  border-radius: 14px;
  padding: 32px;
}
.comparison h2 { color: var(--brand-dark); font-size: 1.45rem; }
.comparison p { margin-top: 14px; font-size: 1rem; }

/* FAQ */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 22px 40px 22px 0;
  position: relative;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 18px;
  font-size: 1.5rem;
  color: var(--brand);
}
.faq details[open] summary::after { content: "\2212"; }
.faq .answer { padding: 0 0 24px; color: var(--muted); max-width: 46em; }
.faq .answer p + p { margin-top: 10px; }

/* Tool cards: related block and the /tools/ index */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px 26px 24px;
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.card:hover { border-color: var(--ink); }
.card h3 { font-size: 1.2rem; }
.card p { margin-top: 10px; color: var(--muted); font-size: 0.96rem; flex: 1; }
.card .more { margin-top: 18px; color: var(--brand-dark); font-weight: 600; font-size: 0.92rem; }

/* Index page header */
.index-head { padding: 40px 0 0; }
.index-head h1 {
  font-size: clamp(2.3rem, 5.6vw, 4rem);
  letter-spacing: -0.035em;
  line-height: 1.04;
  max-width: 16ch;
}
.index-head p { margin-top: 20px; max-width: 36em; font-size: 1.15rem; color: var(--muted); }
.index-list { padding-top: 56px; }

/* Final CTA */
.final {
  margin: 104px 0 0;
  background: var(--brand);
  color: #fff;
  border-radius: 20px;
  padding: 60px 56px;
}

.final h2 { font-size: clamp(2rem, 4vw, 3rem); max-width: 18ch; }
.final p { margin-top: 16px; color: rgba(255, 255, 255, 0.82); max-width: 34em; }
.final .btn-primary { background: #fff; color: var(--brand-dark); }
.final .btn-primary:hover { background: var(--brand-tint); }
.final .btn-quiet { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.45); }
.final .btn-quiet:hover { border-color: #fff; }
.final-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Footer */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding: 40px 0 48px;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer nav { display: flex; flex-wrap: wrap; gap: 24px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-split { grid-template-columns: 1fr; gap: 40px; }
  .steps, .pair { grid-template-columns: 1fr; gap: 28px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .section { padding-top: 76px; }
  .final { margin-top: 76px; padding: 44px 28px; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .cards { grid-template-columns: 1fr; }
  .fact, .comparison { padding: 24px 20px; }
  .demo { border-radius: 10px; }
  .illo { min-height: 260px; }
  .btn { padding: 13px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
