/* ---------- tokens ---------- */
:root{
  --bg:            #141414;
  --surface:       #292929;
  --surface-hi:    #333333;
  --line:          #3c3c3c;
  --text:          #EDEAE2;
  --text-dim:      #9a978f;
  --text-faint:    #6b6963;

  --blue:   #4E8DFF;
  --green:  #67D46B;
  --yellow: #F4D13D;
  --red:    #E44A3C;

  --font-display: "Space Grotesk", ui-sans-serif, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;

  --wrap: 1120px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  position: relative;
}

.wrap{
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 32px;
}

.mono{ font-family: var(--font-mono); }

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

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

/* ---------- noise overlay ---------- */
.noise-overlay{
  position: fixed;
  inset: 0;
  background-image: url("assets/noise.png");
  background-size: 260px;
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 500;
}

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

/* ---------- header ---------- */
.site-header{
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(20,20,20,0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand-mark{ height: 22px; width: auto; }

.nav{
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 14px;
  color: var(--text-dim);
}

.nav a{ transition: color 0.15s ease; }
.nav a:hover{ color: var(--text); }

.nav-cta{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
}
.nav-cta:hover{ border-color: var(--blue); color: var(--blue); }

/* ---------- hero ---------- */
.hero{
  position: relative;
  padding: 128px 0 0;
  overflow: hidden;
  isolation: isolate;
}

.hero-bg{
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero-grid{
  position: absolute;
  inset: -1px;
  background-image:
    linear-gradient(to right, rgba(237,234,226,0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(237,234,226,0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 20%, black 10%, transparent 75%);
}

.hero-inner{
  text-align: center;
  padding-bottom: 96px;
}

.eyebrow{
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  margin: 0 0 20px;
}

.hero-title{
  font-size: clamp(40px, 6.4vw, 76px);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
}

.refract-wrap{ display: inline-block; }

.refract-word{
  position: relative;
  display: inline-block;
  color: var(--text);
}

/* signature effect: text-shadow "refraction" ghosting in the four accent colors */
.refract-word::before,
.refract-word::after{
  content: "refract";
  position: absolute;
  left: 0; top: 0;
  z-index: -1;
  opacity: 0.75;
}
.refract-word::before{
  color: var(--blue);
  animation: refract-a 5s ease-in-out infinite;
}
.refract-word::after{
  color: var(--red);
  animation: refract-b 5s ease-in-out infinite;
}

@keyframes refract-a{
  0%, 100%{ transform: translate(0,0); }
  50%{ transform: translate(3px, -2px); }
}
@keyframes refract-b{
  0%, 100%{ transform: translate(0,0); }
  50%{ transform: translate(-3px, 2px); }
}

.hero-sub{
  max-width: 560px;
  margin: 0 auto 40px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-dim);
}

.hero-actions{
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* ---------- buttons ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 7px;
  font-size: 14.5px;
  font-weight: 500;
  font-family: var(--font-mono);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary{
  background: var(--blue);
  color: #0e1420;
}
.btn-primary:hover{
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -8px rgba(78,141,255,0.55);
}

.btn-ghost{
  border: 1px solid var(--line);
  color: var(--text);
}
.btn-ghost:hover{ border-color: var(--text-dim); transform: translateY(-1px); }

.btn-large{ padding: 16px 28px; font-size: 15px; }

/* ---------- spectral bar (signature divider) ---------- */
.spectral-bar{
  display: flex;
  width: 100%;
  height: 5px;
}
.spectral-bar .bar{ flex: 1; }

.bar-blue{ background: var(--blue); }
.bar-green{ background: var(--green); }
.bar-yellow{ background: var(--yellow); }
.bar-red{ background: var(--red); }

/* ---------- stats strip ---------- */
.stats-strip{
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.stats-inner{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  padding: 36px 32px;
  flex-wrap: wrap;
}
.stat{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.stat-num{
  font-size: 22px;
  color: var(--text);
}
.accent-blue{ color: var(--blue); }
.accent-green{ color: var(--green); }
.accent-yellow{ color: var(--yellow); }
.accent-red{ color: var(--red); }
.stat-label{
  font-size: 12.5px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}
.stat-div{
  width: 1px;
  height: 32px;
  background: var(--line);
}
@media (max-width: 640px){ .stat-div{ display:none; } }

/* ---------- sections ---------- */
.section{ padding: 96px 0; }

.section-head{
  margin-bottom: 44px;
}
.section-title{
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.section-desc{
  font-size: 14px;
  color: var(--text-faint);
  margin: 0;
}

/* ---------- repo grid ---------- */
.repo-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.repo-card{
  background: var(--surface);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: background 0.15s ease;
  min-height: 168px;
}
.repo-card:hover{ background: var(--surface-hi); }

.repo-card-top{
  display: flex;
  align-items: center;
  gap: 10px;
}

.repo-dot{
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-blue{ background: var(--blue); }
.dot-green{ background: var(--green); }
.dot-yellow{ background: var(--yellow); }
.dot-red{ background: var(--red); }

.repo-name{
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  flex: 1;
}

.repo-arrow{
  color: var(--text-faint);
  transition: transform 0.15s ease, color 0.15s ease;
}
.repo-card:hover .repo-arrow{ transform: translateX(3px); color: var(--text); }

.repo-desc{
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0;
  flex: 1;
}

.repo-meta{
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-faint);
}

.repo-lang{ display: flex; align-items: center; gap: 6px; }
.lang-dot{
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.lang-dot-yellow{ background: var(--yellow); }
.lang-dot-blue{ background: var(--blue); }
.lang-dot-red{ background: var(--red); }
.lang-dot-green{ background: var(--green); }

.repo-card-more{
  align-items: center;
  justify-content: center;
  text-align: center;
}
.repo-card-more-inner{
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.repo-more-label{ font-size: 15px; color: var(--text); }
.repo-more-sub{ font-size: 12.5px; color: var(--text-faint); }

@media (max-width: 900px){
  .repo-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px){
  .repo-grid{ grid-template-columns: 1fr; }
}

/* ---------- principles ---------- */
.stack-section{ background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.principles-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.principle{ padding-top: 4px; }

.principle-bar{
  display: block;
  width: 28px;
  height: 3px;
  border-radius: 2px;
  margin-bottom: 18px;
}

.principle h3{
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 10px;
}

.principle p{
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0;
}

@media (max-width: 900px){
  .principles-grid{ grid-template-columns: repeat(2, 1fr); row-gap: 36px; }
}
@media (max-width: 560px){
  .principles-grid{ grid-template-columns: 1fr; }
}

/* ---------- cta ---------- */
.cta-section{ text-align: center; padding: 120px 0; }
.cta-title{
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}
.cta-sub{
  color: var(--text-dim);
  font-size: 15.5px;
  margin: 0 0 32px;
}

/* ---------- footer ---------- */
.site-footer{
  border-top: 1px solid var(--line);
  padding: 32px 0;
}
.footer-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-mark{ height: 16px; width: auto; opacity: 0.7; }
.footer-note{ font-size: 12.5px; color: var(--text-faint); }

/* ---------- reveal on scroll ---------- */
[data-reveal]{
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal].is-visible{
  opacity: 1;
  transform: translateY(0);
}

/* ---------- focus states ---------- */
a:focus-visible,
button:focus-visible{
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- responsive header nav ---------- */
@media (max-width: 620px){
  .nav{ gap: 16px; font-size: 13px; }
  .nav a:not(.nav-cta){ display: none; }
  .hero{ padding-top: 88px; }
  .hero-inner{ padding-bottom: 64px; }
  .section{ padding: 64px 0; }
}
