:root {
  --paper: #f4f7ef;
  --paper-strong: #ffffff;
  --ink: #161715;
  --muted: #5d6258;
  --line: #cfd7c6;
  --line-strong: #a8b59e;
  --red: #e44732;
  --teal: #0b8f8d;
  --moss: #78913b;
  --blue: #2869a6;
  --shadow: 0 18px 50px rgba(22, 23, 21, 0.1);
  --radius: 8px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(22, 23, 21, 0.045) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(0deg, rgba(22, 23, 21, 0.04) 1px, transparent 1px) 0 0 / 42px 42px,
    var(--paper);
  color: var(--ink);
  font-family:
    "Avenir Next", "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui,
    sans-serif;
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(228, 71, 50, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 143, 141, 0.07) 1px, transparent 1px);
  background-size: 100% 19px, 29px 100%;
  mix-blend-mode: multiply;
  opacity: 0.42;
}

::selection {
  background: var(--red);
  color: var(--paper-strong);
}

a {
  color: inherit;
  text-decoration-color: rgba(22, 23, 21, 0.35);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-color: currentColor;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 20;
  transform: translateY(-140%);
  background: var(--ink);
  color: var(--paper-strong);
  padding: 10px 14px;
  border-radius: var(--radius);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: calc(var(--max) + 48px);
  min-height: 72px;
  margin: 0 auto;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(22, 23, 21, 0.1);
  background: rgba(244, 247, 239, 0.86);
  backdrop-filter: blur(14px);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--red);
  font-family: "SF Mono", "Cascadia Code", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 800;
}

.brand-lockup strong,
.brand-lockup small {
  display: block;
}

.brand-lockup strong {
  font-size: 16px;
  line-height: 1.1;
}

.brand-lockup small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.site-nav a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  border: 1px solid transparent;
  padding: 6px 10px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.site-nav a:hover {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.48);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(320px, 1.12fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  width: min(var(--max), calc(100% - 40px));
  min-height: clamp(560px, calc(100svh - 112px), 760px);
  margin: 0 auto;
  padding: clamp(36px, 7vw, 78px) 0 44px;
}

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

.eyebrow {
  margin: 0 0 14px;
  color: var(--teal);
  font-family: "SF Mono", "Cascadia Code", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2 {
  margin: 0;
  font-family: "Bodoni 72", "Didot", "Georgia", "Songti SC", serif;
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  font-size: clamp(76px, 15vw, 188px);
}

h2 {
  font-size: clamp(42px, 8vw, 94px);
}

h3 {
  margin: 0;
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.1;
}

.hero-lede {
  max-width: 540px;
  margin: 22px 0 0;
  color: #353a33;
  font-size: clamp(18px, 2.4vw, 23px);
  line-height: 1.55;
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 10px 16px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

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

.button-primary {
  background: var(--ink);
  color: var(--paper-strong);
  box-shadow: 6px 6px 0 var(--red);
}

.button-primary:hover {
  box-shadow: 4px 4px 0 var(--red);
}

.button-quiet {
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
}

.signal-stage {
  position: relative;
  min-height: clamp(360px, 54vw, 640px);
  overflow: hidden;
  border: 1px solid rgba(22, 23, 21, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(22, 23, 21, 0.08) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(0deg, rgba(22, 23, 21, 0.08) 1px, transparent 1px) 0 0 / 28px 28px,
    #eef3e7;
  box-shadow: var(--shadow);
  isolation: isolate;
}

.signal-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 10px solid rgba(255, 255, 255, 0.24);
  mix-blend-mode: screen;
}

#signalCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.signal-caption {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  justify-content: space-between;
  border: 1px solid rgba(22, 23, 21, 0.22);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: rgba(244, 247, 239, 0.82);
  backdrop-filter: blur(8px);
  font-family: "SF Mono", "Cascadia Code", ui-monospace, monospace;
  font-size: 12px;
}

.signal-caption span {
  color: var(--red);
  font-weight: 800;
  text-transform: uppercase;
}

.identity-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

.identity-strip p {
  min-height: 86px;
  margin: 0;
  padding: 20px 22px;
  border-right: 1px solid var(--line-strong);
  color: #30372d;
  font-size: 18px;
  font-weight: 800;
}

.identity-strip p:last-child {
  border-right: 0;
}

.section {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(74px, 12vw, 130px) 0 0;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1fr);
  gap: 22px clamp(28px, 5vw, 72px);
  align-items: end;
  margin-bottom: 30px;
}

.section-heading .eyebrow {
  grid-column: 1 / -1;
  margin: 0;
}

.section-heading p:not(.eyebrow) {
  max-width: 560px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 18px;
}

.filter-bar {
  display: inline-flex;
  max-width: 100%;
  gap: 6px;
  margin: 0 0 18px;
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 6px;
  background: rgba(255, 255, 255, 0.5);
}

.filter-button {
  min-width: 72px;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.filter-button:hover,
.filter-button.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper-strong);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}

.project-card {
  min-height: 310px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 22px;
  background: rgba(255, 255, 255, 0.5);
}

.project-card[hidden] {
  display: none;
}

.project-card:hover {
  background: var(--paper-strong);
}

.project-kicker {
  margin: 0;
  color: var(--red);
  font-family: "SF Mono", "Cascadia Code", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.project-card p:not(.project-kicker) {
  margin: 0;
  color: var(--muted);
}

.project-card a {
  width: fit-content;
  margin-top: auto;
  color: var(--teal);
  font-weight: 800;
  text-decoration-thickness: 2px;
}

.now-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.now-item {
  min-height: 210px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 22px;
  background: rgba(255, 255, 255, 0.44);
}

.now-item:nth-child(2) {
  border-color: rgba(11, 143, 141, 0.6);
}

.now-item:nth-child(3) {
  border-color: rgba(40, 105, 166, 0.58);
}

.now-item p {
  margin: 14px 0 0;
  color: var(--muted);
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.7fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
  width: min(var(--max), calc(100% - 40px));
  margin: clamp(78px, 12vw, 140px) auto 0;
  padding: clamp(34px, 5vw, 58px);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(228, 71, 50, 0.1) 1px, transparent 1px) 0 0 / 34px 34px,
    var(--paper-strong);
  box-shadow: 8px 8px 0 var(--teal);
}

.contact-section h2 {
  font-size: clamp(38px, 7vw, 78px);
}

.contact-section p:not(.eyebrow) {
  max-width: 650px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.contact-actions {
  justify-content: flex-start;
  margin-top: 0;
}

.copy-status {
  width: 100%;
  min-height: 24px;
  margin: 0;
  color: var(--moss);
  font-size: 14px;
  font-weight: 800;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 40px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer a {
  font-weight: 800;
}

@media (max-width: 960px) {
  .hero,
  .section-heading,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .project-grid,
  .now-grid,
  .identity-strip {
    grid-template-columns: 1fr;
  }

  .identity-strip p {
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .identity-strip p:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 640px) {
  body {
    background-size: 30px 30px, 30px 30px, auto;
  }

  .site-header {
    align-items: flex-start;
    padding-inline: 16px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .site-nav {
    gap: 4px;
  }

  .site-nav a {
    min-height: 32px;
    padding: 5px 7px;
    font-size: 13px;
  }

  .hero,
  .section,
  .identity-strip,
  .contact-section,
  .site-footer {
    width: min(100% - 28px, var(--max));
  }

  h1 {
    font-size: clamp(64px, 22vw, 112px);
  }

  .hero-lede,
  .section-heading p:not(.eyebrow),
  .contact-section p:not(.eyebrow) {
    font-size: 16px;
  }

  .signal-stage {
    min-height: 420px;
  }

  .project-card,
  .now-item {
    min-height: 220px;
  }

  .contact-section {
    padding: 26px 20px;
  }

  .button {
    width: 100%;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@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;
  }
}
