/* ============================================================
   CONVICTION — Protect Your Conviction
   type system: Cinzel (display only) · Lora (text) · Courier Prime (labels)
   ============================================================ */

:root {
  --abyss: #050805;
  --armor: #0B120B;
  --green: #52D726;
  --emerald: #1A4020;
  --ray: #E8F5E4;
  --body: #B7C6B1;
  --grey: #5C6B5C;
  --line: rgba(232, 245, 228, 0.08);
  --line-strong: rgba(232, 245, 228, 0.14);
  --card-bg: rgba(11, 18, 11, 0.72);
  --nav-bg: rgba(5, 8, 5, 0.8);
  --display: 'Cinzel', serif;
  --text: 'Lora', serif;
  --mono: 'Courier Prime', monospace;
  --card-w: min(500px, 86vw);

  /* motion & depth — one easing for everything */
  --transition: 0.3s cubic-bezier(0.25, 0.8, 0.3, 1);
  --radius: 14px;
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
  --glow-green: 0 0 24px rgba(82, 215, 38, 0.3);

  /* type scale — the only sizes used on the page */
  --fs-hero: clamp(56px, 10vw, 116px);
  --fs-quote: clamp(34px, 5vw, 64px);
  --fs-h2: clamp(28px, 3.6vw, 38px);
  --fs-lead: 21px;
  --fs-body: 18px;
  --fs-card: 17px;
  --fs-small: 16px;
  --fs-label: 12px;
}

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

html {
  scroll-behavior: smooth;
  background: var(--abyss);
}

body {
  background: var(--abyss);
  color: var(--ray);
  font-family: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(82, 215, 38, 0.25); color: var(--ray); }

a:focus-visible, button:focus-visible {
  outline: 1px solid var(--green);
  outline-offset: 3px;
}

/* ---------- ambient ---------- */

.ray {
  position: fixed;
  top: 0;
  left: 30%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(82, 215, 38, 0.03) 50%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

#ambient {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.grain {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 2;
}

/* ---------- shared primitives ---------- */

main { position: relative; z-index: 3; }

.section { padding: 120px 32px; }

.container-narrow {
  max-width: 720px;
  margin: 0 auto;
}

.label-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

.label {
  font-family: var(--mono);
  font-size: var(--fs-label);
  font-weight: 700;
  color: var(--green);
  letter-spacing: 4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.rule {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.h2 {
  font-family: var(--text);
  font-size: var(--fs-h2);
  font-weight: 500;
  color: var(--ray);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-top: 28px;
}

.prose {
  font-size: var(--fs-body);
  line-height: 1.85;
  color: var(--body);
  margin-top: 24px;
}

/* ---------- nav ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition);
}

.nav.scrolled {
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav-brand {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  color: var(--green);
  letter-spacing: 4px;
  text-decoration: none;
}

.nav-ca {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: var(--fs-label);
  color: var(--grey);
  letter-spacing: 0.5px;
  transition: color var(--transition);
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-ca:hover { color: var(--green); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-icon {
  color: var(--ray);
  display: flex;
  align-items: center;
  transition: color var(--transition);
}

.nav-icon:hover { color: var(--green); }

.nav-acquire {
  font-family: var(--mono);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--green);
  text-decoration: none;
  border: 1px solid var(--green);
  border-radius: 999px;
  padding: 8px 22px;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.nav-acquire:hover {
  background: var(--green);
  color: var(--abyss);
  box-shadow: var(--glow-green);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  height: 100vh;
  min-height: 620px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(5, 8, 5, 0.96) 0%, rgba(5, 8, 5, 0.6) 16%, transparent 34%),
    linear-gradient(to bottom, rgba(5, 8, 5, 0.25) 0%, transparent 30%);
}

.hero-content {
  position: relative;
  z-index: 3;
  padding: 0 32px 8vh;
  text-align: center;
  animation: hero-rise 1.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-title {
  font-family: var(--display);
  font-size: var(--fs-hero);
  font-weight: 700;
  color: var(--ray);
  letter-spacing: 2px;
  line-height: 1;
  text-shadow: 0 0 80px rgba(82, 215, 38, 0.2);
}

.hero-sub {
  font-family: var(--text);
  font-style: italic;
  font-size: var(--fs-lead);
  font-weight: 500;
  color: var(--green);
  margin-top: 18px;
}

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

/* ---------- buttons ---------- */

.btn {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  border-radius: 999px;
  padding: 15px 32px;
  transition: border-color var(--transition), color var(--transition), background var(--transition), box-shadow var(--transition);
}

.btn-solid {
  background: var(--green);
  border: 1px solid var(--green);
  color: var(--abyss);
}

.btn-solid:hover { box-shadow: var(--glow-green); }

.btn-ghost {
  border: 1px solid var(--line-strong);
  color: var(--ray);
}

.btn-ghost:hover { border-color: var(--green); }

.btn-archive {
  display: inline-block;
  color: var(--green);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 15px 34px;
}

.btn-archive:hover {
  border-color: var(--green);
  box-shadow: var(--glow-green);
}

/* ---------- II — the term ---------- */

.commandments {
  margin-top: 36px;
  padding-left: 28px;
  border-left: 1px solid var(--green);
}

.commandment {
  font-family: var(--text);
  font-style: italic;
  font-size: var(--fs-lead);
  font-weight: 500;
  color: var(--ray);
  line-height: 1.5;
  margin: 14px 0;
}

.term-final {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 4px;
  margin-top: 32px;
}

/* ---------- III — the archive (gallery) ---------- */

.archive {
  background: linear-gradient(180deg, transparent 0%, rgba(26, 64, 32, 0.1) 18%, rgba(26, 64, 32, 0.1) 82%, transparent 100%);
  overflow: hidden;
}

.gallery {
  position: relative;
  margin-top: 56px;
}

.gal-track {
  display: flex;
  align-items: center;
  gap: 28px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 12px calc(50vw - var(--card-w) / 2 - 32px);
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.gal-track::-webkit-scrollbar { display: none; }

.gal-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ray);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.gal-arrow:hover {
  border-color: var(--green);
  color: var(--green);
  box-shadow: var(--glow-green);
}

.gal-prev { left: max(20px, calc(50vw - var(--card-w) / 2 - 86px)); }
.gal-next { right: max(20px, calc(50vw - var(--card-w) / 2 - 86px)); }

.gal-counter {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 4px;
  color: var(--grey);
  text-align: center;
  margin-top: 28px;
}

.gal-counter #galIndex { color: var(--green); }

/* ---------- tweet cards ---------- */

.tweet {
  flex: 0 0 var(--card-w);
  scroll-snap-align: center;
  display: block;
  background: var(--card-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 26px 28px;
  text-decoration: none;
  color: var(--ray);
  opacity: 0.35;
  transform: scale(0.97);
  transition: border-color var(--transition), opacity 0.45s ease, transform 0.45s ease, box-shadow var(--transition);
}

.tweet.active {
  opacity: 1;
  transform: scale(1);
}

.tweet.active:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
}

.tweet-main { border-color: rgba(82, 215, 38, 0.45); }

.tweet-main.active:hover { border-color: var(--green); }

.tweet-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tweet-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  object-fit: cover;
  background: var(--abyss);
  flex-shrink: 0;
}

.tweet-id {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tweet-name {
  font-family: var(--text);
  font-weight: 600;
  font-size: var(--fs-small);
  color: var(--ray);
  display: flex;
  align-items: center;
  gap: 6px;
}

.verified { color: var(--green); flex-shrink: 0; }

.tweet-handle {
  font-family: var(--mono);
  font-size: var(--fs-label);
  color: var(--grey);
}

.tweet-text {
  font-size: var(--fs-card);
  line-height: 1.7;
  color: var(--ray);
  margin-top: 16px;
}

.cv {
  font-style: normal;
  font-weight: 600;
  color: var(--green);
}

.media-wrap {
  position: relative;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.tweet-media {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
}

.media-video::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(5, 8, 5, 0.7) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6.5v11l9-5.5z' fill='%23E8F5E4'/%3E%3C/svg%3E") center / 24px no-repeat;
  border: 1px solid var(--line-strong);
}

.tweet-stats {
  font-family: var(--mono);
  font-size: var(--fs-label);
  color: var(--grey);
  letter-spacing: 1px;
  margin-top: 16px;
}

.archive-more {
  text-align: center;
  margin-top: 44px;
}

/* ---------- IV — the code ---------- */

.code-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 56px;
}

.tenet {
  border-top: 1px solid var(--line-strong);
  padding-top: 28px;
  transition: border-color var(--transition);
}

.tenet:hover { border-top-color: rgba(82, 215, 38, 0.45); }

.tenet-num {
  font-family: var(--mono);
  font-size: var(--fs-label);
  font-weight: 700;
  color: var(--green);
  letter-spacing: 3px;
}

.tenet-title {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  color: var(--ray);
  letter-spacing: 5px;
  margin-top: 14px;
}

.tenet-text {
  font-size: var(--fs-small);
  line-height: 1.75;
  color: var(--body);
  margin-top: 16px;
}

/* ---------- V — big quote ---------- */

.bigquote {
  padding: 150px 32px;
  background: radial-gradient(ellipse 70% 55% at 50% 0%, rgba(82, 215, 38, 0.04), transparent);
  display: flex;
  justify-content: center;
}

.quote {
  font-family: var(--display);
  font-size: var(--fs-quote);
  font-weight: 700;
  color: var(--ray);
  line-height: 1.35;
  max-width: 900px;
  text-align: center;
  letter-spacing: 2px;
}

.qw {
  display: inline-block;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: calc(var(--i) * 90ms);
}

.quote.in .qw {
  opacity: 1;
  transform: translateY(0);
}

.qw-green { color: var(--green); }

/* ---------- footer ---------- */

.footer {
  position: relative;
  z-index: 3;
  background: #030503;
  padding: 72px 32px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.footer-logo {
  width: 56px;
  height: auto;
  opacity: 0.85;
  margin: 0 auto;
  display: block;
}

.footer-oath {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 4px;
  margin-top: 24px;
}

.footer-ca {
  margin-top: 18px;
}

.footer-ca-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: var(--fs-label);
  color: var(--grey);
  transition: color var(--transition);
  word-break: break-all;
}

.footer-ca-btn:hover { color: var(--green); }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 200;
  background: var(--card-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(82, 215, 38, 0.4);
  border-radius: 999px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 2px;
  padding: 11px 28px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: var(--d, 0ms);
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .code-grid { grid-template-columns: 1fr; gap: 44px; max-width: 720px; }
}

@media (max-width: 720px) {
  .nav { padding: 14px 20px; }
  .nav-ca { display: none; }
  .nav-right { gap: 16px; }
  .nav-acquire { padding: 7px 16px; }

  .section { padding: 88px 24px; }
  .hero-content { padding: 0 24px 7vh; }
  .hero-actions { margin-top: 26px; }
  .btn { padding: 14px 26px; }

  .archive { padding-left: 0; padding-right: 0; }
  .archive-head { padding: 0 24px; }
  .gal-track { gap: 16px; }
  .gal-arrow { display: none; }
  .tweet { padding: 22px 22px; }

  .bigquote { padding: 110px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-content { animation: none; }
  .reveal, .qw { opacity: 1; transform: none; transition: none; }
  .tweet { transition: border-color 0.3s ease; }
  #ambient { display: none; }
}
