/* ==========================================================================
   Bestall Ventures, LLC
   Design tokens transcribed from the Stitch "Refined Portfolio Workspace"
   screen (blueprint aesthetic: fine grid, mono labels, drafting blue).
   ========================================================================== */

:root {
  /* Color */
  --bg:                 #f9f9f9;
  --surface:            #ffffff;
  --surface-container:  #f3f3f3;
  --on-surface:         #1a1c1c;
  --on-surface-variant: #434656;
  --outline:            #737688;
  --stroke-grid:        #f0f0f0;
  --stroke-strong:      #e2e2e2;
  --blue:               #0057ff;

  /* Geometry */
  --radius:      2px;
  --margin:      48px;
  --gutter:      24px;
  --nav-h:       64px;
  --maxw:        1400px;

  /* Type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
               "Liberation Mono", monospace;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--on-surface);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Persistent blueprint grid, per the design system's 24px cells. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right,  var(--stroke-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--stroke-grid) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.6;
}

img, svg { max-width: 100%; }
a { color: inherit; }

::selection { background: var(--blue); color: #fff; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--blue);
  color: #fff;
  padding: 12px 20px;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* Keep anchor targets clear of the fixed nav. */
#main,
#portfolio,
#studio { scroll-margin-top: calc(var(--nav-h) + 24px); }

/* --------------------------------------------------------------- Utilities */

.mono-eyebrow {
  display: block;
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--blue);
  margin-bottom: 16px;
}

.accent { color: var(--blue); }

/* -------------------------------------------------------------------- Nav */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-h);
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 0 var(--margin);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--stroke-grid);
}

.nav__group {
  display: flex;
  align-items: center;
  gap: 48px;
  min-width: 0;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-decoration: none;
  white-space: nowrap;
}

/* Modular cube emblem (Stitch "Bestall Ventures - Modular Cube Emblem"). */
.nav__mark {
  display: block;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.nav__links { display: flex; align-items: center; gap: 32px; }

.nav__link {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--on-surface-variant);
  text-decoration: none;
  padding-bottom: 2px;
  transition: color 0.15s ease;
}
.nav__link:hover { color: var(--on-surface); }

.nav__link.is-active {
  color: var(--blue);
  border-bottom: 1px solid var(--blue);
}

/* ----------------------------------------------------------------- Buttons */

.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 14px 32px;
  transition: background-color 0.15s ease, border-color 0.15s ease,
              transform 0.15s ease, color 0.15s ease;
}

.btn--solid { background: var(--blue); color: #fff; }
.btn--solid:hover { transform: translateY(-1px); }

.btn--ghost {
  background: transparent;
  border-color: var(--stroke-strong);
  color: var(--on-surface);
}
.btn--ghost:hover { border-color: var(--on-surface); }

/* -------------------------------------------------------------------- Hero */

main { padding-top: var(--nav-h); }

.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 96px var(--margin) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero__title {
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 32px;
}

.hero__lede {
  max-width: 32rem;
  margin: 0 0 48px;
  color: var(--on-surface-variant);
  opacity: 0.9;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
}

/* ------------------------------------------------------------------ Ticker */

.ticker {
  max-width: var(--maxw);
  margin: 96px auto;
  padding: 24px 0;
  border-top: 1px solid var(--stroke-grid);
  border-bottom: 1px solid var(--stroke-grid);
  overflow: hidden;
}

.ticker__track {
  display: flex;
  gap: 64px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 var(--margin);
}

.ticker__item {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--on-surface-variant);
  opacity: 0.4;
  white-space: nowrap;
}

.ticker__item.is-accent { color: var(--blue); opacity: 0.6; }

/* --------------------------------------------------------------- Portfolio */

.portfolio {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--margin) 128px;
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 48px;
  align-items: start;
}

.featured__title {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
}

.featured__body {
  color: var(--on-surface-variant);
  max-width: 34rem;
  margin: 0 0 48px;
}

/* Product screenshots. The frame keeps the blueprint border treatment but
   carries no padding — the shot is meant to bleed to the frame edge. Source
   captures are 1440x900 (16:10), so `cover` crops a little top and bottom. */
.featured__frame {
  aspect-ratio: 16 / 9;
  background: var(--surface);
  border: 1px solid var(--stroke-grid);
  border-radius: var(--radius);
  margin-bottom: 24px;
  overflow: hidden;
}

.featured__shot,
.card__shot {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.card__frame {
  aspect-ratio: 16 / 9;
  border: 1px solid var(--stroke-grid);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

/* Product logo marks, sourced from each property's own favicon. */
.logo-mark {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  flex-shrink: 0;
}
.logo-mark--sm { width: 28px; height: 28px; border-radius: 6px; }

.featured__head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.featured__head .featured__title { margin: 0; }

.card__name {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.featured__link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
.featured__link:hover { border-bottom-color: var(--blue); }

/* ------------------------------------------------------------ Product cards */

.systems { display: flex; flex-direction: column; }

.card {
  position: relative;
  display: block;
  background: var(--surface);
  border: 1px solid var(--stroke-grid);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.card + .card { margin-top: 24px; }
.card:hover { border-color: var(--blue); }

.card__rail {
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--blue);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.card:hover .card__rail { opacity: 1; }

.card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
}

.card__title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  margin: 0;
  transition: color 0.15s ease;
}
.card:hover .card__title { color: var(--blue); }

.card__badge {
  flex: none;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--blue);
  background: rgba(0, 87, 255, 0.08);
  padding: 2px 8px;
}

.card__body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--on-surface-variant);
  opacity: 0.85;
  margin: 0 0 24px;
}

.card__meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--outline);
}

/* ------------------------------------------------------------------ Studio */

.studio {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--margin) 128px;
}

.studio__grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 48px;
  align-items: start;
}

.studio__title {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0;
}

.studio__body { color: var(--on-surface-variant); }
.studio__body p { margin: 0 0 24px; }

/* ------------------------------------------------------------------ Footer */

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 32px;
  padding: 48px var(--margin);
  background: var(--surface);
  border-top: 1px solid var(--stroke-grid);
}

.footer__left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 32px;
}

.footer__note,
.footer__copy,
.footer__links a {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.footer__note { color: var(--outline); opacity: 0.6; }
.footer__copy { color: var(--outline); opacity: 0.6; }

.footer__links { display: flex; flex-wrap: wrap; gap: 24px; }

.footer__links a {
  color: var(--on-surface-variant);
  text-decoration: none;
  transition: color 0.15s ease;
}
.footer__links a:hover { color: var(--blue); }

/* ------------------------------------------------------------- Responsive */

@media (max-width: 900px) {
  .portfolio,
  .studio__grid { grid-template-columns: 1fr; }

  .featured__body { margin-bottom: 32px; }
  .systems { margin-top: 16px; }
}

@media (max-width: 640px) {
  :root { --margin: 20px; }

  .nav__links { display: none; }
  .nav__group { gap: 0; }

  .hero { padding-top: 64px; }
  .hero__actions { width: 100%; flex-direction: column; gap: 16px; }
  .hero__actions .btn { width: 100%; }

  .ticker { margin: 64px auto; }
  .ticker__track { gap: 20px; justify-content: flex-start; }

  .portfolio,
  .studio { padding-bottom: 80px; }

  .featured__frame { padding: 16px; }

  .footer { flex-direction: column; align-items: flex-start; gap: 24px; }
  .footer__left { flex-direction: column; align-items: flex-start; gap: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
