/* ============================================================
   plugsight.com — Swiss typographic system
   One face (Space Grotesk) for headings and body, restrained.
   Mono (IBM Plex Mono) only where it is functional: timestamps,
   the timeline, code. One ink per text block. Paper, hairlines,
   one signal red used only as function.
   ============================================================ */

:root{
  --paper:       #f4f1ea;
  --paper-deep:  #ece8de;
  --ink:         #15130f;
  --ink-soft:    #4c4739;   /* AA on paper at body sizes */
  --ink-faint:   #6b6555;   /* 5.1:1 on paper — AA at small sizes too */
  --rule:        #cfc9bb;
  --accent:      #c0392b;   /* signal red — function only */
  --accent-deep: #a02c20;   /* AA-safe on paper for small text */
  --grotesk: "Space Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
  --measure: 34em;
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --label-col: 16rem;
}

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

@media (prefers-reduced-motion: no-preference){
  html { scroll-behavior: smooth; }
}

body{
  background: var(--paper);
  color: var(--ink);
  font-family: var(--grotesk);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--ink); color: var(--paper); }

a { color: inherit; }

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

.skip{
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.875rem;
  padding: 0.6rem 1rem;
  z-index: 10;
  text-decoration: none;
}
.skip:focus{ left: 0; }

/* ---------- page frame ---------- */

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

/* ---------- masthead ---------- */

.masthead{
  border-bottom: 1px solid var(--ink);
}
.masthead-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  padding-top: 1.05rem;
  padding-bottom: 1.05rem;
}
.wordmark{
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: 0.01em;
}
.wordmark .glyph{ transform: translateY(1px); }
.wordmark .glyph-dot{ fill: var(--accent); }
.site-nav{
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.6rem;
}
.site-nav a{
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:hover{
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  color: var(--accent-deep);
}

/* ---------- section scaffolding ---------- */

.section{
  border-bottom: 1px solid var(--ink);
}
.sec-head{
  display: grid;
  grid-template-columns: minmax(0, var(--label-col)) 1fr;
  gap: var(--gutter);
  padding: clamp(2.5rem, 5vw, 3.75rem) 0 clamp(1.75rem, 3vw, 2.5rem);
}
.sec-num{
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.05em;
}
.sec-num::after{
  content: "";
  display: block;
  width: 2.5rem;
  height: 1px;
  background: var(--ink);
  margin-top: 0.75rem;
}
.sec-body h2{
  font-size: clamp(1.5rem, 1.05rem + 1.8vw, 2.125rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.015em;
  max-width: 22em;
}
.sec-lede{
  margin-top: 1rem;
  max-width: var(--measure);
  color: var(--ink-soft);
}
.sec-note{
  margin-top: 1rem;
  max-width: var(--measure);
  font-size: 0.9375rem;
  color: var(--ink-soft);
}
@media (max-width: 52rem){
  .sec-head{ grid-template-columns: 1fr; gap: 1.25rem; }
}

/* ---------- hero ---------- */

.hero{
  border-bottom: 1px solid var(--ink);
}
.eyebrow{
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: clamp(2rem, 4vw, 3rem) 0 0;
}
.hero h1{
  font-size: clamp(1.9375rem, 1.05rem + 3.4vw, 3.375rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: 17em;
  padding: clamp(1rem, 2vw, 1.5rem) 0 0;
  text-wrap: balance;
}
.hero-under{
  display: grid;
  grid-template-columns: minmax(0, 26rem) 1fr;
  gap: var(--gutter);
  align-items: start;
  padding: clamp(1.75rem, 3.5vw, 2.75rem) 0 clamp(2.5rem, 5vw, 3.75rem);
}
.hero-side{
  display: flex;
  flex-direction: column;
}
.lede{
  max-width: var(--measure);
  font-size: clamp(1.0625rem, 1.4vw, 1.1875rem);
  line-height: 1.55;
  color: var(--ink-soft);
}
.cta-row{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1.75rem;
}
.btn{
  display: inline-block;
  font-family: var(--grotesk);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.75rem 1.35rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  transition: background-color 120ms ease, color 120ms ease;
}
.btn-primary{
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover{ background: #2c2820; }
.btn-ghost{
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover{ background: var(--ink); color: var(--paper); }
.cta-note{
  font-size: 0.8125rem;
  color: var(--ink-faint);
}
@media (max-width: 64rem){
  .hero-under{ grid-template-columns: minmax(0, 1fr); }
}

/* ---------- ruled sheets (timeline, schematic, code) ---------- */

.sheet{
  border: 1px solid var(--ink);
  background: var(--paper);
}
.sheet-cap{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--ink);
}
.sheet-cap .cap-code{
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: none;
  letter-spacing: 0.02em;
}
.sheet-cap .cap-fig{
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  white-space: nowrap;
}
@media (max-width: 34rem){
  .sheet-cap .cap-fig{ display: none; }
}

/* timeline */
.timeline{
  list-style: none;
}
.timeline li{
  display: grid;
  grid-template-columns: 6.2rem 1fr;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
  line-height: 1.45;
}
.timeline li:last-child{ border-bottom: 0; }
.timeline time{
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-faint);
  padding-top: 0.1em;
}
.timeline .warn{
  border-left: 3px solid var(--accent);
  padding-left: calc(1.1rem - 3px);
  background: var(--paper-deep);
}
@media (max-width: 30rem){
  .timeline li{ grid-template-columns: 1fr; gap: 0.15rem; }
}

/* ---------- section 01: three questions, ruled ---------- */

.q-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--ink);
}
.q-cell{
  padding: 1.75rem 1.75rem 2.25rem 0;
  border-right: 1px solid var(--rule);
}
.q-cell:last-child{ border-right: 0; }
.q-cell + .q-cell{ padding-left: 1.75rem; }
.q-index{
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin-bottom: 1.1rem;
}
.q-cell h3{
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 0.8rem;
}
.q-cell p{
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
@media (max-width: 52rem){
  .q-grid{ grid-template-columns: 1fr; }
  .q-cell{ border-right: 0; border-bottom: 1px solid var(--rule); padding: 1.5rem 0; }
  .q-cell + .q-cell{ padding-left: 0; }
  .q-cell:last-child{ border-bottom: 0; }
}

/* caveat: a datasheet note */
.caveat{
  display: grid;
  grid-template-columns: minmax(0, var(--label-col)) 1fr;
  gap: var(--gutter);
  border-top: 1px solid var(--ink);
  padding: 1.5rem 0 clamp(2.5rem, 5vw, 3.5rem);
}
.caveat-label{
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.caveat p{
  max-width: var(--measure);
  font-size: 1rem;
  line-height: 1.55;
}
@media (max-width: 52rem){
  .caveat{ grid-template-columns: 1fr; gap: 0.6rem; }
}

/* ---------- section 02: schematic + MCP call ---------- */

.faces-grid{
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: var(--gutter);
  align-items: start;
  padding-bottom: clamp(2.5rem, 5vw, 3.75rem);
}
.faces-grid > .sheet{ min-width: 0; }
.schematic-body{
  padding: 1.5rem 1.25rem 1.25rem;
}
.schematic-body svg{
  display: block;
  width: 100%;
  height: auto;
}
.schematic .box-label{
  font-family: var(--grotesk);
  font-size: 15px;
  font-weight: 500;
  fill: var(--ink);
}
.schematic .box-sub{
  font-family: var(--grotesk);
  font-size: 12.5px;
  fill: var(--ink-faint);
}
.schematic .line{
  stroke: var(--ink);
  stroke-width: 1.2;
  fill: none;
}
.schematic .box{
  stroke: var(--ink);
  stroke-width: 1.2;
  fill: var(--paper);
}

.code-body{
  padding: 1.1rem 1.25rem 1.25rem;
  overflow-x: auto;
}
.code-body pre{
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.6;
}
.code-body code{ font-family: inherit; }
.code-body .c{ color: var(--ink-faint); }

@media (max-width: 60rem){
  .faces-grid{ grid-template-columns: minmax(0, 1fr); }
}

/* ---------- section 03: limits as a specification ---------- */

.spec{
  border-top: 1px solid var(--ink);
}
.spec-row{
  display: grid;
  grid-template-columns: minmax(0, var(--label-col)) minmax(0, 18rem) 1fr;
  gap: var(--gutter);
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--rule);
}
.spec-row:last-of-type{ border-bottom: 0; }
.spec-id{
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  padding-top: 0.2em;
}
.spec-row h3{
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.spec-row p{
  max-width: var(--measure);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.spec-foot{
  border-top: 1px solid var(--ink);
  padding: 1.4rem 0 clamp(2.5rem, 5vw, 3.5rem);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 44em;
}
@media (max-width: 60rem){
  .spec-row{ grid-template-columns: minmax(0, 5rem) 1fr; }
  .spec-row h3{ grid-column: 2; }
  .spec-row p{ grid-column: 2; margin-top: 0.5rem; }
}
@media (max-width: 30rem){
  .spec-row{ grid-template-columns: 1fr; gap: 0.4rem; }
  .spec-row h3, .spec-row p{ grid-column: 1; }
}

/* ---------- sections 04 + 05: label column + body ---------- */

.split-body{
  display: grid;
  grid-template-columns: minmax(0, var(--label-col)) 1fr;
  gap: var(--gutter);
  padding-bottom: clamp(2.5rem, 5vw, 3.75rem);
}
.split-copy{
  max-width: var(--measure);
}
.split-copy p + p{
  margin-top: 1rem;
}
@media (max-width: 52rem){
  .split-body{ grid-template-columns: 1fr; }
  .split-body > .split-fill{ display: none; }
}

/* section 05: get — two ruled columns */
.get-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--ink);
}
.get-cell{
  padding: 1.75rem 1.75rem 2rem 0;
  border-right: 1px solid var(--rule);
}
.get-cell:last-child{ border-right: 0; padding-left: 1.75rem; }
.get-cell h3{
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.8rem;
}
.get-cell p{
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 30em;
}
.inline-code{
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--paper-deep);
  padding: 0.1em 0.35em;
}
.get-foot{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  border-top: 1px solid var(--ink);
  padding: 1.4rem 0 clamp(2.5rem, 5vw, 3.5rem);
}
.get-foot p{
  font-size: 0.9375rem;
  color: var(--ink-soft);
  max-width: 34em;
}
@media (max-width: 52rem){
  .get-grid{ grid-template-columns: 1fr; }
  .get-cell{ border-right: 0; border-bottom: 1px solid var(--rule); padding: 1.5rem 0; }
  .get-cell:last-child{ border-bottom: 0; padding-left: 0; }
}

/* ---------- footer ---------- */

.site-footer{
  padding-top: clamp(2rem, 4vw, 3rem);
}
.footer-grid{
  display: grid;
  grid-template-columns: minmax(0, 34rem) 1fr;
  gap: var(--gutter);
  align-items: start;
  padding-bottom: clamp(2rem, 4vw, 3rem);
}
.footer-reality{
  margin-top: 1rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 34em;
}
.footer-links{
  display: flex;
  justify-content: flex-end;
  gap: clamp(2rem, 5vw, 5rem);
}
.footer-links div{
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.footer-links a{
  font-size: 0.9375rem;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule);
}
.footer-links a:hover{
  color: var(--accent-deep);
  text-decoration-color: currentColor;
}
.footer-meta-band{
  border-top: 1px solid var(--ink);
}
.footer-meta{
  padding-top: 1.1rem;
  padding-bottom: 2.25rem;
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
@media (max-width: 52rem){
  .footer-grid{ grid-template-columns: 1fr; }
  .footer-links{ justify-content: flex-start; }
}
