:root {
  color-scheme: light dark;
  --bg: #f3f2ee;
  --surface: #e9e8e3;
  --surface-strong: #deddd7;
  --text: #181a18;
  --muted: #60645f;
  --line: #c9c8c1;
  --accent: #b94418;
  --accent-ink: #fff8f4;
  --shadow: 0 24px 70px rgb(44 45 42 / 0.13);
  --radius: 22px;
  --shell: min(1180px, calc(100% - 40px));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Aptos", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  content: "";
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}

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

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

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

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
}

.nav {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 38px);
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
}

.nav-links a {
  transition: color 180ms ease;
}

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

.hero {
  display: grid;
  min-height: calc(100dvh - 71px);
  grid-template-columns: minmax(0, 0.88fr) minmax(420px, 1.12fr);
  align-items: center;
  gap: clamp(32px, 5vw, 76px);
  padding-block: clamp(48px, 8vh, 84px);
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.eyebrow,
.work-type {
  margin: 0 0 20px;
  color: var(--accent);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

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

h1 {
  max-width: none;
  margin-bottom: 24px;
  font-size: clamp(3.2rem, 5vw, 5.35rem);
  font-weight: 650;
  letter-spacing: -0.065em;
  line-height: 0.98;
}

.hero-lede {
  max-width: 23em;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.5vw, 1.22rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border: 1px solid var(--text);
  border-radius: 999px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  transition: transform 180ms ease, background-color 180ms ease, color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.button-secondary:hover {
  background: var(--text);
  color: var(--bg);
}

.hero-media {
  position: relative;
  margin: 0;
}

.hero-media::before {
  position: absolute;
  inset: -18px 18px 18px -18px;
  z-index: -1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  content: "";
}

.hero-media img {
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  object-fit: cover;
}

.principles {
  border-block: 1px solid var(--line);
}

.principle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.principle-grid p {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 30px clamp(18px, 3vw, 38px);
}

.principle-grid p + p {
  border-left: 1px solid var(--line);
}

.principle-grid p:first-child {
  padding-left: 0;
}

.principle-grid p:last-child {
  padding-right: 0;
}

.principle-grid span {
  color: var(--muted);
  font-size: 0.92rem;
}

.section {
  padding-block: clamp(84px, 11vw, 144px);
}

.section-heading {
  max-width: 720px;
  margin-bottom: clamp(42px, 6vw, 74px);
}

.section-heading h2,
.about h2 {
  margin-bottom: 18px;
  font-size: clamp(2.25rem, 4vw, 4.3rem);
  font-weight: 620;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.section-heading p {
  max-width: 56ch;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  grid-template-rows: auto auto;
  gap: 20px;
}

.work-item {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
}

.work-featured {
  display: grid;
  grid-row: 1 / 3;
  grid-template-rows: minmax(0, 1fr) auto;
}

.work-item img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
}

.work-visual img {
  aspect-ratio: 4 / 3;
}

.work-copy {
  padding: clamp(24px, 3vw, 38px);
}

.work-type {
  margin-bottom: 12px;
}

.work-copy h3 {
  margin-bottom: 12px;
  font-size: clamp(1.45rem, 2.4vw, 2.15rem);
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.work-copy p:not(.work-type) {
  max-width: 46ch;
  margin-bottom: 0;
  color: var(--muted);
}

.work-note {
  display: flex;
  min-height: 300px;
  align-items: flex-end;
  color: var(--accent-ink);
  background: var(--accent);
}

.work-note .work-type,
.work-note .work-copy p {
  color: color-mix(in srgb, var(--accent-ink) 82%, transparent);
}

.work-note .work-copy h3 {
  color: var(--accent-ink);
}

.work-note .work-proof {
  padding-top: 26px;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.82rem;
}

.method {
  background: var(--surface);
}

.method-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}

.method-flow div {
  display: grid;
  gap: 14px;
  padding: 26px 24px 0 0;
}

.method-flow div + div {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.method-flow span {
  color: var(--muted);
}

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

.writing-list article {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.7fr);
  gap: 40px;
  padding-block: 28px;
  border-bottom: 1px solid var(--line);
}

.writing-list h3 {
  margin-bottom: 0;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 620;
  letter-spacing: -0.025em;
}

.writing-list p {
  margin-bottom: 0;
  color: var(--muted);
}

.about {
  padding-block: clamp(82px, 10vw, 128px);
  background: var(--surface-strong);
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1fr);
  gap: clamp(40px, 8vw, 120px);
  align-items: start;
}

.about-grid p {
  max-width: 58ch;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
}

.site-footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-inner p {
  margin: 0;
}

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 560ms cubic-bezier(0.16, 1, 0.3, 1), transform 560ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141614;
    --surface: #1d201d;
    --surface-strong: #252825;
    --text: #f0f0ea;
    --muted: #b7bbb4;
    --line: #3b3f3a;
    --accent: #f06c37;
    --accent-ink: #17130f;
    --shadow: 0 24px 70px rgb(0 0 0 / 0.34);
  }

  .hero-media img,
  .work-item img {
    filter: brightness(0.88) contrast(1.04);
  }
}

@media (max-width: 900px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-block: 58px 84px;
  }

  .hero-copy {
    max-width: 690px;
  }

  .hero-media {
    width: calc(100% - 12px);
    margin-left: 12px;
  }

  .work-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }

  .work-featured {
    grid-column: 1 / 3;
    grid-row: auto;
  }

  .method-flow {
    grid-template-columns: 1fr 1fr;
    row-gap: 30px;
  }

  .method-flow div:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }
}

@media (max-width: 640px) {
  :root {
    --shell: min(100% - 28px, 1180px);
    --radius: 16px;
  }

  .nav {
    min-height: 62px;
  }

  .nav-links {
    gap: 16px;
    font-size: 0.84rem;
  }

  .nav-links a:nth-child(2),
  .nav-links a:nth-child(4) {
    display: none;
  }

  .hero {
    padding-block: 46px 68px;
  }

  h1 {
    font-size: clamp(2.9rem, 14vw, 4.2rem);
  }

  .hero-media::before {
    inset: -10px 10px 10px -10px;
  }

  .principle-grid,
  .work-grid,
  .method-flow,
  .writing-list article,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .principle-grid p,
  .principle-grid p:first-child,
  .principle-grid p:last-child {
    padding: 20px 0;
  }

  .principle-grid p + p {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .work-featured {
    grid-column: auto;
  }

  .work-item img {
    min-height: 220px;
  }

  .method-flow {
    row-gap: 0;
  }

  .method-flow div,
  .method-flow div + div,
  .method-flow div:nth-child(3) {
    padding: 22px 0;
    border-top: 0;
    border-bottom: 1px solid var(--line);
    border-left: 0;
  }

  .writing-list article {
    gap: 10px;
  }

  .footer-inner {
    min-height: 110px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
  }
}

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

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

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