/* Ensue B2B design system — champagne palette
   Paired with Tailwind tokens in src/_includes/head.njk.
   Keep this file restrained: form inputs, minimal load animations.
   No ambient motion (no pulses, no drifting scanlines, no blinking cursors). */

/* -------------------------------------------------------------------------- */
/* Design tokens                                                               */
/* Single source of truth for the champagne palette. Keep in sync with the    */
/* Tailwind config in head.njk so utility classes (bg-bg, text-fg, etc.) and  */
/* custom CSS render from the same values.                                    */
/* -------------------------------------------------------------------------- */

:root {
  --bg: #F5F3ED;
  --fg: #222222;
  --fg-dim: #8A857A;
  --border-col: #E3E0D8;
  --accent: #C3A96C;
  --accent-hover: #B89A5E;
  --accent-bg: #FDF8E4;
  /* RGB form of --accent for rgba() usage in grid backgrounds */
  --accent-rgb: 195, 169, 108;
}

/* -------------------------------------------------------------------------- */
/* Logo wordmark — Crimson Pro semibold, upright, tight tracking               */
/* Mirrors the exact styling of the live ensue.dev nav logo:                   */
/*   <a class="font-serif text-2xl font-semibold tracking-tight text-cream-900"> */
/* Defined directly (not via Tailwind fontFamily) because Tailwind's CDN       */
/* runtime can be unreliable generating custom fontFamily utilities.           */
/* -------------------------------------------------------------------------- */

.logo-wordmark {
  font-family: "Crimson Pro", Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-style: normal;
  letter-spacing: -0.025em;
  /* Optical centering fix: "ensue" is all lowercase with no ascenders or
     descenders, so its letterforms sit below the bounding-box center inside
     a flex container. Nudge up ~10% of the font size to visually center
     against neighboring uppercase/tracked text in the nav. */
  display: inline-block;
  transform: translateY(-0.08em);
}

/* Lock the nav logo size in static CSS so the Tailwind CDN boot delay can't
   produce a flash-of-oversized-logo on hard refresh. Mirrors `text-2xl md:text-3xl`. */
nav .logo-wordmark {
  font-size: 1.5rem;
  line-height: 1;
}

@media (min-width: 768px) {
  nav .logo-wordmark {
    font-size: 1.875rem;
  }
}

/* Hide the nav logo until webfonts are loaded. Without this, Crimson Pro is
   swapped in after first paint and the Georgia fallback renders noticeably
   wider, producing a visible "big logo → correct logo" flash. The
   `.fonts-loaded` class is added by an inline bootstrap script in head.njk. */
html:not(.fonts-loaded) nav .logo-wordmark {
  visibility: hidden;
}

/* -------------------------------------------------------------------------- */
/* Grid background — subtle 24px champagne grid, for sections that need       */
/* b2b editorial texture. Ported from hero-concepts/.                          */
/* -------------------------------------------------------------------------- */

.bg-grid {
  background-image:
    linear-gradient(to right, rgba(var(--accent-rgb), 0.10) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(var(--accent-rgb), 0.10) 1px, transparent 1px);
  background-size: 24px 24px;
  background-color: var(--bg);
}

.bg-grid-dense {
  background-image:
    linear-gradient(to right, rgba(var(--accent-rgb), 0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(var(--accent-rgb), 0.12) 1px, transparent 1px);
  background-size: 48px 48px;
  background-color: var(--bg);
}

/* Cross-lines: a sparser, larger grid for hero-scale sections */
.bg-grid-hero {
  background-image:
    linear-gradient(to right, rgba(var(--accent-rgb), 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(var(--accent-rgb), 0.08) 1px, transparent 1px);
  background-size: 96px 96px;
  background-color: var(--bg);
}

/* -------------------------------------------------------------------------- */
/* Mono eyebrow label — one per section                                        */
/* -------------------------------------------------------------------------- */

.eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

/* Gold variant — for section eyebrows that should read as b2b accent */
.eyebrow-accent {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Editorial section divider — thin dashed gold rule */
.rule-dashed-accent {
  border: none;
  border-top: 1px dashed var(--accent);
  opacity: 0.55;
  margin: 0;
}

/* Dashed gold container — use on key cards and primary visuals */
.frame-dashed-accent {
  border: 1px dashed var(--accent);
  position: relative;
}

/* -------------------------------------------------------------------------- */
/* Buttons                                                                     */
/* Three variants share the same shape (square, uppercase, tracked); they    */
/* only differ in background/border color. All ported from                    */
/* ensue-b2b-website/01 homepage.html.                                         */
/* -------------------------------------------------------------------------- */

.btn-accent,
.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem; /* px-8 py-4 */
  font-family: "Inter", sans-serif;
  font-size: 0.75rem; /* text-xs */
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-accent {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.btn-accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-primary {
  background: var(--fg);
  color: #ffffff;
  border-color: var(--fg);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.btn-primary:hover {
  background: #000;
  border-color: #000;
}

.btn-ghost {
  background: var(--bg);
  color: var(--fg);
  border-color: var(--border-col);
}
.btn-ghost:hover {
  border-color: var(--fg-dim);
}

/* -------------------------------------------------------------------------- */
/* Lead form — clean underline inputs (Granola style)                          */
/* -------------------------------------------------------------------------- */

.b2b-field {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.b2b-field label {
  font-family: "Lora", serif;
  font-size: 0.92rem;
  color: var(--fg);
  letter-spacing: 0.005em;
}

.b2b-field input,
.b2b-field select,
.b2b-field textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-col);
  padding: 0.65rem 0.2rem;
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  color: var(--fg);
  transition: border-color 0.2s ease;
  width: 100%;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}

.b2b-field input::placeholder,
.b2b-field textarea::placeholder {
  color: var(--fg-dim);
  opacity: 1;
}

.b2b-field input:focus,
.b2b-field select:focus,
.b2b-field textarea:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.b2b-field textarea {
  resize: vertical;
  min-height: 5.5rem;
  line-height: 1.55;
}

.b2b-field select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='%238A857A' stroke-width='1' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.25rem center;
  padding-right: 1.25rem;
}

/* -------------------------------------------------------------------------- */
/* Single load animation — one fade-up per section                             */
/* Motion is for moments, not decoration.                                      */
/* -------------------------------------------------------------------------- */

@keyframes b2b-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up {
  opacity: 0;
  animation: b2b-fade-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.fade-up.delay-1 { animation-delay: 0.10s; }
.fade-up.delay-2 { animation-delay: 0.22s; }
.fade-up.delay-3 { animation-delay: 0.34s; }
.fade-up.delay-4 { animation-delay: 0.46s; }
.fade-up.delay-5 { animation-delay: 0.58s; }

/* Timeline path draw-in for the hero SVG */
@keyframes b2b-draw {
  to { stroke-dashoffset: 0; }
}
.draw-line {
  stroke-dasharray: var(--draw-len, 1200);
  stroke-dashoffset: var(--draw-len, 1200);
  animation: b2b-draw 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.draw-line.delay-1 { animation-delay: 0.2s; }
.draw-line.delay-2 { animation-delay: 0.7s; }

/* -------------------------------------------------------------------------- */
/* Arrow link — inline text link with animated chevron on hover                */
/* -------------------------------------------------------------------------- */

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--fg);
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.arrow-link:hover {
  border-bottom-color: var(--accent);
}
.arrow-link .arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}
.arrow-link:hover .arrow {
  transform: translateX(3px);
}

/* -------------------------------------------------------------------------- */
/* Card helpers — blog index + case study grid                                 */
/* -------------------------------------------------------------------------- */

.card-lift {
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.card-lift:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Day chips — small rectangular labels used inside the autoresearch card
   on the blog index to link to each daily report. */
.day-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
  background: transparent;
  border: 1px solid var(--border-col);
  border-radius: 2px;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.day-chip:hover {
  border-color: var(--accent);
  color: var(--fg);
  background: var(--accent-bg);
}

/* -------------------------------------------------------------------------- */
/* Editorial section divider                                                   */
/* -------------------------------------------------------------------------- */

.rule-gold {
  border: none;
  border-top: 1px solid var(--accent);
  opacity: 0.35;
  margin: 0;
}

/* -------------------------------------------------------------------------- */
/* Anchor scroll offset — accounts for fixed nav height                        */
/* -------------------------------------------------------------------------- */

html {
  scroll-behavior: smooth;
}

section[id] {
  scroll-margin-top: 5rem;
}

/* -------------------------------------------------------------------------- */
/* Reduced motion                                                              */
/* -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .fade-up,
  .draw-line {
    animation: none !important;
    opacity: 1;
    transform: none;
    stroke-dashoffset: 0;
  }
  html {
    scroll-behavior: auto;
  }
  .case-slides {
    transition: none !important;
  }
}

/* -------------------------------------------------------------------------- */
/* Anchor-nav active state + carousel transition (script.js DOM contract)      */
/* -------------------------------------------------------------------------- */

nav a.is-active {
  color: var(--fg);
  font-weight: 500;
}
.case-slides {
  transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
