/* ============================================================
   SOLOSOUNDLY — styles.css
   Single source of truth for all visual tokens.
   See BRAND_TOKENS.md for the design system reference.
   ============================================================ */

/* ============================================================
   DESIGN TOKENS — CSS Custom Properties
   ============================================================ */

:root {
  /* --- Colors --- */
  --accent:        #8A6300;  /* deep amber */
  --accent-strong: #6A4D00;  /* deeper amber */
  --accent-soft:   #F5E9C0;  /* pale gold */
  --bg:            #F5F5F2;  /* clean off-white */
  --surface:       #ECECEA;  /* light grey */
  --surface-alt:   #E3E3E0;  /* slightly deeper */
  --text:          #111110;  /* near-black */
  --muted:         #666662;  /* mid grey */
  --inverse:       #F5F5F2;  /* off-white */
  --border:        #DDDDD8;  /* light border */

  /* --- Typography — font families --- */
  --font-mono: 'Space Mono', 'Courier New', monospace;
  --font-sans: 'DM Sans', system-ui, sans-serif;

  /* --- Typography — fluid type scale --- */
  --text-xs:   clamp(0.75rem,  0.70rem + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.82rem + 0.28vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.30vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1.05rem + 0.45vw, 1.35rem);
  --text-xl:   clamp(1.25rem,  1.10rem + 0.75vw, 1.6rem);
  --text-2xl:  clamp(1.5rem,   1.20rem + 1.40vw, 2.25rem);
  --text-3xl:  clamp(2rem,     1.50rem + 2.50vw, 3.2rem);
  --text-4xl:  clamp(2.5rem,   1.80rem + 3.50vw, 4.5rem);

  /* --- Typography — letter spacing --- */
  --tracking-tight: -0.02em;
  --tracking-snug:  -0.01em;
  --tracking-body:   0.005em;
  --tracking-wide:   0.14em;

  /* --- Typography — line height --- */
  --leading-tight: 1.1;
  --leading-snug:  1.3;
  --leading-body:  1.7;
  --leading-lede:  1.55;

  /* --- Spacing — fluid scale --- */
  --space-1: clamp(0.5rem,  0.40rem + 0.40vw, 0.75rem);
  --space-2: clamp(0.75rem, 0.60rem + 0.70vw, 1.2rem);
  --space-3: clamp(1rem,    0.90rem + 0.90vw, 1.6rem);
  --space-4: clamp(1.5rem,  1.20rem + 1.40vw, 2.4rem);
  --space-5: clamp(2rem,    1.60rem + 2.20vw, 3.6rem);
  --space-6: clamp(3rem,    2.20rem + 3.80vw, 5.5rem);

  /* --- Section padding --- */
  --section-space: clamp(3rem, 2rem + 4.5vw, 6.5rem);

  /* --- Container --- */
  --container-max:    1080px;
  --container-narrow: 680px;
  --container-gutter: clamp(1.5rem, 1rem + 2vw, 4rem);

  /* --- Border radius — tighter for technical feel --- */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-pill: 999px;

  /* --- Shadows --- */
  --shadow:      0 8px 24px rgba(17, 17, 16, 0.08);
  --shadow-soft: 0 4px 14px rgba(17, 17, 16, 0.05);
  --shadow-lift: 0 16px 36px rgba(17, 17, 16, 0.12);

  /* --- Animation --- */
  --ease-reveal:     cubic-bezier(0.2, 0.65, 0.2, 1);
  --duration-reveal: 600ms;
  --duration-fast:   200ms;

  /* --- Layout --- */
  --header-height: 64px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--text);
  background-color: var(--bg);
  letter-spacing: var(--tracking-body);
  overflow-x: hidden;
}

/* Subtle dot texture — overlays the whole page, pointer-events-free */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(
    circle,
    rgba(17, 17, 16, 0.055) 1px,
    transparent 1px
  );
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 9999;
}

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

a {
  color: inherit;
}

/* ============================================================
   CURSOR ANIMATION
   ============================================================ */

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--accent);
  margin-left: 0.2em;
  vertical-align: text-bottom;
  animation: blink 1.1s step-end infinite;
}

@media (prefers-reduced-motion: reduce) {
  .cursor {
    animation: none;
    opacity: 1;
  }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

/* Skip to content */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--text);
  color: var(--bg);
  padding: 0.5em 1.25em;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  z-index: 10000;
  transition: top var(--duration-fast) var(--ease-reveal);
}

.skip-link:focus {
  top: 1rem;
}

/* Global focus-visible styles */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ============================================================
   SCROLL REVEAL
   gated by html.js — no animation without JavaScript
   ============================================================ */

html.js .reveal {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity  var(--duration-reveal) var(--ease-reveal),
    transform var(--duration-reveal) var(--ease-reveal);
}

html.js .reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Disable all motion when user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  html.js .reveal,
  html.js .reveal.revealed {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-gutter);
  width: 100%;
}

.container-narrow {
  max-width: var(--container-narrow);
}

/* ============================================================
   TYPOGRAPHY UTILITIES
   ============================================================ */

/* Code-comment style label */
.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--muted);
  margin-bottom: var(--space-2);
}

/* ============================================================
   COMPONENTS — Button
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.7em 1.4em;
  background: var(--accent);
  color: var(--bg);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition:
    background  var(--duration-fast) ease,
    box-shadow  var(--duration-fast) ease,
    transform   var(--duration-fast) ease;
}

.btn:hover {
  background: var(--accent-strong);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--accent-strong);
  border-color: var(--accent);
}

.btn-secondary:hover {
  background: var(--accent-soft);
  box-shadow: none;
  border-color: var(--accent-strong);
  transform: translateY(-1px);
}

/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  /* Semi-transparent bg with backdrop blur */
  background-color: rgba(245, 245, 242, 0.88); /* fallback */
  background-color: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-fast) ease;
  z-index: 100;
}

.site-header.scrolled {
  border-bottom-color: var(--border);
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wordmark {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}

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

.nav-link {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

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

/* ============================================================
   HERO SECTION
   ============================================================ */

.section-hero {
  padding-top: clamp(5rem, 4rem + 5vw, 10rem);
  padding-bottom: clamp(4rem, 3rem + 5vw, 8rem);
}

/* Terminal prompt line */
.hero-prompt {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0;
  color: var(--muted);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: 0.4em;
  line-height: 1;
}

.prompt-symbol {
  color: var(--accent);
  font-weight: 700;
  user-select: none;
}

.section-hero h1 {
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: var(--tracking-snug);
  color: var(--text);
  margin-bottom: var(--space-3);
  overflow-wrap: break-word;
}

.hero-subheading {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0;
  line-height: var(--leading-lede);
  color: var(--muted);
  margin-bottom: var(--space-5);
}

/* ============================================================
   ABOUT SECTION — single line strip
   ============================================================ */

.section-about {
  padding: var(--space-5) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-statement {
  font-size: var(--text-lg);
  line-height: var(--leading-lede);
  color: var(--muted);
  max-width: 640px;
}

/* ============================================================
   PRODUCTS / TOOLS SECTION
   ============================================================ */

.section-products {
  padding: var(--section-space) 0;
  background: var(--surface);
}

.section-products h2 {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: var(--tracking-snug);
  line-height: var(--leading-snug);
  color: var(--text);
  margin-bottom: var(--space-5);
}

.products-grid {
  margin-bottom: var(--space-5);
}

/* Card styled like a file/tool entry — accent top border as a "tab" */
.product-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  max-width: 480px;
  transition:
    box-shadow var(--duration-fast) ease,
    transform  var(--duration-fast) ease;
}

.product-card:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-3px);
}

.product-card-inner {
  padding: var(--space-5);
}

/* Version + status meta row */
.product-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.product-version {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
}

.product-status {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.4em;
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.product-name {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: var(--tracking-snug);
  line-height: 1.2;
  color: var(--text);
  margin-bottom: var(--space-2);
  overflow-wrap: break-word;
}

.product-description {
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--muted);
  margin-bottom: var(--space-4);
}

/* Code-comment style "more coming" line */
.products-more {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--muted);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--border);
}

/* ============================================================
   CLOSING SECTION
   ============================================================ */

.section-closing {
  padding: calc(var(--section-space) * 1.6) 0;
  background: var(--surface-alt);
  text-align: center;
}

.section-closing h2 {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: var(--tracking-snug);
  line-height: 1.3;
  color: var(--text);
  margin-bottom: var(--space-3);
}

.closing-sub {
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--muted);
  max-width: 400px;
  margin-inline: auto;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-4) 0;
  background: var(--bg);
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: 1;
}

.footer-link {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

.footer-link:hover {
  color: var(--accent-strong);
}

/* ============================================================
   RESPONSIVE — mobile safety
   ============================================================ */

@media (max-width: 480px) {
  /* Prevent long mono strings from overflowing on narrow viewports */
  .hero-prompt {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }

  /* Tighten hero bottom spacing on small screens */
  .section-hero {
    padding-bottom: var(--space-6);
  }
}
