/* webark.sk – shared styles
   Direction: a Slovak school exercise book ("zošit").
   Squared paper, a red margin line, blue pen ink, the teacher's red check. */

:root {
  --papier: #f5f7f9;   /* page */
  --linajka: #d3dfee;  /* squared-paper grid */
  --atrament: #2340b8; /* blue pen ink – links, primary action */
  --atrament-2: #1a3090;
  --grafit: #262a31;   /* text */
  --grafit-2: #545b67; /* secondary text */
  --okraj: #c8322a;    /* margin line + teacher's red pen, nothing else */
  --rule: #dde4ee;

  --font: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", ui-sans-serif, system-ui, sans-serif;

  /* type scale */
  --t-sm: 15px;
  --t-body: 17px;
  --t-lead: 21px;
  --t-h3: 21px;
  --t-h2: 28px;
  --t-q: clamp(32px, 5.2vw, 60px);

  --grid: 20px;                       /* one notebook square */
  --margin-x: 56px;                   /* where the red line sits inside the sheet */
  --sheet: 1040px;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--papier);
  color: var(--grafit);
  font: 400 var(--t-body)/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--atrament); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
p { margin: 0 0 1em; }
h1, h2, h3 { color: var(--grafit); margin: 0; }

:focus-visible { outline: 3px solid var(--atrament); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--grafit); color: var(--papier); padding: 8px 12px; z-index: 10; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- The sheet: everything sits right of the red margin line ---------- */
.sheet {
  position: relative;
  max-width: var(--sheet);
  margin: 0 auto;
  padding: 0 32px 0 calc(var(--margin-x) + 32px);
  min-height: 100vh;
  display: flex; flex-direction: column;   /* footer sits at the bottom on short pages */
}
.sheet > main { flex: 1 0 auto; }
.sheet::before {
  content: "";
  position: absolute; top: 0; bottom: 0; left: var(--margin-x);
  width: 2px; background: var(--okraj);
}

/* ---------- Header ---------- */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 28px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--grafit); text-decoration: none; font-weight: 800; font-size: 22px; letter-spacing: -0.01em; }
.brand { gap: 8px; }
.brand svg { width: 30px; height: 30px; margin-top: -2px; }
.nav { display: flex; gap: 28px; }
.nav a { color: var(--grafit); text-decoration: none; font-weight: 500; }
.nav .lang { padding-left: 24px; border-left: 1px solid var(--rule); color: var(--atrament); }
.btn .note { font-weight: 400; margin-left: 6px; opacity: .85; }
.doc .legal { margin-top: 72px; max-width: 60ch; font-size: 14px; line-height: 1.6; color: var(--grafit-2); }
.nav a:hover, .nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--atrament); text-decoration-thickness: 2px; }

/* ---------- Home: intro + quiz ---------- */
.intro { max-width: 34ch; font-size: var(--t-lead); font-weight: 500; line-height: 1.45; padding: 40px 0 28px; letter-spacing: -0.005em; }

.quiz {
  /* the grid starts at the margin line, like real paper */
  margin: 0 0 0 calc(-32px + 2px);
  padding: calc(var(--grid) * 3) 32px calc(var(--grid) * 3);
  background-color: #fbfcfd;
  background-image:
    linear-gradient(var(--linajka) 1px, transparent 1px),
    linear-gradient(90deg, var(--linajka) 1px, transparent 1px);
  background-size: var(--grid) var(--grid);
  background-position: -1px -1px;
  border: 0;
  min-width: 0;
}
.quiz legend { float: left; width: 100%; padding: 0; } /* float lets the legend sit inside the padded box */
.quiz legend + * { clear: both; }
.quiz .q {
  display: block;
  font-size: var(--t-q); font-weight: 800; line-height: 1.04; letter-spacing: -0.025em;
  max-width: 17ch; margin-bottom: calc(var(--grid) * 2);
}
.opts { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 0; padding: 0; list-style: none; }
.opt { position: relative; display: inline-flex; align-items: baseline; gap: 10px; cursor: pointer; font-size: 28px; font-weight: 700; padding: 10px 18px; color: var(--grafit); }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt .letter { font-weight: 400; color: var(--grafit-2); font-size: 22px; }
.opt .ring { position: absolute; inset: -6px -10px; width: calc(100% + 20px); height: calc(100% + 12px); pointer-events: none; overflow: visible; }
.opt .ring path { fill: none; stroke: var(--atrament); stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 101; stroke-dashoffset: 101; opacity: 0; }
.opt input:checked ~ .ring path { opacity: 1; stroke-dashoffset: 0; transition: stroke-dashoffset .45s ease-out; }
.opt input:focus-visible ~ .text { outline: 3px solid var(--atrament); outline-offset: 6px; border-radius: 2px; }
.opt:hover .text { text-decoration: underline; text-decoration-color: var(--linajka); text-decoration-thickness: 3px; text-underline-offset: 6px; }

.result { display: flex; gap: 16px; align-items: flex-start; margin-top: calc(var(--grid) * 2); max-width: 46ch; min-height: 64px; }
.result:empty { min-height: 0; margin: 0; }
.result .mark { flex: none; width: 48px; height: 48px; overflow: visible; }
.result .mark path { fill: none; stroke: var(--okraj); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 101; stroke-dashoffset: 0; }
.result.is-new .mark path { animation: draw .5s .1s ease-out both; }
@keyframes draw { from { stroke-dashoffset: 101; } to { stroke-dashoffset: 0; } }
.quiz fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.result p { margin: 0; font-size: 19px; }
.result strong { color: var(--okraj); }
.result a { white-space: nowrap; }

/* ---------- Home: sections ---------- */
.block { padding: 88px 0 0; }
.block h2 { font-size: var(--t-h2); font-weight: 800; letter-spacing: -0.015em; line-height: 1.15; margin-bottom: 20px; }

.product { display: grid; grid-template-columns: 88px minmax(0, 52ch); gap: 28px; align-items: start; }
.product img { width: 88px; height: 88px; border-radius: 20px; }
.product h2 { font-size: 44px; line-height: 1; margin-bottom: 16px; letter-spacing: -0.025em; }
.product p { color: var(--grafit); }
.actions { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; margin-top: 24px; }

.btn {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px;
  background: var(--atrament); color: #fff; font-weight: 700; text-decoration: none; border-radius: 6px;
}
.btn:hover { background: var(--atrament-2); }

.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; margin: 0; padding: 0; list-style: none; }
.principles li { border-top: 2px solid var(--grafit); padding-top: 16px; }
.principles h3 { font-size: var(--t-h3); font-weight: 700; line-height: 1.25; margin-bottom: 8px; }
.principles p { margin: 0; color: var(--grafit-2); }

.company { display: grid; grid-template-columns: max-content 1fr; gap: 10px 32px; margin: 0; max-width: 720px; }
.company dt { color: var(--grafit-2); }
.company dd { margin: 0; }

/* ---------- Footer ---------- */
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; margin-top: 112px; padding: 28px 0 48px; border-top: 1px solid var(--rule); color: var(--grafit-2); font-size: var(--t-sm); }
footer ul { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; list-style: none; }
footer a { color: var(--grafit-2); }

/* ---------- Legal / document pages ---------- */
.doc { max-width: 68ch; padding: 40px 0 0; }
.doc h1 { font-size: clamp(34px, 4.6vw, 48px); font-weight: 800; line-height: 1.05; letter-spacing: -0.025em; margin-bottom: 14px; }
.doc h2 { font-size: 23px; font-weight: 700; letter-spacing: -0.01em; margin: 44px 0 12px; }
.doc .meta { color: var(--grafit-2); font-size: var(--t-sm); }
.doc ul { padding-left: 1.2em; }
.doc li { margin: 6px 0; }
.doc code { font-size: 0.9em; background: #e8edf4; padding: 1px 5px; border-radius: 3px; }
.doc table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.doc th, .doc td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.doc th { border-bottom: 2px solid var(--grafit); }
.mail { font-size: 28px; font-weight: 700; }
.imprint { margin-top: 40px; color: var(--grafit-2); }
.imprint p { margin: 0 0 4px; }
.imprint b { color: var(--grafit); }

.langs { display: flex; gap: 20px; margin: 20px 0 8px; font-weight: 500; }
.langs a[aria-current="page"] { color: var(--grafit); text-decoration: none; position: relative; }
.langs a[aria-current="page"]::after { content: ""; position: absolute; left: -6px; right: -6px; top: -4px; bottom: -4px; border: 2px solid var(--atrament); border-radius: 50%; }

.table-scroll { overflow-x: auto; margin: 16px 0; }
.table-scroll table { margin: 0; min-width: 480px; }
.todo { background: #fff0b8; padding: 0 4px; border-radius: 3px; }

/* ---------- Small screens: the margin line moves close to the edge ---------- */
@media (max-width: 760px) {
  :root { --margin-x: 14px; --t-q: clamp(30px, 8.6vw, 44px); }
  .sheet { padding: 0 18px 0 calc(var(--margin-x) + 18px); }
  .quiz { margin-left: -16px; padding-left: 16px; padding-right: 16px; margin-right: -18px; }
  .opts { flex-direction: column; gap: 4px; }
  .opt { font-size: 24px; }
  .principles { grid-template-columns: 1fr; gap: 28px; }
  .company { grid-template-columns: 1fr; gap: 2px; }
  .company dd { margin-bottom: 10px; }
  .product { grid-template-columns: 1fr; }
  .product h2 { font-size: 36px; }
  .nav { gap: 18px; }
  .block { padding-top: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .opt input:checked ~ .ring path { transition: none; }
  .result.is-new .mark path { animation: none; }
}
