/* "Sheet": calm, architectural, drawing-sheet grid. */
:root {
  --bg: #141413;
  --ink: #e9e7e1;
  --muted: #8d8a83;
  --line: #2e2d2a;
  --grid: rgba(233, 231, 225, 0.045);
  --accent: #ff6a45;
  --ph-bg: #1c1c1a;
  --ph-soft: #2a2926;
  --ph-ink: #6f6c66;
  --ph-line: #3c3a36;

  --font-sans: "Switzer", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Fragment Mono", ui-monospace, Menlo, monospace;
  --gutter: clamp(16px, 3vw, 40px);
}

:root[data-theme="light"] {
  --bg: #ebe9e3;
  --ink: #171717;
  --muted: #6b6963;
  --line: #c9c6be;
  --grid: rgba(23, 23, 23, 0.05);
  --accent: #c6401f;
  --ph-bg: #e1ded6;
  --ph-soft: #d3cfc5;
  --ph-ink: #8a867d;
  --ph-line: #bdb8ad;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

/* 12-column hairline grid, fixed behind everything */
.grid-lines {
  position: fixed;
  inset: 0 var(--gutter);
  z-index: -1;
  background-image: repeating-linear-gradient(
    to right,
    var(--grid) 0 1px,
    transparent 1px calc(100% / 12)
  );
  border-right: 1px solid var(--grid);
  pointer-events: none;
}

.site-header,
main,
.title-block {
  padding-inline: var(--gutter);
}

.site-header {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: baseline;
  padding-block: 22px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.brand {
  grid-column: 1 / 4;
  text-decoration: none;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.header-note {
  grid-column: 4 / 8;
  margin: 0;
  color: var(--muted);
}

.site-header nav {
  grid-column: 8 / 13;
  display: flex;
  justify-content: flex-end;
  gap: 22px;
}

.site-header nav a {
  text-decoration: none;
}

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

.theme-toggle {
  border: 0;
  padding: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

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

.show-dark,
.show-light {
  display: none;
}

:root[data-theme="dark"] .show-dark,
:root[data-theme="light"] .show-light {
  display: inline;
}

/* Hero */
.hero {
  padding-block: clamp(80px, 16vh, 180px) clamp(64px, 10vh, 120px);
}

h1 {
  margin: 0;
  font-weight: 300;
  font-size: clamp(2.1rem, 6.4vw, 6.6rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.hero-line {
  display: block;
  position: relative;
}

.hero-num {
  position: absolute;
  left: 0;
  top: 0.55em;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0;
  color: var(--accent);
  transform: translateX(-130%);
}

.hero-meta {
  margin: 48px 0 0 calc(100% / 12 * 7);
  max-width: 38ch;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
}

/* Work index */
.work {
  padding-block: 40px 120px;
  border-top: 1px solid var(--line);
}

.work-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

h2 {
  margin: 0;
  font-weight: 400;
  font-size: 1rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.filters button {
  border: 0;
  padding: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.filters button[aria-pressed="true"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 5px;
}

.work-body {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 0;
}

.index {
  grid-column: 1 / 8;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.row {
  border-bottom: 1px solid var(--line);
}

.row-link {
  display: grid;
  grid-template-columns: 3.5rem 1fr auto 4rem;
  align-items: baseline;
  gap: 16px;
  padding: 22px 0;
  text-decoration: none;
  transition: padding 0.3s ease, color 0.3s ease;
}

.row-no,
.row-type,
.row-year {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.row-year {
  text-align: right;
}

.row-title {
  font-size: clamp(1.4rem, 2.6vw, 2.3rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.row.is-active .row-link {
  padding-left: 14px;
}

.row.is-active .row-no {
  color: var(--accent);
}

.row-thumb {
  display: none;
}

.preview {
  grid-column: 9 / 13;
  position: sticky;
  top: 24px;
  align-self: start;
  margin: 0;
}

.preview-frame {
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.preview-frame .ph,
.preview-frame img,
.row-thumb .ph {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview figcaption {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.ph-bg { fill: var(--ph-bg); }
.ph { background: var(--ph-bg); }
.ph-soft { fill: var(--ph-soft); }
.ph-ink { fill: var(--ph-ink); }
.ph-line { fill: var(--ph-line); }
.ph-acc { fill: var(--accent); }

/* Disciplines */
.disciplines {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.discipline {
  padding: 28px 28px 80px 0;
}

.discipline + .discipline {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.discipline-no {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
}

.discipline h3 {
  margin: 40px 0 10px;
  font-weight: 400;
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  letter-spacing: -0.015em;
}

.discipline p {
  margin: 0;
  max-width: 32ch;
  color: var(--muted);
}

/* About */
.about {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  padding-block: 120px;
  border-top: 1px solid var(--line);
}

.about-statement {
  grid-column: 1 / 8;
  font-weight: 300;
  font-size: clamp(1.7rem, 3.6vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.about-text {
  grid-column: 9 / 13;
  color: var(--muted);
}

.about-text p {
  margin: 0 0 1em;
}

/* Footer as a drawing title block */
.title-block {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  margin-top: 40px;
  margin-bottom: var(--gutter);
}

.tb-cell {
  padding: 16px;
  border: 1px solid var(--line);
  margin: 0 -1px -1px 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.tb-cell a {
  margin-right: 10px;
}

.tb-cell a:hover {
  color: var(--accent);
}

.tb-label {
  display: block;
  margin-bottom: 18px;
  color: var(--muted);
}

.tb-big {
  font-family: var(--font-sans);
  font-size: clamp(1.1rem, 2.4vw, 2rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  text-decoration: none;
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 1fr auto;
    row-gap: 6px;
  }

  .brand {
    grid-column: 1;
  }

  .header-note {
    display: none;
  }

  .site-header nav {
    grid-column: 2;
    gap: 14px;
  }

  .hero-num {
    position: static;
    display: block;
    transform: none;
    margin-top: 0.6em;
  }

  .hero-meta {
    margin-left: 0;
  }

  .index {
    grid-column: 1 / -1;
  }

  .preview {
    display: none;
  }

  .row-link {
    grid-template-columns: 2.4rem 1fr auto;
  }

  .row-type {
    display: none;
  }

  .row-thumb {
    display: block;
    aspect-ratio: 16 / 10;
    margin-bottom: 22px;
  }

  .row.is-active .row-link {
    padding-left: 0;
  }

  .disciplines,
  .about,
  .title-block {
    grid-template-columns: 1fr;
  }

  .discipline,
  .discipline + .discipline {
    padding: 24px 0 40px;
    border-left: 0;
  }

  .discipline + .discipline {
    border-top: 1px solid var(--line);
  }

  .about {
    padding-block: 80px;
    row-gap: 32px;
  }

  .about-statement,
  .about-text {
    grid-column: 1;
  }
}

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

  .row-link {
    transition: none;
  }
}
