/* ============================================
   waves-ruby.avi.nyc — Stylesheet
   Based on avi.nyc microsite base template
   ============================================ */

:root {
  --bg: #000000;
  --surface: #080808;
  --surface-elevated: #0F0F0F;
  --surface-code: #0d1117;
  --text: #FFFFFF;
  --text-secondary: #A0A0A0;
  --text-tertiary: #505050;
  --accent-primary: #C74B7A;
  --accent-secondary: #4ECDC4;
  --accent-tertiary: #E8A849;
  --border: #1a1a1a;
  --border-light: #252525;

  --font-serif: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier Prime', Menlo, monospace;
}

/* ── Reset & Base ── */

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(199, 75, 122, 0.3);
}

/* ── Typography ── */

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1.25rem;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  margin-top: 2rem;
}

p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

p:last-child {
  margin-bottom: 0;
}

strong {
  color: var(--text);
  font-weight: 600;
}

a {
  color: var(--accent-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-primary);
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-elevated);
  color: var(--accent-secondary);
  padding: 0.15em 0.4em;
  border-radius: 2px;
}

/* ── Lists ── */

ul {
  list-style: none;
  padding: 0;
  margin-bottom: 1.5rem;
}

ul li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-secondary);
}

/* ── Hero ── */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(255, 165, 0, 0.04) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 50%, rgba(179, 217, 255, 0.03) 0%, transparent 60%);
  pointer-events: none;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-primary);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color 0.2s ease;
}

.eyebrow:hover {
  color: var(--accent-secondary);
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.1;
  max-width: 720px;
  margin-bottom: 1rem;
}

.lead {
  font-size: 1.15rem;
  color: var(--accent-secondary);
  margin-bottom: 2.5rem;
  max-width: 480px;
}

/* ── Terminal ── */

.terminal {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 2px;
  width: 100%;
  max-width: 520px;
  text-align: left;
  margin-bottom: 3rem;
}

.terminal-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-light);
}

.terminal-dot:first-child { background: #ff5f57; }
.terminal-dot:nth-child(2) { background: #febc2e; }
.terminal-dot:nth-child(3) { background: #28c840; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-left: auto;
  margin-right: auto;
}

.terminal-body {
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.terminal-prompt {
  color: var(--accent-secondary);
  font-weight: 500;
}

.terminal-output {
  color: var(--text-tertiary);
}

.terminal-str {
  color: var(--accent-tertiary);
}

/* ── Scroll Hint ── */

.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.2s ease;
  animation: bounce 1.5s infinite;
}

.scroll-hint:hover {
  color: var(--text-secondary);
}

.scroll-hint span {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ── Content ── */

.content {
  max-width: 720px;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
}

section {
  margin-bottom: 4.5rem;
}

section:last-child {
  margin-bottom: 0;
}

/* ── Note/Aside ── */

.note {
  border-left: 3px solid var(--accent-tertiary);
  background: rgba(232, 168, 73, 0.05);
  padding: 1rem 1.5rem;
  border-radius: 2px;
  margin-bottom: 1.5rem;
}

.note p {
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* ── Code Blocks ── */

.code-block {
  position: relative;
  background: var(--surface-code);
  border: 1px solid var(--border);
  border-radius: 2px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.code-block[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  pointer-events: none;
}

.code-block pre {
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 0;
}

.code-block code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  background: none;
  padding: 0;
  color: var(--text-secondary);
}

.tok-comment { color: var(--text-tertiary); }
.tok-operator { color: var(--accent-secondary); }
.tok-hash { color: var(--accent-secondary); }
.tok-str { color: var(--accent-tertiary); }
.tok-num { color: var(--accent-primary); }

/* ── Copy Button ── */

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border-light);
  border-radius: 2px;
  color: var(--text-tertiary);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.code-block:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  color: var(--text-secondary);
  background: var(--border);
}

.copy-btn.copied {
  color: var(--accent-secondary);
}

.coda .copy-btn {
  top: auto;
  bottom: 0.5rem;
}

/* ── Table ── */

.table-wrap {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

thead th {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-tertiary);
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
}

tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

tbody tr:hover {
  background: var(--surface);
}

/* ── Coda ── */

.coda {
  text-align: center;
  border-top: 1px solid var(--border);
  padding-top: 3rem;
}

.coda .code-block {
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.5rem;
}

.coda-links {
  font-size: 0.92rem;
}

.coda-links a {
  color: var(--text-tertiary);
  transition: color 0.2s ease;
}

.coda-links a:hover {
  color: var(--accent-secondary);
}

/* ── Scroll Reveal ── */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ── Footer ── */

footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
}

.footer-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.footer-inner a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-inner a:hover {
  color: var(--accent-secondary);
}

.footer-sep {
  color: var(--border-light);
}

/* ── Scrollbar ── */

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ── Responsive ── */

@media (max-width: 640px) {
  body { font-size: 16px; }

  .hero {
    min-height: 90vh;
    padding: 1.5rem 1rem;
  }

  .hero h1 { font-size: 2.5rem; }
  .lead { font-size: 1.05rem; }

  .content { padding: 3rem 1rem 4rem; }
  section { margin-bottom: 3.5rem; }

  h2 { font-size: 1.6rem; }
  h3 { font-size: 1.25rem; }

  .code-block code { font-size: 0.8rem; }
  .copy-btn { opacity: 1; }

  .terminal { max-width: 100%; }
  .terminal-body { font-size: 0.78rem; padding: 1rem 1.25rem; }
}

/* ── Accessibility ── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html { scroll-behavior: auto; }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
