/* slavij.app: the app's "linen and cross-stitch" look. Colours are Palette (Shared/Theme.swift), headings Unbounded. */

@font-face {
  font-family: "Unbounded";
  src: url("/fonts/unbounded-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --ground: #F7F3EC;
  --surface: #FFFFFF;
  --surface-2: #EEE8DE;
  --ink: #1E1A1F;
  --muted: #5B5358;
  --line: #E3DACD;
  --rowan: #B3261E;
  --on-rowan: #FFFFFF;
  --rowan-soft: #F8E3E0;
  --rowan-ink: #A32019;
  --ochre: #D9961A;
  --pine: #2E6B4C;
  --header: #B3261E;
  --header-2: #8A1E17;
  --on-header: #FFFFFF;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #141215;
    --surface: #1F1C20;
    --surface-2: #2B272C;
    --ink: #F4EFE8;
    --muted: #B5ACA9;
    --line: #3A3438;
    --rowan: #E5554A;
    --on-rowan: #1A0E0D;
    --rowan-soft: #3A1E1C;
    --rowan-ink: #F07A70;
    --ochre: #E8AE3A;
    --pine: #5CB287;
    --header: #8A1E17;
    --header-2: #5E140F;
    --on-header: #FFF4F0;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}
a { color: var(--rowan-ink); }
img { max-width: 100%; height: auto; }
code { font-size: .92em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }

h1, h2, h3, .brand {
  font-family: "Unbounded", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(28px, 6vw, 40px); margin: 0 0 14px; }
h2 { font-size: clamp(21px, 4.5vw, 26px); margin: 44px 0 12px; }
h3 { font-size: 17px; margin: 0 0 6px; }
p, li { color: var(--muted); }
strong { color: var(--ink); }

.wrap { max-width: 900px; margin: 0 auto; padding: 0 16px; }

.skip { position: absolute; left: -999px; top: 0; z-index: 2; background: var(--surface); color: var(--ink); padding: 10px 14px; }
.skip:focus { left: 8px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header: the red band of the app's lesson card, ending in the embroidered hem. */
header.site {
  background: linear-gradient(180deg, var(--header), var(--header-2));
  color: var(--on-header);
  padding-top: 18px;
}
header.site a { color: var(--on-header); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 22px; text-decoration: none; min-height: 44px; }
.brand img { border-radius: 11px; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); }
.lang-link { font-weight: 700; text-decoration: none; padding: 10px 14px; min-height: 44px; border: 1.5px solid rgba(255, 255, 255, .55); border-radius: 999px; font-size: 15px; }
nav.main { display: flex; flex-wrap: wrap; gap: 0 22px; margin-top: 10px; padding-bottom: 14px; }
nav.main a { font-weight: 700; text-decoration: none; padding: 10px 0; }
nav.main a:hover, nav.main a[aria-current="page"] { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }

.hero { padding: 18px 0 34px; }
.hero h1 { font-size: clamp(30px, 7vw, 50px); max-width: 820px; }
.hero .lead { color: var(--on-header); opacity: .95; }
.hero .note { color: var(--on-header); opacity: .85; }
.hero .btn.primary { background: var(--on-header); color: var(--header); }

.hem {
  height: 26px;
  background: var(--ground) url("/img/hem.svg") repeat-x center;
}

main { padding-top: 26px; padding-bottom: 40px; }
.lead { font-size: clamp(18px, 2.6vw, 20px); max-width: 720px; margin: 0 0 22px; }

.download { margin: 0 0 8px; }
.btn { display: inline-block; padding: 13px 22px; min-height: 48px; border-radius: 999px; font-weight: 700; text-decoration: none; }
.btn.primary { background: var(--rowan); color: var(--on-rowan); }
.btn.secondary { background: var(--surface-2); color: var(--ink); margin-top: 8px; }
.note { font-size: 15px; margin: 8px 0 0; }

/* Screenshots: a row that scrolls sideways on its own, never the page. */
.shots { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 12px; margin: 4px -2px 0; }
.shots figure { margin: 0; flex: 0 0 auto; width: 220px; scroll-snap-align: start; }
.shots img { display: block; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); }
.shots figcaption { font-size: 14px; font-weight: 700; color: var(--muted); margin-top: 8px; text-align: center; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; }
.card p { margin: 0; font-size: 16px; }

ul.facts, ol.steps, ol.units { padding-left: 22px; }
ul.facts li, ol.steps li, ol.units li { margin: 6px 0; }
ol.units .note { margin-left: 6px; }

/* Word tables: Interslavic first and sticky, the twins scroll sideways inside the table's own box. */
/* position: relative keeps the screen-reader-only notes (.vh) inside the scrolling box, not off the page's edge. */
.table-scroll { position: relative; overflow-x: auto; margin: 10px 0 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.table-scroll:focus { outline: 2px solid var(--rowan); outline-offset: 2px; }
table.words { border-collapse: collapse; width: 100%; min-width: 720px; font-size: 15px; }
table.words caption { text-align: left; padding: 12px 14px 4px; font-size: 13px; color: var(--muted); }
table.words th, table.words td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.words tbody tr:last-child th, table.words tbody tr:last-child td { border-bottom: 0; }
table.words thead th { font-size: 13px; color: var(--muted); font-weight: 700; white-space: nowrap; }
table.words th.isv { position: sticky; left: 0; background: var(--surface); font-weight: 700; color: var(--ink); min-width: 120px; }
table.words thead th:first-child { position: sticky; left: 0; background: var(--surface); }
th.isv span { display: block; }
th.isv .cyr { font-weight: 400; color: var(--muted); font-size: 14px; }
.other { color: var(--muted); opacity: .7; }

.faq h2 { font-size: 19px; margin: 32px 0 6px; }
.faq p { margin: 0; }

footer.site { border-top: 1px solid var(--line); background: var(--surface); padding: 22px 0 30px; font-size: 15px; }
footer.site p { margin: 8px 0; }
footer.site .links a { display: inline-block; padding: 6px 0; }
nav.langs { display: flex; flex-wrap: wrap; gap: 4px 16px; }
nav.langs a { color: var(--muted); padding: 6px 0; }
nav.langs a[aria-current] { color: var(--ink); font-weight: 700; text-decoration: none; }

@media (max-width: 540px) {
  .shots figure { width: 180px; }
  .card { padding: 16px; }
}
