/* IVIA v4 components - the site's own rules (v4.ivia.ch, audited 2026-10-09) remapped onto --iv-* tokens.
   Load after ../tokens/fonts.css and ../tokens/tokens.css. Works for web, print (PDF) and video frames. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
body {
  margin: 0; background: var(--iv-ground); color: var(--iv-ink);
  font-family: var(--iv-font); font-size: var(--iv-type-body-size); line-height: var(--iv-type-body-leading);
  font-weight: 400; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--iv-ink); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; display: block; }

/* type roles (measured on v4) */
.iv-display { font-size: var(--iv-type-hero-size); font-weight: 800; line-height: 1; letter-spacing: -.035em; margin: 0 0 var(--iv-space-4); max-width: 13ch; }
@media (max-width: 767px) { .iv-display { font-size: clamp(34px, 10vw, 46px); } }
h1, .iv-h1 { font-size: var(--iv-type-h1-size); font-weight: 700; line-height: 1.1; letter-spacing: -.015em; margin: 0 0 var(--iv-space-4); max-width: 18ch; text-wrap: balance; }
h2, .iv-h2 { font-size: var(--iv-type-h2-size); font-weight: 700; line-height: 1.22; letter-spacing: -.01em; margin: 0 0 var(--iv-space-4); text-wrap: balance; }
.iv-title { font-size: var(--iv-type-story-size); font-weight: 800; line-height: 1.05; letter-spacing: -.03em; margin: 0 0 10px; }
h3, .iv-h3 { font-size: 20px; font-weight: 600; line-height: 28px; letter-spacing: -.005em; margin: 0 0 var(--iv-space-2); text-wrap: pretty; }
h4, .iv-h4 { font-size: 17px; font-weight: 600; line-height: 26px; margin: 0 0 var(--iv-space-2); }
p { margin: 0 0 var(--iv-space-4); }
.iv-body-large { font-size: 18px; line-height: 28px; color: var(--iv-muted); }
.iv-lead { font-size: var(--iv-type-lead-size); line-height: var(--iv-type-lead-leading); color: var(--iv-muted); max-width: 62ch; margin: var(--iv-space-4) 0 0; }
.iv-meta { font-size: var(--iv-type-meta-size); line-height: var(--iv-type-meta-leading); color: var(--iv-muted); }
.iv-eyebrow { display: inline-block; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--iv-muted); margin: 0 0 var(--iv-space-4); }
/* home-page variant: mono, ink rule before, optional number */
.iv-eyebrow--rule { display: flex; align-items: center; gap: 10px; font-family: var(--iv-font-family-mono); letter-spacing: .14em; line-height: 1.4; }
.iv-eyebrow--rule::before { content: ""; flex: 0 0 26px; height: 2px; background: var(--iv-ink); }
.iv-eyebrow__number { color: var(--iv-ink); }
/* the signature highlighter: yellow band under the lower ~40 % of a word */
.iv-mark { background: linear-gradient(transparent 58%, var(--iv-highlight) 58%); color: inherit; padding: 0 .04em; }
[data-theme="dark"] .iv-mark { background: linear-gradient(transparent 86%, var(--iv-highlight) 86%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .iv-mark { background: linear-gradient(transparent 86%, var(--iv-highlight) 86%); } }

/* layout */
.iv-wrap { width: 100%; max-width: var(--iv-layout-max); margin-inline: auto; padding-inline: var(--iv-layout-gutter, clamp(16px, 4vw, 32px)); padding-inline: clamp(16px, 4vw, 32px); }
.iv-page-header { max-width: var(--iv-layout-max); margin: 0 auto; padding: clamp(40px, 6vw, 72px) clamp(16px, 4vw, 32px) var(--iv-space-8); }
.iv-section { padding-block: clamp(48px, 7vw, 88px); }
.iv-section--raised { background: var(--iv-raised); border-block: 1px solid var(--iv-line); }
.iv-grid { display: grid; gap: var(--iv-space-6); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }

/* connector: the ink line with a ring node (page headers, timelines) */
.iv-connector { position: relative; height: 3px; background: var(--iv-ink); border-radius: 2px; margin: var(--iv-space-8) 0 0; }
.iv-connector::after { content: ""; position: absolute; top: 50%; left: var(--at, 22%); width: 14px; height: 14px; transform: translate(-50%, -50%);
  background: var(--iv-ground); border: 3px solid var(--iv-ink); border-radius: 999px; }

/* cards */
.iv-card { display: flex; flex-direction: column; gap: var(--iv-space-3); padding: var(--iv-space-6); background: var(--iv-raised); color: var(--iv-ink);
  border: 1px solid var(--iv-line); border-radius: var(--iv-radius-lg); text-decoration: none; transition: border-color var(--iv-motion-duration-fast) ease-out; }
a.iv-card:hover, .iv-card--link:hover { border-color: var(--iv-ink); }
.iv-card h3 { margin: 0; font-weight: 700; }
.iv-card__media { aspect-ratio: 16 / 9; border: 1px solid var(--iv-line); border-radius: var(--iv-radius-md); background: #fff; overflow: hidden; display: grid; place-items: center; margin-bottom: var(--iv-space-3); }
.iv-card__media img { width: 100%; height: 100%; object-fit: cover; }
.iv-card .iv-card__body { color: var(--iv-muted); }
.iv-card .iv-button { align-self: flex-start; margin-top: auto; }
.iv-count { display: inline-block; min-width: 24px; padding: 1px 8px; border-radius: 999px; background: var(--iv-sunken); color: var(--iv-ink); font: 600 12px/20px var(--iv-font); text-align: center; font-variant-numeric: tabular-nums; }
.iv-filter { background: var(--iv-raised); border: 1px solid var(--iv-line); border-radius: var(--iv-radius-lg); padding: var(--iv-space-6) var(--iv-space-6); display: grid; gap: var(--iv-space-3); }
.iv-filter__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.iv-filter__label { flex: 0 0 88px; font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--iv-muted); }
.iv-dot { width: 10px; height: 10px; border-radius: 999px; border: 1px solid var(--iv-ink); display: inline-block; }
.iv-card p { margin: 0; }
/* strong (home story) card: 2 px ink border, 18 px radius */
.iv-card--strong { border: 2px solid var(--iv-ink); border-radius: 18px; padding: 18px 18px 16px; }

/* buttons: pill, 2 px ink outline, 44 px tall */
.iv-button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 9px 20px; border: 2px solid var(--iv-ink); border-radius: 999px;
  background: transparent; color: var(--iv-ink); font: 700 15px/1.2 var(--iv-font); text-decoration: none; cursor: pointer; transition: background-color var(--iv-motion-duration-fast) ease-out; }
.iv-button:hover { background: var(--iv-hover); }
.iv-button--solid, .iv-button--solid:hover { background: var(--iv-ink); color: var(--iv-ground); }
.iv-button--solid:hover { text-decoration: underline; }
.iv-button--accent { background: var(--iv-highlight); color: #111; border-color: var(--iv-ink); }
.iv-button--rect { border-radius: var(--iv-radius-md); font-weight: 600; min-height: 40px; padding: 8px 18px; }
.iv-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* chips / filters / tags */
.iv-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 1.5px solid var(--iv-line); border-radius: 999px;
  background: var(--iv-raised); color: var(--iv-ink); font: 600 14px/1 var(--iv-font); text-decoration: none; transition: border-color var(--iv-motion-duration-fast) ease-out, background-color var(--iv-motion-duration-fast) ease-out; }
.iv-chip:hover { border-color: var(--iv-ink); }
.iv-chip.is-active, .iv-chip[aria-pressed="true"] { background: var(--iv-selected); border-color: var(--iv-selected); color: var(--iv-on-selected); }
.iv-tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 16px; padding: 0; }
.iv-tags li { border: 1.5px solid var(--iv-ink); border-radius: 999px; font-size: 13px; font-weight: 600; padding: 3px 10px; }

/* pillar tints (ink text on pastel) */
.iv-tint-understand { background: var(--iv-color-pillar-understand-tint); color: #181818; }
.iv-tint-align { background: var(--iv-color-pillar-align-tint); color: #181818; }
.iv-tint-augment { background: var(--iv-color-pillar-augment-tint); color: #181818; }
.iv-callout { padding: var(--iv-space-4) var(--iv-space-6); border-radius: var(--iv-radius-md); background: var(--iv-color-pillar-understand-tint); color: #181818; }

/* tables: no fills, hairlines */
.iv-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.iv-table th { text-align: left; font-weight: 700; border-bottom: 2px solid var(--iv-ink); padding: 10px 12px 8px 0; }
.iv-table td { border-bottom: 1px solid var(--iv-line); padding: 10px 12px 10px 0; vertical-align: top; }
.iv-num { font-variant-numeric: tabular-nums; }

/* forms */
.iv-field { display: grid; gap: 6px; margin-bottom: var(--iv-space-4); }
.iv-field label { font-weight: 600; font-size: 15px; }
.iv-input { min-height: 44px; padding: 10px 14px; border: 1.5px solid var(--iv-line); border-radius: var(--iv-radius-md); background: var(--iv-raised); color: var(--iv-ink); font: 400 16px/1.4 var(--iv-font); }
.iv-input:focus { outline: 3px solid var(--iv-ink); outline-offset: 1px; border-color: var(--iv-ink); }

/* nav + footer */
.iv-nav { position: sticky; top: 0; z-index: 100; height: 72px; display: flex; align-items: center; gap: var(--iv-space-6);
  padding-inline: clamp(16px, 4vw, 32px); background: var(--iv-ground); border-bottom: 1px solid var(--iv-line); }
.iv-nav__brand { display: flex; align-items: center; gap: 0; text-decoration: none; white-space: nowrap; }
.iv-nav__links { display: flex; gap: var(--iv-space-8); list-style: none; margin: 0 0 0 auto; padding: 0; font-weight: 600; font-size: 16px; }
.iv-nav__links a { text-decoration: none; }
.iv-nav__links a:hover { text-decoration: underline; text-underline-offset: .3em; text-decoration-thickness: 2px; }
.iv-footer { background: var(--iv-raised); border-top: 1px solid var(--iv-line); padding-top: var(--iv-space-16); color: var(--iv-ink); font-size: 15px; }
.iv-footer__grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: var(--iv-space-8); }
.iv-footer__lab { font-size: 20px; font-weight: 700; line-height: 28px; max-width: 11em; margin: 12px 0 8px; }
.iv-footer__col h2 { font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--iv-muted); margin: 0 0 16px; }
.iv-footer__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.iv-footer__col a { font-weight: 500; text-decoration: none; }
.iv-footer__col a:hover { text-decoration: underline; }
.iv-footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: var(--iv-space-12); padding-block: 20px 28px; border-top: 1px solid var(--iv-line); color: var(--iv-muted); font-size: 13px; }
@media (max-width: 768px) { .iv-footer__grid { grid-template-columns: 1fr 1fr; } .iv-footer__grid > :first-child { grid-column: 1 / -1; } }
/* pillar band: understand | align | augment, full width at the very bottom (footer, sheets, slides, video) */
.iv-pillar-band { display: grid; grid-template-columns: repeat(3, 1fr); height: 8px; }
.iv-pillar-band::before, .iv-pillar-band::after, .iv-pillar-band > i { content: ""; display: block; }
.iv-pillar-band--edge { position: absolute; left: 0; right: 0; bottom: 0; }
.iv-pillar-band::before { background: var(--iv-color-pillar-understand-tint); }
.iv-pillar-band > i { background: var(--iv-color-pillar-align-tint); }
.iv-pillar-band::after { background: var(--iv-color-pillar-augment-tint); }
.iv-eth-logo { height: 30px; width: auto; content: url("../logo/eth-logo-black.svg"); }
[data-theme="dark"] .iv-eth-logo { content: url("../logo/eth-logo-white.svg"); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .iv-eth-logo { content: url("../logo/eth-logo-white.svg"); } }

/* motion */
@keyframes iv-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes iv-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes iv-mark-in { from { background-size: 0% 100%; } to { background-size: 100% 100%; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; } }

/* header details measured on v4: ETH logo | 1 px divider | IVIA wordmark + lab name in two lines, round 44 px icon buttons */
.iv-nav__divider { flex: 0 0 1px; width: 1px; height: 42px; background: var(--iv-ink); margin-inline: 40px 0; }
.iv-wordmark { font-weight: 700; font-size: 30px; letter-spacing: -.01em; line-height: 1; margin-left: 40px; }
.iv-nav__lab { font-weight: 400; font-size: 14px; line-height: 1.2; letter-spacing: 0; margin-left: 16px; }
.iv-nav > nav { margin-left: auto; }
.iv-nav__tools { display: flex; gap: 16px; margin-left: var(--iv-space-8); }
.iv-nav__menu-only { display: none; }
.iv-nav.is-open .iv-nav__menu-only { display: block; }
.iv-icon-button.iv-menu-button { display: none; border-radius: var(--iv-radius-md); border: 2px solid var(--iv-ink); }
@media (max-width: 768px) {
  .iv-icon-button.iv-menu-button { display: grid; }
  .iv-nav__tools [data-iv-fullscreen] { display: none; }
  .iv-nav__brand { min-width: 0; overflow: hidden; }
  .iv-nav__tools { margin-left: auto; gap: 12px; }
  .iv-nav > nav { position: absolute; top: 100%; left: 0; right: 0; margin: 0; background: var(--iv-ground); border-bottom: 1px solid var(--iv-line); display: none; }
  .iv-nav.is-open > nav { display: block; }
  .iv-nav.is-open .iv-nav__links { display: grid; gap: 4px; padding: 12px clamp(16px, 4vw, 32px) 20px; margin: 0; }
  .iv-nav.is-open .iv-nav__links a { display: block; padding: 10px 0; font-size: 19px; font-weight: 700; }
}
.iv-icon-button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--iv-line); background: transparent; color: var(--iv-ink); cursor: pointer; transition: border-color var(--iv-motion-duration-fast) ease-out; }
.iv-icon-button:hover { border-color: var(--iv-ink); }
.iv-pill { align-self: flex-start; display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.iv-footer__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
@media (min-width: 1360px) { .iv-nav__divider { margin-left: 40px; } .iv-wordmark { margin-left: 20px; } }
@media (max-width: 1359px) { .iv-nav .iv-nav__lab { display: none; } }
@media (max-width: 599px) { .iv-wordmark { font-size: 24px; margin-left: 14px; } .iv-nav__divider { margin-left: 14px; height: 32px; } .iv-eth-logo { height: 22px; } }

/* scrollbars: thin, token colors, both themes */
* { scrollbar-width: thin; scrollbar-color: var(--iv-line) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--iv-line); border-radius: 999px; border: 2px solid var(--iv-ground); }
::-webkit-scrollbar-track { background: transparent; }
@media (max-width: 768px) { .iv-nav__links { display: none; } }

/* theme toggle shows the mode you switch to: moon in light, sun in dark (as on v4) */
.iv-when-dark { display: none; }
[data-theme="dark"] .iv-when-dark { display: block; }
[data-theme="dark"] .iv-when-light { display: none; }
/* light island: embeds and forms that stay light inside dark pages (v4 contact form); add data-theme="light" too */
.iv-embed-light { background: #fff; color: #181818; border-radius: var(--iv-radius-lg); color-scheme: light; padding: var(--iv-space-6); }
