*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --page-bg: #f0f1f3;
  --panel-bg: #e6e8eb;
  --text: #141414;
  --muted: rgba(0, 0, 0, 0.4);
  --faint: rgba(0, 0, 0, 0.1);
  --line: #d8d9db;
  --accent: #2591cd;
  --rail-width: clamp(272px, 28vw, 360px);
  --font-display: "Darker Grotesque", sans-serif;
  --font-body: "Geist", "Inter", sans-serif;
  --font-ui: "Inter", sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.4;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.system-rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--rail-width);
  height: 100vh;
  border-right: 1px solid var(--faint);
  background: var(--page-bg);
  overflow: hidden;
}

.system-rail::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 22%;
  height: 511px;
  background: var(--page-bg);
}

.rail-content {
  position: relative;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  gap: 0;
  padding: 0 26px 50px 22%;
  padding-right: 4px;
  justify-content: space-evenly;

  padding-bottom: 0px;
  padding-top: 6vh;
}

.rail-title {
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
}

.rail-nav,
.rail-social {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  line-height: normal;
}

.rail-nav a,
.rail-social a {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0;
  color: rgba(20, 20, 20, 0.6);
  transition:
    color 180ms ease,
    gap 180ms ease,
    transform 180ms ease;
}

.rail-nav a::after,
.rail-social a::after {
  content: "->";
  opacity: 0;
  transform: translateX(-4px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.rail-nav a:hover,
.rail-social a:hover,
.rail-nav a:focus-visible,
.rail-social a:focus-visible {
  color: var(--accent);
  gap: 7px;
  transform: translateX(6px);
}

.rail-nav a:hover::after,
.rail-social a:hover::after,
.rail-nav a:focus-visible::after,
.rail-social a:focus-visible::after {
  opacity: 1;
  transform: translateX(0);
}

.rail-pattern {
  position: relative;
  width: 100%;
  /* min-height: 425px; */
  /* opacity: 0.58; */
  height: 55vh;
  overflow: hidden;
}

.rail-pattern-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.page-main {
  min-height: 100vh;
  margin-left: var(--rail-width);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

 /* ── Interactive Bot ── */
    .bot-container {
      width: 35px;
      height: 35px;
      cursor: pointer;
      transition: transform 0.3s ease;
      position: relative;
    }
    .bot-container:hover {
      animation: wiggle 0.5s ease;
    }
    @keyframes wiggle {
      0%, 100% { transform: rotate(0deg); }
      25% { transform: rotate(-5deg); }
      75% { transform: rotate(5deg); }
    }
    .bot-logo {
      width: 100%;
      height: 100%;
      display: block;
    }
    .bot-eyes {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
    }
    .bot-eye {
      position: absolute;
      width: 17.5px;
      height: 17.5px;
      background: #ff0d0d00;
      top: 50%;
      transform: translateY(-50%);
      transition: height 0.15s ease, top 0.15s ease, width 0.15s ease;
      
    }
    .bot-eye.left {
      left: 8%;
      
    }
    .bot-eye.right {
      right: 8%;
   
    }
    .bot-eye.squint {
      height: 5px;
      top: 77%;
      
      overflow: hidden;
    }
    @keyframes blinkLeft {
      0%, 96%, 100% {
        height: 12px;
      }
      98% {
        height: 2px;
      }
    }
   
    .bot-pupil {
      position: absolute;
      width: 6px;
      height: 12px;
      background: url('/src/resources/icons/eye.svg');
      background-size: contain;
      background-repeat: no-repeat;
      animation: blinkLeft 5s infinite;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      transition: transform 0.1s ease;
    }

.hero {
  display: grid;
  min-height: inherit;
  grid-template-rows: minmax(1px, 28vh) 1fr;
}

.hero-copy {
  display: flex;
  align-items: flex-end;
  padding-bottom: 37px;
  padding-left: 6%;
}

.intro-kicker {
  margin-bottom: -10px;
  color: rgba(19, 19, 19, 0.5);
  font-size: 16px;
  line-height: 24px;
}

.hero h1 {
  color: #131313;
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 72px;
}

.hero h1 span {
  color: var(--accent);
}

.hero-visual {
  position: relative;
  min-height: 516px;
  background: var(--panel-bg);
  overflow: hidden;
  background-image: url("/src/resources/figma/experiments-hero.png");
  background-size: cover;
  background-position-y: 21px;
  background-position-x: left;
  background-repeat: no-repeat;

}

.hero-visual img {
 position: absolute;
    top: 30px;
    left: -1%;
    width: 113%;
    max-width: none;
    display: none;
}

.content-section {
  width: 88%;
  margin-right: 6%;
  margin-left: 6%;
  border-top: 1px solid var(--faint);
  scroll-margin-top: 32px;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(140px, 30%) minmax(0, 70%);
  gap: 10px;
  padding-top: 32px;
}

.section-label {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}

.project-directory {
  min-height: 466px;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.project-row {
  display: grid;
  min-height: 48px;
  grid-template-columns: 52px minmax(180px, 1fr) auto;
  align-items: start;
  gap: 19px;
  color: inherit;
  transition: transform 180ms ease;
}

.project-number {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  line-height: normal;
}

.project-meta,
.project-type {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: normal;
}

.project-title {
  display: block;
  margin-top: 8px;
  color: #000;
  font-size: 16px;
  line-height: normal;
  transition: color 180ms ease;
}

.project-row:hover .project-title,
.project-row:focus-visible .project-title,
.project-row:hover .project-action,
.project-row:focus-visible .project-action {
  color: var(--accent);
}

.project-row:hover,
.project-row:focus-visible {
  transform: translateX(8px);
}

.project-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: end;
  /* padding-top: 31px; */
  color: #000;
  font-size: 14px;
  line-height: normal;
  white-space: nowrap;
  transition: color 180ms ease;
}

.project-action img {
  width: 14px;
  height: 14px;
}

.project-divider {
  width: 100%;
  height: 1px;
  border: 0;
  background: var(--line);
}

.principles {
  min-height: 519px;
}

.principles .section-grid {
  display: block;
}

.principle-board {
  display: grid;
  height: 455px;
  margin-top: 32px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.principle-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  margin: 0 -1px -1px 0;
  border-style: solid;
  border-width: 1px;
  border-color: var(--line);
  /* overflow: hidden; */
}

.principle-card::before {
  content: "";
  position: absolute;
  width: 83%;
  height: 108%;
  background: #f0f1f3;
  z-index: 11;
}

.principle-card::after {
  content: "";
  position: absolute;
  width: 108%;
  height: 83%;
  background: #f0f1f3;
  z-index: 11;
}

.principle-card img {
  width: min(46%, 135px);
  /* max-height: 150px; */
  /* opacity: 0.55; */
  aspect-ratio: 1 / 1;
  position: relative;
  z-index: 12;
}

.principle-card:nth-child(1) img {
  width: min(50%, 130px);
}

.principle-caption {
  position: absolute;
  top: 11px;
  left: 9px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: normal;
  z-index: 12;
}

.principle-code {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
}

.principle-name {
  color: var(--text);
  font-size: 13px;
}

.about {
  min-height: 248px;
}

.about-copy {
  color: #000;
  font-size: 14px;
  line-height: 24px;
  max-width: 50ch;
}

.about-copy p + p {
  margin-top: 24px;
}

.site-footer {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-left: 0;
  padding: 11px 48px;
  background: var(--panel-bg);
  color: var(--muted);
  font-size: 14px;
  line-height: normal;
  white-space: nowrap;
}

.reveal-ready .reveal,
.reveal-ready .reveal-stagger > .reveal-item {
  opacity: 0;
  translate: 0 var(--reveal-distance, 20px);
  transition:
    opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
    translate 700ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 180ms ease,
    color 180ms ease,
    gap 180ms ease;
  transition-delay: var(--reveal-delay, 0ms), var(--reveal-delay, 0ms), 0ms, 0ms,
    0ms;
  will-change: opacity, translate;
}

.reveal {
  --reveal-distance: 22px;
}

.reveal-stagger > .reveal-item {
  --reveal-distance: 16px;
}

.reveal-stagger > .project-divider {
  --reveal-distance: 0;
}

.reveal-ready .reveal.is-visible,
.reveal-ready .reveal-stagger.is-visible > .reveal-item {
  opacity: 1;
  translate: 0 0;
}

@media (prefers-reduced-motion: reduce) {
  .reveal-ready .reveal,
  .reveal-ready .reveal-stagger > .reveal-item {
    opacity: 1;
    translate: none;
    transition: none;
  }
}

@media (max-width: 1100px) {
  :root {
    --rail-width: 260px;
  }

  .project-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .project-action {
    grid-column: 2;
    justify-self: start;
    padding-top: 0;
  }
}

@media (max-width: 820px) {
  .system-rail {
    position: relative;
    top: auto;
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: 0;
    background: rgba(240, 241, 243, 0.96);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    overflow: visible;
  }

  .system-rail::before,
  .rail-pattern {
    display: none;
  }

  .rail-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
    min-height: auto;
    gap: 0;
    padding: 0 24px;
  }

  .rail-header {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    grid-column: 1 / -1;
    padding: 0;
  }

  .rail-title {
    margin-bottom: 0;
    font-size: 16px;
  }

  .rail-content nav,
  .rail-nav,
  .rail-social {
    display: contents;
  }

  .reveal-ready .system-rail .rail-nav > .reveal-item,
  .reveal-ready .system-rail .rail-social > .reveal-item {
    opacity: 1;
    translate: 0 0;
  }

  .rail-nav a,
  .rail-social a {
    width: 100%;
    min-height: 44px;
    justify-content: space-between;
    border-bottom: 1px solid rgba(20, 20, 20, 0.07);
    font-size: 13px;
    line-height: normal;
  }

  .rail-social a:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .rail-nav a::after,
  .rail-social a::after {
    margin-left: auto;
    opacity: 0.36;
    transform: none;
  }

  .rail-nav a:hover,
  .rail-social a:hover,
  .rail-nav a:focus-visible,
  .rail-social a:focus-visible {
    gap: 0;
    transform: none;
  }

  .page-main {
    margin-left: 0;
  }

  .hero {
    min-height: auto;
    grid-template-rows: auto auto;
    padding-left: 24px;
  }

  .hero-copy {
    padding: 64px 24px 28px 0;
  }

  .hero h1 {
    font-size: 52px;
    line-height: 58px;
  }

  .hero-visual {
    min-height: 430px;
  }

  .hero-visual img {
    top: 38px;
    left: 5%;
    width: 145%;
  }

  .content-section {
    width: auto;
    margin: 0 24px;
  }

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

  .project-directory,
  .principles,
  .about {
    min-height: auto;
    padding-bottom: 56px;
  }

  .principle-board {
    height: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .principle-card {
    min-height: 180px;
  }

  .site-footer {
    margin: 0;
    padding: 14px 24px;
    gap: 16px;
    white-space: nowrap;
  }
}

@media (max-width: 540px) {
  .rail-header {
    min-height: 58px;
    padding: 0;
  }

  .rail-content {
    column-gap: 14px;
  }

  .hero h1 {
    font-size: 44px;
    line-height: 50px;
  }

  .hero-visual {
    min-height: 330px;
  }

  .project-row {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 14px;
  }

  .project-title {
    font-size: 15px;
  }

  .project-action {
    align-items: center;
  }

  .principle-card {
    min-height: 160px;
  }

  .principle-card img {
    width: min(38%, 92px);
  }

  .principle-card:nth-child(1) img {
    width: min(42%, 96px);
  }

  .site-footer {
    gap: 10px;
    padding-right: 12px;
    padding-left: 12px;
    font-size: clamp(9px, 2.8vw, 11px);
  }
}
