@import url("https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400;500;600&display=swap");

:root {
  color-scheme: light;
  --paper: #f4f1ea;
  --paper-soft: #ebe7dc;
  --ink: #171512;
  --text: #171512;
  --muted: #776f63;
  --dim: #aaa193;
  --line: rgb(23 21 18 / 13%);
  --line-strong: rgb(23 21 18 / 25%);
  --accent: #8fa99a;
  --accent-2: #6f8f9a;
  --clay: #b87655;
  --icon-fill: rgb(143 169 154 / 28%);
  --copy: #2a2a2a;
  --header-bg: rgb(255 255 255 / 84%);
  --panel-bg: rgb(255 255 255 / 84%);
  --chip-bg: rgb(255 255 255 / 78%);
  --cell-bg: rgb(255 255 255 / 72%);
  --body-grid-a: rgb(23 21 18 / 7%);
  --body-grid-b: rgb(23 21 18 / 4%);
  --body-grid-c: rgb(143 169 154 / 14%);
  --canvas-bg: #f4f1ea;
  --canvas-glow-a: rgba(111, 143, 154, 0.16);
  --canvas-glow-b: rgba(143, 169, 154, 0.1);
  --canvas-glow-end: rgba(244, 241, 234, 0);
  --canvas-grid-soft: 143, 169, 154;
  --canvas-grid-ink: 23, 21, 18;
  --max: 1520px;
  --mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  --pixel: "Pixelify Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111315;
  --paper-soft: #1a1d1f;
  --ink: #f0eee8;
  --text: #f0eee8;
  --muted: #aaa398;
  --dim: #746f66;
  --line: rgb(240 238 232 / 13%);
  --line-strong: rgb(240 238 232 / 24%);
  --accent: #789287;
  --accent-2: #87aebb;
  --clay: #c08a6c;
  --icon-fill: rgb(120 146 135 / 32%);
  --copy: #d2ccc0;
  --header-bg: rgb(17 19 21 / 84%);
  --panel-bg: rgb(26 29 31 / 82%);
  --chip-bg: rgb(26 29 31 / 78%);
  --cell-bg: rgb(26 29 31 / 72%);
  --body-grid-a: rgb(240 238 232 / 7%);
  --body-grid-b: rgb(240 238 232 / 4%);
  --body-grid-c: rgb(135 174 187 / 11%);
  --canvas-bg: #111315;
  --canvas-glow-a: rgba(135, 174, 187, 0.14);
  --canvas-glow-b: rgba(120, 146, 135, 0.1);
  --canvas-glow-end: rgba(17, 19, 21, 0);
  --canvas-grid-soft: 120, 146, 135;
  --canvas-grid-ink: 240, 238, 232;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--text);
  font-family: "Helvetica Neue", Helvetica, Arial, "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: "ss06" 1;
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0;
  background: transparent;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(90deg, var(--body-grid-a) 1px, transparent 1px),
    repeating-linear-gradient(0deg, var(--body-grid-b) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, var(--body-grid-c) 0 1px, transparent 1px 5px);
  background-size: 14px 100%, auto, auto;
  mix-blend-mode: multiply;
}

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

a:hover,
a.active {
  color: var(--accent-2);
}

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

button,
input,
select {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

main,
.site-footer,
.site-controls,
.controls-toggle {
  position: relative;
  z-index: 2;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 54px;
  padding: 0 28px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 34px;
  padding: 0;
  color: var(--text);
  background: var(--chip-bg);
  border: 1px solid var(--line);
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--accent);
  border-color: var(--ink);
}

.theme-toggle svg {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
  transform: rotate(-4deg);
}

.theme-toggle .sketch-fill {
  fill: var(--icon-fill);
  stroke: none;
}

.theme-toggle:hover svg {
  transform: rotate(4deg) translateY(-1px);
}

.theme-toggle .sun-icon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .sun-icon {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .moon-icon {
  display: none;
}

.brand {
  width: max-content;
  max-width: 56vw;
  color: var(--text);
  font-family: var(--pixel);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.site-nav,
.site-footer nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  color: var(--muted);
  font-family: var(--pixel);
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
}

.site-nav {
  min-width: 0;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.page-shell {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: 0 28px;
}

.hero {
  min-height: calc(100vh - 54px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: 42px;
  padding-bottom: 28px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 44px;
}

.hero-copy {
  display: grid;
  min-height: 58vh;
  align-content: space-between;
}

.kicker,
.eyebrow {
  margin: 0;
  color: var(--clay);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 1160px;
  margin-bottom: 0;
  font-size: clamp(68px, 13vw, 220px);
  line-height: 0.84;
  font-weight: 400;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.hero-statement {
  max-width: 720px;
  margin: 24px 0 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-family: var(--mono);
  font-size: clamp(13px, 1.2vw, 18px);
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero-statement::first-letter {
  color: inherit;
}

.hero-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 24px;
}

.control-board {
  display: grid;
  gap: 14px;
  padding: 16px;
  width: min(440px, 100%);
  color: var(--muted);
  background: var(--panel-bg);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-controls {
  position: fixed;
  right: 18px;
  bottom: 68px;
  z-index: 20;
  width: min(360px, calc(100vw - 36px));
  padding: 10px;
  gap: 8px;
  box-shadow: 0 10px 34px rgb(23 21 18 / 10%);
}

.controls-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 21;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--text);
  background: var(--chip-bg);
  border: 1px solid var(--line);
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.controls-toggle:hover,
.controls-toggle.active {
  background: var(--accent);
  border-color: var(--ink);
}

.controls-toggle svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.board-row {
  display: grid;
  grid-template-columns: 64px repeat(3, 1fr);
  gap: 8px;
  align-items: center;
}

.board-row span {
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.board-row button {
  min-height: 34px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.board-row button:hover,
.board-row button.active {
  color: var(--ink);
  background: var(--accent);
  border-color: var(--ink);
}

.control-board p,
.project-row-description,
.project-header p,
.empty-state {
  color: var(--copy);
  text-align: justify;
  text-align-last: left;
}

.signal-strip,
.contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 28px;
}

.signal-strip a,
.signal-strip span,
.contact-list a,
.contact-list span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  color: var(--text);
  background: var(--chip-bg);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.signal-strip .social-icon {
  justify-content: center;
  width: 36px;
  min-height: 36px;
  padding: 0;
}

.signal-strip .social-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.signal-strip a:hover,
.contact-list a:hover {
  color: var(--ink);
  background: var(--accent);
  border-color: var(--ink);
}

.section-heading h2 {
  max-width: 980px;
  margin: 0;
  font-size: clamp(36px, 5.4vw, 86px);
  line-height: 0.98;
  font-weight: 400;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.work-index {
  padding-top: 72px;
  padding-bottom: 82px;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(180px, 0.34fr) minmax(0, 1fr);
  gap: 42px;
  padding: 28px 0 38px;
  border-top: 1px solid var(--line-strong);
}

.project-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.project-row {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(180px, 0.8fr) minmax(220px, 0.9fr) minmax(160px, 240px) 130px;
  gap: 18px;
  align-items: center;
  min-height: 190px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.project-row::before {
  content: "";
  position: absolute;
  inset: 8px -12px;
  z-index: -1;
  background: rgb(143 169 154 / 0%);
  transform: skewY(-0.2deg);
  transition: background 180ms ease;
}

.project-row:hover::before {
  background: rgb(143 169 154 / 24%);
}

.project-number,
.project-row-type {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.project-row-title {
  font-size: clamp(34px, 6.2vw, 94px);
  line-height: 0.9;
  font-weight: 400;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.project-row-media {
  overflow: hidden;
  justify-self: stretch;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  mix-blend-mode: multiply;
}

.project-row-media img {
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  filter: grayscale(0.1) contrast(1.05) saturate(0.92);
  transition: transform 420ms ease, filter 420ms ease;
}

.project-row:hover .project-row-media img {
  transform: scale(1.08);
  filter: grayscale(0) contrast(1.08) saturate(1.04);
}

.archive,
.project-page,
.contact {
  min-height: calc(100vh - 54px);
  padding-top: 72px;
  padding-bottom: 110px;
}

.page-title {
  display: grid;
  grid-template-columns: minmax(180px, 0.34fr) minmax(0, 1fr);
  gap: 42px;
  align-items: end;
  margin-bottom: 48px;
}

.page-title h1,
.contact h1 {
  margin: 0;
  font-size: clamp(54px, 9vw, 142px);
  line-height: 0.86;
  font-weight: 400;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.project-header {
  display: grid;
  grid-template-columns: 140px 160px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-bottom: 48px;
}

.project-header h1 {
  grid-column: 3;
  font-size: clamp(58px, 10vw, 164px);
}

.project-header p:last-child {
  grid-column: 3;
  max-width: 720px;
  margin: 10px 0 0;
  font-size: 18px;
  line-height: 1.5;
}

.back-link {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.image-stack {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.image-stack img {
  width: 100%;
  min-height: 260px;
  max-height: 980px;
  object-fit: cover;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  mix-blend-mode: multiply;
}

.image-stack img:nth-child(6n + 1) {
  grid-column: span 7;
  aspect-ratio: 4 / 5;
}

.image-stack img:nth-child(6n + 2) {
  grid-column: span 5;
  aspect-ratio: 5 / 6;
}

.image-stack img:nth-child(6n + 3) {
  grid-column: 3 / span 8;
  aspect-ratio: 16 / 10;
}

.image-stack img:nth-child(6n + 4),
.image-stack img:nth-child(6n + 5) {
  grid-column: span 6;
  aspect-ratio: 4 / 3;
}

.image-stack img:nth-child(6n + 6) {
  grid-column: 2 / span 10;
  aspect-ratio: 16 / 9;
}

.contact {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.contact h1 {
  max-width: 1180px;
  margin-top: 18px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

@media (max-width: 940px) {
  body::after {
    background-size: 28px 100%, auto, auto;
  }

  .site-header {
    padding: 0 16px;
    gap: 14px;
  }

  .site-nav {
    gap: 12px;
  }

  .page-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

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

  .hero-grid,
  .section-heading,
  .page-title,
  .project-header {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero-copy {
    min-height: auto;
  }

  h1 {
    font-size: clamp(58px, 17vw, 118px);
  }

  .hero-statement {
    font-size: clamp(12px, 3.4vw, 16px);
  }

  .hero-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .control-board {
    max-width: 520px;
  }

  .work-index {
    padding-top: 58px;
    padding-bottom: 72px;
  }

  .project-row {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 14px;
    min-height: auto;
    padding: 22px 0 28px;
  }

  .project-row-title,
  .project-row-description,
  .project-row-media,
  .project-row-type {
    grid-column: 2;
  }

  .project-row-media {
    width: min(100%, 440px);
  }

  .project-header h1,
  .project-header p:last-child {
    grid-column: auto;
  }

  .image-stack {
    grid-template-columns: 1fr;
  }

  .image-stack img:nth-child(n) {
    grid-column: auto;
    aspect-ratio: 4 / 5;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px 16px;
  }
}

@media (max-width: 560px) {
  .site-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 48px;
    gap: 8px;
    padding: 0 12px;
  }

  .site-nav {
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 7px;
    font-size: clamp(7px, 2.35vw, 10px);
  }

  .brand {
    max-width: 100%;
    font-size: clamp(10px, 2.85vw, 13px);
  }

  .theme-toggle {
    width: 28px;
    height: 28px;
  }

  .theme-toggle svg {
    width: 14px;
    height: 14px;
  }

  .board-row {
    grid-template-columns: 50px repeat(3, minmax(44px, 1fr));
    gap: 6px;
  }

  .site-controls {
    right: 12px;
    bottom: 58px;
    width: calc(100vw - 24px);
    padding: 8px;
  }

  .controls-toggle {
    right: 12px;
    bottom: 12px;
    width: 38px;
    height: 38px;
  }

  .controls-toggle svg {
    width: 23px;
    height: 23px;
  }

  .site-controls .board-row button {
    min-height: 30px;
    font-size: 10px;
  }

  .signal-strip a,
  .signal-strip span,
  .contact-list a,
  .contact-list span {
    min-height: 32px;
    padding: 0 10px;
    font-size: 10px;
  }
}
