/* BokForge — form follows function */

:root {
  --bg: #14110e;
  --bg-deep: #0e0c0a;
  --ink: #f1e8dc;
  --ink-dim: #b7ab9c;
  --muted: #8a7e70;
  --line: #2c2722;
  --ember: #d06a2b;
  --ember-hot: #e08440;
  --copper: #c4894a;
  --steel: #6e6458;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "URW Palladio L",
    "Noto Serif", "Liberation Serif", Georgia, serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Code", Menlo,
    Consolas, monospace;

  --measure: 38rem;
  --wrap: min(1120px, calc(100% - 2.5rem));
  --header: 4.25rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + 0.75rem);
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--sans);
  font-size: clamp(1.02rem, 0.96rem + 0.28vw, 1.125rem);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  color-scheme: dark;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection {
  background: var(--ember);
  color: var(--bg-deep);
}

a {
  color: inherit;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--copper) 70%, transparent);
}

a:hover {
  color: var(--ember-hot);
  text-decoration-color: var(--ember);
}

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

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.5rem 0.8rem;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
}

.skip:focus {
  top: 1rem;
}

.heat {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  z-index: 12;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: var(--ember);
  pointer-events: none;
}

.forge {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.9;
  transition: opacity 0.6s var(--ease);
}

.forge.is-dim {
  opacity: 0.14;
}

.forge.is-focus {
  opacity: 0.42;
}

.mast,
main,
.colophon {
  position: relative;
  z-index: 1;
}

.mast {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header);
  width: 100%;
  padding-inline: max(1.25rem, calc((100% - 1120px) / 2));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
}

.brand:hover {
  color: var(--ink);
}

.mark {
  width: 1.55rem;
  height: 1.55rem;
  fill: currentColor;
  color: var(--copper);
}

.mark-ember {
  fill: var(--ember);
}

.brand-name {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.nav-toggle {
  display: none;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0.4rem 0;
  cursor: pointer;
}

.menu {
  display: flex;
  gap: 1.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu a {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-dim);
}

.menu a:hover,
.menu a.is-active {
  color: var(--ink);
}

.hero {
  width: var(--wrap);
  margin-inline: auto;
  min-height: calc(100svh - var(--header));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12vh 0 14vh;
}

.kicker,
.section-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ember);
  margin: 0 0 1.1rem;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.4rem, 2rem + 8vw, 8.4rem);
  line-height: 0.88;
  letter-spacing: -0.03em;
  margin: 0 0 1.1rem;
}

.wordmark em {
  font-style: italic;
  font-weight: 400;
}

.lead {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 1.1rem + 1.1vw, 2rem);
  font-style: italic;
  color: var(--ink-dim);
  margin: 0 0 1.4rem;
}

.standfirst {
  max-width: 28rem;
  color: var(--ink-dim);
  margin: 0 0 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  margin: 0;
}

.text-link {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--ember);
  padding-bottom: 0.2rem;
}

.text-link:hover {
  color: var(--ember-hot);
}

.ethos,
.values,
.workshop {
  width: var(--wrap);
  margin-inline: auto;
  padding: 7rem 0;
  border-top: 1px solid var(--line);
}

.ethos-quote {
  margin: 0 0 3rem;
}

.ethos-quote p {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 1.2rem + 2.1vw, 3rem);
  line-height: 1.22;
  font-weight: 400;
  margin: 0;
  max-width: 13em;
}

.ethos-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem 3rem;
  max-width: 48rem;
  color: var(--ink-dim);
}

.ethos-split p {
  margin: 0;
}

.values-head {
  display: grid;
  grid-template-columns: 1fr minmax(0, 28rem);
  gap: 1rem 3rem;
  margin-bottom: 3rem;
  align-items: end;
}

.values-prompt {
  margin: 0;
  color: var(--ink-dim);
}

.values-layout {
  display: grid;
  grid-template-columns: minmax(17rem, 0.9fr) minmax(0, 1.15fr);
  gap: 2.5rem 3.5rem;
  align-items: start;
}

.value-tabs {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.value-tab {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.85rem;
  text-align: left;
  padding: 1rem 0.2rem 1rem 0.8rem;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 2px solid transparent;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.value-tab:hover {
  background: color-mix(in srgb, var(--ink) 3%, transparent);
}

.value-tab[aria-selected="true"] {
  border-left-color: var(--ember);
  background: color-mix(in srgb, var(--ember) 7%, transparent);
}

.value-index {
  grid-row: 1 / span 2;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding-top: 0.35rem;
}

.value-name {
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.2;
}

.value-tag {
  grid-column: 2;
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.value-panels {
  min-height: 22rem;
  padding: 0.5rem 0 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}

.value-panel[hidden] {
  display: none;
}

.value-panel h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 1.5rem + 1.5vw, 2.8rem);
  font-weight: 400;
  margin: 0 0 0.4rem;
}

.value-axiom {
  font-style: italic;
  font-family: var(--serif);
  color: var(--copper);
  margin: 0 0 1.1rem;
  font-size: 1.2rem;
}

.value-panel p {
  color: var(--ink-dim);
  max-width: 36em;
}

.diagram {
  width: min(100%, 22rem);
  height: auto;
  color: var(--copper);
  margin-bottom: 1.4rem;
}

.ember-stroke {
  stroke: var(--ember);
}

.ember-fill {
  fill: var(--ember);
  stroke: none;
}

.draw {
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: draw-line 1.1s var(--ease) forwards;
}

.snap {
  animation: snap-in 0.7s var(--ease) both;
}

@keyframes draw-line {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes snap-in {
  from {
    transform: translateX(10px);
    opacity: 0.2;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.workshop-head {
  max-width: 36rem;
  margin-bottom: 2.5rem;
}

.workshop-head h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 1.4rem + 2vw, 3.1rem);
  font-weight: 400;
  margin: 0 0 0.9rem;
}

.workshop-head p {
  color: var(--ink-dim);
  margin: 0;
}

.workshop-empty {
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  max-width: 28rem;
  margin: 0;
}

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

.repo-list li {
  border-bottom: 1px solid var(--line);
}

.repo-list a {
  display: grid;
  grid-template-columns: minmax(8rem, 0.7fr) minmax(0, 1.4fr) auto;
  gap: 1rem;
  padding: 1.1rem 0.2rem;
  text-decoration: none;
  align-items: baseline;
}

.repo-list a:hover {
  color: inherit;
}

.repo-name {
  font-family: var(--serif);
  font-size: 1.2rem;
}

.repo-desc {
  color: var(--ink-dim);
}

.repo-meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.workshop-cta {
  margin: 2.5rem 0 0;
}

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--bg-deep);
  background: var(--ember);
  padding: 0.85rem 1.15rem;
  border: 0;
}

.btn:hover {
  color: var(--bg-deep);
  background: var(--ember-hot);
  text-decoration: none;
}

.colophon {
  width: var(--wrap);
  margin: 0 auto;
  padding: 2.5rem 0 3.5rem;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  align-items: start;
  color: var(--muted);
  font-size: 0.92rem;
}

.colophon-brand {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.colophon-brand p {
  margin: 0;
  max-width: 18rem;
}

.colophon-brand strong {
  display: block;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.05rem;
}

.colophon-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.colophon-links a,
.colophon-copy a {
  color: var(--ink-dim);
  text-decoration: none;
}

.colophon-links a:hover,
.colophon-copy a:hover {
  color: var(--ember-hot);
}

.colophon-copy {
  margin: 0;
  justify-self: end;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 860px) {
  .ethos-split,
  .values-head,
  .values-layout,
  .colophon,
  .repo-list a {
    grid-template-columns: 1fr;
  }

  .mast {
    position: relative;
  }

  .hero {
    padding: 10vh 0 3.25rem;
    min-height: calc(100svh - var(--header));
    justify-content: flex-end;
  }

  .wordmark {
    font-size: clamp(2.75rem, 14vw, 4.4rem);
  }

  .ethos,
  .values,
  .workshop {
    padding: 4.5rem 0;
  }

  .ethos-quote {
    max-width: none;
  }

  .nav-toggle {
    display: block;
    position: relative;
    z-index: 12;
  }

  .menu {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 1.4rem;
    padding: 5rem 1.5rem;
    background: var(--bg-deep);
  }

  .nav.is-open .menu {
    display: flex;
  }

  .nav.is-open .nav-toggle {
    color: var(--ink);
  }

  .menu a {
    font-size: 1.1rem;
    letter-spacing: 0.16em;
  }

  .colophon-copy {
    justify-self: start;
  }

  .value-panels {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .forge,
  .heat,
  .value-tab,
  .draw,
  .snap {
    transition: none;
    animation: none;
  }

  .draw {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
  }
}
