/*
 * MythScribe website. One stylesheet for every page; no inline styles (the CSP forbids them).
 * Colour, radius, and font tokens are copied from src/renderer/styles/tokens.css so the site
 * looks like the app. Keep the two in step by hand when the app's tokens change.
 */
:root {
  color-scheme: dark;

  --ms-bg: #1b1b1f;
  --ms-surface: #232327;
  --ms-surface-raised: #2b2b31;
  --ms-line: #3a3a42;
  --ms-line-strong: #4a4a54;

  --ms-fg: #e6e6ea;
  --ms-fg-muted: #9a9aa6;

  --ms-accent: #6cc38f;
  --ms-accent-hover: #83d1a3;
  --ms-accent-fg: #0f1a13;
  --ms-warning: #f5a524;

  --ms-radius: 6px;
  --ms-radius-lg: 10px;
  --ms-shadow: 0 10px 30px rgb(0 0 0 / 0.45);

  --ms-font-ui:
    Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --ms-font-prose: Georgia, 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', serif;
  --ms-font-mono: ui-monospace, 'Cascadia Mono', 'JetBrains Mono', Menlo, Consolas, monospace;

  --site-width: 68rem;
  --text-width: 44rem;
  --gutter: 1.25rem;
}

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

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

body {
  margin: 0;
  background: var(--ms-bg);
  color: var(--ms-fg);
  font-family: var(--ms-font-ui);
  font-size: 1.0625rem;
  line-height: 1.6;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.6em;
  font-weight: 650;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2rem, 1.2rem + 3.2vw, 3.25rem);
}

h2 {
  font-size: clamp(1.5rem, 1.15rem + 1.4vw, 2rem);
  margin-top: 0;
}

h3 {
  font-size: 1.2rem;
}

p,
ul,
ol,
dl,
table {
  margin: 0 0 1em;
}

a {
  color: var(--ms-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

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

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

code {
  font-family: var(--ms-font-mono);
  font-size: 0.92em;
  background: var(--ms-surface-raised);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* Shell */

.wrap {
  max-width: var(--site-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-header {
  border-bottom: 1px solid var(--ms-line);
  background: var(--ms-surface);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  min-height: 3.75rem;
  padding-block: 0.6rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ms-fg);
  text-decoration: none;
  font-weight: 650;
  font-size: 1.15rem;
}

.brand img {
  width: 2rem;
  height: 2rem;
  border-radius: var(--ms-radius);
}

.site-nav ul,
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.site-nav a {
  color: var(--ms-fg-muted);
  text-decoration: none;
  padding-block: 0.25rem;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--ms-fg);
}

.site-nav a[aria-current='page'] {
  text-decoration: underline;
  text-decoration-color: var(--ms-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4em;
}

main {
  padding-block: 2.5rem 4rem;
}

section + section {
  margin-top: 4rem;
}

.site-footer {
  border-top: 1px solid var(--ms-line);
  background: var(--ms-surface);
  color: var(--ms-fg-muted);
  font-size: 0.95rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-block: 1.5rem;
}

.site-footer p {
  margin: 0;
}

/* Landing page */

.hero {
  padding-block: 1.5rem 1rem;
  max-width: 52rem;
}

.hero .lede {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  color: var(--ms-fg-muted);
  max-width: 40rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block: 1.5rem;
}

.button {
  display: inline-block;
  padding: 0.65rem 1.2rem;
  border-radius: var(--ms-radius);
  border: 1px solid transparent;
  background: var(--ms-accent);
  color: var(--ms-accent-fg);
  font-weight: 600;
  text-decoration: none;
  line-height: 1.3;
}

.button:hover {
  background: var(--ms-accent-hover);
  color: var(--ms-accent-fg);
}

.button-secondary {
  background: var(--ms-surface-raised);
  color: var(--ms-fg);
  border-color: var(--ms-line-strong);
}

.button-secondary:hover {
  background: var(--ms-line);
  color: var(--ms-fg);
}

.cards {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
}

.card {
  background: var(--ms-surface);
  border: 1px solid var(--ms-line);
  border-radius: var(--ms-radius-lg);
  padding: 1.25rem 1.35rem;
}

.card h3 {
  margin-bottom: 0.4em;
}

.card p:last-child {
  margin-bottom: 0;
}

.card .badge {
  display: inline-block;
  margin-left: 0.5rem;
  vertical-align: middle;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ms-warning);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0.1em 0.6em;
}

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.shots figure {
  margin: 0;
}

.shots a {
  display: block;
  border-radius: var(--ms-radius-lg);
}

.shots img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--ms-line-strong);
  border-radius: var(--ms-radius-lg);
  box-shadow: var(--ms-shadow);
}

.shots figcaption {
  margin-top: 0.6rem;
  color: var(--ms-fg-muted);
  font-size: 0.95rem;
}

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block: 1.25rem;
}

.note {
  color: var(--ms-fg-muted);
  max-width: var(--text-width);
}

/* Text pages (privacy, terms, docs, 404) */

.prose {
  max-width: var(--text-width);
}

.prose h2 {
  margin-top: 2.25rem;
}

.prose h3 {
  margin-top: 1.5rem;
}

.prose .meta {
  color: var(--ms-fg-muted);
  margin-top: -0.5rem;
}

.prose li + li {
  margin-top: 0.35em;
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.97rem;
}

caption {
  text-align: left;
  color: var(--ms-fg-muted);
  padding-bottom: 0.5rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--ms-line);
}

th {
  color: var(--ms-fg-muted);
  font-weight: 600;
}

thead th {
  white-space: nowrap;
}

th:first-child,
td:first-child {
  padding-left: 0;
}

tbody th {
  color: var(--ms-fg);
}

@media (max-width: 30rem) {
  body {
    font-size: 1rem;
  }

  .site-header .wrap {
    padding-block: 0.75rem;
  }

  main {
    padding-block: 1.75rem 3rem;
  }

  section + section {
    margin-top: 3rem;
  }

  th,
  td {
    padding: 0.5rem 0.5rem;
  }

  thead th {
    white-space: normal;
  }
}
