/* SPDX-License-Identifier: CC-BY-SA-4.0 */
/* Solid Geeks — site styles. Tokens come from the logo kit (GUIDE.md). */
@font-face { font-family: "SG Mono"; src: url(fonts/display.woff) format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "SG Sans"; src: url(fonts/ui-regular.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "SG Sans"; src: url(fonts/ui-semibold.woff) format("woff"); font-weight: 600; font-display: swap; }

:root {
  --ink: #0D0F0C;      /* ground */
  --volt: #C8FF2E;     /* the one accent: the symbol, the cursor, primary actions */
  --chalk: #F2F2EE;    /* type on ink */
  --paper: #EDEDE6;    /* the document sections, as in the film */
  --iron: #8A8F84;     /* secondary text on ink */
  --slab: #2A2E27;     /* rules on ink */
  --lead: #55594F;     /* secondary text on paper */

  --mono: "SG Mono", ui-monospace, "DejaVu Sans Mono", Menlo, monospace;
  --sans: "SG Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* scale: 18 base, perfect fourth */
  --s-1: .8125rem; --s0: 1.125rem; --s1: 1.5rem; --s2: 2rem; --s3: 2.625rem; --s4: 3.5rem;
  --display: clamp(3rem, 7.6vw, 9rem);
  --word: clamp(2.6rem, 8.2vw, 8.75rem);

  --gut: clamp(1rem, 4vw, 4rem);
  --max: 1680px;
  --sp: clamp(5rem, 12vw, 11rem);  /* section rhythm */
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--ink); color: var(--chalk);
  font: 400 var(--s0)/1.6 var(--sans); font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg, iframe { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--volt); }
code { white-space: nowrap; font: 700 .88em/1 var(--mono); background: rgba(200,255,46,.12); padding: .12em .32em; }
:focus-visible { outline: 3px solid var(--volt); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--gut); top: -4rem; background: var(--volt); color: var(--ink); padding: .6rem 1rem; font-weight: 600; z-index: 10; }
.skip:focus { top: 1rem; }

.display, .section-title, .word, .empty-title, .reps h3 { font-family: var(--mono); font-weight: 700; }

/* ---------------------------------------------------------------- buttons: the cursor block */
.btn {
  display: inline-flex; align-items: center; min-height: 3rem; padding: 0 1.4rem;
  font: 600 var(--s0)/1 var(--sans); text-decoration: none; border: 2px solid transparent;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-volt { background: var(--volt); color: var(--ink); }
.btn-volt:hover { background: var(--chalk); color: var(--ink); }
.btn-ghost { border-color: var(--slab); color: var(--chalk); }
.btn-ghost:hover { border-color: var(--volt); color: var(--volt); }

/* ---------------------------------------------------------------- top bar */
.top {
  max-width: var(--max); margin: 0 auto; padding: 1.25rem var(--gut);
  display: flex; align-items: center; gap: 2rem;
}
.brand { flex: none; }
.brand svg { height: 2.25rem; width: auto; }
.top nav { display: flex; gap: 1.75rem; margin-left: auto; }
.top nav a { text-decoration: none; color: var(--iron); font-weight: 600; }
.top nav a:hover { color: var(--chalk); }
.top-gh { min-height: 2.5rem; padding: 0 1rem; }

/* ---------------------------------------------------------------- hero: the film is the opening */
.hero { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }
.reel { position: relative; aspect-ratio: 16 / 9; background: var(--ink); }
.reel iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.hero-text {
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 2rem 4rem; align-items: end;
  padding: clamp(2.5rem, 6vw, 5.5rem) 0 0;
}
.display { margin: 0; font-size: var(--display); line-height: .9; letter-spacing: -.045em; }
.hero-side { padding-bottom: .6rem; max-width: 34rem; }
.lede { margin: 0 0 2rem; font-size: var(--s1); line-height: 1.45; color: var(--chalk); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------------------------------------------------------------- sections */
section { scroll-margin-top: 1rem; }
.manifesto, .projects, .join, .standard, .licenses { max-width: var(--max); margin: 0 auto; padding: var(--sp) var(--gut) 0; }
.section-title { margin: 0 0 2.5rem; font-size: var(--s2); line-height: 1.1; letter-spacing: -.02em; }

/* ---------------------------------------------------------------- manifesto: the one loud thing */
.words {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); column-gap: 4rem;
  grid-template-rows: repeat(4, auto); border-top: 1px solid var(--slab);
}
.word {
  grid-column: 1; all: unset; box-sizing: border-box; grid-column: 1; cursor: pointer;
  display: block; padding: .06em 0 .02em; border-bottom: 1px solid var(--slab);
  font: 700 var(--word)/.92 var(--mono); letter-spacing: -.05em; text-transform: uppercase;
  color: #646960; transition: color .25s ease;
}
.word span { position: relative; display: inline-block; padding: 0 .42em; }
/* the brackets: the logo's own plates, clamping the active word */
.word span::before, .word span::after {
  content: ""; position: absolute; top: .08em; bottom: .06em; width: .22em;
  background: no-repeat center / 100% 100% url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2060%20176%22%20preserveAspectRatio%3D%22none%22%3E%3Cpath%20fill%3D%22%23C8FF2E%22%20d%3D%22M0%200H60V28H36V148H60V176H0Z%22/%3E%3C/svg%3E");
  opacity: 0; transition: transform .45s cubic-bezier(.2, 1.4, .3, 1), opacity .2s;
}
.word span::before { left: 0; transform: translateX(-.6em); }
.word span::after { right: 0; transform: translateX(.6em) scaleX(-1); }
.word:hover { color: var(--iron); }  /* resting words keep 3.4:1 on ink */
.word[aria-expanded="true"] { color: var(--chalk); }
.word[aria-expanded="true"] span::before { opacity: 1; transform: translateX(0); }
.word[aria-expanded="true"] span::after { opacity: 1; transform: translateX(0) scaleX(-1); }
.word:focus-visible { outline-offset: -3px; }
.panel { grid-column: 2; align-self: center; max-width: 30rem; }
#p-rebel { grid-row: 1; } #p-rigorous { grid-row: 2; } #p-secure { grid-row: 3; } #p-free { grid-row: 4; }
.word:nth-of-type(1) { grid-row: 1; } .word:nth-of-type(2) { grid-row: 2; } .word:nth-of-type(3) { grid-row: 3; } .word:nth-of-type(4) { grid-row: 4; }
.panel p { margin: 0; font-size: var(--s1); line-height: 1.45; }
.panel:not([hidden]) { animation: panel-in .35s ease both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(.6rem); } }
@media (prefers-reduced-motion: reduce) {
  .word span::before, .word span::after { transition: none; }
  .panel:not([hidden]) { animation: none; }
}

/* ---------------------------------------------------------------- the paperwork (paper, like the film's document) */
.paper { background: var(--paper); color: var(--ink); margin-top: var(--sp); padding-bottom: var(--sp); }
.paper a:hover { color: var(--ink); text-decoration-thickness: 3px; text-decoration-color: var(--volt); }
.paper code { background: rgba(13,15,12,.08); }
.paper :focus-visible { outline-color: var(--ink); }
.standard, .licenses { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 2rem 4rem; }
.col-head p { margin: 0; max-width: 26rem; color: var(--lead); }
.col-head .section-title { margin-bottom: 1rem; }
.checklist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.checklist li {
  display: grid; grid-template-columns: 3.4rem 1fr; gap: 1rem; align-items: baseline;
  padding: 1.15rem 0; border-bottom: 1px solid rgba(13,15,12,.18); font-size: var(--s1); line-height: 1.35;
}
.mark { font: 700 var(--s0)/1 var(--mono); }
.lic { width: 100%; border-collapse: collapse; font-size: var(--s0); }
.lic th, .lic td { text-align: left; vertical-align: baseline; padding: 1.1rem 1.5rem 1.1rem 0; border-bottom: 1px solid rgba(13,15,12,.18); }
.lic thead th { font: 600 var(--s-1)/1.2 var(--sans); color: var(--lead); border-bottom: 1px solid var(--ink); padding-top: 0; }
.lic tbody th { font-weight: 600; width: 26%; }
.lic td:nth-child(2) { font: 700 var(--s0)/1.3 var(--mono); white-space: nowrap; width: 28%; }
.lic td:last-child { color: var(--lead); padding-right: 0; }

/* ---------------------------------------------------------------- projects: an empty state as an invitation */
.empty { display: grid; grid-template-columns: max-content minmax(0, 40rem); justify-content: start; gap: 2.5rem; align-items: start; }
.cursor { width: clamp(3.5rem, 7vw, 6rem); aspect-ratio: .73; background: var(--volt); animation: blink 1.06s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }
.empty-title { margin: 0 0 1rem; font-size: var(--s3); line-height: 1.05; letter-spacing: -.03em; }
.empty p { margin: 0 0 2rem; color: var(--iron); font-size: var(--s1); line-height: 1.45; }
.empty p.empty-title { color: var(--chalk); }

/* ---------------------------------------------------------------- app hub */
.apps-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 1rem 4rem; align-items: baseline; margin-bottom: 2.5rem; }
.apps-head .section-title { margin: 0; }
.apps-head p { margin: 0; max-width: 40rem; color: var(--iron); font-size: var(--s1); line-height: 1.45; }
/* Two columns: four apps make two even rows */
.apps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--slab); }
.app { display: flex; flex-direction: column; padding: 2.5rem 2.5rem 3rem; border-bottom: 1px solid var(--slab); }
.app:nth-child(odd) { padding-left: 0; }
.app:nth-child(even) { padding-right: 0; border-left: 1px solid var(--slab); }
.app-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.app-glyph { width: 3.5rem; height: 3.5rem; flex: none; }
.app-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
.app-meta li { font: 700 var(--s-1)/1 var(--mono); padding: .45em .6em; border: 1px solid var(--slab); color: var(--iron); }
.app-meta li:first-child { border-color: var(--volt); color: var(--volt); }
.app-kind { margin: 0 0 .75rem; font: 700 var(--s-1)/1.2 var(--mono); color: var(--volt); text-transform: uppercase; letter-spacing: .04em; }
.app-name { margin: 0 0 .75rem; font: 700 var(--s3)/1 var(--mono); letter-spacing: -.045em; }
.app-tag { margin: 0 0 1.25rem; font-size: var(--s1); line-height: 1.35; color: var(--chalk); }
.app-desc { margin: 0 0 1.5rem; color: var(--iron); max-width: 36rem; }
.app-feats { list-style: none; margin: 0 0 1.5rem; padding: 0; border-top: 1px solid var(--slab); }
.app-feats li { position: relative; padding: .7rem 0 .7rem 1.6rem; border-bottom: 1px solid var(--slab); font-size: var(--s0); line-height: 1.4; }
.app-feats li::before { content: ""; position: absolute; left: 0; top: 1.15rem; width: .55rem; height: .75rem; background: var(--volt); }
.app-stack { margin: 0 0 2rem; font: 700 var(--s-1)/1.5 var(--mono); color: var(--iron); }
.app .actions { margin-top: auto; gap: .5rem; }
.app .btn { padding: 0 1rem; }
.next { margin-top: clamp(3rem, 6vw, 5rem); }

/* ---------------------------------------------------------------- join: a real sequence, so it is numbered */
.reps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--slab); }
.reps li { padding: 1.5rem 2rem 0 0; }
.reps li + li { padding-left: 2rem; border-left: 1px solid var(--slab); }
.rep { display: block; font-size: var(--s-1); color: var(--iron); margin-bottom: 2.5rem; }
.reps h3 { margin: 0 0 .75rem; font-size: var(--s1); line-height: 1.15; letter-spacing: -.02em; }
.reps p { margin: 0; color: var(--iron); }

/* ---------------------------------------------------------------- footer */
.foot {
  max-width: var(--max); margin: var(--sp) auto 0; padding: 3rem var(--gut) 3.5rem;
  display: grid; grid-template-columns: auto 1fr auto; gap: 2rem 3rem; align-items: center;
  border-top: 1px solid var(--slab); color: var(--iron); font-size: var(--s-1);
}
.foot-brand svg { height: 1.75rem; width: auto; }
.foot p { margin: 0; max-width: 40rem; }
.foot nav { display: flex; gap: 1.5rem; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1200px) {
  .apps { grid-template-columns: 1fr; }
  .app, .app:nth-child(odd), .app:nth-child(even) { padding: 2.5rem 0 3rem; border-left: 0; }
}
@media (max-width: 1020px) {
  .top nav { display: none; }
  .top-gh { margin-left: auto; }
  .hero-text, .standard, .licenses, .apps-head { grid-template-columns: 1fr; }

  .words { grid-template-columns: 1fr; }
  .panel, #p-rebel, #p-rigorous, #p-secure, #p-free, .word:nth-of-type(n) { grid-column: 1; grid-row: auto; }
  .panel { padding: 1rem 0 1.75rem; border-bottom: 1px solid var(--slab); max-width: 40rem; }
  .word[aria-expanded="true"] { border-bottom-color: transparent; }
  .reps { grid-template-columns: 1fr 1fr; }
  .reps li:nth-child(3) { padding-left: 0; border-left: 0; }
  .reps li:nth-child(n+3) { padding-top: 2.5rem; }
}
@media (max-width: 640px) {
  .brand svg { height: 1.8rem; }
  .reps { grid-template-columns: 1fr; }
  .reps li, .reps li + li { padding: 1.5rem 0 1.5rem; border-left: 0; border-bottom: 1px solid var(--slab); }
  .rep { margin-bottom: 1rem; }
  .empty { grid-template-columns: 1fr; }
  .lic thead { display: none; }
  .lic tr { display: grid; grid-template-columns: 1fr; padding: 1rem 0; border-bottom: 1px solid rgba(13,15,12,.18); }
  .lic th, .lic td { border: 0; padding: .1rem 0; width: auto !important; }
  .lic td:nth-child(2) { white-space: normal; }
  .checklist li { grid-template-columns: 2.6rem 1fr; font-size: var(--s0); }
  .foot { grid-template-columns: 1fr; }
}
