:root {
  --bg: #f3f1ea;
  --paper: #f7f5ef;
  --ink: #20201e;
  --soft-ink: #5f5d58;
  --line: #d4d0c5;
  --accent: #c5bfb0;
  --max: 1160px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: radial-gradient(circle at 15% -8%, #ffffff 0%, var(--bg) 45%, #ece8dd 100%);
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  line-height: 1.45;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before,
body::after {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  width: 26px;
  pointer-events: none;
  z-index: 0;
}

body::before {
  left: 0;
  border-right: 1px solid rgba(124, 119, 108, 0.18);
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 18px,
    rgba(108, 104, 96, 0.15) 18px 19px
  );
}

body::after {
  right: 0;
  border-left: 1px solid rgba(124, 119, 108, 0.18);
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 24px,
    rgba(108, 104, 96, 0.12) 24px 25px
  );
}

.paper-grain,
.dot-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.paper-grain {
  opacity: 0.28;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='2'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.07'/%3E%3C/svg%3E");
}

.dot-field {
  opacity: 0.35;
  background-image: radial-gradient(circle, rgba(28, 28, 28, 0.09) 0.8px, transparent 0.8px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%);
}

.site-header,
.page,
.site-footer {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.site-header {
  margin-top: 1rem;
  position: sticky;
  top: 12px;
  background: rgba(250, 248, 242, 0.9);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.72rem 1rem;
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.site-header.scrolled {
  background: rgba(247, 245, 239, 0.98);
  border-color: #cbc6ba;
  box-shadow: 0 10px 24px rgba(45, 45, 45, 0.1);
}

.brand-pill {
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.22rem 0.56rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.site-nav {
  display: flex;
  gap: 0.95rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--soft-ink);
  font-size: 0.88rem;
  font-family: "Sora", sans-serif;
  border-radius: 999px;
  padding: 0.2rem 0.44rem;
  transition: color 0.2s ease, background 0.2s ease;
}

.site-nav a:hover { color: var(--ink); }

.site-nav a.active {
  color: var(--ink);
  background: rgba(36, 36, 36, 0.07);
}

.page {
  margin-top: 1.8rem;
  display: grid;
  gap: 4.2rem;
  flex: 1;
  padding-bottom: 1.2rem;
}

.page::after {
  content: "";
  display: block;
  height: 80px;
  border-top: 1px solid rgba(122, 117, 107, 0.18);
  background:
    linear-gradient(to bottom, rgba(241, 237, 228, 0.4), transparent),
    repeating-linear-gradient(
      to right,
      transparent 0 20px,
      rgba(117, 112, 103, 0.08) 20px 21px
    );
  mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
}

.mono-label {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.72rem;
  color: #706d67;
}

h1, h2, h3, p, blockquote, pre {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: "Sora", sans-serif;
}

h1 {
  margin-top: 0.55rem;
  font-size: clamp(2.2rem, 6.9vw, 5.3rem);
  line-height: 0.92;
  max-width: 10ch;
}

h2 {
  margin-top: 0.45rem;
  font-size: clamp(1.45rem, 4vw, 2.8rem);
  line-height: 1.05;
  max-width: 16ch;
}

.hero {
  min-height: 78vh;
  display: grid;
  align-content: center;
}

.hero {
  grid-template-columns: 1.08fr 0.92fr;
  display: grid;
  gap: 1rem;
}

.hero-copy {
  display: grid;
  gap: 0.9rem;
  align-content: center;
}

.hero-support {
  max-width: 50ch;
  color: var(--soft-ink);
  font-size: clamp(0.98rem, 1.45vw, 1.22rem);
  font-family: "IBM Plex Mono", monospace;
  line-height: 1.55;
}

.hero-edge {
  max-width: 56ch;
  border-left: 2px solid #b8b1a3;
  padding-left: 0.7rem;
  color: #393733;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.cta-row a {
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fffdf8;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
}

.hero-portrait {
  margin: 0;
  display: grid;
  gap: 0.55rem;
  justify-items: end;
}

.portrait {
  width: min(100%, 460px);
  aspect-ratio: 4/5;
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid #2b2b2b;
  background: #070707;
  box-shadow: 0 18px 42px rgba(18, 18, 18, 0.28);
  isolation: isolate;
}

.portrait img {
  position: absolute;
  inset: 0;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.25) brightness(0.78);
  transform: scale(1.02);
  object-position: 50% 42%;
  transition: opacity 0.3s ease;
}

.portrait-mode-label {
  position: absolute;
  z-index: 5;
  top: 10px;
  left: 10px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(16, 16, 16, 0.8);
  color: #efefef;
  border-radius: 999px;
  padding: 0.25rem 0.5rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.portrait.mode-film img { opacity: 0.96; }

.portrait-caption {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  color: #6f6c66;
}

.marquee-wrap {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8f6f0;
  overflow: hidden;
}

.marquee {
  display: inline-flex;
  gap: 1.55rem;
  white-space: nowrap;
  font-family: "IBM Plex Mono", monospace;
  color: #5c5954;
  font-size: 0.8rem;
  padding: 0.88rem 0;
  animation: marquee 26s linear infinite;
}

@keyframes marquee {
  from { transform: translateX(0%); }
  to { transform: translateX(-50%); }
}

.section-header {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.95rem;
}

.page > section {
  position: relative;
  padding-top: 0.35rem;
}

.page > section::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1.7rem;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(120, 115, 106, 0.32), transparent);
}

.hairline {
  height: 1px;
  background: var(--line);
}

.writing-art .artifact-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  min-height: 360px;
  position: relative;
  overflow: hidden;
}

.artifact-text {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0.95rem;
  color: rgba(56, 56, 56, 0.2);
  font-family: "Caveat", cursive;
  font-size: clamp(14px, 1.4vw, 19px);
  line-height: 0.9;
  white-space: pre-wrap;
}

.artifact-focus {
  position: relative;
  z-index: 1;
  width: min(640px, calc(100% - 2rem));
  margin: 3.8rem auto;
  text-align: center;
}

.artifact-focus p:first-child {
  font-size: clamp(1.2rem, 2.8vw, 2rem);
  color: #2f2f2f;
}

.artifact-focus p:last-child {
  margin-top: 0.55rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6f6d67;
}

.story-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0.75rem;
}

.story-rail,
.story-main,
.capability-card,
.work-card,
.universe-card,
.signal-card,
.background-item,
.contact {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

.story-rail {
  padding: 0.7rem;
  display: grid;
  gap: 0.45rem;
  align-content: start;
}

.story-rail button {
  border: 1px solid var(--line);
  background: #f6f2e8;
  color: #6d6964;
  border-radius: 999px;
  padding: 0.4rem 0.65rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.73rem;
  text-align: left;
  cursor: pointer;
}

.story-rail button.active {
  background: #222;
  color: #f1f1f1;
}

.story-main {
  padding: 1rem;
  display: grid;
  gap: 0.72rem;
}

.story-main p {
  color: var(--soft-ink);
  max-width: 64ch;
  font-family: "IBM Plex Mono", monospace;
  line-height: 1.58;
}

.story-main blockquote {
  margin: 0.2rem 0 0;
  border-left: 2px solid #bdb8ad;
  padding-left: 0.75rem;
  color: #47443f;
  font-size: clamp(1rem, 1.35vw, 1.14rem);
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
}

.capability-card {
  padding: 0.9rem;
}

.capability-card p {
  margin-top: 0.38rem;
  color: var(--soft-ink);
}

.meta-tags {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.meta-tags span {
  border: 1px solid #ccc7bc;
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.64rem;
  color: #6f6b64;
  text-transform: uppercase;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.8rem;
}

.filter-row button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f6f3ea;
  color: #66635d;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.34rem 0.62rem;
  cursor: pointer;
}

.filter-row button.active {
  background: #202020;
  color: #f3f3f3;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}

.work-card {
  padding: 0.9rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.work-card:hover,
.universe-card:hover,
.signal-card:hover,
.capability-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(44, 44, 44, 0.08);
  border-color: #beb8ab;
}

.work-card p {
  margin-top: 0.35rem;
  color: var(--soft-ink);
}

.card-seq {
  margin-top: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.63rem;
  color: #78736b !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card-meta {
  margin-top: 0.65rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.67rem;
  color: #67645e;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.universe-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
}

.universe-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #faf7f1;
  padding: 0.95rem;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.universe-card p {
  margin-top: 0.34rem;
  color: var(--soft-ink);
}

.universe-card .tab {
  margin-top: 0.6rem;
  display: inline-block;
  border: 1px solid #cdc7ba;
  border-radius: 8px;
  padding: 0.2rem 0.45rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.62rem;
  color: #69655f;
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}

.signal-card {
  padding: 0.9rem;
  background: #f8f4eb;
}

.signal-card p {
  margin-top: 0.35rem;
  color: var(--soft-ink);
}

.background-accordion {
  display: grid;
  gap: 0.55rem;
}

.background-item {
  overflow: hidden;
}

.background-item button {
  width: 100%;
  border: 0;
  background: #f6f2e8;
  color: var(--ink);
  padding: 0.78rem 0.9rem;
  text-align: left;
  font: inherit;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.background-item .panel {
  padding: 0.85rem 0.9rem;
  color: var(--soft-ink);
  display: none;
  font-family: "IBM Plex Mono", monospace;
  line-height: 1.6;
}

.background-item.open .panel {
  display: block;
}

.contact {
  padding: 1.1rem;
}

.contact-text {
  margin-top: 0.55rem;
  max-width: 58ch;
  color: var(--soft-ink);
  font-family: "IBM Plex Mono", monospace;
  line-height: 1.58;
}

.site-footer {
  margin-top: 3rem;
  margin-bottom: 2rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  color: #75716a;
  font-size: 0.9rem;
}

.footer-note {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

.preview-more {
  margin-top: 0.7rem;
  text-align: right;
}

.preview-more a {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  color: #4f4b45;
  text-decoration: none;
  border-bottom: 1px solid rgba(79, 75, 69, 0.35);
}

.preview-more a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.work-card.placeholder {
  cursor: default;
  background: #f5f2ea;
  border-style: dashed;
}

.work-card.placeholder[aria-disabled="true"] {
  pointer-events: auto;
}

.work-card.placeholder:hover {
  transform: none;
  box-shadow: none;
  border-color: #c7c1b3;
}

@media (max-width: 1020px) {
  .hero,
  .story-grid,
  .capability-grid,
  .work-grid,
  .universe-grid,
  .signal-grid {
    grid-template-columns: 1fr;
  }

  .hero-portrait {
    justify-items: start;
  }

  .site-header {
    border-radius: 18px;
    flex-direction: column;
    gap: 0.55rem;
  }

  .site-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .site-footer {
    flex-direction: column;
    gap: 0.45rem;
  }
}
