/*
  Design tokens
  ---------------------------------------------------------------------------
  The site relies on a small, opinionated set of primitives: rich earthy tones,
  strong editorial typography, and rigid grid alignment. Keep these values
  central so future visual changes stay consistent across all sections.
*/
:root {
  --ink: #1d2a24;
  --paper: #f5f2ea;
  --acid: #d5ed56;
  --coral: #ff775f;
  --line: rgba(29, 42, 36, 0.2);
  --muted: #5f675f;
  --panel: #ece9de;
}

/*
  Base reset and shared rules
  ---------------------------------------------------------------------------
  These rules set the tone for every page and keep the system predictable.
*/
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--paper);
  background-image: linear-gradient(rgba(29, 42, 36, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 42, 36, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.site-nav a:focus-visible,
.header-link:focus-visible,
.wordmark:focus-visible,
.filter:focus-visible,
.menu-button:focus-visible,
.contact-link:focus-visible,
.text-link:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-weight: 400;
  letter-spacing: 0;
}

em {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
}

/*
  Shared layout and navigation
  ---------------------------------------------------------------------------
  These classes are reused across the homepage and note pages.
*/
.site-header {
  min-height: 84px;
  padding: 0 5vw;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.wordmark {
  font: 500 1.5rem/1 "DM Mono", monospace;
  letter-spacing: -0.08em;
}

.wordmark span {
  color: var(--coral);
}

.site-nav {
  display: flex;
  gap: 2rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.site-nav a,
.header-link,
footer a {
  transition: color 180ms ease;
}

.site-nav a:hover,
.header-link:hover,
footer a:hover {
  color: var(--coral);
}

.header-link {
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
}

.menu-button {
  display: none;
  cursor: pointer;
  background: transparent;
  border: 0;
}

.menu-button span {
  display: block;
  width: 24px;
  height: 1px;
  background: var(--ink);
  transition: transform 180ms ease, opacity 180ms ease;
}

/*
  Homepage hero and intro sections
  ---------------------------------------------------------------------------
*/
.hero {
  padding: 7.5rem 5vw 5.5rem;
  min-height: 700px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 4vw;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.hero::before {
  content: "";
  width: 9rem;
  height: 9rem;
  right: 45%;
  top: 9rem;
  position: absolute;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  pointer-events: none;
}

.eyebrow,
.section-label {
  margin: 0;
  color: var(--muted);
  font: 0.7rem/1.3 "DM Mono", monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  margin: 0 0.55rem 0 0;
  display: inline-block;
  border-radius: 50%;
  background: #7d9d00;
  box-shadow: 0 0 0 3px rgba(125, 157, 0, 0.15);
}

h1 {
  margin: 1.25rem 0 1.5rem;
  font-size: clamp(3.5rem, 7.1vw, 7.3rem);
  line-height: 0.86;
}

.hero-intro {
  max-width: 34rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

.text-link {
  display: inline-flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid currentColor;
  font: 500 0.78rem "DM Mono", monospace;
  text-transform: uppercase;
}

.hero-image {
  justify-self: end;
  width: min(100%, 470px);
}

.hero-image img {
  width: 100%;
  aspect-ratio: 0.85;
  object-fit: cover;
  filter: saturate(0.75) contrast(1.08);
}

.system-readout {
  margin-top: 0.75rem;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding-top: 0.65rem;
}

.system-readout p {
  margin: 0;
  font: 0.62rem/1.5 "DM Mono", monospace;
  text-transform: uppercase;
}

.system-readout span {
  color: var(--muted);
  display: block;
}

.statement {
  padding: 8rem 5vw;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
}

.statement .section-label {
  color: var(--acid);
}

.statement-lead {
  max-width: 930px;
  margin-bottom: 5rem;
  font-size: clamp(2rem, 4vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.capabilities {
  border-top: 1px solid rgba(245, 242, 234, 0.25);
  padding-top: 1rem;
  display: grid;
  grid-template-columns: 1fr 2fr;
  font: 0.7rem "DM Mono", monospace;
  text-transform: uppercase;
}

.capabilities p {
  color: var(--acid);
}

.capabilities ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

/*
  Section groups and cards
  ---------------------------------------------------------------------------
*/
.work-section,
.writing-section,
.playbooks-section,
.reading-section,
.finance-section {
  padding: 8rem 5vw;
}

.section-heading {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  margin-bottom: 4rem;
}

.section-heading h2 {
  max-width: 800px;
  margin: -0.5rem 0 0;
  font-size: clamp(2.7rem, 5vw, 5.5rem);
  line-height: 0.9;
}

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

.project--wide {
  grid-column: span 2;
}

.project-visual {
  min-height: 400px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 300ms ease;
}

.project--wide .project-visual {
  min-height: 510px;
}

.project-visual span {
  font: 0.75rem "DM Mono", monospace;
  position: relative;
  z-index: 1;
}

.project-visual strong {
  position: relative;
  z-index: 1;
  font-size: clamp(2rem, 4vw, 4.5rem);
  line-height: 0.95;
  font-weight: 500;
}

.visual-one {
  background-color: var(--acid);
  background-image: linear-gradient(rgba(29, 42, 36, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 42, 36, 0.1) 1px, transparent 1px);
  background-size: 28px 28px;
}

.window-lines {
  position: absolute;
  inset: 10% 7%;
  border: 1px solid var(--ink);
  background: repeating-linear-gradient(
    90deg,
    transparent 0 17%,
    rgba(29, 42, 36, 0.14) 17.1% 17.5%,
    transparent 17.6% 34%
  );
  transform: rotate(-8deg);
}

.visual-two {
  background: var(--coral);
  color: var(--paper);
}

.orbit {
  position: absolute;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.8;
}

.orbit-one {
  width: 95%;
  aspect-ratio: 1;
  left: -10%;
  top: -30%;
}

.orbit-two {
  width: 75%;
  aspect-ratio: 1;
  right: -18%;
  bottom: -24%;
}

.visual-three {
  background-color: #b8d9df;
  background-image: linear-gradient(45deg, rgba(29, 42, 36, 0.06) 25%, transparent 25%, transparent 75%, rgba(29, 42, 36, 0.06) 75%);
  background-size: 20px 20px;
}

.tile-grid {
  position: absolute;
  width: 70%;
  height: 70%;
  right: 4%;
  top: 12%;
  background-image: linear-gradient(var(--ink) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink) 1px, transparent 1px);
  background-size: 25% 25%;
  opacity: 0.8;
}

.project-meta {
  padding: 1.15rem 0 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.project-meta h3,
.project-meta p {
  margin: 0;
  font-size: 0.85rem;
}

.project-meta p {
  color: var(--muted);
  font: 0.65rem "DM Mono", monospace;
  text-transform: uppercase;
  text-align: right;
}

.project a:hover .project-visual {
  transform: scale(0.985);
}

.writing-section {
  border-top: 1px solid var(--line);
}

.writing-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.filter {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 0.6rem 0.8rem;
  color: var(--ink);
  font: 0.67rem "DM Mono", monospace;
  text-transform: uppercase;
  transition: background 180ms ease, color 180ms ease;
}

.filter:hover,
.filter.is-active {
  background: var(--ink);
  color: var(--paper);
}

.article {
  padding: 1.75rem 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  align-items: center;
  gap: 2rem;
  transition: padding 200ms ease, background 200ms ease;
}

.article:hover {
  padding-left: 1rem;
  padding-right: 1rem;
  background: var(--panel);
}

.article.is-disabled {
  opacity: 0.75;
  cursor: default;
}

.article-meta {
  font: 0.67rem/1.6 "DM Mono", monospace;
  color: var(--muted);
  text-transform: uppercase;
}

.article h3 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  font-weight: 500;
}

.article-arrow {
  font-size: 1.5rem;
}

.playbooks-section {
  background: #e5e1d4;
}

.section-intro {
  max-width: 34rem;
  margin: 1.5rem 0 0;
  font-size: 1rem;
  line-height: 1.65;
}

.playbook-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--ink);
  border: 1px solid var(--ink);
}

.playbook-card {
  grid-column: span 2;
  min-height: 510px;
  padding: 1.5rem;
  background: var(--acid);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.playbook-card:nth-child(4),
.playbook-card:nth-child(5) {
  grid-column: span 3;
}

.playbook-card--dark {
  color: var(--paper);
  background: var(--ink);
}

.playbook-card--coral {
  background: var(--coral);
}

.playbook-card--blue {
  background: #b8d9df;
}

.playbook-card--paper {
  background: #f7f3dc;
}

.playbook-number,
.playbook-type,
.playbook-footer {
  font: 0.67rem/1.55 "DM Mono", monospace;
  text-transform: uppercase;
}

.playbook-number {
  margin: 0;
}

.playbook-type {
  margin-bottom: 0.85rem;
}

.playbook-card h3 {
  margin: 0;
  font-size: clamp(1.7rem, 2.7vw, 3rem);
  line-height: 0.96;
  font-weight: 500;
}

.playbook-description {
  max-width: 21rem;
  margin: 1.5rem 0 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.playbook-footer {
  border-top: 1px solid currentColor;
  padding-top: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
}

.playbook-footer p {
  margin: 0;
}

.playbook-footer a {
  padding-bottom: 0.25rem;
  border-bottom: 1px solid currentColor;
  white-space: nowrap;
  transition: opacity 180ms ease;
}

.playbook-footer a:hover {
  opacity: 0.6;
}

.book-grid,
.finance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--ink);
  border: 1px solid var(--ink);
}

.book-card,
.finance-card {
  min-height: 360px;
  padding: 1.5rem;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: background 180ms ease;
}

.book-card:hover,
.finance-card:hover {
  background: var(--panel);
}

.book-number,
.book-type,
.book-footer,
.finance-number,
.finance-type,
.finance-footer {
  font: 0.67rem/1.55 "DM Mono", monospace;
  text-transform: uppercase;
}

.book-number,
.finance-number {
  margin: 0;
  color: var(--muted);
}

.book-type,
.finance-type {
  margin-bottom: 0.85rem;
  color: var(--muted);
}

.book-card h3,
.finance-card h3 {
  margin: 0;
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  line-height: 1;
  font-weight: 500;
}

.book-card > a,
.finance-card > a {
  display: block;
}

.book-description,
.finance-description {
  max-width: 22rem;
  margin: 1.25rem 0 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #4a5249;
}

.book-footer,
.finance-footer {
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
}

.book-footer p,
.finance-footer p {
  margin: 0;
}

.book-footer a,
.finance-footer a {
  white-space: nowrap;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid currentColor;
  transition: opacity 180ms ease;
}

.book-footer a:hover,
.finance-footer a:hover {
  opacity: 0.6;
}

/*
  Note page styles
  ---------------------------------------------------------------------------
*/
.note-page main {
  padding: 3rem 5vw 6rem;
  max-width: 780px;
  margin: 0 auto;
}

.note-back {
  display: inline-flex;
  gap: 0.6rem;
  font: 500 0.72rem "DM Mono", monospace;
  text-transform: uppercase;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid currentColor;
}

.note-meta {
  margin: 2rem 0 0.5rem;
  font: 0.7rem "DM Mono", monospace;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.note-page h1 {
  margin: 0.5rem 0 2.5rem;
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  line-height: 0.95;
}

.note-content h2 {
  margin: 3rem 0 1rem;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 500;
  border-top: 1px solid var(--line);
  padding-top: 2rem;
}

.note-content h2:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.note-content p,
.note-content li {
  font-size: 1rem;
  line-height: 1.75;
}

.note-content ul,
.note-content ol {
  padding-left: 1.2rem;
  margin: 0 0 1.25rem;
}

.note-content li {
  margin-bottom: 0.6rem;
}

.note-content blockquote {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  border-left: 2px solid var(--coral);
  background: var(--panel);
  font-style: italic;
}

.note-content blockquote p {
  margin: 0;
}

.note-content strong {
  font-weight: 700;
}

.note-content table {
  width: 100%;
  margin: 0 0 1.5rem;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.note-content th,
.note-content td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.note-content th {
  font: 0.67rem "DM Mono", monospace;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-section {
  padding: 6rem 5vw 2.5rem;
  min-height: 530px;
  color: var(--paper);
  background: var(--coral);
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
}

.contact-section .section-label {
  color: var(--ink);
}

.contact-content h2 {
  margin: -0.75rem 0 3rem;
  font-size: clamp(4rem, 8vw, 8.5rem);
  line-height: 0.82;
}

.contact-link {
  display: inline-block;
  font: 500 1rem "DM Mono", monospace;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid currentColor;
}

footer {
  min-height: 110px;
  padding: 0 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 0.68rem "DM Mono", monospace;
}

footer p {
  margin: 0;
  color: var(--muted);
}

.reveal {
  animation: reveal 700ms both;
}

.hero-image {
  animation-delay: 120ms;
}

.project:nth-child(2) {
  animation-delay: 100ms;
}

.project:nth-child(3) {
  animation-delay: 180ms;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 700px) {
  .site-header {
    min-height: 68px;
  }

  .site-nav,
  .header-link {
    display: none;
  }

  .menu-button {
    display: flex;
    padding: 0.5rem 0;
    flex-direction: column;
    gap: 5px;
  }

  .menu-button span {
    width: 25px;
  }

  .site-nav.is-open {
    display: flex;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    padding: 1.5rem 5vw;
    flex-direction: column;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 14px 20px rgba(29, 42, 36, 0.04);
  }

  .site-nav.is-open a {
    padding: 0.2rem 0;
  }

  .hero {
    padding-top: 4rem;
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .hero::before {
    right: -3rem;
    top: 5rem;
  }

  .hero-image {
    justify-self: stretch;
    width: 100%;
  }

  .hero-image img {
    aspect-ratio: 1.2;
  }

  .system-readout {
    grid-template-columns: 1fr;
  }

  .statement,
  .section-heading,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .statement,
  .work-section,
  .writing-section,
  .playbooks-section,
  .reading-section,
  .finance-section {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }

  .statement-lead {
    margin-bottom: 3rem;
  }

  .capabilities {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .capabilities p {
    margin-bottom: 0;
  }

  .capabilities ul {
    grid-template-columns: 1fr;
  }

  .section-heading {
    gap: 1rem;
    margin-bottom: 2.5rem;
  }

  .section-heading h2 {
    margin-top: 0;
  }

  .project-grid,
  .playbook-grid,
  .book-grid,
  .finance-grid {
    grid-template-columns: 1fr;
  }

  .project--wide,
  .playbook-card,
  .playbook-card:nth-child(4),
  .playbook-card:nth-child(5) {
    grid-column: auto;
  }

  .project-visual,
  .project--wide .project-visual {
    min-height: 320px;
  }

  .article {
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
  }

  .article-meta {
    grid-column: span 2;
  }

  .playbook-card,
  .book-card,
  .finance-card {
    min-height: 300px;
  }

  .contact-section {
    min-height: 420px;
  }

  .contact-content h2 {
    margin-top: 0;
  }

  footer {
    min-height: 90px;
  }
}