:root {
  --bg: #000;
  --fg: #fff;
  --mute: #9a9a9a;
  --line: #262626;
  --panel: #111;
  --head: 60px;
  --pad: clamp(20px, 4vw, 56px);
  --step: 90vh;
  --step: 90svh;
}

@font-face {
  font-family: "Koradin";
  src: url("fonts/KoradinDua.woff2") format("woff2"), url("fonts/Koradin.otf") format("opentype");
  font-display: swap;
}

* { box-sizing: border-box; margin: 0; }

html { background: var(--bg); color-scheme: dark; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

/* Header */
.site-head {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  height: var(--head);
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.site-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--fg);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.mark {
  display: block;
  width: 24px;
  height: 24px;
  flex: none;
  transform: rotate(var(--rot, 0deg));
  transition: scale 0.35s cubic-bezier(0.2, 0.7, 0.1, 1);
}
.wordmark:hover .mark { scale: 1.25; }
.site-nav { display: flex; gap: 28px; }
.site-nav a {
  padding-bottom: 4px;
  color: var(--mute);
  text-decoration: none;
  font-size: 0.95rem;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: color 0.2s, background-size 0.35s cubic-bezier(0.2, 0.7, 0.1, 1);
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--fg); background-size: 100% 1px; }

/* Opening screen */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--head) + 48px) var(--pad) var(--pad);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: clamp(40px, 7vw, 88px);
}
.hero h1 {
  font-size: clamp(3.4rem, 13vw, 12rem);
  line-height: 0.88;
  letter-spacing: -0.05em;
  font-weight: 800;
}
.hero-sub { max-width: 36ch; color: var(--mute); font-size: clamp(1.05rem, 1.6vw, 1.35rem); }
.hero-sub strong { color: var(--fg); font-weight: 600; }

.index { list-style: none; padding: 0; column-width: 17rem; column-gap: var(--pad); }
.index li { break-inside: avoid; }
.index a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
}
.index-cat { color: var(--mute); }

/* Showcase entries */
.entry {
  position: relative;
  height: calc(100vh + (var(--n) - 1) * var(--step));
  height: calc(100svh + (var(--n) - 1) * var(--step));
}
.pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  padding: calc(var(--head) + 16px) var(--pad) var(--pad);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: var(--pad);
}

.stage { position: relative; overflow: hidden; min-height: 0; background: var(--bg); border: 1px solid var(--line); }
.slide { position: absolute; inset: 0; will-change: transform; }
.slide img { display: block; width: 100%; height: 100%; object-fit: contain; }
.placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--mute);
  border: 1px solid var(--line);
}

.copy {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.copy::-webkit-scrollbar { display: none; }
.copy-name {
  font-size: clamp(2.4rem, 5.5vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.copy-cat-unused { margin-top: 0.75rem; color: var(--mute); }
.copy-lower { margin-top: auto; padding-top: 2rem; max-width: 46ch; }
.copy-text { font-size: clamp(1rem, 1.15vw, 1.15rem); }
.copy-text p + p { margin-top: 1em; }
.copy-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.socials { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.socials a { text-underline-offset: 4px; }
.socials a:hover { text-decoration: none; }
.count { color: var(--mute); font-variant-numeric: tabular-nums; white-space: nowrap; }

.outro {
  min-height: 60vh;
  min-height: 60svh;
  padding: var(--pad);
  display: flex;
  align-items: flex-end;
  border-top: 1px solid var(--line);
}
.outro a {
  font-size: clamp(2.4rem, 9vw, 8rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-weight: 700;
  text-decoration: none;
}
.outro a:hover { text-decoration: underline; text-underline-offset: 0.12em; }

/* Directory */
.page { padding: calc(var(--head) + 48px) var(--pad) 96px; }
.page h1 {
  font-size: clamp(3rem, 11vw, 9rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
  font-weight: 800;
}
.page-sub { margin-top: 1.25rem; max-width: 40ch; color: var(--mute); }

.tools {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 16px 32px;
  margin-top: clamp(40px, 6vw, 72px);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--fg);
}
.search {
  flex: 1 1 220px;
  min-width: 0;
  padding: 0.35rem 0;
  font: inherit;
  color: var(--fg);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.search::placeholder { color: var(--mute); }
.search:focus { outline: none; border-bottom-color: var(--fg); }
.filters { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.filters button {
  padding: 0;
  font: inherit;
  color: var(--mute);
  background: none;
  border: 0;
  cursor: pointer;
}
.filters button:hover { color: var(--fg); }
.filters button[aria-pressed="true"] {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 6px;
}
.count-line { margin-top: 16px; color: var(--mute); font-variant-numeric: tabular-nums; }

.list { list-style: none; padding: 0; }
.row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 2fr);
  gap: var(--pad);
  align-items: baseline;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}
.row-name {
  font-size: clamp(1.4rem, 2.6vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.row-name a { text-decoration: none; }
.row-name a:hover { text-decoration: underline; text-underline-offset: 5px; }
.row-cat { color: var(--mute); }
.kradin {
  font-family: "Koradin", sans-serif;
  font-weight: 400;
  font-variant-ligatures: common-ligatures;
  font-feature-settings: "liga" 1;
}
.empty { padding: 2rem 0; color: var(--mute); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 820px) {
  :root { --head: 52px; --step: 70vh; --step: 70svh; }
  .pin {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 16px;
    padding-top: calc(var(--head) + 12px);
  }
  .copy-name { font-size: clamp(2rem, 9vw, 3rem); }
  .copy-lower { padding-top: 1rem; }
  .copy-text { font-size: 0.95rem; }
  .copy-foot { margin-top: 1rem; }
  .site-nav { gap: 20px; }
  .row { grid-template-columns: 1fr; gap: 6px; }
}

/* Homepage */
.site-nav a.nav-cta { color: var(--fg); }

.home-hero {
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  padding: calc(var(--head) + 24px) var(--pad) var(--pad);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  grid-template-areas: "copy chart" "strip chart";
  grid-template-rows: auto minmax(0, 1fr);
  column-gap: var(--pad);
  row-gap: clamp(20px, 4vh, 48px);
}
.home-copy { grid-area: copy; }
.soul-strip { grid-area: strip; align-self: end; }
.hero-chart { grid-area: chart; min-height: 0; }
.home-copy { display: flex; flex-direction: column; gap: 1.5rem; min-width: 0; }
.home-kicker { color: var(--mute); }
.home-hero h1 {
  font-size: clamp(3.2rem, 8vw, 8rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
  font-weight: 800;
}
.home-lede { max-width: 34ch; color: var(--mute); font-size: clamp(1.1rem, 1.6vw, 1.4rem); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn, .btn-line {
  display: inline-block;
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--fg);
  text-decoration: none;
  font-weight: 500;
}
.btn { background: var(--fg); color: var(--bg); }
.btn:hover { background: var(--bg); color: var(--fg); }
.btn-line:hover { background: var(--fg); color: var(--bg); }

.doors { list-style: none; padding: 0; border-top: 1px solid var(--fg); }
.doors a {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: var(--pad);
  align-items: baseline;
  padding: clamp(20px, 3vw, 36px) var(--pad);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.doors-name {
  font-size: clamp(2rem, 6vw, 5rem);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 700;
}
.doors-note { color: var(--mute); max-width: 36ch; }
.doors a:hover .doors-name { text-decoration: underline; text-underline-offset: 0.1em; }

.section {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: var(--pad);
  padding: clamp(56px, 9vw, 120px) var(--pad);
  border-top: 1px solid var(--line);
  scroll-margin-top: var(--head);
}
.section h2 {
  font-size: clamp(1.4rem, 2.6vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 600;
}
.section h2 small { display: block; margin-top: 0.4rem; color: var(--mute); font-size: 1rem; letter-spacing: 0; font-weight: 400; }
.lead {
  font-size: clamp(1.8rem, 3.6vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.prose { max-width: 52ch; font-size: clamp(1.05rem, 1.4vw, 1.3rem); }
.prose p + p { margin-top: 1em; }
.prose strong { font-weight: 600; }
.prose .actions, .prose .link { margin-top: 1.75rem; }
.link { display: inline-block; text-underline-offset: 4px; }
.link:hover { text-decoration: none; }
.figure { margin-top: 2.5rem; max-width: 52ch; overflow: hidden; }
.figure img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.figure figcaption { margin-top: 0.6rem; color: var(--mute); }

.articles { list-style: none; padding: 0; }
.article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(96px, 14vw, 180px);
  gap: var(--pad);
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}
.article:first-child { border-top: 0; padding-top: 0; }
.article-meta { color: var(--mute); }
.article h3 {
  margin: 0.35rem 0 0.6rem;
  font-size: clamp(1.4rem, 2.4vw, 2.1rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 600;
}
.article h3 a { text-decoration: none; }
.article h3 a:hover { text-decoration: underline; text-underline-offset: 5px; }
.article p.excerpt { color: var(--mute); max-width: 52ch; }
.thumb { overflow: hidden; align-self: start; }
.article img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.all-link { margin-top: 1.5rem; }

.arch-list { list-style: none; padding: 0; }
.arch { padding: 1.5rem 0; border-top: 1px solid var(--line); }
.arch:first-child { border-top: 0; padding-top: 0; }
.arch h3 {
  font-size: clamp(1.4rem, 2.4vw, 2.1rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 600;
}
.arch-tag { margin-top: 0.25rem; color: var(--mute); }
.arch p.arch-body { margin-top: 0.75rem; max-width: 56ch; }
.arch-role { margin-top: 0.75rem; color: var(--mute); }
.arch.featured {
  margin-top: 1.5rem;
  padding: 1.75rem clamp(18px, 2.5vw, 32px);
  background: var(--fg);
  color: var(--bg);
  border-top: 0;
}
.arch.featured .arch-tag,
.arch.featured .arch-role { color: #4a4a4a; }

.rules {
  list-style: none;
  padding: 0;
  margin-top: 2rem;
  counter-reset: rule;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.rules li {
  counter-increment: rule;
  padding: 1rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.rules li::before {
  content: counter(rule, upper-roman);
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.rules li span { color: var(--mute); }
.quote {
  margin-top: clamp(40px, 6vw, 72px);
  font-size: clamp(1.8rem, 3.6vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 700;
  max-width: 22ch;
}
.quote-by { margin-top: 1rem; color: var(--mute); }

.collab {
  padding: clamp(72px, 12vw, 160px) var(--pad);
  border-top: 1px solid var(--line);
}
.collab h2 {
  font-size: clamp(2.6rem, 8vw, 7.5rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
  font-weight: 800;
  max-width: 14ch;
}
.collab p { margin-top: 1.5rem; max-width: 46ch; color: var(--mute); font-size: clamp(1.05rem, 1.5vw, 1.3rem); }
.collab .actions { margin-top: 2rem; }
.collab .link { margin-top: 1.75rem; }

.site-foot {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px var(--pad);
  padding: clamp(40px, 6vw, 72px) var(--pad) 24px;
  border-top: 1px solid var(--line);
}
.foot-brand p { max-width: 34ch; margin-top: 0.75rem; color: var(--mute); }
.foot-brand .wordmark { display: inline-flex; }
.site-foot h4 { margin-bottom: 0.75rem; color: var(--mute); font-weight: 400; }
.site-foot ul { list-style: none; padding: 0; }
.site-foot li + li { margin-top: 0.4rem; }
.site-foot a { text-underline-offset: 4px; }
.site-foot a:hover { text-decoration: none; }
.foot-contact { margin-top: 1.25rem; display: grid; gap: 0.25rem; justify-items: start; }
.foot-base {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--mute);
}

@media (max-width: 1000px) {
  .rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .doors a, .section { grid-template-columns: 1fr; gap: 8px; }
  .section { gap: 24px; }
  .site-nav a.nav-anchor { display: none; }
  .site-foot { grid-template-columns: 1fr; }
  .article { grid-template-columns: minmax(0, 1fr) 84px; gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ------------------------------------------------------------------
   Directory: Kradin, Latin, link
------------------------------------------------------------------- */
.table-head,
.row {
  grid-template-columns: minmax(0, 2fr) 150px minmax(0, 2fr) minmax(0, 2fr);
  align-items: center;
}
.table-head {
  display: grid;
  gap: var(--pad);
  padding: 0.75rem 0;
  color: var(--mute);
  border-bottom: 1px solid var(--line);
}
.row { position: relative; }
.row-kradin {
  font-size: clamp(1.6rem, 3vw, 2.8rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
  transform-origin: left center;
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.1, 1);
}
.row-linkcell { min-width: 0; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------
   Flags band
------------------------------------------------------------------- */
.flags {
  overflow: hidden;
  white-space: nowrap;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.flags-track { display: inline-flex; will-change: transform; }
.flag {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0 1.6rem;
  color: var(--mute);
  transition: opacity 0.3s, color 0.3s;
}
.flag img {
  display: block;
  width: 28px;
  height: 21px;
  object-fit: cover;
  outline: 1px solid rgba(255, 255, 255, 0.18);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.1, 1);
}

/* ------------------------------------------------------------------
   Title reveal on load: one orchestrated moment
------------------------------------------------------------------- */
.line { display: block; overflow: hidden; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.line > span {
  display: block;
  transform: translateY(105%);
  animation: lineUp 0.95s cubic-bezier(0.2, 0.7, 0.1, 1) forwards;
  animation-delay: calc(var(--i, 0) * 110ms + 120ms);
}
.after-title {
  opacity: 0;
  animation: fadeIn 0.9s ease forwards;
  animation-delay: 0.75s;
}
@keyframes lineUp { to { transform: translateY(0); } }
@keyframes fadeIn { to { opacity: 1; } }
@keyframes redraw {
  0%   { background-position: 100% 100%; background-size: 100% 1px; }
  45%  { background-position: 100% 100%; background-size: 0 1px; }
  55%  { background-position: 0 100%;    background-size: 0 1px; }
  100% { background-position: 0 100%;    background-size: 100% 1px; }
}
@keyframes rowIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------
   Links: drawn underline that redraws on hover
------------------------------------------------------------------- */
.link,
.socials a,
.site-foot a:not(.wordmark),
.row-link {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 2px;
}

/* ------------------------------------------------------------------
   Scroll-linked pieces
------------------------------------------------------------------- */
[data-words] .w { opacity: 0.2; transition: opacity 0.25s; }
[data-words] .w.on { opacity: 1; }
.js .figure img { clip-path: inset(0 0 var(--clip, 100%) 0); transform: scale(var(--zoom, 1.15)); }

/* ------------------------------------------------------------------
   Hover states (only where a real hover exists)
------------------------------------------------------------------- */
@media (hover: hover) {
  /* Underline redraw */
  .link:hover,
  .socials a:hover,
  .site-foot a:not(.wordmark):hover,
  .row-link:hover { animation: redraw 0.55s cubic-bezier(0.2, 0.7, 0.1, 1); }

  /* Lists: everything else steps back */
  .index li,
  .article,
  .arch,
  .row { transition: opacity 0.3s; }
  .index:hover li:not(:hover),
  .articles:hover .article:not(:hover),
  .arch-list:hover .arch:not(:hover),
  .list:hover .row:not(:hover) { opacity: 0.3; }

  /* Index names slide */
  .index-name { display: inline-block; transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.1, 1); }
  .index a:hover .index-name { transform: translateX(10px); }

  /* Doors: a white fill rises from the bottom */
  .doors a { position: relative; overflow: hidden; isolation: isolate; transition: color 0.35s; }
  .doors a::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--fg);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.1, 1);
  }
  .doors a:hover { color: var(--bg); }
  .doors a:hover::before { transform: scaleY(1); }
  .doors a:hover .doors-name { text-decoration: none; transform: translateX(16px); }
  .doors a:hover .doors-note { color: #3a3a3a; }
  .doors-name { transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.1, 1); }
  .doors-note { transition: color 0.35s; }

  /* Buttons: fill slides across */
  .btn, .btn-line { position: relative; overflow: hidden; isolation: isolate; transition: color 0.3s; }
  .btn::before, .btn-line::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    transform: translateX(-101%);
    transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.1, 1);
  }
  .btn::before { background: var(--bg); }
  .btn-line::before { background: var(--fg); }
  .btn:hover, .btn-line:hover { background: transparent; }
  .btn { background: var(--fg); }
  .btn:hover { color: var(--fg); }
  .btn-line:hover { color: var(--bg); }
  .btn:hover::before, .btn-line:hover::before { transform: translateX(0); }

  /* Articles */
  .article img { filter: grayscale(1); transition: filter 0.5s, transform 0.5s cubic-bezier(0.2, 0.7, 0.1, 1); }
  .article:hover img { filter: none; transform: scale(1.06); }
  .article h3 a { display: inline-block; transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.1, 1); }
  .article:hover h3 a { text-decoration: none; transform: translateX(10px); }

  /* Archetypes */
  .arch h3 { transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.1, 1); }
  .arch:hover h3 { transform: translateX(12px); }
  .arch.featured { transition: opacity 0.3s, background 0.35s, color 0.35s, box-shadow 0.35s; }
  .arch.featured:hover { background: var(--bg); color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
  .arch.featured:hover .arch-tag,
  .arch.featured:hover .arch-role { color: var(--mute); }

  /* Rules and Kradin cells invert */
  .rules li { transition: background 0.25s, color 0.25s; }
  .rules li:hover { background: var(--fg); color: var(--bg); }
  .rules li:hover span { color: #3a3a3a; }

  /* Flags: the band slows, the flag under the cursor lifts */
  .flags:hover .flag { opacity: 0.3; }
  .flags .flag:hover { opacity: 1; color: var(--fg); }
  .flag:hover img { transform: scale(1.4); }

  /* Directory rows */
  .row::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: var(--fg);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.1, 1);
  }
  .row:hover::after { transform: scaleX(1); }
  .row:hover .row-kradin { transform: scale(1.06); }

  /* Filters */
  .filters button {
    padding-bottom: 4px;
    background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
    transition: color 0.2s, background-size 0.35s cubic-bezier(0.2, 0.7, 0.1, 1);
  }
  .filters button:hover { background-size: 100% 1px; }

  /* Exhibition stage */
  .stage { transition: box-shadow 0.4s; }
}

.filters button[aria-pressed="true"] { text-decoration: none; background-size: 100% 1px; }
.filters button { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; padding-bottom: 4px; }
.search { transition: border-color 0.3s, letter-spacing 0.3s; }
.search:focus { letter-spacing: 0.01em; }
.row-anim { animation: rowIn 0.5s cubic-bezier(0.2, 0.7, 0.1, 1) both; animation-delay: calc(var(--i, 0) * 28ms); }

/* ------------------------------------------------------------------
   Reduced motion: keep colour changes, drop movement
------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .line > span { animation: none; transform: none; }
  .after-title { animation: none; opacity: 1; }
  .row-anim { animation: none; }
  .flags { overflow-x: auto; }
  .js .figure img { clip-path: none; transform: none; }
  [data-words] .w { opacity: 1; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

@media (max-width: 1100px) { .site-nav a.nav-anchor { display: none; } }
@media (max-width: 820px) {
  .row { grid-template-columns: 1fr; gap: 6px; }
  .table-head { display: none; }
}


/* ------------------------------------------------------------------
   A name that turns into Kradin: hover (mouse) or tap (touch)
------------------------------------------------------------------- */
.hint-touch { display: none; }
@media (hover: none), (pointer: coarse) {
  .hint-hover { display: none; }
  .hint-touch { display: inline; }
}
.word {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 56px;
  padding: 0.1em 0.3em 0.15em;
  margin-left: -0.3em;
  font: inherit;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  text-align: left;
  color: var(--fg);
  background: transparent;
  border: 0;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.3s, color 0.3s;
}
.word-face { display: grid; align-items: center; min-height: 1.25em; }
.w-latin, .w-kradin { grid-area: 1 / 1; transition: opacity 0.35s, transform 0.5s cubic-bezier(0.2, 0.7, 0.1, 1), clip-path 0.6s cubic-bezier(0.2, 0.7, 0.1, 1); }
.w-kradin { font-size: 1.25em; font-weight: 400; letter-spacing: 0; line-height: 1; opacity: 0; transform: translateY(45%); clip-path: inset(0 100% 0 0); align-self: center; }
.word.flip { background: var(--fg); color: var(--bg); }
.word.flip .w-latin { opacity: 0; transform: translateY(-45%); }
.word.flip .w-kradin { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }
@media (hover: hover) and (pointer: fine) {
  .word:hover { background: var(--fg); color: var(--bg); }
  .word:hover .w-latin { opacity: 0; transform: translateY(-45%); }
  .word:hover .w-kradin { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }
}
.word:focus-visible { background: var(--fg); color: var(--bg); outline-offset: 2px; }
.word:focus-visible .w-latin { opacity: 0; transform: translateY(-45%); }
.word:focus-visible .w-kradin { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }

/* ------------------------------------------------------------------
   Soul names strip (hero) and shared toggle
------------------------------------------------------------------- */
.seg { display: inline-flex; border: 1px solid var(--line); }
.seg button {
  min-height: 44px;
  padding: 0 18px;
  font: inherit;
  color: var(--mute);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
  -webkit-tap-highlight-color: transparent;
}
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
@media (hover: hover) { .seg button:not([aria-pressed="true"]):hover { color: var(--fg); } }

.soul-strip { padding-top: 16px; border-top: 1px solid var(--line); }
.strip-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.strip-label { color: var(--mute); }
.strip-main { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 40px; margin-top: 8px; }
.strip-slot { min-width: min(100%, 300px); min-height: 112px; }
.slot-inner { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; animation: slotIn 0.5s cubic-bezier(0.2, 0.7, 0.1, 1) both; }
@keyframes slotIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.slot-day { color: var(--mute); }
.strip-hint { margin-top: 8px; color: var(--mute); font-size: 0.9rem; max-width: 52ch; }
.strip-days { list-style: none; padding: 0; display: flex; gap: 6px; flex: 1 1 260px; max-width: 480px; }
.strip-days li { flex: 1; }
.strip-days button {
  position: relative;
  width: 100%;
  min-height: 44px;
  padding: 0;
  font: inherit;
  font-size: 0.85rem;
  color: var(--mute);
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.25s;
}
.strip-days button::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -1px;
  height: 2px;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: left;
}
.strip-days button.on { color: var(--fg); }
.strip-days button.on::before { transform: scaleX(1); }
.soul-strip.playing:not(.paused) .strip-days button.on::before { animation: dayFill 3.8s linear both; }
@keyframes dayFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (hover: hover) { .strip-days button:hover { color: var(--fg); } }

/* ------------------------------------------------------------------
   The Kradin table
------------------------------------------------------------------- */
.chart { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-half { border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.ch-row { display: grid; grid-template-columns: 2.4em repeat(7, minmax(0, 1fr)); }
.ch-head span { padding: 4px 0; text-align: center; color: var(--mute); font-size: 0.85rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ch-label { display: grid; place-items: center; color: var(--mute); font-size: 0.8rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cell {
  display: grid;
  place-items: center;
  min-height: 40px;
  font-size: 1.35rem;
  line-height: 1;
  overflow: hidden;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: background 0.25s, color 0.25s, transform 0.3s cubic-bezier(0.2, 0.7, 0.1, 1);
}
.cell.empty { background: repeating-linear-gradient(135deg, transparent 0 6px, #111 6px 7px); }
.cell.lit { background: var(--fg); color: var(--bg); }

/* On desktop the table fills its frame, so it is always fully visible */
@media (min-width: 901px) {
  .chart.fit { height: 100%; grid-template-rows: minmax(0, 1fr); }
  .chart.fit .chart-half { min-height: 0; }
  .chart.fit .ch-row { min-height: 0; overflow: hidden; grid-template-rows: minmax(0, 1fr); }
  .chart.fit .cell { line-height: 1; }
  .chart.fit .chart-half { display: grid; grid-template-rows: repeat(16, minmax(0, 1fr)); }
  .chart.fit .cell { min-height: 0; font-size: clamp(0.8rem, 2.5vh, 1.6rem); }
  .chart.fit .ch-head span, .chart.fit .ch-label { display: grid; place-items: center; padding: 0; font-size: clamp(0.65rem, 1.6vh, 0.85rem); }
}

/* ------------------------------------------------------------------
   Kradin page
------------------------------------------------------------------- */
.kr-layout { margin-top: clamp(32px, 5vw, 56px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: var(--pad); align-items: start; }
.kr-note { margin-top: 0.75rem; max-width: 46ch; color: var(--mute); }
.kr-left .sub { margin-top: 2.5rem; }
.kr-left .seg { margin-top: 1.25rem; }
.day-rows { list-style: none; padding: 0; margin-top: 1.25rem; border-top: 1px solid var(--line); }
.day-row {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(5.5rem, 1fr) minmax(0, 2fr) auto;
  gap: 16px;
  align-items: center;
  padding: 10px 0;
  font: inherit;
  color: var(--fg);
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.25s, color 0.25s, padding 0.3s cubic-bezier(0.2, 0.7, 0.1, 1);
}
.dr-day { color: var(--mute); transition: color 0.25s; }
.dr-name { font-size: clamp(1.5rem, 3vw, 2.4rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.dr-kradin { font-size: clamp(1.6rem, 3vw, 2.6rem); line-height: 1; }
.day-row.on { background: var(--fg); color: var(--bg); padding-left: 12px; padding-right: 12px; }
.day-row.on .dr-day { color: #3a3a3a; }
@media (hover: hover) and (pointer: fine) {
  .day-row:hover { background: var(--fg); color: var(--bg); padding-left: 12px; padding-right: 12px; }
  .day-row:hover .dr-day { color: #3a3a3a; }
}
.day-row:focus-visible { outline-offset: -2px; }
.kr-chart { position: sticky; top: calc(var(--head) + 24px); height: calc(100svh - var(--head) - 48px); min-height: 480px; }
.kr-chart .chart { height: 100%; }

/* ------------------------------------------------------------------
   Exhibition tags, Kradin sample, small header button
------------------------------------------------------------------- */
.copy-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.copy-tag { display: inline-block; padding: 3px 12px; border: 1px solid var(--fg); color: var(--fg); font-size: 0.9rem; }
.sample { margin-top: 1.25rem; display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sample-glyph { font-size: clamp(2.2rem, 4vw, 3.2rem); line-height: 1; }
.sample-cap { color: var(--mute); }

.lang {
  min-width: 44px;
  min-height: 44px;
  padding: 0 4px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg);
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) { .lang:hover { text-decoration: underline; text-underline-offset: 6px; } }

/* ------------------------------------------------------------------
   Index: logos and the apply call to action
------------------------------------------------------------------- */
.row-logocell { min-width: 0; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.row-logo {
  display: block;
  width: 100%;
  max-width: 110px;
  height: 26px;
  background-repeat: no-repeat;
  background-position: left center;
  background-size: contain;
  mix-blend-mode: screen;
  opacity: 0.9;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.cta { margin-top: clamp(56px, 8vw, 112px); padding-top: 2rem; border-top: 1px solid var(--fg); display: grid; gap: 1rem; justify-items: start; }
.cta-title { font-size: clamp(1.8rem, 4vw, 3.2rem); line-height: 1; letter-spacing: -0.04em; font-weight: 700; }
.cta-text { color: var(--mute); max-width: 44ch; }

@media (min-width: 901px) {
  .home-hero h1 { font-size: clamp(2.6rem, min(8vw, 13vh), 8rem); }
  .home-copy { gap: clamp(0.6rem, 2vh, 1.5rem); }
}
@media (min-width: 901px) and (max-height: 760px) {
  .home-lede { display: none; }
  .home-hero { row-gap: 12px; }
  .strip-slot { min-height: 0; }
  .home-hero .btn, .home-hero .btn-line { padding: 0.6rem 1.1rem; }
}
@media (max-width: 900px) {
  .home-hero {
    height: auto;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "copy" "strip" "chart";
    grid-template-rows: auto;
  }
  .hero-chart { margin-top: 8px; }
  .chart { grid-template-columns: minmax(0, 1fr); }
  .kr-layout { grid-template-columns: minmax(0, 1fr); }
  .kr-chart { position: static; height: auto; min-height: 0; }
  .kr-chart .chart { height: auto; }
}
@media (max-width: 820px) {
  .table-head { display: none; }
  .row { grid-template-columns: 1fr; gap: 6px; }
  .row-logocell { order: 3; }
  .strip-slot { min-height: 100px; }
  .site-nav { gap: 14px; }
  .site-head { gap: 8px; }
}
@media (max-width: 480px) {
  .wordmark span { display: none; }
  .site-nav { gap: 12px; }
  .site-nav a { font-size: 0.9rem; }
  .day-row { grid-template-columns: minmax(4.2rem, auto) minmax(0, 1fr) auto; gap: 10px; }
}

/* Full screen hint on the exhibition stage */
.stage { position: relative; }
.enlarge {
  position: absolute; right: 12px; bottom: 12px; z-index: 2;
  padding: 6px 10px; font-size: 0.75rem; letter-spacing: 0.02em;
  background: var(--bg); color: var(--fg); border: 1px solid var(--line);
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.stage:hover .enlarge, .stage:focus-visible .enlarge { opacity: 1; }
@media (hover: none) { .enlarge { display: none; } }

/* Full-screen image viewer */
.viewer {
  position: fixed; inset: 0; z-index: 100;
  display: none; grid-template-rows: auto minmax(0, 1fr) auto;
  background: #000;
}
.viewer.open { display: grid; }
.viewer-top, .viewer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--pad);
}
.viewer-title { font-weight: 600; letter-spacing: -0.01em; }
.viewer-top button, .viewer-nav button {
  padding: 0.55rem 1rem; border: 1px solid var(--fg); background: transparent; color: var(--fg); cursor: pointer; font: inherit;
}
.viewer-top button:hover, .viewer-nav button:hover:not(:disabled) { background: var(--fg); color: var(--bg); }
.viewer-nav { display: flex; gap: 10px; }
.viewer-nav button:disabled { opacity: 0.3; cursor: default; }
.viewer-img { min-height: 0; position: relative; margin: 0 var(--pad); }
.viewer-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
#vCount { color: var(--mute); }
@media (max-width: 600px) { .viewer-img { margin: 0; } }

/* Day rows open downward to show other spellings */
.day-item { border-bottom: 1px solid var(--line); }
.day-item .day-row { border-bottom: 0; }
.dr-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.35s cubic-bezier(0.2, 0.7, 0.1, 1); }
.dr-more-in { overflow: hidden; min-height: 0; }
.day-item.open .dr-more { grid-template-rows: 1fr; }
.dr-vars { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0 18px; }
.dr-var {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 8px 12px; font: inherit; color: var(--fg); background: none;
  border: 1px solid var(--line); cursor: default;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.dr-var:hover, .dr-var:focus-visible { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.dv-kradin { font-size: 1.35rem; line-height: 1; }
.day-item:not(.open) .dr-var { visibility: hidden; }

/* Surnames table */
.kr-left .sub.names-sub { margin-top: clamp(48px, 7vw, 96px); }
.name-table { width: 100%; margin-top: 1.25rem; border-collapse: collapse; border-top: 1px solid var(--line); }
.name-table th { text-align: left; font-weight: 400; color: var(--mute); padding: 10px 0; border-bottom: 1px solid var(--line); }
.name-table td { padding: 12px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.name-table tr { transition: background 0.2s, color 0.2s; }
.nm-latin { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; }
.nm-kradin { font-size: 1.6rem; line-height: 1.1; text-align: right; }
.nm-sep { font-family: inherit; opacity: 0.5; }
.name-table tbody tr:focus-visible { outline-offset: -2px; }
.name-table tbody tr.on { background: var(--fg); color: var(--bg); }
@media (hover: hover) and (pointer: fine) { .name-table tbody tr:hover { background: var(--fg); color: var(--bg); } }
.name-table tbody tr:hover td:first-child, .name-table tbody tr.on td:first-child { padding-left: 12px; }
.name-table tbody tr:hover td:last-child, .name-table tbody tr.on td:last-child { padding-right: 12px; }

/* Kradin: about, breakdown, colours */
.kr-section { margin-top: clamp(64px, 9vw, 128px); padding-top: 2rem; border-top: 1px solid var(--fg); }
.kr-prose { margin-top: 1rem; max-width: 62ch; color: var(--fg); }
.bk-cards { margin-top: 1.5rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 16px; }
.bk-card { border: 1px solid var(--line); padding: 18px 18px 8px; }
.bk-title { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 12px; }
.bk-row { display: grid; grid-template-columns: 3.4em repeat(7, minmax(0, 1fr)); align-items: center; }
.bk-head span { text-align: center; color: var(--mute); font-size: 0.75rem; padding-bottom: 4px; }
.bk-label { color: var(--mute); font-size: 0.8rem; padding-right: 4px; }
.bk-cell { display: grid; place-items: center; min-height: 44px; font-size: 1.5rem; line-height: 1; border-top: 1px solid var(--line); }
.bk-cell.empty { background: repeating-linear-gradient(135deg, transparent 0 6px, #111 6px 7px); min-height: 44px; }
.bk-base .bk-cell { font-size: 1.9rem; min-height: 56px; }
.bk-base .bk-label { color: var(--fg); font-weight: 600; }
.bk-vlabel { margin: 14px 0 2px; color: var(--mute); font-size: 0.8rem; }
.bk-var .bk-cell { color: #cfcfcf; }
.bk-card .bk-row:last-child .bk-cell { margin-bottom: 8px; }

.col-group { margin-top: clamp(32px, 5vw, 56px); }
.col-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 24px; margin-bottom: 14px; }
.col-title { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; letter-spacing: -0.03em; }
.col-kr { font-weight: 400; margin-left: 10px; }
.col-desc { color: var(--mute); max-width: 52ch; }
.col-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 12px; }
.col-card { border: 1px solid var(--line); }
.col-swatch { aspect-ratio: 5 / 3; border-bottom: 1px solid var(--line); }
.col-swatch.shine { background-image: linear-gradient(115deg, rgba(255,255,255,0) 30%, rgba(200,215,255,0.85) 48%, rgba(255,255,255,0) 66%) !important; background-color: #fff !important; }
.col-body { padding: 12px 14px 14px; }
.col-twi { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.col-script { font-size: 1.7rem; line-height: 1.15; margin-top: 6px; }
.col-en { color: var(--mute); margin-top: 6px; font-size: 0.9rem; }
@media (max-width: 480px) { .bk-cell { font-size: 1.25rem; } .bk-base .bk-cell { font-size: 1.5rem; } }

/* Newsletter pop-up */
.news {
  position: fixed; right: var(--pad); bottom: var(--pad); z-index: 90;
  width: min(380px, calc(100vw - 2 * var(--pad)));
  padding: 22px 22px 18px; background: var(--bg); color: var(--fg);
  border: 1px solid var(--fg);
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.35s, transform 0.35s cubic-bezier(0.2, 0.7, 0.1, 1);
}
.news.show { opacity: 1; transform: none; }
.news-x { position: absolute; top: 6px; right: 10px; padding: 4px 8px; font-size: 1.6rem; line-height: 1; background: none; border: 0; color: var(--fg); cursor: pointer; }
.news-title { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; padding-right: 28px; }
.news-text { margin-top: 8px; color: var(--mute); }
.news-form { margin-top: 14px; display: grid; gap: 10px; }
.news-form input[type="email"] { width: 100%; padding: 0.8rem 0.9rem; font: inherit; color: var(--fg); background: transparent; border: 1px solid var(--fg); border-radius: 0; }
.news-form input[type="email"]::placeholder { color: var(--mute); }
.news-form .btn { width: 100%; cursor: pointer; font: inherit; font-weight: 500; }
.news-form .btn:disabled { opacity: 0.5; cursor: default; }
.news-honey { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.news-fine { margin-top: 10px; font-size: 0.78rem; color: var(--mute); }
.news-msg { margin-top: 8px; min-height: 1.2em; font-size: 0.9rem; }
.news-msg a { text-decoration: underline; text-underline-offset: 0.15em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 600px) { .news { right: 12px; left: 12px; bottom: 12px; width: auto; } }
