/* ==========================================================================
   Text2Tana Landing Page
   ========================================================================== */

/* --- Custom Properties --- */
:root {
  --bg: #0c0c10;
  --bg-alt: #111117;
  --bg-card: #16161e;
  --text: #e8e8f0;
  --text-muted: #8888a8;
  --accent: #f0b429;
  --accent-dim: rgba(240, 180, 41, 0.10);
  --accent-border: rgba(240, 180, 41, 0.25);
  --border: rgba(255, 255, 255, 0.07);
  --border-bright: rgba(255, 255, 255, 0.12);

  --neon-amber: #f0b429;
  --neon-cyan: #00e5ff;
  --neon-green: #7cfc9f;

  --indigo: oklch(23% 0.06 278);
  --terracotta: oklch(57% 0.13 36);
  --almost-white: #fbfbfa;
  --almost-white-rgb: 251, 251, 250;

  --font-heading: 'EB Garamond', 'Garamond', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Menlo', monospace;

  --max-width: 720px;
  --padding-x: 1.5rem;
  --section-spacing: 4.5rem;
}

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

/* --- Base --- */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* --- Typography --- */
h1 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.1;
  color: var(--text);
  letter-spacing: 0.02em;
  font-size: 3rem;
}

h2 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 1.75rem;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: 0.01em;
  margin-bottom: 1rem;
}

h3 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

p {
  font-family: var(--font-body);
  font-weight: 300;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

/* --- Layout --- */
.section {
  padding: var(--section-spacing) var(--padding-x);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section--alt {
  background-color: var(--bg-alt);
}

/* --- Hero --- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 5rem var(--padding-x) 4rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(240, 180, 41, 0.07) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.04) 3px,
    rgba(0, 0, 0, 0.04) 4px
  );
  pointer-events: none;
  z-index: 1;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
  display: block;
  opacity: 0.8;
}

.hero h1 {
  margin-bottom: 1rem;
}

.hero-subline {
  font-size: 1.15rem;
  color: var(--text-muted);
  font-weight: 300;
  margin-bottom: 2.5rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  background: transparent;
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  cursor: pointer;
}

.hero-cta:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* --- Code Preview --- */
.code-preview {
  margin-top: 3.5rem;
  text-align: left;
}

.code-preview-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  align-items: stretch;
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  overflow: hidden;
}

.code-panel {
  padding: 1.25rem 1.5rem;
  overflow: hidden;
}

.code-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg);
}

.code-arrow-inner {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  opacity: 0.4;
  writing-mode: initial;
  letter-spacing: 0.1em;
}

.code-panel-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  display: block;
}

.code-panel:nth-child(1) .code-panel-label { color: var(--neon-cyan); }
.code-panel:nth-child(3) .code-panel-label { color: var(--neon-amber); }

pre {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.6;
  overflow-x: auto;
  color: var(--text);
  white-space: pre;
}

/* Syntax colors */
.tok-key   { color: var(--neon-cyan); }
.tok-str   { color: #b5cea8; }
.tok-num   { color: #9cdcfe; }
.tok-kw    { color: #c586c0; }
.tok-sym   { color: var(--neon-amber); }
.tok-cmt   { color: #6a9955; opacity: 0.8; }

/* --- Syntax reference --- */
.syntax-table {
  margin-top: 2rem;
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border-bright);
}

.syntax-table th {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  text-align: left;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-bright);
}

.syntax-table td {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.syntax-table tr:last-child td {
  border-bottom: none;
}

.syntax-table td:first-child {
  color: var(--neon-amber);
  white-space: nowrap;
}

.syntax-table td:nth-child(2) {
  color: var(--text);
  font-weight: 400;
}

/* --- Steps --- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-top: 2rem;
}

.step {
  background: var(--bg-card);
  padding: 1.75rem 1.25rem;
  text-align: left;
}

.step-number {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  opacity: 0.6;
  margin-bottom: 0.75rem;
  display: block;
}

.step-text {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* --- Feature list --- */
.feature-list {
  list-style: none;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.feature-list li {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.5;
}

.feature-list li::before {
  content: '▸';
  color: var(--accent);
  font-size: 0.8rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
}

/* --- Code block --- */
.code-block {
  margin-top: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  overflow-x: auto;
}

.code-block pre {
  padding: 1.25rem 1.5rem;
}

/* --- CTA section --- */
.cta-section {
  text-align: center;
  border-top: 1px solid var(--border);
}

.cta-section h2 {
  margin-bottom: 0.75rem;
}

/* --- Footer --- */
.footer {
  padding: 2.5rem var(--padding-x);
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-brand {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  display: block;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.footer-brand:hover {
  opacity: 0.8;
  text-decoration: none;
  color: var(--text-muted);
}

.footer-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 300;
  margin: 0;
  opacity: 0.4;
}

/* --- Focus styles --- */
a:focus-visible,
.hero-cta:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

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

/* --- Scroll-driven reveals --- */
@supports (animation-timeline: view()) {
  .section,
  .footer {
    animation: section-reveal linear both;
    animation-duration: auto;
    animation-timeline: view();
    animation-range: entry 0% entry 28%;
  }
}

@keyframes section-reveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Responsive --- */
@media (max-width: 620px) {
  h1 {
    font-size: 2.25rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .hero {
    padding: 3.5rem var(--padding-x) 3rem;
  }

  .code-preview-grid {
    grid-template-columns: 1fr;
  }

  .code-arrow {
    border: none;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.5rem;
    writing-mode: initial;
  }

  .code-arrow-inner {
    writing-mode: vertical-rl;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .syntax-table th,
  .syntax-table td {
    padding: 0.6rem 0.75rem;
  }
}
