/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

@font-face {
  font-family: "DM Sans";
  src: url("/fonts/dm-sans-latin.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Mono";
  src: url("/fonts/dm-mono-latin-300.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Mono";
  src: url("/fonts/dm-mono-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Mono";
  src: url("/fonts/dm-mono-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Playfair Display";
  src: url("/fonts/playfair-display-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Playfair Display";
  src: url("/fonts/playfair-display-latin-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}

/* All design tokens are now defined once in brand_tokens.css (loaded first).
   This file only carries base element styles + component CSS that consume them. */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans), system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
textarea {
  font: inherit;
}

/* Bare buttons are reset by Tailwind preflight; styling is opt-in via the
   .btn system (app/assets/tailwind/application.css) so it never hijacks utilities. */
button {
  cursor: pointer;
}

/* Room-enter motion, applied via the `motion` Stimulus controller (enterClass).
   Keyframes are an escape hatch utilities can't express — keep here. */
@keyframes founders-room-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.motion-enter {
  animation: founders-room-enter 180ms ease-out both;
  animation-delay: var(--motion-delay, 0ms);
}

/* ═══ Forms ════════════════════════════════ */

.input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--background);
  padding: 0.75rem 1rem;
  color: var(--foreground);
  font-size: 1rem;
  transition: border-color 0.15s;
}

.input::placeholder {
  color: var(--fg-muted);
}

.input:focus {
  outline: none;
  border-color: var(--border-hover);
}

/* Button system unified in app/assets/tailwind/application.css (@layer components). */

/* Markdown-rendered Velros conversational replies in the product room.
   Tailwind preflight strips list/heading styling, so restore the basics here. */
.markdown-body > :first-child {
  margin-top: 0;
}

.markdown-body > :last-child {
  margin-bottom: 0;
}

.markdown-body p {
  margin: 0.5rem 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 1rem 0 0.5rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--foreground);
}

.markdown-body h1 {
  font-size: 1.25rem;
}

.markdown-body h2 {
  font-size: 1.125rem;
}

.markdown-body h3,
.markdown-body h4 {
  font-size: 1rem;
}

.markdown-body ul,
.markdown-body ol {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}

.markdown-body ul {
  list-style: disc;
}

.markdown-body ol {
  list-style: decimal;
}

.markdown-body li {
  margin: 0.25rem 0;
}

.markdown-body a {
  color: var(--accent-info);
  text-decoration: underline;
}

.markdown-body strong {
  font-weight: 600;
}

.markdown-body em {
  font-style: italic;
}

.markdown-body code {
  font-family: var(--font-mono), monospace;
  font-size: 1rem;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

.markdown-body pre {
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.markdown-body pre code {
  background: none;
  border: 0;
  padding: 0;
}

.markdown-body blockquote {
  margin: 0.75rem 0;
  padding-left: 0.875rem;
  border-left: 3px solid var(--border-hover);
  color: var(--fg-secondary);
}

.markdown-body hr {
  margin: 1rem 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.markdown-body table {
  margin: 0.75rem 0;
  width: 100%;
  border-collapse: collapse;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid var(--border);
  padding: 0.375rem 0.625rem;
  text-align: left;
}

.markdown-body th {
  background: var(--bg-surface-hover);
  font-weight: 600;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   Velros Brand — paper / deep-green ink / serif. Canonical: docs/DESIGN.md.
   Tokens are global (brand_tokens.css); the whole app renders on this system.
   `.brand` now only carries the RICH public-page treatment (gradient ground +
   serif) — the app shell uses the flat paper body background.

   COMPONENT LAYER (Tailwind-first policy): the `.brand-*` skin is the public-
   page design system — like the `.btn` system, it's a cohesive set of reusable
   classes, not ad-hoc CSS. It leans on multi-layer gradients, backdrop-filter,
   and untokenized translucent colors that utilities can't express without
   scattering raw colors into markup. Reuse these classes; don't inline-utility
   them. One-off layout/spacing in brand pages still uses utilities.
   ═══════════════════════════════════════════════════════════════════════ */

.brand {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 250, 242, 0.96), rgba(255, 250, 242, 0) 38rem),
    radial-gradient(ellipse at 12% 6%, rgba(220, 235, 212, 0.5), rgba(220, 235, 212, 0) 26rem),
    radial-gradient(ellipse at 88% 4%, rgba(220, 234, 246, 0.42), rgba(220, 234, 246, 0) 26rem),
    linear-gradient(180deg, var(--paper), var(--paper-deep));
  color: var(--ink);
  font-family: var(--brand-sans);
  font-size: 1rem;
  line-height: 1.55;
}

/* ── Layout ─────────────────────────────────────────────── */
.brand-container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.brand-section {
  padding: 5rem 0;
  border-top: 1px solid var(--line);
}

.brand-section:first-of-type {
  border-top: 0;
}

.brand-page {
  padding: 8rem 0 2rem; /* clear the fixed brand header */
}

/* ── Type ───────────────────────────────────────────────── */
.brand-eyebrow {
  font-family: var(--brand-sans);
  font-size: 1rem;
  font-weight: 820;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
}

.brand-h1 {
  font-family: var(--brand-serif);
  color: var(--green);
  font-size: clamp(2.75rem, 7vw, 5.25rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.045em;
  margin: 0;
}

.brand-h1 em {
  font-style: italic;
  font-weight: 430;
}

.brand-h2 {
  font-family: var(--brand-serif);
  color: var(--green);
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  margin: 0;
}

.brand-h3 {
  font-family: var(--brand-serif);
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}

.brand-lede {
  color: var(--ink-soft);
  font-size: 1.18rem;
  line-height: 1.5;
  margin: 1.25rem 0 0;
  max-width: 38rem;
}

.brand-body {
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.55;
}

.brand-muted {
  color: var(--ink-muted);
}

/* ── Cards & grids ──────────────────────────────────────── */
.brand-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.brand-card {
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  background: rgba(255, 250, 242, 0.62);
  backdrop-filter: blur(28px) saturate(1.18);
  box-shadow:
    0 1rem 3rem rgba(18, 63, 50, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  padding: 1.5rem;
}

.brand-card__num {
  font-family: var(--brand-sans);
  font-size: 1rem;
  font-weight: 820;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
}

/* ── Tags / badges ──────────────────────────────────────── */
.brand-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(18, 63, 50, 0.08);
  color: var(--ink-soft);
  padding: 0.2rem 0.55rem;
  font-size: 1rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-tag--live {
  background: var(--moss);
  color: var(--green);
}

/* ── Buttons (one system, brand context) ────────────────── */
.brand-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--green);
  color: var(--paper-warm);
  padding: 0.7rem 1.3rem;
  font-family: var(--brand-sans);
  font-size: 1rem;
  font-weight: 760;
  transition: transform 200ms var(--ease), background 200ms var(--ease);
}

.brand-btn:hover {
  transform: translateY(-1px);
  background: var(--green-bright);
  color: var(--ink);
}

.brand-btn--ghost {
  background: rgba(255, 250, 242, 0.6);
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.brand-btn--ghost:hover {
  background: rgba(255, 250, 242, 0.9);
  color: var(--green);
}

.brand-btn--block {
  width: 100%;
}

/* ── Header / footer ────────────────────────────────────── */
.brand-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: 4rem;
  background: rgba(248, 241, 231, 0.78);
  backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}

.brand-header__inner {
  max-width: 72rem;
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  color: var(--green);
  font-family: var(--brand-serif);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  user-select: none;
}

.brand-wordmark em {
  font-style: italic;
  font-weight: 500;
  font-size: 1.12em;
  margin: 0 -0.02em;
}

.brand-nav {
  display: none;
  align-items: center;
  gap: 1.6rem;
}

.brand-nav a {
  color: var(--nav-link);
  font-size: 1rem;
  font-weight: 600;
  transition: color 150ms var(--ease);
}

.brand-nav a:hover {
  color: var(--nav-link-hover);
}

.brand-footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0;
  color: var(--ink-muted);
  font-size: 1rem;
}

.brand-footer__inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 768px) {
  .brand-nav {
    display: flex;
  }
}
