/* ==========================================================================
   SlowBuild Labs — Tactile Workshop / Field Manual
   ========================================================================== */

:root {
  /* Palette Tokens */
  --vellum: #ECEEE9;
  --vellum-deep: #E2E6DE;
  --plate: #F6F7F4;
  --iron: #141815;
  --slate: #525B54;
  --lichen: #244A34;
  --lichen-tint: #E3ECE6;
  --brass: #B87D2E;
  --brass-tint: #F4ECE0;
  --rule: #CFD5CE;
  --rule-strong: #AEB7AE;

  /* Typography Tokens */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Layout Tokens */
  --max-width: 1080px;
  --rail-width: 228px;
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--vellum);
}

body {
  margin: 0;
  background-color: var(--vellum);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(20, 24, 21, 0.055) 1px, transparent 0);
  background-size: 24px 24px;
  color: var(--iron);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Focus visibility */
:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Typography Base */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--iron);
  margin: 0;
  font-optical-sizing: auto;
}

p {
  margin: 0;
}

a {
  color: var(--lichen);
  text-underline-offset: 0.2em;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

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

/* ==========================================================================
   Workbench Frame & Header
   ========================================================================== */

.workbench-frame {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--iron);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--iron);
}

.maker-mark {
  color: var(--lichen);
  flex-shrink: 0;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.wordmark:hover .maker-mark {
  transform: rotate(15deg);
}

.wordmark-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.site-header nav a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate);
  text-decoration: none;
  padding: 0.25rem 0;
  position: relative;
}

.site-header nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1.5px;
  background-color: var(--brass);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.22s ease;
}

.site-header nav a:hover {
  color: var(--iron);
}

.site-header nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ==========================================================================
   Workbench Grid Rows & Left Registration Rail
   ========================================================================== */

.workbench-row {
  display: grid;
  grid-template-columns: var(--rail-width) 1fr;
  gap: 3rem;
  padding: 4rem 0;
  border-bottom: 1px solid var(--rule);
}

.rail {
  border-right: 1px solid var(--rule);
  padding-right: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rail-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-pip {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(184, 125, 46, 0.18);
}

.rail-note {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--slate);
}

.content-col {
  min-width: 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.section-head h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
}

/* ==========================================================================
   Hero & Signature Escapement Dial
   ========================================================================== */

.hero {
  padding: 4.5rem 0;
  align-items: center;
}

.escapement-widget {
  background: var(--plate);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  padding: 1rem 0.85rem 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  box-shadow: inset 0 1px 0 #ffffff, 0 2px 6px rgba(20, 24, 21, 0.03);
}

.escapement-svg {
  width: 148px;
  height: 148px;
  display: block;
}

.dial-text {
  font-family: var(--font-mono);
  font-size: 7.5px;
  fill: var(--slate);
  letter-spacing: 0.05em;
}

.escapement-rotor {
  transform-origin: 90px 90px;
  animation: escapement-sweep 60s steps(60, end) infinite;
}

@keyframes escapement-sweep {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.dial-readout {
  width: 100%;
  margin: 0;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--rule);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
  gap: 0.25rem;
}

.dial-readout dt {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--slate);
  letter-spacing: 0.06em;
}

.dial-readout dd {
  margin: 0.1rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--iron);
}

.hero-content .eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--lichen);
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-content .eyebrow::before {
  content: "—";
  color: var(--brass);
}

.hero-content h1 {
  font-size: clamp(2.85rem, 6vw, 4.5rem);
  line-height: 1.04;
  margin-bottom: 1.35rem;
}

.hero-content h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--lichen);
  text-decoration: underline;
  text-decoration-color: var(--brass);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.14em;
}

.lede {
  font-size: clamp(1.1rem, 1.8vw, 1.25rem);
  line-height: 1.65;
  color: var(--slate);
  max-width: 60ch;
  margin-bottom: 2.25rem;
}

.telemetry-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
  padding: 0.95rem 0;
  gap: 1.25rem;
}

.telemetry-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.telemetry-key {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.09em;
  color: var(--slate);
}

.telemetry-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--iron);
}

/* ==========================================================================
   Products — Workshop Dossier Cards
   ========================================================================== */

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.card {
  background: var(--plate);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--lichen);
  transition: background-color 0.22s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--iron);
  box-shadow: 0 10px 24px -12px rgba(20, 24, 21, 0.14);
}

.card:hover::before {
  background-color: var(--brass);
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--rule);
  background-color: rgba(236, 238, 233, 0.45);
}

.catalog-id {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--slate);
}

.status-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--brass);
  background: var(--brass-tint);
  border: 1px solid rgba(184, 125, 46, 0.35);
  padding: 0.18rem 0.5rem;
  border-radius: 3px;
}

.status-tag--foss {
  color: var(--lichen);
  background: var(--lichen-tint);
  border-color: rgba(36, 74, 52, 0.3);
}

.card-body {
  padding: 1.5rem 1.5rem 1.25rem;
}

.card h3 {
  font-size: 1.65rem;
  margin-bottom: 0.35rem;
}

.card .tagline {
  color: var(--lichen);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}

.card .card-desc {
  color: var(--slate);
  font-size: 0.95rem;
  line-height: 1.62;
}

.spec-sheet {
  margin: auto 1.5rem 1.25rem;
  padding: 0.85rem 0 0;
  border-top: 1px dashed var(--rule);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.8rem;
}

.spec-row dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate);
  flex-shrink: 0;
}

.spec-row dd {
  margin: 0;
  color: var(--iron);
  font-weight: 500;
  text-align: right;
}

.card-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.95rem 1.5rem;
  border-top: 1px solid var(--rule);
  background-color: var(--vellum);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--iron);
  text-decoration: none;
}

.card-link:hover {
  background-color: var(--iron);
  color: var(--plate);
}

.link-arrow {
  transition: transform 0.2s ease;
}

.card-link:hover .link-arrow {
  transform: translateX(4px);
  color: var(--brass);
}

/* ==========================================================================
   About ("Why slow?") — Operating Principles Ledger
   ========================================================================== */

.about-lead {
  font-size: 1.15rem;
  color: var(--slate);
  margin-bottom: 2rem;
  max-width: 58ch;
}

.principles-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--iron);
}

.principles-list li {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}

.principle-term {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.principle-term strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--iron);
}

.principle-spec {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--lichen);
}

.principle-detail {
  color: var(--slate);
  font-size: 0.98rem;
}

/* ==========================================================================
   Contact — Stamped Dispatch Plate
   ========================================================================== */

.contact-row {
  border-bottom: none;
}

.contact-plate {
  background: var(--plate);
  border: 1px solid var(--iron);
  border-radius: 8px;
  padding: 2.25rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  position: relative;
  box-shadow: 4px 4px 0 var(--rule-strong);
}

.contact-copy h2 {
  font-size: 1.85rem;
  margin: 0.3rem 0 0.45rem;
}

.contact-copy p {
  color: var(--slate);
  font-size: 0.98rem;
}

.dispatch-button {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background-color: var(--iron);
  color: var(--plate);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.9rem 1.35rem;
  border-radius: 6px;
  text-decoration: none;
  flex-shrink: 0;
  border: 1px solid var(--iron);
}

.dispatch-button:hover {
  background-color: var(--lichen);
  border-color: var(--lichen);
}

.dispatch-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--brass);
}

.dispatch-arrow {
  color: var(--brass);
  transition: transform 0.2s ease;
}

.dispatch-button:hover .dispatch-arrow {
  transform: translate(2px, -2px);
}

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

.site-footer {
  border-top: 1px solid var(--iron);
  padding: 1.75rem 0 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--slate);
}

.site-footer a {
  color: var(--iron);
  font-weight: 500;
}

.site-footer a:hover {
  color: var(--lichen);
}

.snail {
  letter-spacing: 0.04em;
}

/* ==========================================================================
   Accessibility & Responsive Breakpoints
   ========================================================================== */

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

@media (max-width: 860px) {
  .workbench-row {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 3rem 0;
  }

  .rail {
    border-right: none;
    border-bottom: 1px dashed var(--rule-strong);
    padding-right: 0;
    padding-bottom: 1.25rem;
  }

  .hero-rail {
    order: 2;
    border-bottom: none;
    padding-bottom: 0;
  }

  .hero-content {
    order: 1;
  }

  .escapement-widget {
    flex-direction: row;
    justify-content: space-between;
    padding: 1rem 1.25rem;
  }

  .escapement-svg {
    width: 112px;
    height: 112px;
    flex-shrink: 0;
  }

  .dial-readout {
    border-top: none;
    border-left: 1px dashed var(--rule);
    padding-top: 0;
    padding-left: 1rem;
  }
}

@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .site-header nav {
    width: 100%;
    justify-content: space-between;
    border-top: 1px dashed var(--rule);
    padding-top: 0.75rem;
  }

  .telemetry-bar {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .principles-list li {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .contact-plate {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
  }

  .dispatch-button {
    width: 100%;
    justify-content: center;
  }

  .escapement-widget {
    flex-direction: column;
  }

  .dial-readout {
    border-left: none;
    border-top: 1px dashed var(--rule);
    padding-left: 0;
    padding-top: 0.65rem;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }
}
