/* ==========================================================================
   Molotov Studios — design system
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,500;9..144,600&family=JetBrains+Mono:wght@400;500;600;700&family=Inter:wght@400;500&display=swap');

:root {
  --bg: #0A0A09;
  --surface: #141412;
  --surface-hover: #1B1B18;
  --text: #E8E3D3;
  --text-muted: #8B8578;
  --border: #2A2822;
  --accent: #C9A876;

  --font-display: 'Fraunces', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Menlo, monospace;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --container: 1120px;
  --gutter: clamp(20px, 5vw, 64px);
}

/* -------------------------------------------------------------------------
   Reset
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

ul { list-style: none; margin: 0; padding: 0; }
button { font: inherit; }

h1, h2, h3 { margin: 0; font-weight: 500; }

/* Visible keyboard focus */
a:focus-visible,
button:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 3px;
}

/* -------------------------------------------------------------------------
   Utility text styles
   ------------------------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 1.25rem;
}

.display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.02;
}

.mono {
  font-family: var(--font-mono);
}

/* -------------------------------------------------------------------------
   Layout shell
   ------------------------------------------------------------------------- */
.shell {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.page {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1;
}

/* -------------------------------------------------------------------------
   Marginal vertical text
   ------------------------------------------------------------------------- */
.margin-text {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 18px;
  display: flex;
  align-items: center;
  z-index: 5;
  pointer-events: none;
}

.margin-text span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .margin-text { display: none; }
}

/* -------------------------------------------------------------------------
   Header / nav
   ------------------------------------------------------------------------- */
.site-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--border);
}

.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.brand {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.brand:hover { color: var(--accent); }

.main-nav ul {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
}

.main-nav a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.header-clock {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.header-clock .tick { color: var(--accent); }

@media (max-width: 640px) {
  .header-clock { display: none; }
  .main-nav ul { gap: 1rem; }
}

/* -------------------------------------------------------------------------
   Hero (Home)
   ------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding-top: clamp(3rem, 10vw, 6rem);
  padding-bottom: clamp(4rem, 12vw, 8rem);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to bottom, rgba(10,10,9,0.15) 0%, rgba(10,10,9,0.55) 55%, var(--bg) 92%),
    url('../assets/hero-duotone.png');
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
}

.hero-headline {
  font-size: clamp(2.75rem, 8vw, 5.5rem);
  margin-bottom: 1.25rem;
}

.hero-subhead {
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--text);
  max-width: 42ch;
  margin: 0 0 1.75rem;
}

.status-line {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

.status-line .sep { opacity: 0.5; }
.status-line .live-tick { color: var(--accent); }
.status-line .status-value { color: var(--text); }

/* -------------------------------------------------------------------------
   Section wrapper
   ------------------------------------------------------------------------- */
.section {
  padding-top: clamp(2.5rem, 6vw, 4.5rem);
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.section-border-top {
  border-top: 1px solid var(--border);
}

.page-headline {
  font-size: clamp(2.25rem, 5.5vw, 3.5rem);
  max-width: 18ch;
  margin-bottom: 2.5rem;
}

/* -------------------------------------------------------------------------
   Dossier row component
   ------------------------------------------------------------------------- */
.dossier {
  border-top: 1px solid var(--border);
}

.dossier-row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 1rem 2rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.dossier-row .label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.dossier-row .value {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
}

.dossier-row .value a {
  border-bottom: 1px solid var(--border);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.dossier-row .value a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 560px) {
  .dossier-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

/* -------------------------------------------------------------------------
   Stat block
   ------------------------------------------------------------------------- */
.stat-block {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem 1rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 0;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.stat .num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  color: var(--text);
  line-height: 1;
}

.stat .label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.35;
}

@media (max-width: 640px) {
  .stat-block {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 2rem;
  }
}

/* -------------------------------------------------------------------------
   Body copy
   ------------------------------------------------------------------------- */
.prose {
  max-width: 60ch;
}

.prose p {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text);
  margin: 0 0 1.35em;
}

.prose p:last-child { margin-bottom: 0; }

/* -------------------------------------------------------------------------
   Buttons / CTA
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--accent);
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--accent);
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.btn:hover {
  background: transparent;
  color: var(--accent);
}

.btn:active { transform: translateY(1px); }

/* -------------------------------------------------------------------------
   Project cards
   ------------------------------------------------------------------------- */
.project-grid {
  display: grid;
  gap: 1.5rem;
}

.project-card {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.project-card:hover {
  background: var(--surface-hover);
  border-color: var(--text-muted);
}

.project-card .test-id {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.75rem;
}

.project-card .project-name {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 0.6rem;
}

.project-card .result {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.project-card .desc {
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  max-width: 60ch;
}

.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.stack-tags .tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.3rem 0.65rem;
}

.project-card .view-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  display: inline-block;
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.project-card .view-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 2.5rem;
}

.footer-flourish {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.footer-text {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.barcode {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 26px;
}

.barcode span {
  display: block;
  width: 2px;
  background: var(--text-muted);
  opacity: 0.7;
}

/* pseudo-random bar widths/heights via nth-child */
.barcode span:nth-child(1)  { height: 100%; width: 2px; }
.barcode span:nth-child(2)  { height: 60%;  width: 1px; }
.barcode span:nth-child(3)  { height: 85%;  width: 3px; }
.barcode span:nth-child(4)  { height: 45%;  width: 1px; }
.barcode span:nth-child(5)  { height: 100%; width: 2px; }
.barcode span:nth-child(6)  { height: 70%;  width: 1px; }
.barcode span:nth-child(7)  { height: 55%;  width: 2px; }
.barcode span:nth-child(8)  { height: 90%;  width: 1px; }
.barcode span:nth-child(9)  { height: 40%;  width: 3px; }
.barcode span:nth-child(10) { height: 100%; width: 1px; }
.barcode span:nth-child(11) { height: 65%;  width: 2px; }
.barcode span:nth-child(12) { height: 80%;  width: 1px; }
.barcode span:nth-child(13) { height: 50%;  width: 2px; }
.barcode span:nth-child(14) { height: 95%;  width: 1px; }
.barcode span:nth-child(15) { height: 60%;  width: 3px; }
.barcode span:nth-child(16) { height: 100%; width: 1px; }
.barcode span:nth-child(17) { height: 35%;  width: 2px; }
.barcode span:nth-child(18) { height: 75%;  width: 1px; }

/* -------------------------------------------------------------------------
   Reduced motion
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
