:root {
  color-scheme: light;
  --ink: #171313;
  --ink-soft: #342b2b;
  --muted: #6e6262;
  --paper: #ffffff;
  --soft: #f7f5f4;
  --soft-blue: #f8eeee;
  --line: #e4d9d9;
  --line-strong: #c9b6b6;
  --blue: #b21f2a;
  --blue-dark: #7d111a;
  --gold: #b21f2a;
  --rust: #7d111a;
  --green: #8f2028;
  --teal: #1d6f73;
  --amber: #b98b2d;
  --plum: #6e4d7b;
  --shadow: 0 18px 52px rgba(125, 17, 26, 0.12);
  --content-max: 1180px;
  --section-label-width: 150px;
  --section-body-width: 980px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.62;
  overflow-x: clip;
}

a {
  color: var(--blue);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--rust);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 920px;
  margin-bottom: 20px;
  font-size: 4.2rem;
  line-height: 1.04;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h2 {
  max-width: 940px;
  margin-bottom: 22px;
  font-size: 2.55rem;
  line-height: 1.14;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.08rem;
  line-height: 1.28;
  letter-spacing: 0;
}

code {
  border: 1px solid rgba(178, 31, 42, 0.16);
  border-radius: 4px;
  padding: 0.08em 0.34em;
  background: rgba(178, 31, 42, 0.07);
  color: #5a1118;
  font-size: 0.92em;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 918px);
  align-items: center;
  justify-content: center;
  gap: 22px;
  min-height: 78px;
  padding: 12px clamp(18px, 3vw, 48px);
  border-bottom: 1px solid var(--line);
  border-top: 4px solid var(--blue-dark);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand-lockup {
  display: grid;
  flex: 0 0 auto;
  width: 190px;
  height: 64px;
  place-items: center;
}

.brand-lockup img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.98rem;
  line-height: 1.1;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
}

.topbar-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-self: end;
  justify-content: flex-end;
  gap: 18px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: clamp(14px, 2.2vw, 30px);
  font-size: 0.9rem;
  font-weight: 760;
}

.nav a {
  color: var(--ink);
  text-decoration: none;
}

.nav a:hover {
  color: var(--blue);
}

.language-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(46px, 1fr));
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--paper);
}

.language-button {
  min-height: 34px;
  border: 0;
  border-right: 1px solid var(--line-strong);
  padding: 7px 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
}

.language-button:last-child {
  border-right: 0;
}

.language-button.active {
  background: var(--blue-dark);
  color: #fff;
}

.language-button:focus-visible {
  outline: 3px solid rgba(178, 31, 42, 0.18);
  outline-offset: 2px;
}

.masthead {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 720px) minmax(330px, 380px);
  justify-content: center;
  gap: clamp(28px, 4vw, 56px);
  align-items: end;
  min-height: 620px;
  padding: clamp(64px, 8vw, 104px) clamp(20px, 3vw, 48px) clamp(48px, 6vw, 78px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(0deg, rgba(125, 17, 26, 0.1), rgba(125, 17, 26, 0.1)),
    #f8f6f5;
}

.masthead::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(125, 17, 26, 0.05), transparent 42%),
    repeating-linear-gradient(0deg, rgba(23, 19, 19, 0.035), rgba(23, 19, 19, 0.035) 1px, transparent 1px, transparent 44px);
  content: "";
}

.masthead-copy,
.record-panel {
  position: relative;
  min-width: 0;
}

.kicker,
.section-label,
.paper-label {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.lead {
  max-width: 770px;
  margin-bottom: 30px;
  color: #443737;
  font-size: 1.22rem;
}

.signal-ribbon {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  max-width: 720px;
  margin-top: 28px;
  border: 1px solid rgba(125, 17, 26, 0.18);
  border-left: 4px solid var(--blue-dark);
  border-radius: 6px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 36px rgba(23, 19, 19, 0.07);
}

.signal-ribbon span {
  color: var(--blue-dark);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.signal-ribbon svg {
  display: block;
  width: 100%;
  height: 64px;
}

.signal-grid-line {
  fill: none;
  stroke: rgba(125, 17, 26, 0.18);
  stroke-width: 1;
}

.signal-wave {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 780;
  animation: waveTrace 5.6s ease-in-out infinite;
}

.signal-wave-main {
  stroke: var(--blue-dark);
  stroke-width: 4;
}

.signal-wave-ghost {
  stroke: var(--teal);
  stroke-width: 2.4;
  opacity: 0.56;
  animation-delay: -2.2s;
}

.action-row,
.access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 10px 16px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 820;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.button:hover {
  border-color: var(--blue);
  color: var(--blue);
  transform: translateY(-1px);
}

.button.primary {
  border-color: var(--blue-dark);
  background: var(--blue-dark);
  color: #fff;
}

.button.primary:hover {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.button.secondary.dark {
  border-color: #4b1d20;
  background: #1e1516;
  color: #fff;
}

.button.secondary.dark:hover {
  background: #4b1d20;
  color: #fff;
}

.full {
  width: 100%;
}

.record-panel {
  border: 1px solid rgba(125, 17, 26, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.record-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.record-code {
  color: var(--ink);
  font-size: 1.32rem;
  font-weight: 900;
}

.record-status {
  border: 1px solid rgba(178, 31, 42, 0.24);
  border-radius: 4px;
  padding: 5px 8px;
  background: rgba(178, 31, 42, 0.08);
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 850;
  white-space: nowrap;
}

.record-list {
  margin: 0;
}

.record-list div {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}

.record-list div:last-child {
  border-bottom: 0;
}

.record-list dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.record-list dd {
  margin: 0;
  color: var(--ink);
  text-align: left;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 236px));
  justify-content: center;
  border-bottom: 1px solid var(--line);
  background: #fffdfd;
}

.stats-strip div {
  min-height: 116px;
  padding: 26px clamp(16px, 3vw, 36px);
  border-right: 1px solid var(--line);
}

.stats-strip div:last-child {
  border-right: 0;
}

.stats-strip span {
  display: block;
  color: var(--rust);
  font-size: 2.35rem;
  font-weight: 900;
  line-height: 1;
}

.stats-strip p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 760;
}

.visual-section {
  background:
    linear-gradient(180deg, #fffdfd 0%, #ffffff 48%, #f8f6f5 100%);
}

.visual-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 1180px;
  margin-top: 30px;
}

.visual-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 48px rgba(23, 19, 19, 0.08);
}

.visual-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--blue-dark), var(--teal), var(--amber));
  content: "";
}

.visual-card h3 {
  margin-bottom: 10px;
}

.visual-card p {
  color: #4a3f3f;
  margin-bottom: 0;
}

.visual-art {
  position: relative;
  min-height: 258px;
  margin: 2px 0 22px;
  border: 1px solid rgba(125, 17, 26, 0.12);
  border-radius: 6px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(125, 17, 26, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(125, 17, 26, 0.045) 1px, transparent 1px),
    #fffafa;
  background-size: 34px 34px;
}

.eeg-art svg {
  display: block;
  width: 100%;
  height: 258px;
}

.channel-field circle {
  fill: var(--teal);
  opacity: 0.82;
  animation: channelPulse 2.8s ease-in-out infinite;
}

.channel-field circle:nth-child(2n) {
  fill: var(--blue);
  animation-delay: -1.3s;
}

.channel-field circle:nth-child(3n) {
  fill: var(--amber);
  animation-delay: -2.1s;
}

.eeg-band {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 5;
  stroke-dasharray: 720;
  animation: waveTrace 6s ease-in-out infinite;
}

.eeg-band-a {
  stroke: url("#waveGradient");
}

.eeg-band-b {
  stroke: var(--teal);
  opacity: 0.72;
  animation-delay: -2.4s;
}

.eeg-band-c {
  stroke: var(--amber);
  opacity: 0.72;
  animation-delay: -3.6s;
}

.visual-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.visual-tags span {
  border: 1px solid rgba(125, 17, 26, 0.16);
  border-radius: 999px;
  padding: 5px 9px;
  background: #fff7f7;
  color: var(--blue-dark);
  font-size: 0.78rem;
  font-weight: 850;
}

.emotion-art {
  display: grid;
  place-items: center;
}

.emotion-art::before {
  position: absolute;
  width: 136px;
  height: 136px;
  border: 1px dashed rgba(125, 17, 26, 0.26);
  border-radius: 50%;
  animation: slowSpin 18s linear infinite;
  content: "";
}

.emotion-core {
  position: relative;
  z-index: 2;
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  border: 2px solid var(--blue-dark);
  border-radius: 50%;
  background: #fff;
  color: var(--blue-dark);
  font-weight: 950;
  box-shadow: 0 14px 34px rgba(125, 17, 26, 0.16);
}

.emotion-dot {
  position: absolute;
  z-index: 3;
  min-width: 92px;
  border: 1px solid rgba(23, 19, 19, 0.1);
  border-radius: 999px;
  padding: 7px 9px;
  background: #fff;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1;
  text-align: center;
  box-shadow: 0 10px 26px rgba(23, 19, 19, 0.09);
  animation: floatLabel 4.8s ease-in-out infinite;
}

.emotion-dot::before {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.emotion-dot.happiness {
  top: 28px;
  left: 50%;
  color: #b98b2d;
  transform: translateX(-50%);
}

.emotion-dot.encouragement {
  top: 80px;
  right: 18px;
  color: #1d6f73;
  animation-delay: -0.8s;
}

.emotion-dot.neutral {
  right: 32px;
  bottom: 52px;
  color: #6e6262;
  animation-delay: -1.6s;
}

.emotion-dot.anger {
  bottom: 28px;
  left: 50%;
  color: #b21f2a;
  transform: translateX(-50%);
  animation-delay: -2.4s;
}

.emotion-dot.fear {
  bottom: 52px;
  left: 32px;
  color: #6e4d7b;
  animation-delay: -3.2s;
}

.emotion-dot.sadness {
  top: 80px;
  left: 18px;
  color: #2f6f9f;
  animation-delay: -4s;
}

.mini-bars {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  margin-top: 18px;
  align-items: end;
}

.mini-bars span {
  display: block;
  height: 22px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, rgba(178, 31, 42, 0.8), rgba(125, 17, 26, 0.18));
  animation: barLift 2.8s ease-in-out infinite;
}

.mini-bars span:nth-child(2) {
  animation-delay: -0.4s;
}

.mini-bars span:nth-child(3) {
  animation-delay: -0.8s;
}

.mini-bars span:nth-child(4) {
  animation-delay: -1.2s;
}

.mini-bars span:nth-child(5) {
  animation-delay: -1.6s;
}

.mini-bars span:nth-child(6) {
  animation-delay: -2s;
}

.structure-art {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 18px;
}

.folder-layer {
  position: relative;
  border: 1px solid rgba(125, 17, 26, 0.18);
  border-radius: 6px;
  padding: 18px 16px 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(23, 19, 19, 0.07);
}

.folder-layer::before {
  position: absolute;
  top: -9px;
  left: 14px;
  width: 56px;
  height: 16px;
  border: 1px solid rgba(125, 17, 26, 0.18);
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  background: inherit;
  content: "";
}

.folder-layer strong,
.folder-layer span {
  display: block;
}

.folder-layer strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.folder-layer span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
}

.subject-layer {
  border-left: 4px solid var(--blue-dark);
}

.trial-layer {
  border-left: 4px solid var(--teal);
}

.variable-layer {
  border-left: 4px solid var(--amber);
}

.flow-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.flow-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
  opacity: 0.28;
  animation: packetPulse 1.8s ease-in-out infinite;
}

.flow-dots span:nth-child(2) {
  animation-delay: 0.25s;
}

.flow-dots span:nth-child(3) {
  animation-delay: 0.5s;
}

.section {
  display: grid;
  grid-template-columns: var(--section-label-width) minmax(0, var(--section-body-width));
  justify-content: center;
  gap: clamp(24px, 4vw, 50px);
  padding: clamp(62px, 8vw, 104px) clamp(20px, 3vw, 48px);
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 88px;
}

.section-label {
  position: sticky;
  top: 94px;
  align-self: start;
  margin-bottom: 0;
  color: var(--gold);
}

.section-label,
.section-body {
  min-width: 0;
}

.section-body > p,
.overview-feature p {
  max-width: 880px;
  color: #4a3f3f;
  font-size: 1.04rem;
}

.overview {
  background: #fff;
}

.overview-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  max-width: 1040px;
  align-items: start;
}

.overview-feature {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.overview-feature p {
  min-height: 138px;
  margin-bottom: 0;
}

.overview-feature .experiment-figure {
  width: 100%;
  max-width: none;
  margin: 0;
}

.experiment-figure {
  max-width: 1080px;
  margin: 34px 0 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--paper);
}

.experiment-figure img {
  display: block;
  width: 100%;
  aspect-ratio: 2.1 / 1;
  object-fit: cover;
}

.overview-feature .experiment-figure img {
  aspect-ratio: 4 / 3;
}

.experiment-figure figcaption {
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px;
  max-width: 1180px;
  margin-top: 34px;
}

.photo-grid .experiment-figure {
  height: 100%;
  margin-top: 0;
}

.photo-grid .experiment-figure img {
  aspect-ratio: 1.55 / 1;
}

.photo-grid .participant-figure img {
  aspect-ratio: 4 / 3;
}

.section-intro {
  max-width: 930px;
  color: #4a3f3f;
  font-size: 1.05rem;
}

.stimuli-section {
  background:
    linear-gradient(180deg, #fff 0%, #fffafa 100%);
}

.stimuli-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 1060px;
  margin: 28px 0;
}

.stimuli-summary div {
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue-dark);
  border-radius: 6px;
  padding: 20px;
  background: var(--paper);
  box-shadow: 0 14px 34px rgba(23, 19, 19, 0.06);
}

.stimuli-summary span {
  display: block;
  color: var(--blue-dark);
  font-size: 2rem;
  font-weight: 950;
  line-height: 1;
}

.stimuli-summary p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.movie-emotion-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 1180px;
  margin: 28px 0;
}

.movie-group {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px;
  background: var(--paper);
  box-shadow: 0 16px 38px rgba(23, 19, 19, 0.06);
}

.movie-group::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--blue-dark);
  content: "";
}

.movie-group.happiness::before {
  background: var(--amber);
}

.movie-group.encouragement::before {
  background: var(--teal);
}

.movie-group.neutral::before {
  background: var(--muted);
}

.movie-group.anger::before {
  background: var(--blue);
}

.movie-group.fear::before {
  background: var(--plum);
}

.movie-group.sadness::before {
  background: #2f6f9f;
}

.movie-group h3,
.movie-group p {
  margin: 0;
}

.movie-group p {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.movie-group ol {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.movie-group li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  color: #3d3333;
  font-size: 0.92rem;
}

.movie-group li span {
  color: var(--blue-dark);
  font-size: 0.72rem;
  font-weight: 900;
}

.movie-table-wrap {
  overflow-x: auto;
  max-width: 1180px;
  margin-top: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 0 16px 42px rgba(23, 19, 19, 0.06);
}

.movie-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.movie-table th,
.movie-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.movie-table th {
  background: #fff7f7;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 900;
}

.movie-table td {
  color: #342b2b;
  font-size: 0.92rem;
}

.movie-table tr:last-child td {
  border-bottom: 0;
}

.emotion-pill {
  display: inline-flex;
  min-width: 88px;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 4px 8px;
  background: #fff;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
}

.emotion-pill.happiness {
  color: var(--amber);
}

.emotion-pill.encouragement {
  color: var(--teal);
}

.emotion-pill.neutral {
  color: var(--muted);
}

.emotion-pill.anger {
  color: var(--blue);
}

.emotion-pill.fear {
  color: var(--plum);
}

.emotion-pill.sadness {
  color: #2f6f9f;
}

.dataset-section,
.access-section,
.contact-section {
  background: var(--soft);
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 30px;
  border: 1px solid var(--line);
  background: var(--line);
}

.data-grid article {
  min-height: 266px;
  padding: 26px;
  background: var(--paper);
}

.item-index {
  display: block;
  margin-bottom: 24px;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 900;
}

.data-grid p,
.protocol-list p,
.note,
.paper-record p,
.contact-block p,
.access-card p {
  color: #4a3f3f;
}

.technical-table,
.results-table {
  margin-top: 28px;
  border-top: 2px solid var(--ink);
  background: var(--paper);
}

.technical-table div,
.results-table div {
  display: grid;
  border-bottom: 1px solid var(--line);
}

.technical-table div {
  grid-template-columns: minmax(190px, 0.3fr) minmax(0, 1fr);
}

.results-table div {
  grid-template-columns: minmax(110px, 0.6fr) minmax(240px, 1.4fr) minmax(150px, 0.75fr) minmax(100px, 0.55fr);
}

.technical-table strong,
.technical-table span,
.results-table strong,
.results-table span {
  min-width: 0;
  padding: 16px 18px;
}

.technical-table strong,
.results-table strong {
  color: var(--ink);
  font-weight: 850;
}

.technical-table span,
.results-table span {
  color: #3d3333;
}

.technical-table strong,
.results-table strong:not(:last-child),
.results-table span:not(:last-child) {
  border-right: 1px solid var(--line);
}

.preprocess-demo {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(360px, 1.08fr);
  gap: 24px;
  align-items: center;
  max-width: 1180px;
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: clamp(20px, 3vw, 30px);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(125, 17, 26, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(125, 17, 26, 0.045) 1px, transparent 1px),
    #fffafa;
  background-size: 36px 36px;
  box-shadow: 0 18px 46px rgba(23, 19, 19, 0.07);
}

.preprocess-copy h3 {
  max-width: 560px;
  font-size: 1.7rem;
}

.preprocess-copy p:last-child {
  margin-bottom: 0;
  color: #4a3f3f;
}

.preprocess-visual {
  position: relative;
  min-height: 270px;
  border: 1px solid rgba(125, 17, 26, 0.15);
  border-radius: 6px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 30%, rgba(178, 31, 42, 0.08), transparent 34%),
    linear-gradient(180deg, #fff, #fff8f8);
}

.preprocess-visual svg {
  display: block;
  width: 100%;
  height: 270px;
}

.raw-signal-label,
.clean-signal-label {
  position: absolute;
  z-index: 3;
  left: 18px;
  border: 1px solid rgba(125, 17, 26, 0.16);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--blue-dark);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.raw-signal-label {
  top: 18px;
}

.clean-signal-label {
  bottom: 18px;
}

.raw-noise,
.clean-signal,
.processing-sweep {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.raw-noise {
  stroke: rgba(178, 31, 42, 0.35);
  stroke-width: 3;
  animation: noiseFade 4.2s ease-in-out infinite;
}

.clean-signal {
  stroke: var(--teal);
  stroke-width: 5;
  stroke-dasharray: 760;
  animation: waveTrace 5.2s ease-in-out infinite;
}

.sample-points circle {
  fill: var(--amber);
  animation: sampleBlink 2.4s ease-in-out infinite;
}

.sample-points circle:nth-child(2n) {
  animation-delay: -0.8s;
}

.sample-points circle:nth-child(3n) {
  animation-delay: -1.4s;
}

.filter-band {
  fill: rgba(29, 111, 115, 0.08);
  stroke: rgba(29, 111, 115, 0.34);
  stroke-dasharray: 9 7;
  animation: filterPulse 3.2s ease-in-out infinite;
}

.processing-sweep {
  stroke: var(--blue-dark);
  stroke-width: 4;
  filter: drop-shadow(0 0 8px rgba(178, 31, 42, 0.35));
  animation: preprocessSweep 4.8s ease-in-out infinite;
}

.preprocess-steps {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.preprocess-steps li {
  border: 1px solid rgba(125, 17, 26, 0.14);
  border-radius: 6px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.86);
}

.preprocess-steps strong,
.preprocess-steps span {
  display: block;
}

.preprocess-steps strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.preprocess-steps span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.pipeline-visual {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  max-width: 1060px;
  margin: 30px 0 26px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(125, 17, 26, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(125, 17, 26, 0.05) 1px, transparent 1px),
    #fffdfd;
  background-size: 32px 32px;
}

.pipeline-visual::before {
  position: absolute;
  top: 50%;
  right: 36px;
  left: 36px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue-dark), var(--teal), var(--amber), transparent);
  content: "";
}

.pipeline-visual::after {
  position: absolute;
  top: calc(50% - 4px);
  left: 36px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue-dark);
  box-shadow: 0 0 0 8px rgba(178, 31, 42, 0.1);
  animation: pipelineTravel 5.4s linear infinite;
  content: "";
}

.pipeline-node {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 92px;
  align-content: center;
  gap: 8px;
  border: 1px solid rgba(125, 17, 26, 0.18);
  border-radius: 6px;
  padding: 14px 10px;
  background: rgba(255, 255, 255, 0.94);
  text-align: center;
  box-shadow: 0 12px 26px rgba(23, 19, 19, 0.06);
}

.pipeline-node span {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 950;
}

.pipeline-node strong {
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.25;
}

.protocol-list {
  display: grid;
  gap: 0;
  max-width: 1030px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  border-top: 2px solid var(--ink);
}

.protocol-list li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.protocol-list li > span {
  color: var(--gold);
  font-weight: 900;
}

.protocol-list h3,
.protocol-list p {
  margin-bottom: 0;
}

.access-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.access-card,
.email-form {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.access-card {
  padding: 26px;
}

.access-actions {
  margin-top: 22px;
}

.requirements {
  display: grid;
  gap: 10px;
  margin: 24px 0 0;
  padding-left: 18px;
  color: #3d3333;
}

.requirements li::marker {
  color: var(--gold);
}

.email-form {
  display: grid;
  gap: 15px;
  padding: 24px;
}

.email-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 11px 12px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(178, 31, 42, 0.12);
}

.form-status {
  min-height: 1.35em;
  margin: 0;
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 750;
}

.paper-record {
  max-width: min(980px, 100%);
  border-top: 2px solid var(--ink);
  padding-top: 24px;
}

.paper-label {
  color: var(--muted);
}

.paper-record h3 {
  max-width: 900px;
  font-size: 1.65rem;
}

.bibtex {
  overflow-x: auto;
  max-width: min(980px, 100%);
  margin: 24px 0 0;
  border: 1px solid #4b1d20;
  border-radius: 6px;
  padding: 22px;
  background: #1e1516;
  color: #f7eeee;
  font-size: 0.88rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.contact-block {
  display: grid;
  grid-template-columns: minmax(0, 640px);
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--line);
}

.contact-block > div {
  padding: 26px;
  background: var(--paper);
}

.footer {
  display: grid;
  grid-template-columns: minmax(0, 430px) minmax(0, 720px);
  justify-content: center;
  gap: 14px;
  padding: 28px clamp(20px, 3vw, 48px);
  background: var(--ink);
  color: rgba(255, 255, 255, 0.76);
}

.footer p {
  margin: 0;
}

@keyframes waveTrace {
  0% {
    stroke-dashoffset: 780;
  }

  45%,
  65% {
    stroke-dashoffset: 0;
  }

  100% {
    stroke-dashoffset: -780;
  }
}

@keyframes channelPulse {
  0%,
  100% {
    opacity: 0.42;
    transform: scale(0.92);
    transform-origin: center;
  }

  50% {
    opacity: 1;
    transform: scale(1.24);
    transform-origin: center;
  }
}

@keyframes slowSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes floatLabel {
  0%,
  100% {
    margin-top: 0;
  }

  50% {
    margin-top: -8px;
  }
}

@keyframes barLift {
  0%,
  100% {
    height: 18px;
    opacity: 0.58;
  }

  50% {
    height: 46px;
    opacity: 1;
  }
}

@keyframes packetPulse {
  0%,
  100% {
    opacity: 0.24;
    transform: translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@keyframes pipelineTravel {
  from {
    left: 36px;
  }

  to {
    left: calc(100% - 44px);
  }
}

@keyframes preprocessSweep {
  0% {
    transform: translateX(0);
    opacity: 0;
  }

  12% {
    opacity: 1;
  }

  72% {
    opacity: 1;
  }

  100% {
    transform: translateX(720px);
    opacity: 0;
  }
}

@keyframes noiseFade {
  0%,
  100% {
    opacity: 0.72;
  }

  48%,
  72% {
    opacity: 0.22;
  }
}

@keyframes sampleBlink {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.8);
    transform-origin: center;
  }

  50% {
    opacity: 1;
    transform: scale(1.25);
    transform-origin: center;
  }
}

@keyframes filterPulse {
  0%,
  100% {
    opacity: 0.38;
  }

  50% {
    opacity: 1;
  }
}

@media (max-width: 1180px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 18px;
  }

  .topbar-actions {
    display: contents;
  }

  .nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    gap: 10px 22px;
  }

  .language-switch {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
}

@media (max-width: 980px) {
  .stimuli-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  h1 {
    font-size: 3.35rem;
  }

  h2 {
    font-size: 2.18rem;
  }

  .masthead {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .record-panel {
    max-width: 760px;
  }

  .section {
    grid-template-columns: 1fr;
  }

  .section-label {
    position: static;
  }

  .data-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .visual-grid {
    grid-template-columns: 1fr;
  }

  .movie-emotion-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .photo-grid,
  .preprocess-demo {
    grid-template-columns: 1fr;
  }

  .preprocess-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .access-layout,
  .contact-block {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  h1 {
    font-size: 2.55rem;
  }

  h2 {
    font-size: 1.86rem;
  }

  .nav {
    gap: 10px 16px;
  }

  .masthead {
    padding-top: 52px;
  }

  .lead {
    font-size: 1.06rem;
  }

  .stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-strip div {
    border-bottom: 1px solid var(--line);
  }

  .overview-feature-grid,
  .data-grid,
  .preprocess-steps {
    grid-template-columns: 1fr;
  }

  .overview-feature p {
    min-height: 0;
  }

  .pipeline-visual {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pipeline-visual::before,
  .pipeline-visual::after {
    display: none;
  }

  .technical-table div,
  .results-table div {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .technical-table strong,
  .results-table strong,
  .results-table span {
    border-right: 0 !important;
  }

  .results-table div:first-child {
    display: none;
  }

  .results-table div {
    padding: 12px 0;
  }

  .results-table span {
    padding: 4px 18px;
  }

  .footer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .movie-table-wrap {
    overflow-x: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .movie-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 12px;
  }

  .movie-table thead {
    display: none;
  }

  .movie-table,
  .movie-table tbody,
  .movie-table tr,
  .movie-table td {
    display: block;
    width: 100%;
  }

  .movie-table tr {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--paper);
    box-shadow: 0 12px 28px rgba(23, 19, 19, 0.06);
  }

  .movie-table td {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
  }

  .movie-table td::before {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 900;
    content: attr(data-label);
  }

  .movie-table td:last-child {
    border-bottom: 0;
  }

  .emotion-pill {
    justify-self: start;
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    padding-left: 18px;
    padding-right: 18px;
  }

  .brand-lockup,
  .brand-lockup img {
    height: 42px;
  }

  .brand-lockup {
    width: 126px;
    height: 42px;
  }

  .brand-lockup img {
    width: 100%;
    height: 100%;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 8px 10px;
    font-size: 0.82rem;
  }

  .nav a {
    min-width: 0;
  }

  .language-switch {
    grid-template-columns: repeat(2, 42px);
  }

  .stimuli-summary {
    grid-template-columns: 1fr;
  }

  .movie-emotion-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 2.2rem;
  }

  h2 {
    font-size: 1.62rem;
  }

  .brand small {
    display: none;
  }

  .masthead,
  .section {
    padding-left: 18px;
    padding-right: 18px;
  }

  .record-header,
  .action-row,
  .access-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .record-list div {
    grid-template-columns: minmax(78px, 0.32fr) minmax(0, 1fr);
    gap: 8px;
    padding: 11px 14px;
  }

  .button {
    width: 100%;
  }

  .stats-strip {
    grid-template-columns: 1fr;
  }

  .stats-strip div {
    border-right: 0;
  }

  .movie-emotion-grid {
    grid-template-columns: 1fr;
  }

  .movie-table th,
  .movie-table td {
    padding: 11px 12px;
  }

  .movie-table td {
    padding: 10px 12px;
  }
}

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