/* ═══════════════════════════════════════════════════════════
   BERLIN · Nókis — tokens
   Swiss-editorial on paper. Palette sampled from the brand's
   own Instagram avatar (#5B2AB2 core violet, #E4D8FC tint).
   ═══════════════════════════════════════════════════════════ */

:root {
  /* ── Paper ────────────────────────────────────────────── */
  --paper:      #FFFFFF;
  --paper-2:    #F7F5FC;   /* violet-tinted second surface */
  --paper-3:    #F1EDFA;
  --rule:       #E4E0EE;
  --rule-2:     #CFC8E2;

  /* ── Ink ──────────────────────────────────────────────── */
  --ink:        #14111F;
  --ink-2:      #55506B;
  --ink-3:      #8A8499;

  /* ── Brand violet (from the avatar) ───────────────────── */
  --violet:      #5B2AB2;
  --violet-deep: #3A1A86;
  --violet-dark: #241463;
  --violet-lift: #7947C0;
  --violet-tint: #E4D8FC;
  --violet-wash: #F5F1FE;

  /* ── Inverted surfaces ────────────────────────────────── */
  --night:      #120B26;
  --night-2:    #1D1140;

  --accent:     var(--violet);
  --ring:       var(--violet);

  /* ── Type ─────────────────────────────────────────────── */
  --f-sans: "IBM Plex Sans", "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", "Noto Sans Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* Fluid up to ~1920 so large screens get a proportionally larger page
     instead of a 1280 layout floating in empty margins. */
  --t-2xs:  clamp(.6875rem, .66rem + .1vw, .78rem);
  --t-xs:   clamp(.75rem,   .72rem + .12vw, .875rem);
  --t-sm:   clamp(.8125rem, .78rem + .15vw, .9375rem);
  --t-base: clamp(.9375rem, .89rem + .2vw,  1.125rem);
  --t-lg:   clamp(1.0625rem, .98rem + .32vw, 1.375rem);
  --t-xl:   clamp(1.25rem,  1.08rem + .62vw, 1.75rem);
  --t-2xl:  clamp(1.5rem,   1.1rem + 1.25vw, 2.375rem);
  --t-3xl:  clamp(1.85rem,  1rem + 2.19vw,   3.625rem);
  --t-4xl:  clamp(2.25rem,  1.4rem + 2.9vw,  4.5rem);
  --t-hero: clamp(2.6rem,   2rem + 3.75vw,   6.5rem);

  /* ── Space ────────────────────────────────────────────── */
  --sect-y: clamp(3.5rem, 2.4rem + 4.4vw, 6.5rem);
  --gutter: clamp(1.15rem, .5rem + 2.6vw, 3.5rem);
  --maxw:   1520px;

  /* ── Radius — deliberately small; this is print, not glass */
  --r-sm: 2px;
  --r:    3px;
  --r-lg: 4px;

  /* ── Motion ───────────────────────────────────────────── */
  --e-out: cubic-bezier(.22, 1, .36, 1);
  --e-io:  cubic-bezier(.65, 0, .35, 1);
  --d-fast: 140ms;
  --d: 220ms;
  --d-slow: 380ms;

  --hdr-h: 64px;
}

/* ═══════════════ RESET ═══════════════ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--hdr-h) + 20px);
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: var(--t-base);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-feature-settings: "kern" 1;
}

img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
table { border-collapse: collapse; width: 100%; }
summary::-webkit-details-marker { display: none; }
::selection { background: var(--violet); color: #fff; }

/* ═══════════════ TYPE ═══════════════ */
h1, h2, h3, h4 {
  font-family: var(--f-sans);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -.03em;
  text-wrap: balance;
}
h3 { line-height: 1.22; letter-spacing: -.018em; }
p { text-wrap: pretty; }

/* Mono label — the workhorse of this design */
.mono {
  font-family: var(--f-mono);
  font-size: var(--t-2xs);
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-feature-settings: "zero" 1;
}
.mono--violet { color: var(--violet); }
.num-mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* ═══════════════ FOCUS / A11Y ═══════════════ */
:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: fixed;
  top: -100px; left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  background: var(--violet);
  color: #fff;
  padding: .7rem 1.4rem;
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: .06em;
  transition: top var(--d) var(--e-out);
}
.skip-link:focus { top: 0; }

.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
      overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hp { position: absolute; left: -9999px; opacity: 0; pointer-events: none; height: 0; }

/* ═══════════════ ICONS ═══════════════ */
.ic { width: 18px; height: 18px; flex: 0 0 auto; fill: none; }
.ic--xs { width: 14px; height: 14px; }
.ic--lg { width: 24px; height: 24px; }

/* ═══════════════ LAYOUT ═══════════════ */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--nr { max-width: 940px; }

.sect { position: relative; padding-block: var(--sect-y); }
.sect--tint { background: var(--paper-2); }
.sect--line { border-top: 1px solid var(--rule); }

/* ═══════════════ SECTION HEADER ═══════════════ */
.shead {
  padding-bottom: clamp(1.3rem, 1rem + 1.1vw, 2rem);
  margin-bottom: clamp(1.8rem, 1.3rem + 1.7vw, 2.9rem);
  border-bottom: 1px solid var(--ink);
}
.shead__kick { margin-bottom: .85rem; color: var(--violet); }
.shead__h { font-size: var(--t-3xl); max-width: 22ch; }
.shead__p {
  margin-top: .9rem;
  font-size: var(--t-lg);
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 56ch;
}

/* ═══════════════ BUTTONS ═══════════════ */
.btn {
  --py: .85rem; --px: 1.5rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: var(--py) var(--px);
  border-radius: var(--r);
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--d) var(--e-out),
              color var(--d) var(--e-out),
              border-color var(--d) var(--e-out),
              transform var(--d-fast) var(--e-out);
}
.btn .ic { transition: transform var(--d) var(--e-out); }
.btn:active { transform: translateY(1px); }
.btn:hover .ic:last-child { transform: translateX(4px); }

.btn--sm { --py: .6rem; --px: 1rem; font-size: var(--t-2xs); }
.btn--lg { --py: 1.05rem; --px: 1.9rem; font-size: var(--t-xs); }
.btn--full { width: 100%; }

.btn--solid { background: var(--violet); color: #fff; }
.btn--solid:hover { background: var(--violet-deep); }

.btn--line { border: 1px solid var(--ink); color: var(--ink); }
.btn--line:hover { background: var(--ink); color: var(--paper); }

.btn--ghost { border: 1px solid var(--rule-2); color: var(--ink-2); }
.btn--ghost:hover { border-color: var(--violet); color: var(--violet); }

/* For use on the violet band */
.btn--invert { background: #fff; color: var(--violet); }
.btn--invert:hover { background: var(--violet-tint); }

.btn__spin { display: none; }
.btn.is-busy { pointer-events: none; }
.btn.is-busy .btn__label, .btn.is-busy > .ic { visibility: hidden; }
.btn.is-busy .btn__spin {
  display: block;
  position: absolute; inset: 0; margin: auto;
  width: 17px; height: 17px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Text link with a rule that grows */
.tlink {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: .06em;
  color: var(--violet);
  padding-bottom: 3px;
  background-image: linear-gradient(var(--violet), var(--violet));
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size var(--d) var(--e-out);
}
.tlink:hover { background-size: 100% 1px; }

.linkbtn {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  color: var(--ink-3);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.linkbtn:hover { color: var(--violet); }

.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 120;
  pointer-events: none;
}
.scroll-progress i {
  display: block;
  height: 100%;
  width: var(--p, 0%);
  background: var(--violet);
}

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