/* Vabaring design system — tokens, type, layout, components.
   One margin per layout: every block snaps to --m (left and right). */

@font-face { font-family: "Saira"; src: url("../fonts/saira.woff2") format("woff2");
  font-weight: 100 900; font-stretch: 50% 125%; font-style: normal; font-display: swap; }
@font-face { font-family: "Saira"; src: url("../fonts/saira-italic.woff2") format("woff2");
  font-weight: 100 900; font-stretch: 50% 125%; font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800; font-display: swap; }

:root {
  /* colour */
  --ink: #0E0E10;        /* Süsi */
  --ink-2: #1A1A1D;      /* raised ink surface */
  --ink-3: #2A2A2E;      /* lines on ink */
  --chalk: #F2EFE8;      /* Kriit */
  --chalk-2: #E4E0D6;    /* Matt: canvas grey */
  --stone: #8C877E;      /* Kivi: secondary text on ink */
  --stone-d: #5D5952;    /* secondary text on chalk */
  --red: #FF3A1F;        /* Punane nurk / signal */
  --blue: #2350FF;       /* Sinine nurk */
  --blue-l: #5C7CFF;     /* blue for text on ink */

  /* layout */
  --m: clamp(20px, 4.4vw, 72px);       /* THE margin */
  --maxw: 1520px;
  --col-gap: clamp(16px, 2vw, 32px);
  --sec: clamp(72px, 10vw, 160px);     /* section padding */

  /* type */
  --f: "Saira", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --d1: clamp(56px, 11.5vw, 208px);
  --d2: clamp(40px, 6.6vw, 120px);
  --d3: clamp(28px, 3.6vw, 60px);
  --d4: clamp(20px, 1.9vw, 30px);
  --body: clamp(16px, 1.15vw, 19px);
  --small: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--ink); color: var(--chalk); font-family: var(--f);
  font-size: var(--body); line-height: 1.55; font-stretch: 100%; font-weight: 400;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--red); color: var(--ink); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-left: var(--m); padding-right: var(--m); }

/* --- type roles ---------------------------------------------------------
   Display caps: Saira Black Italic. Estonian caps rule: line-height 1.0
   reserves the accent (Õ top = 0.901 em, cap = 0.688 em), so every stacked
   caps line keeps the same 0.099 em gap whichever words appear.             */
.d1, .d2, .d3, .d4, .disp { font-style: italic; font-weight: 900; text-transform: uppercase;
  line-height: 1; letter-spacing: -0.01em; margin: 0; font-kerning: normal; }
.d1 { font-size: var(--d1); letter-spacing: -0.015em; }
.d2 { font-size: var(--d2); letter-spacing: -0.02em; }
.d3 { font-size: var(--d3); }
.d4 { font-size: var(--d4); letter-spacing: 0; line-height: 1.1; }
.lead { font-size: clamp(19px, 1.6vw, 26px); line-height: 1.4; font-weight: 500; max-width: 34ch; margin: 0; }
.mono, .tag { font-family: var(--mono); font-weight: 500; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; }
.tag { display: inline-flex; align-items: center; gap: 10px; margin: 0; }
.tag::before { content: ""; width: 10px; height: 10px; background: var(--red); flex: none; }
.tag.blue::before { background: var(--blue); }
.tag.plain::before { display: none; }
.muted { color: var(--stone); }
.on-chalk .muted { color: var(--stone-d); }
.red { color: var(--red); } .blue { color: var(--blue-l); }
p { margin: 0 0 1em; max-width: 62ch; }

/* --- surfaces ----------------------------------------------------------- */
.on-chalk { background: var(--chalk); color: var(--ink); }
.on-red { background: var(--red); color: var(--ink); }
.on-blue { background: var(--blue); color: var(--chalk); }
section { padding: var(--sec) 0; position: relative; }

/* --- header ------------------------------------------------------------- */
.site-head { position: sticky; top: 0; z-index: 50; background: var(--ink);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--ink-3); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.site-head .logo img { height: 40px; width: auto; }
.nav { display: flex; gap: clamp(16px, 2vw, 32px); align-items: center; }
.nav a { text-decoration: none; font-weight: 600; font-size: 15px; letter-spacing: .01em; }
.nav a:hover { color: var(--red); }
.nav .btn { margin-left: 8px; }
.menu-btn { display: none; background: none; border: 0; color: inherit; font: 600 14px var(--mono); text-transform: uppercase; letter-spacing: .08em; padding: 10px 0; cursor: pointer; }
@media (max-width: 960px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 72px; background: var(--ink);
    flex-direction: column; align-items: flex-start; padding: 24px var(--m) 32px; border-bottom: 1px solid var(--ink-3); }
  .nav.open { display: flex; }
  .nav a { font-size: 22px; font-style: italic; font-weight: 800; text-transform: uppercase; }
  .nav .btn { margin: 8px 0 0; }
}

/* --- buttons ------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; gap: 12px; padding: 16px 24px; border: 0;
  font: 800 15px/1 var(--f); font-style: italic; text-transform: uppercase; letter-spacing: .04em;
  text-decoration: none; cursor: pointer; background: var(--red); color: var(--ink);
  transition: transform .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-2px); }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.btn.ink { background: var(--ink); color: var(--chalk); }
.btn.sm { padding: 12px 16px; font-size: 13px; }
.btn .arr { font-family: var(--mono); font-weight: 700; }

/* --- grid helpers ------------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); row-gap: 40px; }
.c-12 { grid-column: span 12; } .c-8 { grid-column: span 8; } .c-7 { grid-column: span 7; }
.c-6 { grid-column: span 6; } .c-5 { grid-column: span 5; } .c-4 { grid-column: span 4; } .c-3 { grid-column: span 3; }
@media (max-width: 960px) { .c-8, .c-7, .c-6, .c-5, .c-4 { grid-column: span 12; } .c-3 { grid-column: span 6; } }
@media (max-width: 560px) { .c-3 { grid-column: span 12; } }
.rule { height: 0; border: 0; border-top: 1px solid var(--ink-3); margin: 0; }
.on-chalk .rule { border-top-color: #CFCAC0; }
.stack > * + * { margin-top: var(--gap, 24px); }

/* section heads: tag -> headline -> sub, constant rhythm */
.sec-head { display: grid; gap: 28px; margin-bottom: clamp(40px, 5vw, 80px); }
.sec-head .lead { max-width: 44ch; }

/* --- ticker ------------------------------------------------------------- */
.ticker { overflow: hidden; background: var(--red); color: var(--ink); border-block: 0; padding: 18px 0; }
.ticker .track { display: flex; width: max-content; animation: tick 38s linear infinite; }
.ticker span { font-style: italic; font-weight: 900; text-transform: uppercase; font-size: clamp(18px, 2vw, 28px); line-height: 1; padding-right: 48px; white-space: nowrap; display: inline-flex; align-items: center; gap: 48px; }
.ticker span::after { content: ""; width: .5em; height: .5em; background: var(--ink); display: inline-block; }
@keyframes tick { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker .track { animation: none; } html { scroll-behavior: auto; } }

/* --- footer ------------------------------------------------------------- */
.site-foot { padding: 64px 0 40px; border-top: 1px solid var(--ink-3); }
.site-foot .row { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.site-foot .logo img { height: 52px; width: auto; }
.site-foot nav { display: flex; gap: 24px; flex-wrap: wrap; }
.site-foot nav a { text-decoration: none; }
.site-foot nav a:hover { color: var(--red); }

/* --- mark motif: open-ring outline as a big graphic device -------------- */
.ring-bg { position: absolute; pointer-events: none; opacity: .07; }

/* --- demo badge for placeholder content --------------------------------- */
.demo-note { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--stone); }
