:root {
  color-scheme: light;
  --ink: #101820;
  --ink-rgb: 16, 24, 32;
  --muted: #5b6773;
  --paper: #f8f6ef;
  --paper-rgb: 248, 246, 239;
  --panel: var(--paper);
  --panel-soft: var(--paper);
  --line: #d8d2c3;
  --grid-line: rgba(16, 24, 32, 0.04);
  --mint: #37b99f;
  --coral: #e96f58;
  --amber: #d9a441;
  --blue: #245b8f;
  --button-secondary: transparent;
  --graph-ink: #101820;
  --graph-line-rgb: 16, 24, 32;
  --node-ring: rgba(255, 255, 255, 0.75);
  --proof-muted: var(--muted);
  --shadow: 0 24px 80px rgba(16, 24, 32, 0.14);
  --radius: 8px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f2efe7;
  --ink-rgb: 242, 239, 231;
  --muted: #aeb8c2;
  --paper: #0f151b;
  --paper-rgb: 15, 21, 27;
  --panel: var(--paper);
  --panel-soft: var(--paper);
  --line: #293440;
  --grid-line: rgba(242, 239, 231, 0.045);
  --mint: #44d6bd;
  --coral: #ff8a72;
  --amber: #efc15d;
  --blue: #79b8ff;
  --button-secondary: transparent;
  --graph-ink: #f2efe7;
  --graph-line-rgb: 242, 239, 231;
  --node-ring: rgba(15, 21, 27, 0.84);
  --proof-muted: var(--muted);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(180deg, var(--grid-line) 1px, transparent 1px),
    var(--paper);
  background-size: 64px 64px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

.theme-toggle {
  position: fixed;
  top: 18px;
  right: clamp(20px, 6vw, 88px);
  z-index: 10;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

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

.theme-toggle-icon {
  position: relative;
  width: 13px;
  height: 13px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.theme-toggle-icon::before {
  content: "";
  position: absolute;
  inset: -5px;
  background:
    linear-gradient(currentColor, currentColor) center top / 1px 3px no-repeat,
    linear-gradient(currentColor, currentColor) center bottom / 1px 3px no-repeat,
    linear-gradient(90deg, currentColor, currentColor) left center / 3px 1px no-repeat,
    linear-gradient(90deg, currentColor, currentColor) right center / 3px 1px no-repeat;
}

[data-theme="dark"] .theme-toggle-icon {
  border-color: transparent;
  background: currentColor;
}

[data-theme="dark"] .theme-toggle-icon::before {
  inset: -2px -5px 2px 5px;
  border-radius: 50%;
  background: var(--paper);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(360px, 1.04fr);
  gap: clamp(34px, 6vw, 86px);
  min-height: min(760px, calc(100vh - 120px));
  align-items: center;
  padding: clamp(52px, 8vw, 110px) clamp(20px, 6vw, 88px) 72px;
}

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

.eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 850px;
  margin-bottom: 24px;
  font-size: clamp(3.2rem, 7vw, 6.9rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(2.1rem, 4.3vw, 4.4rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  font-size: 1.05rem;
  line-height: 1.25;
}

.hero-lede {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.8vw, 1.28rem);
}

.hero-email {
  display: inline-flex;
  margin-top: 30px;
  align-items: center;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 650;
  text-decoration: none;
}

.hero-email::after {
  content: "->";
  margin-left: 10px;
  color: var(--muted);
}

.hero-email:hover,
.hero-email:hover::after {
  color: var(--blue);
}

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

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(var(--ink-rgb), 0.13);
}

.hero-visual {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border-radius: 0;
}

#architecture-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: default;
  touch-action: none;
}

#architecture-canvas.is-grab {
  cursor: grab;
}

#architecture-canvas.is-grabbing {
  cursor: grabbing;
}

.section {
  padding: clamp(70px, 10vw, 128px) clamp(20px, 6vw, 88px);
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(280px, 0.72fr);
  gap: clamp(30px, 6vw, 88px);
  align-items: start;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(140px, 0.26fr) minmax(320px, 0.86fr) minmax(280px, 0.72fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}

.portrait-slot {
  width: min(100%, 180px);
  aspect-ratio: 4 / 5;
  justify-self: start;
  margin-top: 8px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 18px 52px rgba(var(--ink-rgb), 0.08);
}

.portrait-slot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 46% 42%;
}

.rich-copy {
  color: var(--muted);
  font-size: 1.08rem;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(260px, 0.5fr);
  gap: 30px;
  align-items: end;
  margin-bottom: 40px;
}

.section-heading h2 {
  margin-bottom: 0;
}

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

.writing-section {
  background: var(--panel);
}

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

.writing-list a {
  display: grid;
  grid-template-columns: minmax(180px, 0.28fr) minmax(0, 1fr);
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.writing-list a:hover strong {
  color: var(--blue);
}

.writing-list span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.writing-list strong {
  font-size: clamp(1.25rem, 2.1vw, 2rem);
  line-height: 1.1;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(280px, 0.65fr) minmax(360px, 0.75fr);
  gap: clamp(34px, 7vw, 96px);
  align-items: start;
  padding: clamp(72px, 10vw, 128px) clamp(20px, 6vw, 88px);
  border-top: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.contact-copy {
  max-width: 560px;
}

.contact-copy h2 {
  margin-bottom: 20px;
}

.contact-copy p:last-child {
  max-width: 480px;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
}

.contact-list {
  display: grid;
  width: min(100%, 760px);
  border-top: 1px solid var(--line);
}

.contact-list a {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.contact-list span {
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-list strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  font-weight: 500;
  line-height: 1.25;
}

.contact-list strong::after {
  content: "->";
  color: var(--muted);
  font-size: 0.9em;
}

.contact-list a:hover strong,
.contact-list a:hover strong::after {
  color: var(--blue);
}

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

  .hero {
    min-height: auto;
  }

  .hero-visual {
    min-height: 520px;
  }

  .portrait-slot {
    width: 132px;
  }

}

@media (max-width: 720px) {
  .theme-toggle {
    right: 18px;
  }

  h1 {
    font-size: clamp(2.75rem, 15vw, 4.15rem);
  }

  .hero {
    padding-top: 42px;
  }

  .hero-visual {
    min-height: 430px;
  }

  .writing-list a {
    grid-template-columns: 1fr;
  }

  .contact-list a {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
