:root {
  color-scheme: light;
  --bg: #f4f6f7;
  --panel: #ffffff;
  --ink: #1d2228;
  --muted: #65717d;
  --line: #d8dee4;
  --accent: #0b6f70;
  --accent-weak: #dceeee;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.home-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 32px 0 42px;
}

.home-header {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 28px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
}

.kicker,
.project-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.home-header h1 {
  max-width: 760px;
  margin: 8px 0 0;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.02;
  letter-spacing: 0;
}

.home-lede {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.project-card {
  min-width: 0;
  min-height: 280px;
  display: grid;
  grid-template-rows: 150px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: inherit;
  text-decoration: none;
}

.project-card:hover {
  border-color: #aebcc4;
  box-shadow: 0 10px 24px rgba(29, 34, 40, 0.08);
  transform: translateY(-1px);
}

.project-card-featured {
  grid-column: span 2;
  grid-template-columns: minmax(360px, 0.92fr) minmax(0, 1.08fr);
  grid-template-rows: auto;
  min-height: 300px;
}

.project-card-wide {
  grid-column: span 2;
  grid-template-columns: minmax(360px, 0.92fr) minmax(0, 1.08fr);
  grid-template-rows: auto;
  min-height: 250px;
}

.project-visual {
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
  background: #f9fbfb;
}

.project-card-featured .project-visual {
  border-right: 1px solid var(--line);
  border-bottom: 0;
}

.project-card-wide .project-visual {
  border-right: 1px solid var(--line);
  border-bottom: 0;
  background: #10292d;
}

.project-visual svg {
  width: min(100%, 320px);
  height: 100%;
}

.project-visual path,
.project-visual circle,
.project-visual line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hyperbolic-preview circle {
  fill: #fcfefe;
  stroke: #9caab2;
  stroke-width: 2;
}

.hyperbolic-preview .octagon {
  fill: rgba(11, 111, 112, 0.08);
  stroke: #0b6f70;
  stroke-width: 3;
}

.hyperbolic-preview .geo-a,
.hyperbolic-preview .geo-b {
  stroke: #d63f2f;
  stroke-width: 4;
}

.hyperbolic-preview .geo-b {
  stroke: #6d5bd0;
  stroke-width: 2.5;
}

.hyperbolic-preview text {
  fill: #1d2228;
  font: 700 12px Inter, system-ui, sans-serif;
}

.tetra-preview .solid {
  fill: rgba(11, 111, 112, 0.1);
  stroke: #0b6f70;
  stroke-width: 3;
}

.tetra-preview .edge {
  stroke: #5b6872;
  stroke-width: 2;
}

.tetra-preview .path {
  stroke: #d63f2f;
  stroke-width: 4;
}

.essay-preview .panel {
  fill: rgba(176, 92, 0, 0.1);
  stroke: #b05c00;
  stroke-width: 3;
}

.essay-preview .ray {
  stroke: #d63f2f;
  stroke-width: 4;
}

.essay-preview .normal {
  stroke: #6d5bd0;
  stroke-width: 2;
}

.surface-preview .sheet {
  fill: rgba(36, 122, 56, 0.16);
  stroke: #247a38;
  stroke-width: 3;
}

.surface-preview .wire {
  stroke: #2f3a42;
  stroke-width: 3;
}

.surface-preview .crease {
  stroke: #0b7285;
  stroke-width: 2;
}

.arithmetic-preview .domain {
  fill: rgba(109, 91, 208, 0.08);
  stroke: #6d5bd0;
  stroke-width: 3;
}

.arithmetic-preview .axis {
  stroke: #d63f2f;
  stroke-width: 3;
}

.arithmetic-preview .wave {
  stroke: #0b7285;
  stroke-width: 3;
}

.arithmetic-preview line {
  stroke: #5b6872;
  stroke-width: 2;
}

.tiling-preview .tiling-boundary {
  fill: #f0dfb7;
  stroke: #d7b867;
  stroke-width: 2;
}

.tiling-preview .tile-a {
  fill: #14565a;
  stroke: #102f32;
  stroke-width: 1.5;
}

.tiling-preview .tile-b {
  fill: #b74d37;
  stroke: #102f32;
  stroke-width: 1.5;
}

.tiling-preview .tile-c {
  fill: #d6a14f;
  stroke: #102f32;
  stroke-width: 1.5;
}

.tiling-preview .tiling-arc {
  fill: none;
  stroke: #f0dfb7;
  stroke-width: 1.25;
}

.project-copy {
  min-width: 0;
  padding: 18px;
}

.project-copy h2 {
  margin: 7px 0 8px;
  font-size: 21px;
  line-height: 1.16;
  letter-spacing: 0;
}

.project-card-featured .project-copy h2 {
  font-size: 28px;
}

.project-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.48;
}

.project-copy dl {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 6px 10px;
  margin: 16px 0 0;
  font-size: 12px;
}

.project-copy dt {
  color: var(--muted);
  font-weight: 750;
}

.project-copy dd {
  margin: 0;
  min-width: 0;
}

@media (max-width: 820px) {
  .home-header,
  .project-grid,
  .project-card-featured {
    grid-template-columns: 1fr;
  }

  .project-card-wide {
    grid-column: span 1;
    grid-template-columns: 1fr;
    grid-template-rows: 170px minmax(0, 1fr);
  }

  .project-card-featured {
    grid-column: span 1;
    grid-template-rows: 170px minmax(0, 1fr);
  }

  .project-card-featured .project-visual {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .project-card-wide .project-visual {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 560px) {
  .home-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 22px;
  }

  .home-header h1 {
    font-size: 31px;
  }

  .project-card,
  .project-card-featured {
    min-height: 0;
  }
}
