/* phaselock.tech — the whole stylesheet. No JavaScript, no webfonts, no
   preprocessor: one file, system font stacks, and CSS custom properties.

   Dark is the base palette (an instrument-panel look suits a project about
   cycle counts); light is an override under prefers-color-scheme so the site
   is readable on a bright screen without a toggle. Every colour is a token —
   nothing below the :root blocks hard-codes one. */

:root {
  --bg:        #0a0c0f;
  --bg-raised: #11151b;
  --rule:      #1f2732;
  --rule-soft: #161c24;
  --ink:       #dde3ea;
  --ink-dim:   #8a94a3;
  --ink-faint: #5c6675;
  --accent:    #7de2d1;  /* phosphor — links, the mark, "locked" states */
  --amber:     #f0b86e;  /* in progress */
  --violet:    #a898f0;  /* planned */

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;

  --measure: 64ch;
  --page: 68rem;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg:        #fbfbfa;
    --bg-raised: #ffffff;
    --rule:      #dcdfe4;
    --rule-soft: #eceef1;
    --ink:       #16191d;
    --ink-dim:   #5a6371;
    --ink-faint: #8b93a0;
    --accent:    #0f8f7c;
    --amber:     #a2660c;
    --violet:    #5b4bb5;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

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

.skip {
  position: absolute; left: -9999px;
  background: var(--bg-raised); color: var(--ink);
  padding: 0.5rem 0.9rem; border: 1px solid var(--rule);
}
.skip:focus { left: 1rem; top: 1rem; z-index: 10; }

/* --- shell ------------------------------------------------------------- */

.site-head, .site-foot, main > section {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}

.site-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
}

.wordmark {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.95rem; letter-spacing: 0.02em;
  color: var(--ink); text-decoration: none;
}
/* The mark: a small square locked to the accent, echoing a phase indicator. */
.wordmark-mark {
  width: 0.6rem; height: 0.6rem;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.site-nav { font-family: var(--mono); font-size: 0.85rem; }

.site-foot {
  margin-top: 6rem;
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--rule-soft);
  font-family: var(--mono); font-size: 0.8rem; color: var(--ink-faint);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem;
}
.site-foot p { margin: 0; }

main > section { margin-block: 5.5rem; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule-soft);
}

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

.hero { margin-block: 3rem 5.5rem; }

.hero-name {
  font-family: var(--mono);
  font-size: clamp(2.6rem, 9vw, 4.5rem);
  font-weight: 600; letter-spacing: -0.03em; line-height: 1;
  margin: 0;
}

.hero-tagline {
  font-family: var(--mono);
  font-size: clamp(1rem, 2.6vw, 1.3rem);
  color: var(--accent);
  margin: 1rem 0 0;
}

.hero-lede {
  max-width: var(--measure);
  font-size: clamp(1.02rem, 1.6vw, 1.15rem);
  color: var(--ink-dim);
  margin: 1.5rem 0 0;
}

.hero-actions { margin: 2rem 0 0; }

.btn {
  display: inline-block;
  font-family: var(--mono); font-size: 0.88rem;
  padding: 0.7rem 1.4rem;
  border: 1px solid var(--accent);
  text-decoration: none;
}
.btn-primary { color: var(--accent); }
.btn-primary:hover { background: var(--accent); color: var(--bg); }

/* A clock-tick strip: evenly spaced marks, faded at both ends. Purely
   decorative, hence aria-hidden on the element itself. */
.cycle-rule {
  margin-top: 3.5rem;
  height: 1.25rem;
  background-image: repeating-linear-gradient(
    to right,
    var(--rule) 0 1px,
    transparent 1px 0.75rem
  );
  -webkit-mask-image: linear-gradient(to right, black 0%, black 55%, transparent 100%);
          mask-image: linear-gradient(to right, black 0%, black 55%, transparent 100%);
}

/* --- prose ------------------------------------------------------------- */

.prose p { max-width: var(--measure); margin: 0 0 1.3rem; }
.prose p:last-child { margin-bottom: 0; }
.prose em { color: var(--ink); font-style: italic; }

/* Component names bolded in the pitch prose echo the card headings in the
   stack grid below, so they are typeset the same way. */
.prose strong { font-family: var(--mono); font-weight: 600; color: var(--accent); }

/* --- proof block ------------------------------------------------------- */

/* A terminal transcript, not a decoration: the one place the site shows the
   claim instead of asserting it. Deliberately narrower than full width so it
   reads as an inset exhibit. */
.term {
  margin: 0;
  max-width: 46rem;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
}

.term-label {
  font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--rule-soft);
}

.term-body {
  margin: 0;
  padding: 1.15rem;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.85;
  /* Long command lines scroll inside the block; the page body never does. */
  overflow-x: auto;
  white-space: pre;
}

/* Lines are separated by the newlines already in the markup, so these stay
   inline — making them block would double the spacing. */
.term-cmd { color: var(--ink); }
.term-out { color: var(--ink-dim); }

/* Not selectable, so copying the transcript yields runnable commands. */
.term-prompt { color: var(--accent); user-select: none; -webkit-user-select: none; }

.term-caption {
  margin: 0;
  padding: 0.85rem 1.1rem;
  border-top: 1px solid var(--rule-soft);
  font-family: var(--mono); font-size: 0.8rem;
  color: var(--accent);
}
.term-caption::before { content: "\2514\2500 "; color: var(--ink-faint); }

/* --- the stack grid ---------------------------------------------------- */

.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
}

.card {
  background: var(--bg-raised);
  padding: 1.75rem 1.5rem 2rem;
}

.card-role {
  font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0;
}
.card-name {
  font-family: var(--mono); font-size: 1.5rem; font-weight: 600;
  color: var(--accent);
  margin: 0.35rem 0 0;
}
.card-claim {
  font-size: 1.02rem; font-weight: 600;
  margin: 1rem 0 0;
  text-wrap: balance;
}
.card-detail {
  font-size: 0.92rem; color: var(--ink-dim);
  margin: 0.75rem 0 0;
}

/* --- keystone pull-quote ----------------------------------------------- */

.keystone blockquote {
  margin: 0;
  padding: 1.75rem 0 1.75rem 1.75rem;
  border-left: 2px solid var(--accent);
  max-width: var(--measure);
  font-size: clamp(1.08rem, 2vw, 1.3rem);
  line-height: 1.5;
  text-wrap: pretty;
}

/* --- edges ------------------------------------------------------------- */

.edge-list {
  list-style: none;
  counter-reset: edge;
  margin: 0; padding: 0;
  display: grid; gap: 2rem;
}
.edge { counter-increment: edge; padding-left: 3rem; position: relative; }
.edge::before {
  content: counter(edge, decimal-leading-zero);
  position: absolute; left: 0; top: 0.1rem;
  font-family: var(--mono); font-size: 0.85rem;
  color: var(--ink-faint);
}
.edge-title { font-size: 1.05rem; margin: 0; }
.edge-body { color: var(--ink-dim); margin: 0.4rem 0 0; max-width: var(--measure); }

/* --- status table ------------------------------------------------------ */

.status-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  text-align: left;
}
.status-table th, .status-table td {
  padding: 0.85rem 1rem 0.85rem 0;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: baseline;
}
.status-table thead th {
  font-family: var(--mono); font-weight: 500; font-size: 0.72rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom-color: var(--rule);
}
.st-name { font-family: var(--mono); color: var(--accent); font-weight: 600; }
.st-what { color: var(--ink); }
.st-lang { font-family: var(--mono); color: var(--ink-dim); }

.pill {
  display: inline-block;
  font-family: var(--mono); font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.pill-done    { color: var(--accent); }
.pill-wip     { color: var(--amber); }
.pill-planned { color: var(--violet); }

/* The table's four columns collapse to stacked rows below the point where
   the "Written in" column starts wrapping mid-word. */
@media (max-width: 34rem) {
  .status-table thead { position: absolute; left: -9999px; }
  .status-table tr { display: block; padding-block: 0.9rem; border-bottom: 1px solid var(--rule-soft); }
  .status-table th, .status-table td { display: block; border: 0; padding: 0; }
  .status-table .st-lang { color: var(--ink-faint); font-size: 0.8rem; }
  .status-table .st-state { margin-top: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
