/* ═══════════════════════════════════════════════════════════ */
/* Landing mockup — revised, decluttered                        */
/* Design tokens (colors, typography, spacing, radii) come from */
/* static/css/design-tokens.css, generated from DESIGN.md via   */
/* `bun run design:export`.                                     */
/* ═══════════════════════════════════════════════════════════ */

:root {
  /* Derived tokens — opacity variants of design colors. color-mix()
   * adapts automatically to the active theme's accent. */
  --accent-dim: color-mix(in oklab, var(--accent) 12%, transparent);
  --accent-ring: color-mix(in oklab, var(--accent) 10%, transparent);
  --accent-border: color-mix(in oklab, var(--accent) 40%, transparent);
  --bg-card-hover: #17171c;

  /* Layout — landing-specific chrome */
  --rail-w: 56px;

  /* Motion — not part of the design token spec */
  --dur-fast: 0.12s;
  --dur: 0.2s;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-ui);
  background: var(--bg-root);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  display: flex;
  overflow: hidden;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
}

/* Keyboard focus ring — visible on every theme, never for mouse users. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.prompt-input:focus-visible {
  outline: none;
}

/* ═══════════════════════════════════════════════════════════ */
/* Icon rail                                                    */
/* ═══════════════════════════════════════════════════════════ */

.rail {
  width: var(--rail-w);
  min-width: var(--rail-w);
  background: var(--bg-rail);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0 14px;
  height: 100vh;
}

.rail-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(
    140deg,
    var(--accent-bright) 0%,
    var(--accent) 100%
  );
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  margin-bottom: 18px;
  box-shadow: 0 2px 10px rgba(202, 138, 4, 0.25);
}

.rail-logo-mark {
  font-family: var(--font-ui);
  letter-spacing: -0.02em;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  align-items: center;
}

.rail-btn {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition:
    background var(--dur-fast),
    color var(--dur-fast);
  position: relative;
}

.rail-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.rail-btn.is-active {
  background: var(--accent-dim);
  color: var(--accent-bright);
}

.rail-btn.is-active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: var(--accent-bright);
}

.rail-divider {
  width: 20px;
  height: 1px;
  background: var(--border);
  margin: 10px 0;
}

.rail-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.rail-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  display: grid;
  place-items: center;
}

.rail-avatar:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

/* Tooltips on rail buttons */
[data-tip] {
  position: relative;
}

[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 9px;
  border-radius: 5px;
  border: 1px solid var(--border-accent);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity var(--dur-fast),
    transform var(--dur-fast);
  z-index: 100;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

[data-tip]:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ═══════════════════════════════════════════════════════════ */
/* Stage (main content)                                         */
/* ═══════════════════════════════════════════════════════════ */

.stage {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  padding: 56px 72px 80px;
  display: flex;
  flex-direction: column;
  gap: 72px;
  position: relative;
}

/* Ambient gradient glow behind hero */
.stage::before {
  content: "";
  position: absolute;
  top: -220px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 520px;
  background: radial-gradient(
    closest-side,
    rgba(234, 179, 8, 0.08),
    rgba(234, 179, 8, 0) 70%
  );
  pointer-events: none;
  z-index: 0;
}

/* ═══════════════════════════════════════════════════════════ */
/* Hero                                                         */
/* ═══════════════════════════════════════════════════════════ */

.hero {
  max-width: 780px;
  width: 100%;
  margin: 80px auto 0;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.hero-title {
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 32px;
  color: var(--text-primary);
}

/* Prompt input — the hero interaction */
.prompt {
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  padding: 18px 18px 12px;
  text-align: left;
  transition:
    border-color var(--dur),
    box-shadow var(--dur);
  box-shadow: var(--shadow-card), var(--highlight-top);
}

.prompt:focus-within {
  border-color: var(--accent);
  box-shadow:
    0 0 0 4px var(--accent-ring),
    var(--shadow-card);
}

.prompt-input {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  resize: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  padding: 4px 6px 12px;
}

.prompt-input::placeholder {
  color: var(--text-dim);
}

.prompt-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.prompt-toolbar-left {
  display: flex;
  gap: 6px;
  align-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 999px;
  transition:
    border-color var(--dur-fast),
    color var(--dur-fast);
}

.chip:hover {
  color: var(--text-primary);
  border-color: #3f3f46;
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 6px var(--accent-bright);
}

.icon-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--text-muted);
  transition:
    background var(--dur-fast),
    color var(--dur-fast);
}

.icon-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 8px;
  transition:
    background var(--dur-fast),
    transform var(--dur-fast);
}

.btn-primary:hover {
  background: var(--accent-bright);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.hero-hint {
  margin-top: 18px;
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--text-secondary);
  margin: 0 1px;
}

/* ═══════════════════════════════════════════════════════════ */
/* Rows (Recent, Templates)                                     */
/* ═══════════════════════════════════════════════════════════ */

.row {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
  padding: 0 2px;
}

.row-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.row-link {
  font-size: 12px;
  color: var(--text-muted);
  transition: color var(--dur-fast);
}

.row-link:hover {
  color: var(--text-primary);
}

.row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.row-grid--templates {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* ═══════════════════════════════════════════════════════════ */
/* Project card                                                 */
/* ═══════════════════════════════════════════════════════════ */

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-card), var(--highlight-top);
  transition:
    border-color var(--dur),
    transform var(--dur);
}

.project-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.project-thumb {
  aspect-ratio: 16 / 10;
  position: relative;
  overflow: hidden;
}

.project-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.4) 100%);
}

.project-thumb--a {
  background: linear-gradient(135deg, #7c2d12, #431407 60%, #1c0a05);
}

.project-thumb--b {
  background:
    radial-gradient(circle at 30% 30%, #334155, transparent 50%),
    linear-gradient(135deg, #0f172a, #020617);
}

.project-thumb--c {
  background: linear-gradient(135deg, #78350f, #431407 70%, #0c0a09);
}

.project-thumb--d {
  background:
    radial-gradient(circle at 70% 40%, #134e4a, transparent 50%),
    linear-gradient(135deg, #042f2e, #020617);
}

.project-thumb--e {
  background: linear-gradient(135deg, #450a0a, #1c1917 70%, #0c0a09);
}

.project-meta {
  padding: 12px 14px 14px;
}

.project-meta h3 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}

.project-meta span {
  font-size: 11.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ═══════════════════════════════════════════════════════════ */
/* Template card                                                */
/* ═══════════════════════════════════════════════════════════ */

.template-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-card), var(--highlight-top);
  transition:
    border-color var(--dur),
    background var(--dur);
}

.template-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.template-art {
  aspect-ratio: 16 / 9;
  background:
    repeating-linear-gradient(
      45deg,
      transparent 0 12px,
      rgba(255, 255, 255, 0.015) 12px 13px
    ),
    linear-gradient(135deg, #0f0f13, #050507);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px;
}

.template-art-node {
  width: 22px;
  height: 30px;
  border: 1px solid var(--border-accent);
  background: var(--bg-surface);
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  position: relative;
}

.template-art-node::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.03),
    transparent 60%
  );
}

.template-art--storyboard .template-art-node:nth-child(1) {
  border-color: var(--accent-border);
}

.template-art--brand .template-art-node:nth-child(1) {
  border-color: rgba(45, 212, 191, 0.4);
}

.template-art--landing .template-art-node:nth-child(2) {
  transform: translateY(-6px);
}

.template-art--landing .template-art-node:nth-child(3) {
  transform: translateY(6px);
}

.template-art--product .template-art-node:nth-child(1) {
  border-color: rgba(139, 92, 246, 0.4);
}

.template-art--multipage .template-art-node {
  height: 24px;
  width: 18px;
}

.template-meta {
  padding: 12px 14px 14px;
}

.template-meta h3 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}

.template-meta span {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════ */
/* Scrollbar                                                    */
/* ═══════════════════════════════════════════════════════════ */

.stage::-webkit-scrollbar {
  width: 10px;
}

.stage::-webkit-scrollbar-track {
  background: transparent;
}

.stage::-webkit-scrollbar-thumb {
  background: var(--border-accent);
  border-radius: 5px;
  border: 2px solid var(--bg-root);
}

.stage::-webkit-scrollbar-thumb:hover {
  background: #3f3f46;
}

/* ═══════════════════════════════════════════════════════════ */
/* Responsive                                                   */
/* ═══════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .stage {
    padding: 40px 24px 60px;
    gap: 48px;
  }

  .hero {
    margin-top: 40px;
  }

  .hero-title {
    font-size: 30px;
  }
}
