/* =============================================================================
   OTSTEK UI, otstek.css, v1.0, 2 December 2026
   -----------------------------------------------------------------------------
   One stylesheet for otstek.ee, the review portal and every internal tool.
   Read top to bottom: each layer only uses the layers above it.

     1. Fonts            licensed webfonts, self-hosted
     2. Brand tokens     raw values from the brand guide. Never used by components.
     3. Theme tokens     semantic names components ask for (dark default, light)
     4. Scale tokens     type, space, radius, shadow, motion
     5. Base             reset and element defaults
     6. Type             display, headings, text, data
     7. Layout           wrap, band, stack, cluster, grid
     8. Components       ot-* blocks, one section each, BEM modifiers (--)
     9. Brand device     viewfinder, REC dot, timecode
    10. Utilities        small, single-purpose helpers

   Rules
   - Components use theme tokens (var(--surface), var(--danger)), never hex.
   - Switch theme with one attribute: <html data-theme="light"> (dark is default).
   - Orange (--accent) marks one thing per view: REC, the active item, focus.
   - Square corners everywhere. Round only for dots, switches and avatars.
   ========================================================================== */


/* 1. FONTS ================================================================= */

@font-face { font-family: "Kurdis";    src: url(fonts/kurdis-xc-900.woff2) format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Kurdis";    src: url(fonts/kurdis-xc-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Mansfield"; src: url(fonts/mansfield-400.woff)  format("woff");  font-weight: 400; font-display: swap; }
@font-face { font-family: "Mansfield"; src: url(fonts/mansfield-400i.woff) format("woff");  font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Mansfield"; src: url(fonts/mansfield-700.woff)  format("woff");  font-weight: 700; font-display: swap; }
@font-face { font-family: "Monodrip";  src: url(fonts/monodrip-300.woff2)  format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Monodrip";  src: url(fonts/monodrip-400.woff2)  format("woff2"); font-weight: 400; font-display: swap; }


/* 2. BRAND TOKENS ========================================================== */
/* Straight from the brand guide. Components never read these directly. */

:root {
  --ot-ink:          #0B0B0B;
  --ot-ink-2:        #151515;
  --ot-ink-3:        #1E1E1E;
  --ot-rule:         #2A2A2A;
  --ot-steel:        #8E9590;  /* secondary text on ink only            */
  --ot-steel-dark:   #5E6460;  /* secondary text on paper and white      */
  --ot-paper:        #F2F2EE;
  --ot-white:        #FFFFFF;
  --ot-rule-light:   #D9D9D4;
  --ot-orange:       #DD6B00;  /* the signal: REC, active, focus          */
  --ot-orange-ink:   #A85200;  /* orange text on light backgrounds        */

  --ot-font-display: "Kurdis", "Arial Narrow", sans-serif;
  --ot-font-text:    "Mansfield", system-ui, sans-serif;
  --ot-font-mono:    "Monodrip", ui-monospace, monospace;
}


/* 3. THEME TOKENS ========================================================== */
/* Dark is the default: OTSTEK lives on ink. Contrast is measured in the UI guide. */

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg:             var(--ot-ink);
  --surface:        var(--ot-ink-2);
  --surface-2:      var(--ot-ink-3);
  --sunken:         #070707;
  --border:         var(--ot-rule);       /* dividers, card edges (decorative) */
  --border-strong:  #5A5F5C;
  --border-control: #6B716D;              /* inputs: 3.7:1 on surface          */
  --text:           var(--ot-paper);      /* 17.5:1 */
  --text-2:         #C9CCC9;              /* 12.2:1 */
  --muted:          var(--ot-steel);      /*  6.4:1 */
  --accent:         var(--ot-orange);     /*  5.8:1 */
  --accent-text:    var(--ot-orange);     /* orange used as text */
  --on-accent:      var(--ot-ink);        /* text on an orange fill: 5.8:1 */
  --focus:          var(--ot-orange);
  --primary-bg:     var(--ot-paper);      /* one primary button per view */
  --primary-text:   var(--ot-ink);
  --ok:             #4CB782;
  --warn:           #E0B341;
  --danger:         #EF5A52;
  --info:           #7AA7E0;
  --danger-text:    var(--ot-ink);        /* text on a danger fill */
  --overlay:        rgba(0, 0, 0, .66);
}

[data-theme="light"] {
  color-scheme: light;
  --bg:             var(--ot-paper);
  --surface:        var(--ot-white);
  --surface-2:      #F7F7F4;
  --sunken:         #E8E8E3;
  --border:         var(--ot-rule-light);
  --border-strong:  #8A908C;
  --border-control: #7A807C;              /* 3.6:1 on paper */
  --text:           var(--ot-ink);        /* 17.5:1 */
  --text-2:         #3A3E3B;              /*  9.7:1 */
  --muted:          var(--ot-steel-dark); /*  5.4:1 */
  --accent:         var(--ot-orange);     /* fills and dots only: 3.0:1 */
  --accent-text:    var(--ot-orange-ink); /*  4.8:1 */
  --on-accent:      var(--ot-ink);
  --focus:          var(--ot-orange-ink);
  --primary-bg:     var(--ot-ink);
  --primary-text:   var(--ot-paper);
  --ok:             #1E7A4C;
  --warn:           #8A6400;
  --danger:         #B42318;
  --info:           #2F5F9E;
  --danger-text:    var(--ot-white);
  --overlay:        rgba(11, 11, 11, .45);
}


/* 4. SCALE TOKENS ========================================================== */

:root {
  /* type: Kurdis caps are 0.80 em, accents reach 1.02 em, so stacked caps use 1.12 */
  --fs-display: clamp(56px, 8vw, 96px);
  --fs-h1:      clamp(40px, 5vw, 56px);
  --fs-h2:      36px;
  --fs-h3:      26px;
  --fs-h4:      20px;
  --fs-lead:    19px;
  --fs-body:    16px;
  --fs-small:   14px;
  --fs-label:   14px;
  --fs-data:    14px;
  --lh-caps:    1.12;
  --lh-text:    1.55;

  /* space: 4 px steps */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;

  /* shape */
  --radius:      0;
  --radius-pill: 999px;   /* dots, switches, avatars only */
  --stroke:      1px;
  --focus-ring:  0 0 0 2px var(--bg), 0 0 0 4px var(--focus);

  /* depth: floating layers only (menus, dialogs, toasts) */
  --shadow-1: 0 2px 8px rgba(0, 0, 0, .28);
  --shadow-2: 0 8px 28px rgba(0, 0, 0, .38);

  /* motion: cuts, not slides. The REC dot is the only thing that blinks. */
  --t-fast: 120ms;
  --t-base: 180ms;

  --wrap: 1240px;
  --gutter: max(5vw, 16px);
  --control-h: 44px;
}


/* 5. BASE ================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--fs-body)/var(--lh-text) var(--ot-font-text);
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--accent-text); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }
::selection { background: var(--accent); color: var(--on-accent); }
hr { border: 0; border-top: var(--stroke) solid var(--border); margin: var(--s-8) 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }


/* 6. TYPE ================================================================== */

.ot-display, .ot-h1, .ot-h2, .ot-h3, .ot-h4 {
  font-family: var(--ot-font-display);
  text-transform: uppercase;
  line-height: var(--lh-caps);
  letter-spacing: 0;
  margin: 0;
}
.ot-display { font-size: var(--fs-display); font-weight: 900; }
.ot-h1      { font-size: var(--fs-h1);      font-weight: 900; }
.ot-h2      { font-size: var(--fs-h2);      font-weight: 900; }
.ot-h3      { font-size: var(--fs-h3);      font-weight: 700; }
.ot-h4      { font-size: var(--fs-h4);      font-weight: 700; }
.ot-lead    { font-size: var(--fs-lead); color: var(--text-2); max-width: 62ch; margin: 0; }
.ot-text    { font-size: var(--fs-body); max-width: 68ch; margin: 0; }
.ot-small   { font-size: var(--fs-small); color: var(--muted); }
.ot-label   { font-size: var(--fs-label); font-weight: 700; }
.ot-data, .ot-num {
  font-family: var(--ot-font-mono);
  font-weight: 300;                 /* Light on dark */
  font-size: var(--fs-data);
  font-synthesis: none;             /* Monodrip is never bold */
}
[data-theme="light"] .ot-data, [data-theme="light"] .ot-num { font-weight: 400; }
.ot-num { text-align: right; white-space: nowrap; }


/* 7. LAYOUT ================================================================ */

.ot-wrap    { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.ot-band    { padding-block: clamp(32px, 5vw, 72px); border-top: var(--stroke) solid var(--border); }
.ot-stack   { display: grid; gap: var(--stack-gap, var(--s-4)); align-content: start; }
.ot-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster-gap, var(--s-3)); }
.ot-grid    { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--grid-min, 260px)), 1fr)); }
.ot-split   { display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 760px) { .ot-split { grid-template-columns: 1fr; } }
.ot-grid > *, .ot-split > *, .ot-cluster > * { min-width: 0; }


/* 8. COMPONENTS ============================================================ */

/* 8.0 Optical centring ------------------------------------------------------
   Labels in buttons, segments, tabs and tags are centred on what the eye sees:
   the text box is trimmed to cap height and baseline (text-box), then lifted
   0.06 em so mostly-lowercase labels do not read low. Applies to every
   button-like element so they all line up when placed side by side. */
.ot-btn, .ot-seg button, .ot-tabs [role="tab"], .ot-tag, .ot-count {
  text-box: trim-both cap alphabetic;
}
/* The lift is built into each component's padding as an extra 0.12 em at the bottom. */

/* 8.1 Button ---------------------------------------------------------------
   <button class="ot-btn ot-btn--primary">Saada</button>
   Variants: --primary (one per view), --ghost, --danger, --accent (rare, the one
   orange action on a page), --sm, --icon. Loading: aria-busy="true" keeps width. */
.ot-btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  --btn-bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--control-h); padding: 0 var(--s-5) .12em;
  font: 700 var(--fs-label)/1 var(--ot-font-text);
  color: var(--btn-fg); background: var(--btn-bg);
  border: var(--stroke) solid var(--btn-bd); border-radius: var(--radius);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.ot-btn:hover          { --btn-bd: var(--text); color: var(--btn-fg); }
.ot-btn:active         { transform: translateY(1px); }
.ot-btn[disabled], .ot-btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.ot-btn--primary       { --btn-bg: var(--primary-bg); --btn-fg: var(--primary-text); --btn-bd: var(--primary-bg); }
.ot-btn--primary:hover { --btn-bg: var(--text-2); --btn-bd: var(--text-2); }
.ot-btn--ghost         { --btn-bg: transparent; --btn-bd: transparent; }
.ot-btn--ghost:hover   { --btn-bd: var(--border-strong); }
.ot-btn--danger        { --btn-bg: var(--danger); --btn-fg: var(--danger-text); --btn-bd: var(--danger); }
.ot-btn--accent        { --btn-bg: var(--accent); --btn-fg: var(--on-accent); --btn-bd: var(--accent); }
.ot-btn--sm            { min-height: 34px; padding: 0 var(--s-3) .12em; font-size: 13px; }
.ot-btn--icon          { width: var(--control-h); padding: 0; }
.ot-btn--icon.ot-btn--sm { width: 34px; }
.ot-btn svg            { width: 18px; height: 18px; flex: none; }
.ot-btn[aria-busy="true"] { color: transparent; position: relative; pointer-events: none; }
.ot-btn[aria-busy="true"]::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--btn-fg); border-right-color: transparent; animation: ot-spin .7s linear infinite;
}
@keyframes ot-spin { to { transform: rotate(360deg); } }

/* Segmented control: <div class="ot-seg" role="group"><button aria-pressed="true"> */
.ot-seg { display: inline-flex; border: var(--stroke) solid var(--border-strong); }
.ot-seg button {
  all: unset; cursor: pointer; padding: 0 var(--s-4) .12em; min-height: 38px; display: inline-flex; align-items: center;
  font: 700 13px/1 var(--ot-font-text); color: var(--muted);
}
.ot-seg button + button { border-left: var(--stroke) solid var(--border-strong); }
.ot-seg button[aria-pressed="true"] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--accent); }
.ot-seg button:focus-visible { box-shadow: var(--focus-ring); }

/* 8.2 Field ----------------------------------------------------------------
   <div class="ot-field"><label class="ot-field__label" for="x">Nimi <span class="ot-req">*</span></label>
   <input class="ot-input" id="x" aria-describedby="x-help"><p class="ot-help" id="x-help">…</p></div>
   Labels sit above, never as placeholders. Errors in words below, not only red. */
.ot-field        { display: grid; gap: var(--s-2); align-content: start; }
.ot-field__label { font: 700 var(--fs-label)/1.3 var(--ot-font-text); }
.ot-req          { color: var(--accent-text); }
.ot-help         { margin: 0; font-size: 13px; color: var(--muted); }
.ot-error        { margin: 0; font-size: 13px; color: var(--danger); display: flex; gap: var(--s-2); align-items: baseline; }
.ot-error::before{ content: ""; width: 8px; height: 8px; flex: none; background: var(--danger); transform: rotate(45deg); }
.ot-input, .ot-select, .ot-textarea {
  width: 100%; min-height: var(--control-h); padding: 0 var(--s-3);
  font: 16px/1.4 var(--ot-font-text); color: var(--text);
  background: var(--sunken); border: var(--stroke) solid var(--border-control); border-radius: var(--radius);
  transition: border-color var(--t-fast);
}
.ot-textarea { padding: var(--s-3); min-height: 120px; resize: vertical; }
.ot-input::placeholder, .ot-textarea::placeholder { color: var(--muted); opacity: 1; }
.ot-input:hover, .ot-select:hover, .ot-textarea:hover { border-color: var(--text-2); }
.ot-input:focus-visible, .ot-select:focus-visible, .ot-textarea:focus-visible { border-color: var(--focus); }
.ot-input[aria-invalid="true"], .ot-select[aria-invalid="true"], .ot-textarea[aria-invalid="true"] { border-color: var(--danger); }
.ot-input:disabled, .ot-select:disabled, .ot-textarea:disabled { opacity: .5; cursor: not-allowed; }
.ot-input--num { font-family: var(--ot-font-mono); font-weight: 400; text-align: right; }
.ot-select {
  appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat;
}
/* input with unit: <div class="ot-affix"><input class="ot-input ot-input--num"><span>€</span></div> */
.ot-affix { display: flex; }
.ot-affix .ot-input { flex: 1; }
.ot-affix span {
  display: inline-flex; align-items: center; padding: 0 var(--s-3); font: 400 14px var(--ot-font-mono); color: var(--muted);
  border: var(--stroke) solid var(--border-control); border-left: 0; background: var(--surface-2);
}

/* 8.3 Check, radio, switch -------------------------------------------------
   <label class="ot-check"><input type="checkbox"> Tekst</label>
   <label class="ot-check"><input type="radio" name="r"> Tekst</label>
   <label class="ot-switch"><input type="checkbox" role="switch"> Tekst</label> */
.ot-check, .ot-switch { display: inline-flex; align-items: center; gap: var(--s-3); cursor: pointer; min-height: 32px; font-size: 15px; }
.ot-check input {
  /* no ::after on inputs: WebKit does not draw pseudo-elements on <input>.
     The mark is the input's own background, clipped to the content box (4 px inset). */
  appearance: none; -webkit-appearance: none; margin: 0; width: 20px; height: 20px; flex: none; padding: 3px;
  border: 2px solid var(--border-control); background: var(--sunken) content-box; cursor: pointer;
  background-clip: content-box; transition: background-color var(--t-fast), border-color var(--t-fast);
}
.ot-check input[type="radio"] {
  /* Viewfinder radio: four corner marks from the brand device, an orange square when chosen.
     Straight lines only, drawn as background layers: pixel-sharp in every engine, no curves to alias. */
  --rc: var(--border-control);
  border: 0; border-radius: 0; padding: 0;
  background:
    linear-gradient(var(--rc), var(--rc)) 0 0/6px 2px no-repeat,
    linear-gradient(var(--rc), var(--rc)) 0 0/2px 6px no-repeat,
    linear-gradient(var(--rc), var(--rc)) 100% 0/6px 2px no-repeat,
    linear-gradient(var(--rc), var(--rc)) 100% 0/2px 6px no-repeat,
    linear-gradient(var(--rc), var(--rc)) 0 100%/6px 2px no-repeat,
    linear-gradient(var(--rc), var(--rc)) 0 100%/2px 6px no-repeat,
    linear-gradient(var(--rc), var(--rc)) 100% 100%/6px 2px no-repeat,
    linear-gradient(var(--rc), var(--rc)) 100% 100%/2px 6px no-repeat;
}
.ot-check input[type="radio"]:hover { --rc: var(--text-2); }
.ot-check input:checked { border-color: var(--text); background-color: var(--accent); }
.ot-check input[type="radio"]:checked {
  --rc: var(--text);
  background:
    linear-gradient(var(--accent), var(--accent)) center/10px 10px no-repeat,
    linear-gradient(var(--rc), var(--rc)) 0 0/6px 2px no-repeat,
    linear-gradient(var(--rc), var(--rc)) 0 0/2px 6px no-repeat,
    linear-gradient(var(--rc), var(--rc)) 100% 0/6px 2px no-repeat,
    linear-gradient(var(--rc), var(--rc)) 100% 0/2px 6px no-repeat,
    linear-gradient(var(--rc), var(--rc)) 0 100%/6px 2px no-repeat,
    linear-gradient(var(--rc), var(--rc)) 0 100%/2px 6px no-repeat,
    linear-gradient(var(--rc), var(--rc)) 100% 100%/6px 2px no-repeat,
    linear-gradient(var(--rc), var(--rc)) 100% 100%/2px 6px no-repeat;
}
.ot-check input:focus-visible, .ot-switch input:focus-visible { box-shadow: var(--focus-ring); }
/* optical centring: the label's visual middle (between cap height and x-height) sits 0.1 em
   below its line-box middle, so the control moves down to meet it */
.ot-check input, .ot-switch input { position: relative; top: 1px; }   /* whole pixel: keeps 2 px strokes sharp at 1x */
.ot-switch input {
  /* the knob is a background dot that slides with background-position */
  appearance: none; -webkit-appearance: none; margin: 0; width: 40px; height: 22px; flex: none; border-radius: var(--radius-pill); cursor: pointer;
  border: 1.5px solid var(--border-control);
  background-color: var(--sunken);
  background-image: radial-gradient(circle closest-side, var(--muted) 0 90%, transparent 97%);
  background-size: 15px 15px; background-repeat: no-repeat; background-position: 2.5px 50%;
  transition: background-color var(--t-fast), background-position var(--t-fast), border-color var(--t-fast);
}
.ot-switch input:checked {
  background-color: var(--accent); border-color: var(--accent);
  background-image: radial-gradient(circle closest-side, var(--on-accent) 0 90%, transparent 97%);
  background-position: calc(100% - 2.5px) 50%;
}

/* 8.4 Tag (status) ---------------------------------------------------------
   Shape + word, never colour alone.
   <span class="ot-tag ot-tag--ok">Kinnitatud</span>  --ok --warn --danger --info --rec --neutral */
.ot-tag {
  --tag: var(--muted);
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px calc(5px + .12em) 7px;
  font: 700 12px/1.3 var(--ot-font-text); color: var(--text);
  border: var(--stroke) solid var(--border-strong); white-space: nowrap;
}
.ot-tag::before { content: ""; width: 8px; height: 8px; flex: none; background: var(--tag); }
.ot-tag--ok     { --tag: var(--ok); }
.ot-tag--ok::before     { border-radius: 50%; }                                   /* full dot   */
.ot-tag--warn   { --tag: var(--warn); }
.ot-tag--warn::before   { clip-path: polygon(50% 0, 100% 100%, 0 100%); }          /* triangle   */
.ot-tag--danger { --tag: var(--danger); }
.ot-tag--danger::before { transform: rotate(45deg); }                              /* diamond    */
.ot-tag--info   { --tag: var(--info); }
.ot-tag--info::before   { background: none; border: 2px solid var(--info); border-radius: 50%; } /* ring */
.ot-tag--neutral::before{ background: none; border: 2px solid var(--muted); }      /* empty square */
.ot-tag--rec    { --tag: var(--accent); }
.ot-tag--rec::before    { border-radius: 50%; animation: ot-blink 2s steps(1) infinite; }

/* 8.5 Table ----------------------------------------------------------------
   <div class="ot-table-wrap"><table class="ot-table"> … <td class="ot-num"> */
.ot-table-wrap { overflow-x: auto; border-top: var(--stroke) solid var(--border-strong); }
.ot-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.ot-table th {
  text-align: left; font: 700 12px/1.2 var(--ot-font-text); color: var(--muted);
  padding: var(--s-3); border-bottom: var(--stroke) solid var(--border-strong); white-space: nowrap;
  position: sticky; top: 0; background: var(--bg);
}
.ot-table td { padding: var(--s-3); border-bottom: var(--stroke) solid var(--border); vertical-align: top; }
.ot-table tbody tr:hover td { background: var(--surface); }
.ot-table tr[aria-selected="true"] td { background: var(--surface-2); }
.ot-table tr[aria-selected="true"] td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.ot-table th.ot-num, .ot-table td.ot-num { text-align: right; }
.ot-table--dense td, .ot-table--dense th { padding: 7px var(--s-3); }
.ot-table th button { all: unset; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.ot-table th[aria-sort] button::after { content: ""; border: 4px solid transparent; }
.ot-table th[aria-sort="ascending"] button::after  { border-bottom-color: var(--text); margin-top: -4px; }
.ot-table th[aria-sort="descending"] button::after { border-top-color: var(--text); margin-top: 4px; }

/* 8.6 Card -----------------------------------------------------------------
   One card = one thing (a project, a video, a client). */
.ot-card {
  display: grid; align-content: start; gap: var(--s-3); padding: var(--s-5);
  background: var(--surface); border: var(--stroke) solid var(--border);
}
.ot-card--link { text-decoration: none; transition: border-color var(--t-fast); }
.ot-card--link:hover { border-color: var(--border-strong); color: inherit; }
.ot-card__media { margin: calc(-1 * var(--s-5)) calc(-1 * var(--s-5)) var(--s-2); aspect-ratio: 16/9; background: var(--sunken); position: relative; overflow: hidden; }
.ot-card__media.ot-vf { background: radial-gradient(120% 90% at 55% 42%, #3a3026, #17140f 55%, #050505); }
.ot-card__media img { width: 100%; height: 100%; object-fit: cover; }
.ot-card__title { font: 700 var(--fs-h4)/var(--lh-caps) var(--ot-font-display); text-transform: uppercase; margin: 0; }
.ot-card__meta { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); color: var(--muted); font-size: 14px; }
.ot-card__foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding-top: var(--s-3); border-top: var(--stroke) solid var(--border); }

/* 8.7 Navigation -----------------------------------------------------------
   <header class="ot-topbar"><a class="ot-logo">…</a><nav class="ot-nav"><a aria-current="page"> */
.ot-topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s-8);
  height: 60px; padding-inline: var(--gutter);
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
  border-bottom: var(--stroke) solid var(--border);
}
.ot-logo { display: block; height: 18px; color: var(--text); flex: none; }
.ot-logo svg { height: 100%; width: auto; fill: currentColor; }
.ot-nav { display: flex; gap: var(--s-6); overflow-x: auto; scrollbar-width: none; align-self: stretch; }
.ot-nav a {
  display: inline-flex; align-items: center; white-space: nowrap; text-decoration: none;
  font-size: 15px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.ot-nav a:hover { color: var(--text); }
.ot-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.ot-topbar__end { margin-left: auto; display: flex; gap: var(--s-3); align-items: center; }

/* Tabs: <div class="ot-tabs" role="tablist"><button role="tab" aria-selected="true">Kõik <span class="ot-count">12</span> */
.ot-tabs { display: flex; gap: var(--s-6); border-bottom: var(--stroke) solid var(--border); overflow-x: auto; }
.ot-tabs [role="tab"] {
  all: unset; cursor: pointer; padding: var(--s-3) 0 calc(var(--s-3) + .12em); display: inline-flex; gap: var(--s-2); align-items: center;
  font: 700 14px/1 var(--ot-font-text); color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.ot-tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.ot-tabs [role="tab"]:focus-visible { box-shadow: var(--focus-ring); }
.ot-count { font: 400 12px/1 var(--ot-font-mono); color: var(--muted); }

/* Breadcrumbs: <nav class="ot-crumbs"><a>Projektid</a><a>RAJU 21</a><span aria-current="page">Lõige 3</span> */
.ot-crumbs { display: flex; flex-wrap: wrap; gap: var(--s-2); font-size: 14px; color: var(--muted); }
.ot-crumbs > * + *::before { content: "/"; margin-right: var(--s-2); color: var(--border-strong); }
.ot-crumbs a { text-decoration: none; }
.ot-crumbs [aria-current] { color: var(--text); }

/* Pagination: <nav class="ot-pager"><span class="ot-data">1–25 / 312</span><button class="ot-btn ot-btn--icon ot-btn--sm"> */
.ot-pager { display: flex; align-items: center; gap: var(--s-3); }

/* 8.8 Feedback -------------------------------------------------------------
   Alert stays on the page. Toast leaves by itself. Dialog asks for a decision. */
.ot-alert {
  --al: var(--info);
  display: grid; grid-template-columns: auto 1fr; gap: var(--s-1) var(--s-3); padding: var(--s-4);
  background: var(--surface); border: var(--stroke) solid var(--border); border-left: 3px solid var(--al);
}
.ot-alert::before { content: ""; width: 10px; height: 10px; margin-top: 6px; background: var(--al); grid-row: span 2; }
.ot-alert__title { font-weight: 700; }
.ot-alert p { margin: 0; color: var(--text-2); font-size: 15px; grid-column: 2; }
.ot-alert--ok     { --al: var(--ok); }      .ot-alert--ok::before     { border-radius: 50%; }
.ot-alert--warn   { --al: var(--warn); }    .ot-alert--warn::before   { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.ot-alert--danger { --al: var(--danger); }  .ot-alert--danger::before { transform: rotate(45deg); }

.ot-toast {
  display: flex; align-items: center; gap: var(--s-4); padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4);
  background: var(--ot-paper); color: var(--ot-ink); box-shadow: var(--shadow-2); max-width: 440px; font-size: 15px;
}
[data-theme="light"] .ot-toast { background: var(--ot-ink); color: var(--ot-paper); }
.ot-toast .ot-btn { --btn-bg: transparent; --btn-fg: currentColor; --btn-bd: transparent; min-height: 34px; text-decoration: underline; }
.ot-toast-region { position: fixed; right: var(--s-6); bottom: var(--s-6); display: grid; gap: var(--s-2); z-index: 60; }

/* Dialog: native <dialog class="ot-dialog">. A dangerous title is a question; the button repeats the action. */
.ot-dialog {
  width: min(520px, calc(100% - 32px)); padding: 0; color: var(--text);
  background: var(--surface); border: var(--stroke) solid var(--border-strong); box-shadow: var(--shadow-2);
}
.ot-dialog::backdrop { background: var(--overlay); }
.ot-dialog__body { padding: var(--s-6); display: grid; gap: var(--s-3); }
.ot-dialog__title { font: 700 var(--fs-h3)/var(--lh-caps) var(--ot-font-display); text-transform: uppercase; margin: 0; }
.ot-dialog__foot { display: flex; justify-content: flex-end; gap: var(--s-3); padding: var(--s-4) var(--s-6); border-top: var(--stroke) solid var(--border); }

/* Empty state: always says what to do next */
.ot-empty { display: grid; justify-items: start; gap: var(--s-3); padding: var(--s-10) var(--s-6); border: var(--stroke) dashed var(--border-strong); }
.ot-empty p { margin: 0; color: var(--text-2); }

/* Skeleton: same shape as the real content, no shimmer */
.ot-skel { background: var(--surface-2); min-height: 14px; }
.ot-skel--text { height: 14px; width: var(--w, 100%); }
.ot-skel--media { aspect-ratio: 16/9; }

/* Progress: <div class="ot-progress" style="--p:.42"><span></span></div> */
.ot-progress { height: 4px; background: var(--surface-2); }
.ot-progress span { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--accent); }

/* 8.9 Avatar ---------------------------------------------------------------*/
.ot-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text); font: 700 13px/1 var(--ot-font-text); overflow: hidden;
}
.ot-avatar img { width: 100%; height: 100%; object-fit: cover; }


/* 9. BRAND DEVICE ========================================================== */
/* The viewfinder from the guide, as UI. Unit u = 1% of the frame's short side,
   set by --u (in px) on the frame; defaults suit a 16:9 player around 720 px wide. */

.ot-rec { display: inline-flex; align-items: center; gap: .5em; font: 300 var(--fs-data)/1 var(--ot-font-mono); letter-spacing: .02em; }
.ot-rec::before { content: ""; width: .7em; height: .7em; border-radius: 50%; background: var(--accent); flex: none; }
.ot-rec--live::before { animation: ot-blink 2s steps(1) infinite; }   /* 1 s on, 1 s off */
.ot-rec--stby::before { background: var(--muted); }
@keyframes ot-blink { 50% { opacity: 0; } }

.ot-tc { font: 300 var(--fs-data)/1 var(--ot-font-mono); font-synthesis: none; }   /* Monodrip is fixed width: no jitter */

.ot-vf {
  --u: 7px;
  position: relative; background: var(--sunken); overflow: hidden;
  color: var(--ot-paper);                       /* the device sits on footage: always paper */
}
.ot-vf__corners { position: absolute; inset: calc(6 * var(--u)); pointer-events: none; }
.ot-vf__corners::before, .ot-vf__corners::after, .ot-vf__corners > i::before, .ot-vf__corners > i::after {
  content: ""; position: absolute; width: calc(5 * var(--u)); height: calc(5 * var(--u));
  border: 0 solid currentColor; filter: drop-shadow(0 calc(.15 * var(--u)) calc(.6 * var(--u)) rgba(0,0,0,.65));
}
.ot-vf__corners::before        { top: 0; left: 0;     border-top-width: calc(.5 * var(--u)); border-left-width:  calc(.5 * var(--u)); }
.ot-vf__corners::after         { top: 0; right: 0;    border-top-width: calc(.5 * var(--u)); border-right-width: calc(.5 * var(--u)); }
.ot-vf__corners > i::before    { bottom: 0; left: 0;  border-bottom-width: calc(.5 * var(--u)); border-left-width:  calc(.5 * var(--u)); }
.ot-vf__corners > i::after     { bottom: 0; right: 0; border-bottom-width: calc(.5 * var(--u)); border-right-width: calc(.5 * var(--u)); }
.ot-vf__row {
  position: absolute; left: calc(13 * var(--u)); right: calc(13 * var(--u)); top: calc(13 * var(--u));
  display: flex; justify-content: space-between; align-items: center; font: 300 calc(2.8 * var(--u))/1 var(--ot-font-mono); font-synthesis: none;
  text-shadow: 0 calc(.15 * var(--u)) calc(.6 * var(--u)) rgba(0,0,0,.65);
}
.ot-vf__row .ot-rec, .ot-vf__row .ot-tc { font-size: inherit; }
.ot-vf__row .ot-dim { color: var(--ot-steel); }
.ot-vf__stack {
  position: absolute; left: calc(13 * var(--u)); right: calc(13 * var(--u)); bottom: calc(13 * var(--u));
  display: grid; gap: calc(2 * var(--u)); text-shadow: 0 calc(.15 * var(--u)) calc(.6 * var(--u)) rgba(0,0,0,.65);
}
.ot-vf__title { font: 900 calc(10 * var(--u))/var(--lh-caps) var(--ot-font-display); text-transform: uppercase; margin: 0; }
.ot-vf__sub   { font: 400 calc(3.6 * var(--u))/1.3 var(--ot-font-text); margin: 0; }
.ot-vf > img, .ot-vf > video { width: 100%; height: 100%; object-fit: cover; }


/* 10. UTILITIES ============================================================ */

.ot-muted   { color: var(--muted); }
.ot-accent  { color: var(--accent-text); }
.ot-right   { margin-left: auto; }
.ot-nowrap  { white-space: nowrap; }
.ot-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ot-grain   { position: relative; }
.ot-grain::after {     /* film grain from the guide, for generated backgrounds only */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .08; mix-blend-mode: normal;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.62' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='1.8' intercept='-.4'/%3E%3CfeFuncG type='linear' slope='1.8' intercept='-.4'/%3E%3CfeFuncB type='linear' slope='1.8' intercept='-.4'/%3E%3C/feComponentTransfer%3E%3CfeGaussianBlur stdDeviation='.55'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
