/* ==========================================================================
   X1Q1 Labs — shared stylesheet (the only stylesheet)
   Plain CSS, no build step. Design spec: docs/site_specifications.md
   Aesthetic: warm workshop — dark graphite/brown, off-white text, brass accents.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  --bg: #17130f;
  --bg-soft: #211b16;
  --panel: #2a231d;
  --panel-light: #352c24;
  --text: #f4eadc;
  --muted: #b8a996;
  --subtle: #7d6f60;      /* fails AA on --bg for body text: large/decorative only */
  --border: #4a3c30;
  --accent: #d49a45;
  --accent-soft: #f0c987;
  --danger-muted: #9f6b5f;

  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background-color: var(--bg);
  /* Faint bench grid (graph-paper feel). Panels, header, and footer have
     opaque backgrounds, so the grid only shows in the deep background.
     Line color is --border (#4a3c30) at low alpha; rgba is used because
     gradients can't reference custom properties with added transparency. */
  background-image:
    linear-gradient(rgba(74, 60, 48, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 60, 48, 0.16) 1px, transparent 1px);
  background-size: 34px 34px;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  line-height: 1.25;
}

a {
  color: var(--accent-soft);
}

a:hover {
  color: var(--accent);
}

/* Visible keyboard focus everywhere, in the accent color */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   3. Skip link (first element in <body>; hidden until focused)
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -999rem;
  top: 0;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-decoration: none;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* --------------------------------------------------------------------------
   4. Layout
   -------------------------------------------------------------------------- */
.wrap {
  max-width: 70rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

main {
  padding-block: 2.5rem 4rem;
}

.section {
  margin-block: 3.25rem 0;
}

.section-title {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  margin: 0 0 0.75rem;
  font-size: 1.45rem;
}

/* --------------------------------------------------------------------------
   5. Header & navigation (no JS: flex row that wraps on narrow screens)
   -------------------------------------------------------------------------- */
.site-header {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.75rem;
  padding-block: 1rem;
}

.wordmark {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--text);
  text-decoration: none;
}

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

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--accent-soft);
}

.site-nav a[aria-current="page"] {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   6. Hero (homepage)
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  z-index: 0;
}

/* Decorative schematic light bulb behind the hero's right side: an inline
   aria-hidden <svg> in index.html, so each part can animate on its own. Sits
   behind the text (z-index) and is hidden on narrow screens where it would
   overlap the headline. Pulse added 2026-10-31. */
.hero-bulb {
  position: absolute;
  z-index: -1;
  top: -0.5rem;
  right: 1.25rem;
  width: 15rem;
  height: 21rem;
  fill: none;
  stroke-linecap: round;
  pointer-events: none;
}

@media (max-width: 60rem) {
  .hero-bulb {
    display: none;
  }
}

.bulb-glass {
  stroke: var(--border);
  stroke-width: 2.5;
  opacity: 0.55;
}

.bulb-glow {
  opacity: 0.18;
  animation: bulb-surge 7.3s ease-in-out infinite;
}

.bulb-glow-core {
  stop-color: var(--accent-soft);
  stop-opacity: 0.75;
}

.bulb-glow-edge {
  stop-color: var(--accent);
  stop-opacity: 0;
}

.bulb-filament {
  stroke: var(--accent);
  stroke-width: 2.5;
  opacity: 0.6;
}

.bulb-filament--hot {
  stroke: var(--accent-soft);
  opacity: 0.35;
  animation: bulb-current 4.7s linear infinite;
}

.bulb-rays {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 2 7;
}

.bulb-rays path {
  opacity: 0.3;
  animation: bulb-arc 5.3s linear infinite;
}

/* CSS can't randomize, so the irregularity comes from timing: every part runs
   on its own prime-numbered duration (in tenths of a second) and offset, so the
   combined pattern never visibly repeats. Keep new durations prime and unique.
   Only opacity animates, which keeps this cheap to paint. */
.bulb-rays path:nth-child(1) { animation-duration: 3.7s; animation-delay: -1.1s; }
.bulb-rays path:nth-child(2) { animation-duration: 6.1s; animation-delay: -4.3s; }
.bulb-rays path:nth-child(3) { animation-duration: 4.3s; animation-delay: -0.4s; }
.bulb-rays path:nth-child(4) { animation-duration: 7.9s; animation-delay: -2.9s; }
.bulb-rays path:nth-child(5) { animation-duration: 5.9s; animation-delay: -5.2s; }
.bulb-rays path:nth-child(6) { animation-duration: 3.1s; animation-delay: -1.9s; }
.bulb-rays path:nth-child(7) { animation-duration: 6.7s; animation-delay: -3.4s; }

/* Keep peaks at least 1/3 second apart in all of these: three flashes a second
   is the WCAG 2.3.1 limit for flashing content. */

/* Slow swell of the light around the bulb */
@keyframes bulb-surge {
  0%, 100% { opacity: 0.18; }
  14% { opacity: 0.34; }
  22% { opacity: 0.2; }
  38% { opacity: 0.46; }
  48% { opacity: 0.24; }
  63% { opacity: 0.3; }
  72% { opacity: 0.55; }
  84% { opacity: 0.2; }
}

/* Filament: an uneven hum with sudden surges and brief sags */
@keyframes bulb-current {
  0%, 100% { opacity: 0.35; }
  8% { opacity: 0.85; }
  15% { opacity: 0.3; }
  24% { opacity: 0.45; }
  32% { opacity: 1; }
  39% { opacity: 0.4; }
  52% { opacity: 0.55; }
  58% { opacity: 0.2; }
  67% { opacity: 0.9; }
  76% { opacity: 0.35; }
  87% { opacity: 1; }
  94% { opacity: 0.4; }
}

/* Rays: resting, then a quick double crackle early in each cycle */
@keyframes bulb-arc {
  0%, 30%, 100% { opacity: 0.3; }
  8% { opacity: 1; }
  15% { opacity: 0.35; }
  21% { opacity: 0.8; }
}

/* Honors the system setting: the bulb stays lit, it just stops pulsing */
@media (prefers-reduced-motion: reduce) {
  .bulb-glow,
  .bulb-filament--hot,
  .bulb-rays path {
    animation: none;
  }
}

.hero h1 {
  margin: 0.5rem 0 1rem;
  font-size: clamp(1.7rem, 1.15rem + 2.4vw, 2.6rem);
  max-width: 30ch;
}

.hero-sub {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 58ch;
  margin: 0;
}

/* --------------------------------------------------------------------------
   7. Buttons
   -------------------------------------------------------------------------- */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: var(--bg);
}

.btn-secondary {
  color: var(--accent-soft);
}

.btn-secondary:hover {
  background: var(--panel);
  color: var(--accent-soft);
}

/* --------------------------------------------------------------------------
   8. Cards & badges (shared across products, projects, notes, contact)
   -------------------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

/* Single-column stack for note/paper lists */
.card-list {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
  max-width: 70ch;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

.card--quiet {
  background: var(--bg-soft);
  border-style: dashed;
}

.card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
}

.card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.card h3 a {
  color: var(--text);
  text-decoration: none;
}

.card h3 a:hover {
  color: var(--accent-soft);
  text-decoration: underline;
}

.card p {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-cta {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

/* Muted non-link marker for URLs that don't exist yet (never a dead <a>) */
.coming-soon {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-style: italic;
}

/* Light backing for bright product art. Dark outlines disappear against the
   workshop panels, so transparent logos sit on this plate. Added 2026-11-01. */
.art-plate {
  background: var(--text);
  border-radius: 6px;
  padding: 0.75rem;
}

.art-plate img {
  display: block;
}

/* Homepage spotlight: one live product shown larger than the card grid. Flex-wrap
   stacks the art above the copy on narrow screens, with no media query.
   Added 2026-11-01. */
.spotlight {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem 2.5rem;
  margin-top: 1.5rem;
}

.spotlight-art {
  flex: 1 1 15rem;
  max-width: 22rem;
}

.spotlight-body {
  flex: 999 1 20rem;
  min-width: 0;
}

.spotlight h3 {
  font-size: 1.45rem;
}

/* --------------------------------------------------------------------------
   9. Prose (readable measure for body copy, notes, product pages)
   -------------------------------------------------------------------------- */
.prose {
  max-width: 70ch;
}

.prose p {
  margin: 0 0 1rem;
}

.prose h2 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.35rem;
}

.lede {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 70ch;
}

.note-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.back-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-top: 2.5rem;
}

.quiet-note {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
  margin-top: 2rem;
  max-width: 70ch;
}

/* --------------------------------------------------------------------------
   10. Product pages
   -------------------------------------------------------------------------- */
.product-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between; /* title left, status badge right */
  gap: 0.5rem 1rem;
}

.product-header h1 {
  margin: 0;
}

/* Two-column product layout: prose + collaborate on the left, Assets as a
   right sidebar. Flex-wrap does the responsive work without a media query:
   the sidebar keeps a 16rem (~256px) basis and wraps below the main column
   whenever the row can't fit both. */
.product-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 2rem 3rem;
  margin-top: 2rem;
}

.product-main {
  flex: 999 1 34rem; /* huge grow factor: absorbs spare width before the aside */
  min-width: 0;
}

.product-main > .prose > h2:first-child {
  margin-top: 0;
}

.product-aside {
  flex: 1 1 16rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

.product-aside h2 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

/* Assets definition list */
.asset-list {
  margin: 1rem 0 0;
  max-width: 70ch;
}

.asset-list dt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 1.1rem;
}

.asset-list dd {
  margin: 0.35rem 0 0;
}

/* Real product screenshots with captions, in the main column because the
   sidebar is too narrow to read them. Added 2026-11-01. */
.shot-list {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.shot {
  margin: 0;
}

.shot img {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.shot figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Text-only placeholder blocks for assets that don't exist yet (no fake <img>) */
.placeholder {
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-align: center;
  padding: 2.25rem 1rem;
}

/* --------------------------------------------------------------------------
   11. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding-block: 2rem 2.5rem;
}

.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-nav a:hover {
  color: var(--accent-soft);
}

.footer-tagline {
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 70ch;
  margin: 1.25rem 0 0.35rem;
}

.footer-copyright {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  margin: 0;
}
