/* ============================================================
   TRUSTIVE — one font, one ink, one canvas.
   Monospace manpage aesthetic (mobile-first).
   ============================================================ */

:root {
  --canvas: #fdfcfc;
  --surface-soft: #f8f7f7;
  --surface-card: #f1eeee;
  --surface-dark: #201d1d;
  --surface-dark-elevated: #302c2c;
  --ink: #201d1d;
  --ink-deep: #0f0000;
  --charcoal: #302c2c;
  --body: #424245;
  --mute: #646262;
  --ash: #9a9898;
  --hairline: rgba(15, 0, 0, 0.12);
  --hairline-strong: #646262;
  --on-dark: #fdfcfc;
  --accent: #007aff;
  --success: #30d158;
  --warning: #ff9f0a;
  --section: 48px;
  --font: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --canvas: #161414;
  --surface-soft: #1c1a1a;
  --surface-card: #242121;
  --surface-dark: #0d0b0b;
  --surface-dark-elevated: #242121;
  --ink: #fdfcfc;
  --ink-deep: #ffffff;
  --charcoal: #e8e6e6;
  --body: #c9c7c7;
  --mute: #9a9898;
  --ash: #6e6c6c;
  --hairline: rgba(253, 252, 252, 0.14);
  --hairline-strong: #6e6c6c;
  --on-dark: #fdfcfc;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  transition: background 0.35s ease, color 0.35s ease;
  overflow-x: hidden;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

.rule {
  border-top: 1px solid var(--hairline);
}

.section {
  padding: var(--section) 0;
}

.section__label {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--ink);
}

.body-copy { color: var(--body); margin-bottom: 16px; }

.caption {
  font-size: 14px;
  line-height: 2;
  color: var(--mute);
  margin-top: 8px;
}

/* ============ NAV ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 16px;
}

.nav__brand {
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav__brand { display: flex; align-items: center; }

.nav__logo { height: 26px; width: auto; display: block; }

/* Theme-swapped logos: black on light, white on dark */
[data-theme="light"] .logo--white { display: none; }
[data-theme="dark"] .logo--black { display: none; }

.nav__links {
  display: none;
  gap: 24px;
}

.nav__links a {
  color: var(--mute);
  text-decoration: none;
  font-weight: 500;
}
.nav__links a:hover { color: var(--ink); }

.theme-toggle {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--hairline-strong);
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--surface-card); }
[data-theme="light"] .theme-toggle__dark { display: none; }
[data-theme="dark"] .theme-toggle__light { display: none; }

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: calc(100svh - 56px);
  display: flex;
  align-items: center;
  overflow: hidden;
}

#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero__content {
  position: relative;
  z-index: 2;
  padding-top: 48px;
  padding-bottom: 64px;
  width: 100%;
}

.hero__badge { font-size: 14px; color: var(--mute); margin-bottom: 24px; }

.badge-dark {
  background: var(--surface-dark);
  color: var(--on-dark);
  font-size: 14px;
  padding: 2px 8px;
  border-radius: 4px;
}

.hero__wordmark { margin-bottom: 32px; }

.hero__logo {
  width: min(420px, 70vw);
  height: auto;
  display: block;
}

.hero__title {
  font-size: clamp(28px, 5vw, 38px);
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 16px;
  max-width: 720px;
}

.hero__title em {
  font-style: normal;
  background: var(--ink);
  color: var(--canvas);
  padding: 0 8px;
}

.hero__sub {
  color: var(--mute);
  font-size: 14px;
  margin-bottom: 32px;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero__scrollhint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--ash);
  font-size: 14px;
  z-index: 2;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-block;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
  line-height: 2;
  padding: 4px 20px;
  border-radius: 4px;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--ink);
  color: var(--canvas);
}
.btn--primary:hover { background: var(--ink-deep); }
[data-theme="dark"] .btn--primary:hover { background: #ffffff; }

.btn--secondary {
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--hairline-strong);
}
.btn--secondary:hover { background: var(--surface-card); }

/* ============ TUI / TYPEWRITER ============ */
.tui {
  background: var(--surface-dark);
  border-radius: 0;
  overflow: hidden;
}

.tui__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(253, 252, 252, 0.1);
}

.tui__dot {
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  background: var(--surface-dark-elevated);
  border: 1px solid #4a4646;
}

.tui__title {
  margin-left: 8px;
  color: #9a9898;
  font-size: 14px;
}

.tui__body { padding: 32px 20px 24px; }

.tui__prompt {
  color: #30d158;
  margin-bottom: 16px;
  font-weight: 500;
}

.tui__type {
  color: #fdfcfc;
  min-height: 12em;
  font-size: 16px;
  line-height: 1.8;
}

.tui__caret {
  color: #30d158;
  animation: blink 1s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.tui__hint {
  margin-top: 24px;
  color: #6e6c6c;
  font-size: 14px;
}

/* ============ MOMENT OF CHANGE ============ */
.moment__lines { max-width: 800px; }

.moment__line {
  font-size: clamp(24px, 4.5vw, 38px);
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink);
}

.moment__line--em {
  color: var(--mute);
  margin-top: 16px;
}

.moment__line--em .flip { color: var(--ink); }

/* ============ VIDEO PLAYER ============ */
.player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-dark);
  overflow: hidden;
  cursor: pointer;
}

.player__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity 0.3s ease, transform 0.6s ease;
}

.player:hover .player__poster { opacity: 1; transform: scale(1.02); }

.player__play {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(15, 0, 0, 0.35);
  border: 0;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.3s ease;
}
.player__play:hover { background: rgba(15, 0, 0, 0.2); }

.player__glyph {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  background: #fdfcfc;
  color: #201d1d;
  border-radius: 4px;
  font-size: 22px;
  padding-left: 4px;
}

.player__label {
  color: #fdfcfc;
  font-size: 14px;
  background: rgba(32, 29, 29, 0.7);
  padding: 2px 10px;
  border-radius: 4px;
}

.player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ============ THEMED FIGURES ============ */
.themed-figure { margin-bottom: 40px; }
.themed-figure:last-child { margin-bottom: 0; }

.themed-figure img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--hairline);
}

[data-theme="light"] .themed-figure__dark { display: none; }
[data-theme="dark"] .themed-figure__light { display: none; }
[data-theme="dark"] .themed-figure img { border-color: var(--hairline); }

/* ============ LINK BOXES ============ */
.linkboxes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.linkbox {
  position: relative;
  display: block;
  padding: 32px 24px;
  border: 1px solid var(--hairline-strong);
  border-radius: 4px;
  text-decoration: none;
  color: var(--ink);
  background: var(--canvas);
  transition: background 0.2s ease, transform 0.2s ease;
}

.linkbox:hover {
  background: var(--surface-soft);
  transform: translateY(-2px);
}

.linkbox__proto {
  display: block;
  font-size: 14px;
  color: var(--ash);
}

.linkbox__domain {
  display: block;
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 700;
  line-height: 1.5;
  margin: 4px 0 12px;
}

.linkbox__domain b { color: var(--mute); font-weight: 700; }

.linkbox__desc {
  display: block;
  font-size: 14px;
  color: var(--body);
}

.linkbox__arrow {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 22px;
  color: var(--mute);
  transition: transform 0.2s ease, color 0.2s ease;
}

.linkbox:hover .linkbox__arrow {
  transform: translateX(6px);
  color: var(--ink);
}

/* ============ PASSWORD NOTE ============ */
.passnote {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding: 16px 20px;
  border: 1px solid var(--hairline);
  background: var(--surface-soft);
  border-radius: 4px;
  font-size: 14px;
}

.passnote__text { color: var(--body); }

.passnote__chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface-card);
  border: 1px solid var(--hairline-strong);
  border-radius: 4px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.passnote__chip:hover { background: var(--canvas); border-color: var(--ink); }
.passnote__chip:active { transform: translateY(1px); }

.passnote__value { letter-spacing: 0.03em; }

.passnote__icon { color: var(--mute); font-size: 18px; line-height: 1; }
.passnote__chip:hover .passnote__icon { color: var(--ink); }

.passnote__copied {
  color: var(--success);
  font-size: 14px;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.passnote__chip.is-copied .passnote__copied { opacity: 1; transform: translateX(0); }
.passnote__chip.is-copied .passnote__icon { display: none; }

/* ============ SPOTIFY ============ */
.spotify iframe { display: block; border-radius: 12px; }

/* ============ FOOTER ============ */
.footer {
  border-top: 1px solid var(--hairline);
  padding: 32px 0;
}

.footer__links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 24px;
}

.footer__links a {
  color: var(--body);
  font-size: 14px;
  line-height: 2;
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1px solid var(--hairline);
}
.footer__links a:hover { color: var(--ink); }

.footer__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  color: var(--mute);
}

/* ============ REVEAL DEFAULTS (GSAP takes over) ============ */
.reveal { opacity: 1; }

/* ============ RESPONSIVE ============ */
@media (min-width: 640px) {
  :root { --section: 64px; }
  .footer__links { grid-template-columns: repeat(2, 1fr); }
  .tui__body { padding: 40px 32px 32px; }
  .tui__type { min-height: 8em; }
}

@media (min-width: 850px) {
  :root { --section: 96px; }
  .nav__links { display: flex; }
  .linkboxes { grid-template-columns: 1fr 1fr; }
  .footer__links { grid-template-columns: repeat(4, 1fr); }
  .container { padding: 0 32px; }
}

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