/* Authorwerks — colors taken from the icon and logo: the mug's violet doing the accent work, its
   lavender "A" and the logo's white lettering on a deep, ink-dark violet ground, and the handle's
   dark indigo for rules and edges. */
:root {
  color-scheme: light dark;
  --ground: #110d22;       /* page ground: the handle's indigo, nearly black */
  --surface: #1a1533;      /* raised surface */
  --rule: #2f2754;         /* borders, rules */
  --violet: #785ed9;       /* mug face */
  --violet-mid: #6c51d7;
  --violet-deep: #6042d3;  /* mug shadow side */
  --handle: #4a30b4;       /* handle (a shade lighter, so it reads on the ground) */
  --violet-light: #a996ef; /* links, labels: the mug's color, light enough to read on the ground */
  --lavender: #ddd7f6;     /* the "A" */
  --text: #f1eefb;         /* "Authorwerks" lettering */
  --muted: #b4abd3;

  --display: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* The page width, the same on every Authorwerks site (docs.authorwerks.com set it). */
  --wrap: 76rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);

  /* The hero's glow and the lightbox's backdrop, which change with the theme. */
  --glow-1: rgba(96, 66, 211, 0.34);
  --glow-2: rgba(64, 38, 162, 0.40);
  --backdrop: rgba(8, 6, 18, 0.92);
}

/* Light theme, for browsers set to light mode: the same violets on a pale lavender ground, with the
   handle's ink for the lettering. Every color above that has to read on the ground turns dark. */
@media (prefers-color-scheme: light) {
  :root {
    --ground: #f6f4fc;
    --surface: #ffffff;
    --rule: #ddd6f2;
    --violet-light: #5b3fd0; /* links, labels */
    --lavender: #3a2891;     /* emphasis, focus rings */
    --text: #1d1838;
    --muted: #5a5478;
    --glow-1: rgba(120, 94, 217, 0.16);
    --glow-2: rgba(96, 66, 211, 0.12);
    --backdrop: rgba(246, 244, 252, 0.95);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--body);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--violet-light); }
a:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--lavender);
  outline-offset: 3px;
  border-radius: 4px;
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.12; margin: 0; text-wrap: balance; }
p { margin: 0; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); width: 100%; }
.label {
  font: 500 0.8125rem/1.3 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--violet-light);
}

/* The header (menu bar) is assets/site-header.css, shared with account.authorwerks.com. */

/* "¿Prefieres español?" notice, on the English page for Spanish-language browsers. */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  border-radius: 0.6rem;
  font: 600 1rem/1.2 var(--body);
  text-decoration: none;
  background: linear-gradient(180deg, var(--violet), var(--violet-mid));
  color: #fff;
  border: 1px solid var(--violet-deep);
  box-shadow: 0 2px 0 var(--handle);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 3px 0 var(--handle); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--handle); }
.btn.ghost { background: none; color: var(--lavender); border-color: var(--rule); box-shadow: none; }
.btn.ghost:hover { border-color: var(--violet-light); }
.btn.soon, .btn.soon:hover, .btn.soon:active {
  background: none; color: var(--muted); border: 1px dashed var(--rule);
  box-shadow: none; transform: none; cursor: default;
}

/* Hero */
.hero {
  background:
    radial-gradient(60rem 26rem at 15% -10%, var(--glow-1), transparent 70%),
    radial-gradient(40rem 22rem at 100% 0%, var(--glow-2), transparent 70%);
  border-bottom: 1px solid var(--rule);
}
.hero .wrap {
  display: grid; gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: minmax(0, 1fr);
  padding-block: clamp(2.5rem, 7vw, 5.5rem);
}
.hero-copy { display: grid; gap: 1.4rem; justify-items: start; }
.hero-copy picture { display: contents; } /* the logo, dark or light lettering */
.hero-logo { width: min(100%, 34rem); margin-left: -0.25rem; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
.hero h1 em { font-style: italic; color: var(--violet-light); }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 38rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Screenshots */
.shot { margin: 0; display: grid; gap: 0.75rem; min-width: 0; }
/* The screenshots carry macOS's own window shadow (and their rounded corners), so no border or
   shadow of ours. Each is a button: it opens the enlarged view (the lightbox below). */
.shot picture, .shot img { display: block; width: 100%; height: auto; }
.shot-zoom {
  display: block; width: 100%; padding: 0; margin: 0;
  border: 0; border-radius: 0.75rem; background: none; color: inherit;
  cursor: zoom-in;
}
.shot-zoom:focus-visible { outline: 2px solid var(--violet-light); outline-offset: 2px; }

/* The enlarged screenshot: the whole window fitted to the screen, or at full size (scrolls). */
dialog.lightbox {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: var(--text);
  overflow: hidden;
}
dialog.lightbox::backdrop { background: var(--backdrop); }
body:has(dialog.lightbox[open]) { overflow: hidden; }
.lightbox-frame {
  width: 100%; height: 100%; overflow: auto;
  display: flex; align-items: center; justify-content: center;
  padding: 4rem 1rem 1rem;
}
.lightbox-frame img { max-width: 100%; max-height: 100%; width: auto; height: auto; cursor: zoom-in; }
.lightbox-frame.is-actual { display: block; }
.lightbox-frame.is-actual img { display: block; max-width: none; max-height: none; width: 1719px; margin: 0 auto; cursor: zoom-out; }
.lightbox-close {
  position: fixed; top: max(1rem, env(safe-area-inset-top)); right: max(1rem, env(safe-area-inset-right)); z-index: 1;
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0;
  border: 1px solid var(--rule); border-radius: 50%;
  background: var(--surface); color: var(--text); cursor: pointer;
}
.lightbox-close:hover { background: var(--rule); }
.lightbox-close:focus-visible { outline: 2px solid var(--violet-light); outline-offset: 2px; }
.about-shot { margin-top: clamp(2rem, 5vw, 3rem); max-width: 52rem; }
.shots .shot-wide { grid-column: 1 / -1; }
.shot figcaption { font-size: 0.875rem; color: var(--muted); }
.shots {
  display: grid; gap: 2rem clamp(1.25rem, 3vw, 2rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
  margin-top: clamp(2.5rem, 6vw, 4rem);
}

/* Sections */
/* The first section of a page other than the home page (its heading is the page's h1). No line
   above it, even on a section that has one elsewhere (.downloads, .about): the menu bar's own line
   is the only one under it, as on every Authorwerks site. */
section.page-top { border-top: 0; }
.page-actions { margin-top: clamp(2rem, 5vw, 3rem); }
.section { padding-block: clamp(3rem, 8vw, 5.5rem); }
.section-head { display: grid; gap: 0.75rem; max-width: 40rem; margin-bottom: clamp(1.75rem, 4vw, 3rem); }
.section-head h1, .section-head h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
.section-head p { color: var(--muted); }

.features {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 2.25rem clamp(1.5rem, 4vw, 3.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}
.features li { display: grid; gap: 0.5rem; align-content: start; min-width: 0; padding-top: 1.1rem; border-top: 2px solid var(--violet-deep); }
.features h2, .features h3 { font-size: 1.3rem; }
.features p { color: var(--muted); }

/* Languages */
.languages {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem;
  margin-top: clamp(2.5rem, 6vw, 4rem); padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.languages ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.languages li {
  padding: 0.3rem 0.85rem; border-radius: 999px;
  border: 1px solid var(--handle); color: var(--lavender);
  font-weight: 500; font-size: 0.95rem;
}
.languages p { color: var(--muted); font-size: 0.95rem; }

/* Roadmap */
.roadmap {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 2rem clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}
.roadmap > li { display: grid; gap: 0.9rem; align-content: start; min-width: 0; padding-top: 1.1rem; border-top: 2px solid var(--violet-deep); position: relative; }
.roadmap > li::before {
  content: ""; position: absolute; top: -0.45rem; left: 0;
  width: 0.75rem; height: 0.75rem; border-radius: 50%;
  background: var(--violet-light); box-shadow: 0 0 0 4px var(--ground);
}
.roadmap h2, .roadmap h3 { font: 500 1.05rem/1.3 var(--mono); letter-spacing: 0.06em; color: var(--violet-light); }
.roadmap ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.45rem; color: var(--text); }
.roadmap ul li::marker { color: var(--violet-light); }

/* About */
.about { background: var(--surface); border-top: 1px solid var(--rule); }
.about .wrap {
  display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}
.about-copy { display: grid; gap: 1rem; min-width: 0; }
.about-copy h1, .about-copy h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
.about-copy p { color: var(--muted); max-width: 36rem; }
.promise {
  display: grid; gap: 0.75rem; min-width: 0;
  background: var(--ground); border: 1px solid var(--handle); border-radius: 0.8rem;
  padding: clamp(1.25rem, 3vw, 2rem);
}
.promise h2, .promise h3 { font-size: 1.4rem; }
.promise p { color: var(--muted); }
.features code, .promise code { font-family: var(--mono); font-size: 0.9em; color: var(--lavender); }

/* Downloads */
.downloads { background: var(--surface); border-block: 1px solid var(--rule); }
.builds {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}
.build {
  display: grid; gap: 0.6rem; align-content: start; justify-items: start; min-width: 0;
  background: var(--ground); border: 1px solid var(--rule); border-radius: 0.8rem;
  padding: 1.5rem;
}
.build h2, .build h3 { font-size: 1.4rem; }
.build p { color: var(--muted); font-size: 0.95rem; }
.build .btn { margin-top: 0.6rem; }
.beta-note { margin-top: 1.75rem; color: var(--muted); font-size: 0.95rem; max-width: 44rem; }

/* The footer is assets/site-header.css, shared with account.authorwerks.com. */

/* A page's own heading, a step above the section headings it replaced. */
.section-head h1, .about-copy h1 { font-size: clamp(2rem, 4.5vw, 2.9rem); }

@media (max-width: 30rem) {
  .actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

/* The cookie policy (pages/cookies.php): reading width, and its tables, which become one card per
   row on a phone (each cell labelled by its column: data-label). */
.policy-updated { font-size: 0.95rem; }
.policy-body { max-width: 48rem; }
.policy-body h2 { font-size: clamp(1.3rem, 2.6vw, 1.6rem); margin: 2.5rem 0 0.75rem; }
.policy-body p { margin: 0 0 1rem; }
.policy-body p.lede { max-width: none; }
.policy-body a { color: var(--violet-light); text-underline-offset: 0.2em; }
.policy-body code { font: 500 0.88em/1 var(--mono); }
.policy-table { margin: 1.25rem 0 1.5rem; overflow-x: auto; border: 1px solid var(--rule); border-radius: 0.8rem; background: var(--surface); }
.policy-table table { width: 100%; border-collapse: collapse; font-size: 0.95rem; line-height: 1.5; }
.policy-table th, .policy-table td { text-align: left; vertical-align: top; padding: 0.75rem 1rem; border-top: 1px solid var(--rule); }
.policy-table thead th { border-top: 0; font-weight: 600; color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.policy-table tbody th { font-weight: 600; color: var(--text); }
.policy-table tbody th code { white-space: nowrap; }
@media (max-width: 40rem) {
  .policy-table { border: 0; background: none; overflow: visible; }
  .policy-table thead { display: none; }
  .policy-table table, .policy-table tbody, .policy-table tr, .policy-table th, .policy-table td { display: block; }
  .policy-table tr { border: 1px solid var(--rule); border-radius: 0.8rem; background: var(--surface); padding: 0.4rem 0; margin-bottom: 0.75rem; }
  .policy-table th, .policy-table td { border-top: 0; padding: 0.35rem 1rem; }
  .policy-table td::before { content: attr(data-label); display: block; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
}
