/* RX1 — shared site CSS */

:root {
  /* Surfaces */
  --surface-0: #0B0B0E;
  --surface-1: #15151A;
  --surface-2: #1F1F26;
  --rule: rgba(255, 255, 255, 0.06);
  --rule-strong: rgba(255, 255, 255, 0.12);

  /* Text */
  --text-primary: #F4F4F0;
  --text-secondary: rgba(244, 244, 240, 0.72);
  --text-tertiary: rgba(244, 244, 240, 0.48);
  --text-muted: rgba(244, 244, 240, 0.32);

  /* Accent — overridden per palette */
  --accent: #00D9FF;
  --accent-soft: rgba(0, 217, 255, 0.18);
  --accent-glow: rgba(0, 217, 255, 0.55);

  /* Typography */
  --font-display: "Fraunces", "GT Sectra", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", "Berkeley Mono", ui-monospace, "SFMono-Regular", monospace;

  /* Type scale */
  --display-xl: clamp(48px, 7.2vw, 104px);
  --display-l: clamp(40px, 5.6vw, 72px);
  --display-m: clamp(30px, 3.8vw, 52px);
  --display-s: clamp(24px, 2.4vw, 32px);
  --body-l: 20px;
  --body-m: 18px;
  --body-s: 16px;
  --mono-m: 13px;
  --mono-s: 11px;

  /* Layout */
  --container: 1240px;
  --gutter: clamp(20px, 4vw, 56px);
}

[data-accent="cyan"] {
  --accent: #2EE6F0;
  --accent-soft: rgba(46, 230, 240, 0.16);
  --accent-glow: rgba(46, 230, 240, 0.6);
}
[data-accent="amber"] {
  --accent: #ECB35A;
  --accent-soft: rgba(236, 179, 90, 0.16);
  --accent-glow: rgba(236, 179, 90, 0.55);
}
[data-accent="lime"] {
  --accent: #B6DE6F;
  --accent-soft: rgba(182, 222, 111, 0.16);
  --accent-glow: rgba(182, 222, 111, 0.5);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface-0);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--body-m);
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

/* Custom cursor */
body[data-cursor="on"] {
  cursor: none;
}
body[data-cursor="on"] a,
body[data-cursor="on"] button,
body[data-cursor="on"] [data-interactive] {
  cursor: none;
}
@media (hover: none), (pointer: coarse) {
  body[data-cursor="on"] {
    cursor: auto;
  }
  body[data-cursor="on"] a,
  body[data-cursor="on"] button {
    cursor: pointer;
  }
}

.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
              height 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 180ms ease,
              background 200ms ease;
  mix-blend-mode: normal;
  opacity: 0.85;
}
.cursor-dot.is-hover {
  width: 22px;
  height: 22px;
  background: transparent;
  border: 1.5px solid var(--accent);
  opacity: 1;
}
.cursor-dot.is-press {
  width: 5px;
  height: 5px;
}
@media (hover: none), (pointer: coarse) {
  .cursor-dot { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cursor-dot { display: none; }
  body[data-cursor="on"] { cursor: auto; }
  body[data-cursor="on"] a, body[data-cursor="on"] button { cursor: pointer; }
}

/* Selection */
::selection {
  background: var(--accent);
  color: var(--surface-0);
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* Header / nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: linear-gradient(to bottom, rgba(11,11,14,0.85), rgba(11,11,14,0.55));
  border-bottom: 1px solid var(--rule);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.wordmark__dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  transform: translateY(-7px);
  box-shadow: 0 0 12px var(--accent-glow);
}
.nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
}
.nav__link {
  font-family: var(--font-mono);
  font-size: var(--mono-s);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  position: relative;
  padding: 6px 0;
  transition: color 160ms ease;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 240ms cubic-bezier(0.4, 0, 0.2, 1);
}
.nav__link:hover { color: var(--text-primary); }
.nav__link:hover::after { transform: scaleX(1); }
.nav__link.is-active { color: var(--text-primary); }
.nav__link.is-active::after { transform: scaleX(1); background: var(--accent); }

/* Page transitions */
main {
  animation: pageIn 480ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  main { animation: none; }
}

.page-transition-line {
  position: fixed;
  inset: 50% 0 auto 0;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
  transform-origin: left;
  transform: scaleX(0);
  z-index: 100;
  pointer-events: none;
}
.page-transition-line.is-out {
  animation: lineSweep 420ms cubic-bezier(0.6, 0, 0.4, 1) forwards;
}
@keyframes lineSweep {
  0% { transform: scaleX(0); transform-origin: left; }
  50% { transform: scaleX(1); transform-origin: left; }
  51% { transform: scaleX(1); transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}

/* Section labels */
.section-label {
  font-family: var(--font-mono);
  font-size: var(--mono-s);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.section-label::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}

/* Headings */
.h-display-xl, .h-display-l, .h-display-m, .h-display-s {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: pretty;
}
.h-display-xl {
  font-size: var(--display-xl);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.h-display-l {
  font-size: var(--display-l);
  line-height: 1.04;
  letter-spacing: -0.03em;
}
.h-display-m {
  font-size: var(--display-m);
  line-height: 1.08;
}
.h-display-s {
  font-size: var(--display-s);
  line-height: 1.18;
  letter-spacing: -0.01em;
}

.lede {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.35;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
  font-style: italic;
  text-wrap: pretty;
}

.body-l {
  font-size: var(--body-l);
  line-height: 1.55;
  color: var(--text-secondary);
  text-wrap: pretty;
}
.body-m {
  font-size: var(--body-m);
  line-height: 1.7;
  color: var(--text-secondary);
  text-wrap: pretty;
}

.prose p + p { margin-top: 1.4em; }
.prose p { margin: 0; }

/* Links */
.text-link {
  color: var(--text-primary);
  text-decoration: none;
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  font-family: var(--font-body);
  transition: color 160ms ease;
}
.text-link__arrow {
  display: inline-block;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.text-link:hover { color: var(--accent); }
.text-link:hover .text-link__arrow { transform: translateX(4px); }
.text-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 1.4em;
  bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.text-link:hover::after { transform: scaleX(1); }

a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 1px;
}

/* Mono utility */
.mono {
  font-family: var(--font-mono);
  font-feature-settings: "ss02", "zero";
}

/* Hairline rule */
.rule {
  border: 0;
  height: 1px;
  background: var(--rule);
  margin: 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 120px;
  padding: 64px 0 40px;
  font-size: var(--body-s);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}
.site-footer__address {
  color: var(--text-tertiary);
  line-height: 1.8;
  font-size: 14px;
  max-width: 460px;
}
.site-footer__address .mono-strong {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.site-footer__address a {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
  transition: color 160ms ease, border-color 160ms ease;
}
.site-footer__address a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.site-footer__links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.site-footer__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}
.site-footer__links a {
  font-family: var(--font-mono);
  font-size: var(--mono-s);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 160ms ease;
}
.site-footer__links a:hover { color: var(--accent); }
.site-footer__bottom {
  margin-top: 64px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--mono-s);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Letter reveal for H2 */
.letter-reveal {
  display: inline-block;
}
.letter-reveal .word {
  display: inline-block;
  white-space: nowrap;
  margin-right: 0.25em;
}
.letter-reveal .ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.4em);
  transition: opacity 600ms ease, transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.letter-reveal.is-in .ch {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .letter-reveal .ch { opacity: 1; transform: none; transition: none; }
}

/* Section spacing */
.section {
  padding: clamp(80px, 12vh, 160px) 0;
  border-top: 1px solid var(--rule);
}
.section--first {
  border-top: 0;
}
.section__head {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 980px;
}

/* Two column section */
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
@media (max-width: 880px) {
  .two-col { grid-template-columns: 1fr; gap: 40px; }
}

/* Mobile nav adjust */
@media (max-width: 600px) {
  .nav { gap: 18px; }
  .site-footer__grid { grid-template-columns: 1fr; gap: 40px; }
  .site-footer__bottom { flex-direction: column; gap: 14px; }
}
