/* Taborca Reader's website, in L&V's colours and the app's serif (FR31). */

@font-face {
  font-family: 'Libre Caslon Text';
  src: url('/fonts/LibreCaslonText-Variable.ttf') format('truetype');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #0a1430;
  --ink-2: #0e1b3a;
  --on-ink: #f7f6f5;
  --on-ink-2: rgb(247 246 245 / 0.72);
  --on-ink-line: rgb(247 246 245 / 0.16);
  --accent: #1a3fa0;
  --accent-strong: #13307d;
  --gold: #f4c84f;
  --gold-deep: #8a6408;
  --paper: #e9f0fa;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --text: #0b0d12;
  --muted: #4c525d;
  --line: #e0e6ee;
  --line-strong: #c3c7d1;
  --problem: #a3251b;
  --problem-bg: #fdecea;
  --good: #1d6b3a;
  --good-bg: #e7f5ec;
  --warn-bg: #fdf3d6;
  --warn-text: #5a4106;
  --radius: 14px;
  --shadow: 0 6px 24px rgb(10 20 48 / 0.1), 0 0 0 1px var(--line);
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Libre Caslon Text', Georgia, 'Times New Roman', serif;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 16px/1.6 var(--sans);
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

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

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.005em;
}

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

h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1em;
}

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.narrow {
  max-width: 640px;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 12px;
  z-index: 10;
  padding: 8px 12px;
  background: var(--surface);
  border-radius: 8px;
}

/* Header and footer */

.site-header {
  background: var(--ink);
  color: var(--on-ink);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  min-height: 64px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  color: inherit;
}

.brand img {
  width: 32px;
  height: 32px;
}

.brand-name {
  font: 1.2rem/1.1 var(--serif);
}

.brand-by {
  display: block;
  color: var(--on-ink-2);
  font: 0.72rem/1.2 var(--sans);
  letter-spacing: 0.04em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: 0.95rem;
}

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

.site-nav a:hover,
.site-nav a[aria-current] {
  color: var(--on-ink);
}

.site-footer {
  margin-top: 72px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.site-footer a {
  color: var(--muted);
}

/* Hero */

.hero {
  background: radial-gradient(120% 140% at 85% 0%, #1a2c5c 0%, var(--ink-2) 45%, var(--ink) 100%);
  color: var(--on-ink);
  padding: 72px 0 88px;
}

.hero .wrap {
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lede {
  max-width: 36em;
  color: var(--on-ink-2);
  font-size: 1.12rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-card {
  padding: 26px 28px;
  border: 1px solid var(--on-ink-line);
  border-radius: 20px;
  background: rgb(255 255 255 / 0.04);
}

.hero-card h2 {
  font-size: 1.25rem;
}

.ticks {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ticks li {
  position: relative;
  padding: 7px 0 7px 28px;
  border-top: 1px solid var(--on-ink-line);
}

.ticks li:first-child {
  border-top: 0;
}

.ticks li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 15px;
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: rotate(-45deg);
}

/* Buttons and forms */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: 600 1rem/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  border-color: var(--accent);
  color: var(--text);
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.button.primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.button.gold {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--ink);
}

.button.gold:hover {
  background: #f7d675;
}

.button.ghost {
  border-color: var(--on-ink-line);
  background: transparent;
  color: var(--on-ink);
}

.button.ghost:hover {
  border-color: var(--on-ink-2);
}

.button[disabled],
.button[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.field label {
  font-weight: 600;
}

.field .hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

input[type='text'],
input[type='email'] {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

input[aria-invalid='true'] {
  border-color: var(--problem);
}

input.code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}

.note {
  margin: 16px 0 0;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.95rem;
}

.note:empty {
  display: none;
}

.note.problem {
  background: var(--problem-bg);
  color: var(--problem);
}

.note.good {
  background: var(--good-bg);
  color: var(--good);
}

.note.info {
  background: var(--surface-2);
  color: var(--muted);
}

/* Sections */

.section {
  padding: 72px 0 0;
}

.section-intro {
  max-width: 40em;
  color: var(--muted);
  font-size: 1.05rem;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin-top: 28px;
}

.card {
  padding: 22px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.card p {
  margin: 0;
  color: var(--muted);
}

.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--warn-text);
  font: 600 0.7rem/1.6 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 0.2em;
}

.pro {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  margin-top: 28px;
}

.price {
  margin: 0 0 4px;
  font: 3rem/1 var(--serif);
}

.price small {
  color: var(--muted);
  font: 1rem var(--sans);
}

.panel {
  padding: 28px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel h2:first-child,
.panel h3:first-child {
  margin-top: 0;
}

.fine {
  color: var(--muted);
  font-size: 0.85rem;
}

.downloads {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 28px;
}

.download {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
}

.download:hover {
  color: var(--text);
  box-shadow: 0 6px 24px rgb(10 20 48 / 0.14), 0 0 0 2px var(--accent);
}

.download strong {
  font: 1.15rem var(--serif);
}

.download span {
  color: var(--muted);
  font-size: 0.9rem;
}

.download[aria-disabled='true'] {
  pointer-events: none;
  opacity: 0.7;
  box-shadow: 0 0 0 1px var(--line);
}

/* Plain pages: claim, lost licence, thanks, legal */

.page {
  padding: 56px 0 0;
}

.page .lede {
  color: var(--muted);
}

.steps {
  margin: 0 0 1em;
  padding-left: 1.3em;
}

.steps li {
  margin-bottom: 6px;
}

.legal h2 {
  margin-top: 1.6em;
  font-size: 1.35rem;
}

.draft {
  margin: 0 0 28px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 0.95rem;
}

/* The dev server's pretend checkout */

dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 28px;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgb(10 20 48 / 0.35);
}

dialog::backdrop {
  background: rgb(10 20 48 / 0.5);
}

@media (max-width: 820px) {
  .hero {
    padding: 48px 0 56px;
  }

  .hero .wrap,
  .pro {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .button,
  .download {
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
  }
}

.panel .ticks li {
  border-top-color: var(--line);
}

.panel .ticks li::before {
  border-color: var(--gold-deep);
}

::placeholder {
  color: #9aa0aa;
  opacity: 1;
}

.panel .button + .note:empty + .fine,
.panel .button + .fine {
  margin-top: 16px;
}
