@font-face {
  font-family: "Familjen Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/familjen-grotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Familjen Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/familjen-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --linen: #F2F1ED;
  --ink: #171717;
  --muted: #4A4946;
  --red: #B3261E;

  --c: 12px;                 /* one stitch cell */
  --gut: 24px;
  --wrap: 1200px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 40px; --s5: 64px; --s6: 104px;
}
@media (min-width: 720px) {
  :root { --c: 16px; --gut: 48px; }
}

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

html {
  background: var(--linen);
  color: var(--ink);
  scrollbar-color: var(--ink) var(--linen);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  font-size: 19px;
  line-height: 1.6;
  font-weight: 400;
  caret-color: var(--red);
  text-rendering: optimizeLegibility;
}
::selection { background: var(--ink); color: var(--linen); }

h1, h2, h3, p, dl, dd, ul { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }

.wrap {
  width: min(100% - 2 * var(--gut), var(--wrap));
  margin-inline: auto;
}

a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 5px; }
a:hover { text-decoration-style: dashed; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 4px; }

.skip {
  position: absolute; left: var(--gut); top: -80px;
  background: var(--ink); color: var(--linen);
  padding: var(--s1) var(--s2); z-index: 5; text-decoration: none; font-weight: 600;
}
.skip:focus { top: var(--s2); }

/* header */
.top .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3); flex-wrap: wrap;
  padding-block: var(--s3);
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  font-weight: 700; font-size: 19px; letter-spacing: -0.01em; text-decoration: none;
}
.brand svg { width: 22px; height: 22px; }
.nav { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; font-size: 17px; font-weight: 500; }
.nav a { text-decoration: none; padding-block: 8px; background: linear-gradient(var(--ink), var(--ink)) 0 100% / 0 2px no-repeat; transition: background-size 220ms var(--ease); }
.nav a:hover, .nav a:focus-visible { background-size: 100% 2px; }
.nav .lang { border: 2px solid var(--ink); padding: 6px 12px; background: none; }
.nav .lang:hover { background: var(--ink); color: var(--linen); }

/* hero */
.hero { padding-top: var(--s5); }
h1 {
  font-size: clamp(2.75rem, 1.2rem + 6.4vw, 5.5rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 600;
  max-width: 24ch;
  text-wrap: balance;
}
.band-wrap { margin-block: var(--s4) var(--s4); overflow: hidden; container-type: inline-size; }
.band {
  position: relative;
  height: calc(9 * var(--c));
  --origin: calc((100cqw - min(100cqw - 2 * var(--gut), var(--wrap))) / 2 - var(--c));
  --rx: 17;
  animation: draw 1.1s steps(48, end) 120ms backwards;
}
@media (min-width: 720px) { .band { --rx: 29; } }
.band::before {
  content: ""; position: absolute; inset: 0; background: var(--ink);
  -webkit-mask: url("../assets/band-tile.svg") repeat-x var(--origin) 0 / calc(12 * var(--c)) calc(9 * var(--c));
  mask: url("../assets/band-tile.svg") repeat-x var(--origin) 0 / calc(12 * var(--c)) calc(9 * var(--c));
}
.red-stitch {
  position: absolute;
  width: var(--c); height: var(--c);
  left: calc(var(--origin) + var(--rx) * var(--c)); top: calc(4 * var(--c));
  animation: land 400ms var(--ease) 1.3s backwards;
}
.red-stitch path { stroke: var(--red); stroke-width: 0.3; stroke-linecap: round; fill: none; }
@keyframes draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes land { from { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: scale(1); } }

.lead { font-size: clamp(1.25rem, 1rem + 0.9vw, 1.6rem); line-height: 1.5; max-width: 34ch; letter-spacing: -0.005em; }
.actions { display: flex; align-items: center; gap: 12px var(--s4); flex-wrap: wrap; margin-top: var(--s4); }
.lead, .text p { text-wrap: pretty; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px;
  background: var(--ink); color: var(--linen);
  border: 2px solid var(--ink);
  font: inherit; font-weight: 600; font-size: 18px; text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms var(--ease);
}
.btn:hover { background: transparent; color: var(--ink); text-decoration: none; }
.btn:active { transform: translateY(2px); }
.link { font-weight: 500; font-size: 18px; padding-block: 10px; }

/* sections */
.stitch-rule {
  height: 2px; margin-top: var(--s6); background: var(--ink);
  -webkit-mask: url("../assets/running-stitch.svg") repeat-x 0 0 / 18px 2px;
  mask: url("../assets/running-stitch.svg") repeat-x 0 0 / 18px 2px;
}
section { padding-block: var(--s6) 0; }
.split { display: grid; gap: var(--s3) var(--s5); }
@media (min-width: 860px) { .split { grid-template-columns: 5fr 7fr; } }
h2 { font-size: clamp(1.9rem, 1.2rem + 2.2vw, 3rem); line-height: 1.08; letter-spacing: -0.025em; font-weight: 600; max-width: 14ch; text-wrap: balance; }
.text p { max-width: 62ch; }
.text p + p { margin-top: var(--s3); }

/* unstitched chart cells: what is not decided yet */
.chart { display: grid; gap: var(--s3); margin-top: var(--s4); }
@media (min-width: 720px) { .chart { grid-template-columns: repeat(3, 1fr); } }
.chart div { display: grid; grid-template-columns: auto 1fr; gap: 4px var(--s2); align-items: center; }
.chart dt { font-weight: 600; font-size: 20px; grid-column: 2; }
.chart dd { color: var(--muted); font-size: 17px; grid-column: 2; }
.chart div::before {
  content: ""; grid-row: 1 / span 2;
  width: calc(2 * var(--c)); height: calc(2 * var(--c));
  background: var(--ink);
  -webkit-mask: url("../assets/unstitched.svg") no-repeat center / contain;
  mask: url("../assets/unstitched.svg") no-repeat center / contain;
}

#contact .text p { margin-bottom: var(--s4); }
p.note { margin: var(--s2) 0 0; font-size: 16px; color: var(--muted); max-width: none; }

footer { margin-top: var(--s6); padding-block: var(--s4) var(--s5); border-top: 2px solid var(--ink); font-size: 16px; color: var(--muted); }
footer .wrap { display: flex; gap: var(--s2) var(--s4); justify-content: space-between; flex-wrap: wrap; }
footer strong { color: var(--ink); font-weight: 600; }

/* inner pages */
.nav a[aria-current="page"] { background-size: 100% 2px; }
.page-head { padding-top: var(--s5); }
.page-head h1 { font-size: clamp(2.5rem, 1.2rem + 5vw, 4.5rem); max-width: 18ch; }
.page-head .lead { margin-top: var(--s3); }
.page-body { padding-top: var(--s5); }
.defs { display: grid; gap: var(--s4) var(--s5); margin-top: var(--s4); }
@media (min-width: 720px) { .defs { grid-template-columns: 1fr 1fr; } }
.defs dt { font-weight: 600; font-size: 21px; letter-spacing: -0.01em; }
.defs dd { margin-top: 6px; max-width: 40ch; }
.refs { list-style: none; margin-top: var(--s4); }
.refs li { padding-block: var(--s3); border-top: 2px solid var(--ink); display: grid; gap: 6px; }
.refs li:first-child { border-top: 0; }
.refs li:last-child { border-bottom: 2px solid var(--ink); }
.refs a { font-weight: 600; font-size: 21px; letter-spacing: -0.01em; }
.refs p { max-width: 60ch; color: var(--muted); font-size: 17px; }
.prose p { max-width: 62ch; }
.prose p + p, .prose p + h2, .prose h2 + p { margin-top: var(--s3); }
.prose h2 { font-size: 1.5rem; max-width: none; }
.page-body .btn { margin-top: var(--s4); }
.text p.status { margin-top: var(--s4); }
footer a { color: inherit; }

/* four questions (home) */
#intrebari h2 { max-width: 22ch; }
.themes { list-style: none; display: grid; gap: var(--s4); margin-top: var(--s4); }
@media (min-width: 600px) { .themes { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .themes { grid-template-columns: repeat(4, 1fr); } }
.themes li { border-top: 2px solid var(--ink); padding-top: var(--s3); display: grid; gap: 14px; align-content: start; }
.motif { display: block; width: calc(7 * var(--c)); height: calc(7 * var(--c)); background: var(--ink); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.motif-fiabilitate { -webkit-mask-image: url("../assets/motif-fiabilitate.svg"); mask-image: url("../assets/motif-fiabilitate.svg"); }
.motif-control { -webkit-mask-image: url("../assets/motif-control.svg"); mask-image: url("../assets/motif-control.svg"); }
.motif-evaluare { -webkit-mask-image: url("../assets/motif-evaluare.svg"); mask-image: url("../assets/motif-evaluare.svg"); }
.motif-guvernanta { -webkit-mask-image: url("../assets/motif-guvernanta.svg"); mask-image: url("../assets/motif-guvernanta.svg"); }
/* the target of a question link on the About page */
.defs > div { scroll-margin-top: 32px; }
.defs > div:target dt { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.themes h3 { font-size: 24px; line-height: 1.2; letter-spacing: -0.015em; font-weight: 600; }
.themes h3 a { text-decoration-thickness: 2px; text-underline-offset: 5px; }
.themes p { color: var(--muted); font-size: 17px; }

/* zigzag border at the head of inner pages */
body.inner .top { container-type: inline-size; }
body.inner .top::after {
  content: ""; display: block; margin-top: var(--s1);
  height: calc(3 * var(--c));
  background: var(--ink);
  -webkit-mask: url("../assets/zigzag.svg") repeat-x calc((100cqw - min(100cqw - 2 * var(--gut), var(--wrap))) / 2) 0 / calc(4 * var(--c)) calc(3 * var(--c));
  mask: url("../assets/zigzag.svg") repeat-x calc((100cqw - min(100cqw - 2 * var(--gut), var(--wrap))) / 2) 0 / calc(4 * var(--c)) calc(3 * var(--c));
}

/* accessibility panel */
.a11y-row { padding-top: var(--s3); }
.a11y summary { cursor: pointer; font-weight: 600; color: var(--ink); width: max-content; padding-block: 8px; }
.a11y-panel { display: flex; gap: 12px; flex-wrap: wrap; margin-top: var(--s1); }
.chip {
  font: inherit; font-size: 16px; font-weight: 500; min-height: 44px; padding: 8px 16px;
  background: transparent; color: var(--ink); border: 2px solid var(--ink); cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}
.chip:hover { background: var(--ink); color: var(--linen); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--linen); }
html[data-text="large"] { zoom: 1.2; }
/* dark theme: follows the system unless the visitor chose */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) { color-scheme: dark; --linen: #141413; --ink: #ECEAE4; --muted: #B7B5AE; --red: #EA6A60; }
}
html[data-theme="dark"] { color-scheme: dark; --linen: #141413; --ink: #ECEAE4; --muted: #B7B5AE; --red: #EA6A60; }
html[data-theme="light"] { color-scheme: light; }

/* high contrast, in both themes */
html[data-contrast="high"] { --linen: #FFFFFF; --ink: #000000; --muted: #1A1A1A; --red: #9E1B14; }
@media (prefers-color-scheme: dark) {
  html[data-contrast="high"]:not([data-theme="light"]) { --linen: #000000; --ink: #FFFFFF; --muted: #E6E6E6; --red: #FF7F75; }
}
html[data-contrast="high"][data-theme="dark"] { --linen: #000000; --ink: #FFFFFF; --muted: #E6E6E6; --red: #FF7F75; }
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after { animation: none !important; transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  .band, .red-stitch { animation: none; }
  html { scroll-behavior: auto; }
  .btn, .nav a { transition: none; }
}
