/* Style of the website (ADR-0067), after the colours of the kv4p HT project's site, with the system font. */

:root {
  --bg: #F8F8F8;
  --surface: #FFFFFF;
  --text: #1F1E1A;
  --muted: #5C5A52;
  --border: #E5E5E5;
  --accent: #AD5642;
  --accent-hover: #8B452F;
  --accent-text: #9A4A38;
  --hero-bg: #000000;
  --hero-text: #FFFCEA;
  --code-bg: #EFEEE9;
  --shot-border: #C9C7C0;
  --shot-shadow: 0 6px 24px rgba(0, 0, 0, 0.16), 0 1px 3px rgba(0, 0, 0, 0.10);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212;
    --surface: #1C1C1C;
    --text: #EDEBE3;
    --muted: #A8A598;
    --border: #2E2E2E;
    --accent-text: #E08E78;
    --code-bg: #262624;
    --shot-border: #4A4945;
    --shot-shadow: 0 6px 28px rgba(0, 0, 0, 0.65), 0 1px 3px rgba(0, 0, 0, 0.5);
  }
}

:root[data-theme="light"] { color-scheme: light; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121212;
  --surface: #1C1C1C;
  --text: #EDEBE3;
  --muted: #A8A598;
  --border: #2E2E2E;
  --accent-text: #E08E78;
  --code-bg: #262624;
  --shot-border: #4A4945;
  --shot-shadow: 0 6px 28px rgba(0, 0, 0, 0.65), 0 1px 3px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; height: auto; }

/* A link to another site opens in a new tab: an arrow after it, and the hint for screen readers, hidden. */
a[target="_blank"]::after { content: "\2009\2197"; content: "\2009\2197" / ""; }

.new-tab {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Bar on top */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.6rem 1rem;
  background: var(--hero-bg);
  color: var(--hero-text);
}

.bar a { color: var(--hero-text); text-decoration: none; }
.bar a:hover { color: #FFFFFF; }

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.brand img { border-radius: 6px; }

.bar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.2rem; }

/* The switch of the colour scheme, which the template's script shows: system, light or dark. */
.theme {
  padding: 0.25rem 0.7rem;
  border: 1px solid rgba(255, 252, 234, 0.5);
  border-radius: 999px;
  background: transparent;
  color: var(--hero-text);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.theme:hover { border-color: var(--hero-text); }

/* Buttons */

.button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: #FFFFFF;
  font-weight: 600;
  text-decoration: none;
}

.button:hover { background: var(--accent-hover); color: #FFFFFF; }

.bar .button.small { padding: 0.3rem 0.9rem; color: #FFFFFF; }

.button.secondary {
  background: transparent;
  color: var(--hero-text);
  box-shadow: inset 0 0 0 1px var(--hero-text);
}

.button.secondary:hover { background: rgba(255, 252, 234, 0.1); color: var(--hero-text); }

/* Hero */

.hero {
  padding: 4rem 1rem 3.5rem;
  background: radial-gradient(circle at 50% 30%, #1E1B16 0%, var(--hero-bg) 70%);
  color: var(--hero-text);
  text-align: center;
}

.hero-icon { border-radius: 28px; }

.hero h1 {
  margin: 1rem 0 0.5rem;
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.tagline {
  max-width: 34rem;
  margin: 0 auto 2rem;
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  opacity: 0.9;
}

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }

.android { margin: 1.25rem auto 0; max-width: 34rem; font-size: 0.9rem; }

.android a { color: var(--hero-text); }

.note { margin-top: 1.5rem; font-size: 0.9rem; opacity: 0.7; }

/* Content */

main { max-width: 60rem; margin: 0 auto; padding: 2rem 1rem 3rem; }

main.doc { max-width: 48rem; }

h1, h2, h3 { line-height: 1.25; }

.home h2 {
  margin: 3rem 0 1rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
}

.home h2:first-child { margin-top: 1rem; }

.doc h2 {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
}

.feature {
  padding: 1.25rem 1.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.feature h3 { margin: 0 0 0.5rem; font-size: 1.1rem; }

.feature p { margin: 0 0 0.75rem; color: var(--muted); }

.screenshots {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 1.5rem;
  margin: 2.5rem 0 1rem;
}

.screenshots figure { margin: 0; text-align: center; color: var(--muted); font-size: 0.9rem; }
.screenshots img { display: block; border-radius: 18px; }
.screenshots .iphone { width: 14rem; }
.screenshots .ipad { width: 22rem; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 1.5rem 1rem;
  margin: 1.5rem 0;
}

.gallery figure { margin: 0; text-align: center; color: var(--muted); font-size: 0.9rem; }
.gallery img { display: block; margin: 0 auto 0.5rem; border-radius: 14px; }
.gallery figure:has(.wide) { grid-column: 1 / -1; }
.gallery .wide img { max-width: 40rem; width: 100%; border-radius: 10px; }

.screenshots .mac { width: 40rem; border-radius: 10px; }

/* Images of the app in the manual. */
.doc img { border-radius: 14px; }

/* Every screenshot has a frame and a shadow, so that its edge shows on a page of the same colour. */
img.light, img.dark {
  border: 1px solid var(--shot-border);
  box-shadow: var(--shot-shadow);
}

.doc img.light, .doc img.dark { margin: 0.5rem 1rem 1rem 0; }

/* Screenshots exist in light and dark: the one of the chosen colour scheme shows. */
:root[data-theme="light"] img.dark,
:root[data-theme="dark"] img.light { display: none; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) img.dark { display: none; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) img.light { display: none; }
}

.steps li { margin-bottom: 0.5rem; }

code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--code-bg);
  font-size: 0.9em;
}

pre { overflow-x: auto; padding: 1rem; border-radius: 8px; background: var(--code-bg); }
pre code { padding: 0; background: none; }

table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1rem 0;
}

th, td { padding: 0.4rem 0.75rem; border: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: var(--surface); }

blockquote {
  margin: 1rem 0;
  padding: 0.25rem 1rem;
  border-left: 4px solid var(--accent);
  background: var(--surface);
}

/* Footer */

footer {
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

footer p { max-width: 48rem; margin: 0.5rem auto; }

@media (max-width: 40rem) {
  .bar nav { gap: 0.4rem 0.9rem; font-size: 0.95rem; }
  .hero { padding-top: 2.5rem; }
}
