/* ==========================================================================
   Sanja Vučković · KFbySV — base: tokens, reset, type, themes, buttons, forms
   ========================================================================== */

:root {
  /* Palette — her white studio walls, ink, the orange of her training pants and the FMS kit,
     the periwinkle of her postnatal posts, the dusty rose of her pregnancy posts */
  --zid: #F2EEE8;
  --zid-2: #E8E2D9;
  --papir: #FBF9F5;
  --ink: #18171B;
  --ink-2: #2A282E;
  --signal: #EC5B28;
  --signal-hi: #FF7A45;
  --signal-deep: #C24418;
  --lavanda: #A3B7EA;
  --lavanda-2: #93A9E2;
  --indigo: #23306A;
  --roza: #EBD0C5;
  --roza-2: #E2C0B3;
  --terakota: #8E3F2E;

  --f-cond: 'Sofia Sans Extra Condensed', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --f-sans: 'Sofia Sans', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --f-serif: 'Cormorant', 'Cormorant Garamond', Georgia, serif;

  --fs-h1: clamp(3.4rem, 1.2rem + 8vw, 10.5rem);
  --fs-h2: clamp(2.6rem, 1.3rem + 4.4vw, 6.2rem);
  --fs-h3: clamp(1.6rem, 1.2rem + 1.3vw, 2.5rem);
  --fs-lead: clamp(1.12rem, 1rem + 0.5vw, 1.4rem);
  --fs-body: clamp(1rem, 0.97rem + 0.15vw, 1.08rem);
  --fs-small: 0.875rem;
  --fs-label: 0.74rem;

  --gutter: clamp(1rem, 0.55rem + 2.4vw, 3rem);
  --space-2xl: clamp(7rem, 4rem + 10vw, 14rem);
  --space-xl: clamp(5rem, 3rem + 6vw, 9rem);
  --space-l: clamp(3rem, 2rem + 3vw, 5rem);
  --space-m: clamp(1.75rem, 1.2rem + 1.5vw, 2.75rem);
  --max: 1380px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1);
  --t-fast: 180ms;
  --t-med: 450ms;

  --nav-h: 76px;
  --tick: 8px;
}

/* Themes */
:root, [data-theme="zid"] {
  --bg: var(--zid);
  --bg-2: var(--zid-2);
  --fg: var(--ink);
  --muted: #67626B;
  --line: rgba(24, 23, 27, 0.12);
  --line-strong: rgba(24, 23, 27, 0.34);
  --accent: var(--signal-deep);
  --hot: var(--signal-deep);
}
[data-theme="noc"] {
  --bg: var(--ink);
  --bg-2: var(--ink-2);
  --fg: var(--zid);
  --muted: #A8A3AC;
  --line: rgba(242, 238, 232, 0.12);
  --line-strong: rgba(242, 238, 232, 0.36);
  --accent: var(--signal-hi);
  --hot: var(--signal-hi);
}
[data-theme="lavanda"] {
  --bg: var(--lavanda);
  --bg-2: var(--lavanda-2);
  --fg: var(--ink);
  --muted: #3A4472;
  --line: rgba(24, 23, 27, 0.14);
  --line-strong: rgba(24, 23, 27, 0.4);
  --accent: var(--indigo);
  --hot: var(--indigo);
}
[data-theme="roza"] {
  --bg: var(--roza);
  --bg-2: var(--roza-2);
  --fg: #2A1B19;
  --muted: #6E4A42;
  --line: rgba(42, 27, 25, 0.13);
  --line-strong: rgba(42, 27, 25, 0.38);
  --accent: var(--terakota);
  --hot: var(--terakota);
}
[data-theme="signal"] {
  --bg: var(--signal);
  --bg-2: #E04E1C;
  --fg: var(--ink);
  --muted: rgba(24, 23, 27, 0.74);
  --line: rgba(24, 23, 27, 0.18);
  --line-strong: rgba(24, 23, 27, 0.5);
  --accent: var(--ink);
  --hot: var(--ink);
}
[data-theme] { background-color: var(--bg); color: var(--fg); }

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  font-family: var(--f-sans); font-size: var(--fs-body); line-height: 1.6; font-weight: 400;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip;
}
/* Plaster grain over everything, very faint */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 500; pointer-events: none; opacity: 0.05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
ul[class], ol[class] { list-style: none; padding: 0; }
h1, h2, h3, h4 { font-weight: 400; line-height: 1; text-wrap: balance; }
p { text-wrap: pretty; }
::selection { background: var(--signal); color: var(--ink); }

[hidden] { display: none !important; }
.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; }
.skip {
  position: fixed; top: 0.75rem; left: 0.75rem; z-index: 600; padding: 0.7rem 1.1rem;
  background: var(--signal); color: var(--ink); font-weight: 600; transform: translateY(-180%); transition: transform var(--t-fast);
}
.skip:focus { transform: none; }
:focus-visible { outline: 2px solid var(--hot); outline-offset: 3px; }
main:focus { outline: none; }

/* Type — condensed capitals (like the numbers on her measuring stick) against a soft serif italic */
.h1, .h2, .h3 { font-family: var(--f-cond); font-weight: 800; text-transform: uppercase; letter-spacing: -0.01em; }
.h1 { font-size: var(--fs-h1); line-height: 0.84; }
.h2 { font-size: var(--fs-h2); line-height: 0.88; }
.h3 { font-size: var(--fs-h3); line-height: 0.95; font-weight: 700; }
.h1 em, .h2 em, .h3 em, .serif-em {
  font-family: var(--f-serif); font-style: italic; font-weight: 500; text-transform: none; letter-spacing: -0.015em; color: var(--accent);
  font-size: 1.04em; line-height: 0.8;
}
.lead { font-size: var(--fs-lead); line-height: 1.48; max-width: 40ch; }
.muted { color: var(--muted); }
.nocase { text-transform: none; }
.label {
  display: inline-flex; align-items: center; gap: 0.75em;
  font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted);
}
/* A tiny ruler before every label */
.label::before {
  content: ''; width: 1.6em; height: 0.6em; flex: none;
  background: linear-gradient(90deg, var(--accent) 0 1px, transparent 1px) 0 100% / 0.4em 60% repeat-x,
    linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 1px no-repeat;
}
.num { font-family: var(--f-cond); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }

.link-u {
  position: relative; display: inline-block; font-weight: 600;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size var(--t-med) var(--ease-out), color var(--t-fast);
}
.link-u:hover { background-size: 0 1px; background-position: 100% 100%; color: var(--accent); }

/* Buttons — square, measured: the fill slides in like a band along a ruler */
.btn {
  --b-bg: transparent; --b-fg: var(--fg); --b-line: var(--line-strong); --b-fill: var(--fg); --b-fill-fg: var(--bg);
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.7em;
  min-height: 54px; padding: 0.85rem 1.6rem; border-radius: 2px;
  background: var(--b-bg); color: var(--b-fg); box-shadow: inset 0 0 0 1px var(--b-line);
  font-family: var(--f-cond); font-size: 1.08rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
  transition: color 380ms var(--ease-out), box-shadow var(--t-med) var(--ease-out), transform var(--t-fast);
}
.btn::before {
  content: ''; position: absolute; inset: 0; z-index: -1; background: var(--b-fill);
  transform: scaleX(0); transform-origin: 0 50%; transition: transform 620ms var(--ease-out);
}
.btn::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; z-index: -1; opacity: 0.5;
  background: linear-gradient(90deg, currentColor 0 1px, transparent 1px) 0 100% / 8px 100% repeat-x;
  transform: translateY(100%); transition: transform 500ms var(--ease-out);
}
.btn:hover::before, .btn:focus-visible::before { transform: scaleX(1); }
.btn:hover::after, .btn:focus-visible::after { transform: none; }
.btn:hover, .btn:focus-visible { color: var(--b-fill-fg); box-shadow: inset 0 0 0 1px var(--b-fill); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.btn--sm { min-height: 42px; padding: 0.5rem 1.05rem; font-size: 0.98rem; }
.btn--signal { --b-bg: var(--signal); --b-fg: var(--ink); --b-line: transparent; --b-fill: var(--ink); --b-fill-fg: var(--zid); }
.btn--ink { --b-bg: var(--ink); --b-fg: var(--zid); --b-line: transparent; --b-fill: var(--zid); --b-fill-fg: var(--ink); }
.btn--line { --b-fill: var(--fg); --b-fill-fg: var(--bg); }
.btn .arrow { transition: transform var(--t-med) var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }

/* Form controls */
.field { display: grid; gap: 0.5rem; }
.field > span:first-child, .field > legend { font-family: var(--f-cond); font-size: 1.05rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
fieldset.field { border: 0; padding: 0; min-width: 0; }
fieldset.field > legend { padding: 0; margin-bottom: 0.6rem; }
.opt { color: var(--muted); font-family: var(--f-sans); font-weight: 400; font-size: 0.82em; letter-spacing: 0; text-transform: none; }
.input {
  width: 100%; min-height: 54px; padding: 0.85rem 1rem; border-radius: 2px;
  background: var(--papir); border: 1px solid var(--line-strong); color: var(--ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
textarea.input { min-height: 7rem; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(236, 91, 40, 0.28); }
.input[aria-invalid="true"] { border-color: #B3261E; box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.14); }
.input::placeholder { color: #767079; }

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
