:root {
  --paper: #f8f5ec;
  --paper-deep: #e7dfcf;
  --ink: #1e221f;
  --muted: #6e756e;
  --line: rgba(30, 34, 31, 0.16);
  --moss: #61765b;
  --clay: #b75f43;
  --blue: #315f7f;
  --yellow: #e2b84d;
  --white: #fffdf6;
  --shadow: 0 26px 70px rgba(30, 34, 31, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(30, 34, 31, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(30, 34, 31, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 78% 10%, rgba(226, 184, 77, 0.22), transparent 24rem),
    radial-gradient(circle at 8% 64%, rgba(49, 95, 127, 0.14), transparent 26rem),
    var(--paper);
  background-size: 34px 34px, 34px 34px, auto, auto, auto;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  content: "";
  pointer-events: none;
  opacity: 0.55;
  background-image:
    radial-gradient(rgba(30, 34, 31, 0.16) 1px, transparent 1px),
    linear-gradient(115deg, transparent 0 44%, rgba(183, 95, 67, 0.08) 44% 46%, transparent 46%);
  background-size: 19px 19px, 220px 220px;
}

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

#cogni-map {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.site-shell {
  position: fixed;
  top: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 20;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: 154px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.78);
  box-shadow: 0 16px 44px rgba(30, 34, 31, 0.1);
  backdrop-filter: blur(18px);
}

.wordmark span {
  display: block;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 2.2rem;
  line-height: 0.95;
}

.wordmark small,
.rail-nav a,
.owner-link,
.folio-meta,
.note-card span,
.systems-copy > span,
.contact-section span,
.portrait-card span {
  font-family: "Source Code Pro", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.wordmark small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.3;
}

.rail-nav {
  align-self: center;
  display: grid;
  gap: 8px;
}

.rail-nav a,
.owner-link {
  display: block;
  padding: 10px 8px;
  border-radius: 7px;
  color: #3d443d;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.rail-nav a:hover,
.owner-link:hover {
  background: rgba(97, 118, 91, 0.12);
}

main,
.footer {
  width: min(1180px, calc(100% - 220px));
  margin-left: calc((100% - min(1180px, calc(100% - 220px))) / 2 + 96px);
}

.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  grid-template-rows: auto 1fr;
  gap: 28px 46px;
  align-items: end;
  padding: 46px 0 56px;
}

.folio-meta {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--moss);
}

.hero-title h1 {
  max-width: 880px;
  margin: 0 0 30px;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(5rem, 11vw, 12rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.82;
}

.hero-title p {
  max-width: 680px;
  margin: 0;
  color: #3e453e;
  font-size: clamp(1.08rem, 2vw, 1.42rem);
  line-height: 1.66;
}

.field-note {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
  transform: rotate(-1.4deg);
}

.note-number {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  margin-bottom: 28px;
  border-radius: 50%;
  color: var(--white);
  background: var(--clay);
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.42rem;
}

.field-note p {
  color: #3e453e;
  line-height: 1.7;
}

.field-note a {
  display: inline-flex;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--white);
  background: var(--ink);
  font-weight: 800;
}

.notebook-section,
.systems-section,
.portrait-band,
.contact-section {
  padding: 92px 0;
  border-top: 1px solid var(--line);
}

.notebook-heading {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 46px;
  align-items: start;
  margin-bottom: 34px;
}

.notebook-heading span {
  color: var(--clay);
  font-family: "Source Code Pro", monospace;
  font-weight: 700;
}

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

h2 {
  margin-bottom: 18px;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(2.8rem, 6vw, 6.6rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 1.16rem;
}

.note-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 1fr;
  grid-auto-rows: minmax(190px, auto);
  gap: 18px;
}

.note-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.72);
}

.note-card.tall {
  grid-row: span 2;
  background: #ecdfc4;
}

.note-card.ink {
  color: var(--white);
  background: var(--ink);
}

.note-card span {
  display: block;
  margin-bottom: 58px;
  color: var(--blue);
}

.note-card.ink span {
  color: var(--yellow);
}

.note-card p,
.systems-copy p,
.system-ledger span,
.portrait-card p,
.contact-section p,
.quote-card p {
  color: var(--muted);
  line-height: 1.7;
}

.note-card.ink p {
  color: rgba(255, 253, 246, 0.74);
}

.systems-section {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(360px, 1.12fr);
  gap: 54px;
  align-items: start;
}

.systems-copy > span,
.contact-section span,
.portrait-card span {
  display: block;
  margin-bottom: 18px;
  color: var(--clay);
}

.system-ledger {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.system-ledger div {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 20px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.system-ledger div:last-child {
  border-bottom: 0;
}

.system-ledger strong {
  color: var(--ink);
}

.portrait-band {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1fr);
  gap: 18px;
}

.portrait-card,
.quote-card {
  min-height: 320px;
  padding: 30px;
  border-radius: 8px;
}

.portrait-card {
  color: var(--white);
  background: var(--moss);
}

.portrait-card span,
.portrait-card p {
  color: rgba(255, 253, 246, 0.78);
}

.quote-card {
  display: flex;
  align-items: flex-end;
  background: #d9c8a8;
}

.quote-card p {
  max-width: 680px;
  margin-bottom: 0;
  color: #3b3127;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 1;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 46px;
  align-items: end;
  padding-bottom: 110px;
}

.contact-list {
  display: grid;
  gap: 10px;
}

.contact-list a {
  min-height: 58px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.78);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.contact-list a:hover {
  background: var(--ink);
  color: var(--white);
}

.footer {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms ease, transform 700ms ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .site-shell {
    position: sticky;
    top: 10px;
    bottom: auto;
    left: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    width: min(100% - 22px, 1180px);
    margin: 10px auto 0;
  }

  .rail-nav {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-self: auto;
    margin-top: 12px;
  }

  .rail-nav a,
  .owner-link {
    writing-mode: horizontal-tb;
    transform: none;
  }

  .owner-link {
    align-self: start;
  }

  main,
  .footer {
    width: min(100% - 22px, 1180px);
    margin: 0 auto;
  }

  .hero,
  .notebook-heading,
  .systems-section,
  .portrait-band,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 54px;
  }

  .note-grid {
    grid-template-columns: 1fr 1fr;
  }

  .field-note {
    transform: none;
  }
}

@media (max-width: 620px) {
  .site-shell {
    padding: 12px;
  }

  .wordmark span {
    font-size: 1.9rem;
  }

  .owner-link {
    display: none;
  }

  .rail-nav a {
    flex: 1;
    padding: 9px 6px;
    text-align: center;
  }

  .folio-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-title h1 {
    font-size: clamp(4.2rem, 22vw, 6.8rem);
  }

  .notebook-section,
  .systems-section,
  .portrait-band,
  .contact-section {
    padding: 62px 0;
  }

  .note-grid,
  .system-ledger div {
    grid-template-columns: 1fr;
  }

  .note-card.tall {
    grid-row: auto;
  }

  .note-card span {
    margin-bottom: 34px;
  }

  .portrait-card,
  .quote-card {
    min-height: 240px;
    padding: 24px;
  }

  .footer {
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
