/* ==========================================================================
   Barely Artificial — base stylesheet
   Brand tokens per Barely_Artificial_Brand_Style_Guide_v1.1
   ========================================================================== */

:root {
  --sky-cyan: #38bdf8;
  --light-blue: #7dd3fc;
  --mid-blue: #0284c7;
  --deep-navy: #0c4a6e;
  --near-black: #09090b;
  --white: #ffffff;

  --ink: #142130;
  --ink-soft: #3f4a5c;
  --border-soft: #e2e8f0;
  --surface-alt: #f4f8fb;

  --bat-teal: #0d9488;
  --services-amber: #d97706;

  --font-head: "Rajdhani", "Arial", sans-serif;
  --font-body: "Rajdhani", "Arial", sans-serif;
  --font-mono: "Share Tech Mono", "Courier New", monospace;

  --container-w: 1160px;
  --radius: 4px;

  --shadow-card: 0 1px 2px rgba(12, 74, 110, 0.06), 0 8px 24px rgba(12, 74, 110, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--mid-blue);
  text-decoration: none;
}

a:hover {
  color: var(--deep-navy);
  text-decoration: underline;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.12;
  margin: 0 0 0.5em;
  color: var(--deep-navy);
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); }
h3 { font-size: clamp(1.35rem, 2.2vw, 1.75rem); }
h4 { font-size: 1.15rem; text-transform: uppercase; letter-spacing: 0.06em; }

p { margin: 0 0 1em; }

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}

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

.eyebrow {
  font-family: var(--font-mono);
  color: var(--mid-blue);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  margin: 0 0 0.9em;
  display: inline-block;
}

.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;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--deep-navy);
  color: var(--white);
  padding: 10px 16px;
  z-index: 200;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  padding: 13px 26px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--mid-blue);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--deep-navy);
  color: var(--white);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border-color: var(--mid-blue);
  color: var(--mid-blue);
}
.btn-outline:hover {
  background: var(--mid-blue);
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  color: var(--deep-navy);
  padding-left: 0;
  padding-right: 0;
  border: none;
}
.btn-ghost:hover { color: var(--mid-blue); }

.btn-block { width: 100%; justify-content: center; }

/* Header / Nav
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--deep-navy);
}
.brand:hover { text-decoration: none; color: var(--deep-navy); }

.brand-mark {
  color: var(--mid-blue);
  flex-shrink: 0;
}

.brand-word {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.brand-word b { color: var(--mid-blue); font-weight: 700; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-nav a:not(.btn) {
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.94rem;
  text-decoration: none;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.site-nav .btn {
  flex-shrink: 0;
  white-space: nowrap;
}
.site-nav a:not(.btn):hover,
.site-nav a:not(.btn).is-active {
  color: var(--mid-blue);
  border-bottom-color: var(--sky-cyan);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 20px;
  margin: 0 auto;
  background: var(--deep-navy);
}

@media (max-width: 1140px) {
  .nav-toggle { display: flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--white);
    border-bottom: 1px solid var(--border-soft);
    padding: 10px 24px 20px;
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a:not(.btn) { width: 100%; padding: 10px 0; }
  .site-nav .btn { margin-top: 8px; }
}

/* Footer
   ========================================================================== */

.site-footer {
  background: var(--white);
  border-top: 1px solid var(--border-soft);
  padding: 56px 0 28px;
  margin-top: 96px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 40px;
}

@media (max-width: 780px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

.footer-grid > div { min-width: 0; }

.footer-brand .brand { margin-bottom: 10px; }
.footer-strap {
  font-family: var(--font-mono);
  color: var(--mid-blue);
  font-size: 0.85rem;
}

.footer-col h4 {
  color: var(--deep-navy);
  font-size: 0.85rem;
  margin-bottom: 14px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--ink-soft); font-size: 0.96rem; overflow-wrap: break-word; }
.footer-col a:hover { color: var(--mid-blue); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.footer-portal {
  font-size: 0.8rem;
  color: #94a3b8;
}
.footer-portal a { color: #94a3b8; }

.build-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #cbd5e1;
  letter-spacing: 0.02em;
}

/* Sections / layout
   ========================================================================== */

.section {
  padding: 88px 0;
}
.section-tight { padding: 48px 0 16px; }
.section-alt { background: var(--surface-alt); }

.section-head {
  max-width: 720px;
  margin: 0 0 32px;
}
.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.lead {
  font-size: 1.2rem;
  color: var(--ink-soft);
}

.grid {
  display: grid;
  gap: 28px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-card);
}

.card-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--mid-blue);
  margin-bottom: 10px;
}

/* Hero
   ========================================================================== */

.hero {
  padding: 72px 0 88px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

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

.hero h1 { margin-bottom: 0.4em; }

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 30px 0 14px;
}

.hero-microcopy {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* Terminal card (the one sanctioned dark surface) */

.terminal {
  background: var(--near-black);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(9, 9, 11, 0.35);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  background: #17171b;
}
.terminal-bar span {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #3f3f46;
}
.terminal-bar .t-title {
  margin-left: 10px;
  font-family: var(--font-mono);
  color: #71717a;
  font-size: 0.8rem;
}

.terminal-body {
  padding: 26px 22px 30px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--light-blue);
  min-height: 220px;
}
.terminal-body .prompt { color: #71717a; }
.terminal-body .line { margin: 0 0 10px; white-space: pre-wrap; }
.terminal-body .ok { color: var(--sky-cyan); }
.terminal-body .ok-services { color: var(--services-amber); }
.terminal-body .ok-training { color: var(--bat-teal); }
.terminal-body .cursor {
  display: inline-block;
  width: 8px; height: 1em;
  background: var(--sky-cyan);
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Arm cards (three-arm snapshot)
   ========================================================================== */

.arm-card {
  border-top: 4px solid var(--mid-blue);
  padding-top: 22px;
}
.arm-card.arm-training { border-top-color: var(--bat-teal); }
.arm-card.arm-services { border-top-color: var(--services-amber); }

.arm-card h3 { margin-bottom: 0.3em; }
.arm-card .arm-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 12px;
}

/* CTA panel
   ========================================================================== */

.cta-panel {
  background: var(--deep-navy);
  border-radius: 8px;
  padding: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}
.cta-panel h3, .cta-panel p { color: var(--white); }
.cta-panel p { color: #cbd5e1; }
.cta-panel .btn-primary { background: var(--sky-cyan); color: var(--near-black); }
.cta-panel .btn-primary:hover { background: var(--white); color: var(--near-black); }

/* Gnarly Rating widget
   ========================================================================== */

.gnarly-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  font-family: var(--font-head);
  font-weight: 600;
}
.gnarly-row span:last-child { color: var(--mid-blue); }

input[type="range"] {
  width: 100%;
  margin: 6px 0 24px;
  accent-color: var(--mid-blue);
}

.gnarly-result {
  text-align: center;
  padding-top: 8px;
}
.gnarly-score {
  font-family: var(--font-mono);
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-bottom: 6px;
}
.gnarly-band {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.6rem;
  padding: 4px 4px;
  margin-bottom: 10px;
}
.gnarly-smooth { color: #16a34a; }
.gnarly-bit-gnarly { color: #ca8a04; }
.gnarly-properly-gnarly { color: #ea580c; }
.gnarly-very-gnarly { color: #dc2626; }

.gnarly-meter-track {
  height: 8px;
  border-radius: 4px;
  background: #e2e8f0;
  overflow: hidden;
  margin-bottom: 16px;
}
.gnarly-meter-fill {
  height: 100%;
  background: #16a34a;
  border-radius: 4px;
  transition: width 0.2s ease, background-color 0.2s ease;
}
.gnarly-meter-fill.gnarly-smooth { background: #16a34a; }
.gnarly-meter-fill.gnarly-bit-gnarly { background: #ca8a04; }
.gnarly-meter-fill.gnarly-properly-gnarly { background: #ea580c; }
.gnarly-meter-fill.gnarly-very-gnarly { background: #dc2626; }

/* Forms
   ========================================================================== */

.field {
  display: block;
  margin-bottom: 18px;
}
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--white);
  color: var(--ink);
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--sky-cyan);
  outline-offset: 1px;
}
.honeypot-field { position: absolute; left: -9999px; top: -9999px; }

.contact-status-ok { color: #16a34a; font-weight: 600; }
.contact-status-error { color: #dc2626; font-weight: 600; }

.of-idea {
  border-left: 3px solid var(--sky-cyan);
  padding: 4px 0 4px 16px;
}
.of-idea h4 {
  color: var(--deep-navy);
  font-size: 1rem;
  margin-bottom: 4px;
  text-transform: none;
  letter-spacing: normal;
}
.of-idea p { margin: 0; color: var(--ink-soft); font-size: 0.96rem; }

/* Long-form article body
   ========================================================================== */

.prose {
  max-width: 720px;
  margin: 0 auto;
}
.prose h2 { margin-top: 1.6em; }
.prose p { color: var(--ink-soft); }
.prose .lead { color: var(--ink); }

.article-meta {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

/* Blog list
   ========================================================================== */

.post-list { display: flex; flex-direction: column; }
.post-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border-soft);
  text-decoration: none;
  color: inherit;
}
.post-row:hover h3 { color: var(--mid-blue); text-decoration: none; }
.post-row .post-date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
  white-space: nowrap;
}
.post-row h3 { margin: 0; font-size: 1.2rem; }

/* Product screenshots
   ========================================================================== */

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}
.screenshot-grid .screenshot-full { grid-column: 1 / -1; }
@media (max-width: 780px) {
  .screenshot-grid { grid-template-columns: 1fr; }
}
.screenshot-frame {
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-soft);
  line-height: 0;
  background: var(--surface-alt);
}
.screenshot-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top center;
}
.screenshot-caption {
  margin-top: 10px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

/* Product tier cards */
.tier-card { display: flex; flex-direction: column; }
.tier-card .tier-number {
  font-family: var(--font-mono);
  color: var(--mid-blue);
  font-size: 0.85rem;
  margin-bottom: 10px;
}

/* Product catalogue cards */
.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.product-card .product-code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.product-card p { flex-grow: 1; }
.product-card.is-upcoming {
  background: var(--surface-alt);
  border-style: dashed;
}
.status-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.status-badge.live { background: #dcfce7; color: #15803d; }
.status-badge.coming-next { background: #fef3c7; color: #b45309; }
.status-badge.coming-soon { background: var(--border-soft); color: var(--ink-soft); }

/* Duck mark */
.duck-mark { color: var(--mid-blue); }

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.small { font-size: 0.9rem; color: var(--ink-soft); }
.divider {
  border: none;
  border-top: 1px solid var(--border-soft);
  margin: 56px 0;
}
