:root {
  color-scheme: light;
  --bg: #f7f8f4;
  --paper: #ffffff;
  --ink: #111311;
  --muted: #5c625e;
  --line: #d9dfd8;
  --line-strong: #aeb9af;
  --cyan: #00a7b5;
  --green: #58d05a;
  --black: #080a08;
  --shadow: 0 20px 70px rgba(17, 19, 17, 0.12);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.7rem 0.9rem;
  background: var(--black);
  color: white;
  border-radius: 6px;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: fixed;
  left: 50%;
  top: 16px;
  z-index: 10;
  display: flex;
  width: min(calc(100% - 32px), var(--max));
  transform: translateX(-50%);
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid rgba(17, 19, 17, 0.12);
  background: rgba(247, 248, 244, 0.86);
  padding: 0.62rem;
  backdrop-filter: blur(16px);
}

.brand,
.nav-links,
.hero-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 0.6rem;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--black);
  background: var(--black);
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
}

.nav-links {
  gap: 0.2rem;
}

.nav-links a {
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.65rem 0.8rem;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: var(--paper);
  color: var(--ink);
  outline: none;
}

.hero {
  position: relative;
  display: grid;
  min-height: 84vh;
  overflow: hidden;
  padding: 7.4rem max(1.25rem, calc((100vw - var(--max)) / 2)) 3rem;
  isolation: isolate;
}

.hero-grid {
  position: absolute;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(rgba(17, 19, 17, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 19, 17, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000 0%, #000 72%, transparent 100%);
}

.hero::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(247, 248, 244, 0.98) 0%, rgba(247, 248, 244, 0.88) 48%, rgba(247, 248, 244, 0.18) 100%),
    linear-gradient(180deg, transparent 60%, var(--bg) 100%);
  content: "";
}

.hero-portrait {
  position: absolute;
  right: max(1rem, calc((100vw - var(--max)) / 2));
  bottom: 3.7rem;
  z-index: -1;
  width: min(38vw, 430px);
  height: min(38vw, 430px);
  border: 1px solid rgba(17, 19, 17, 0.22);
  object-fit: cover;
  filter: saturate(0.85) contrast(1.05);
  box-shadow: var(--shadow);
}

.hero-copy {
  max-width: 710px;
  align-self: center;
}

.system-line,
.section-label {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.5;
  text-transform: uppercase;
}

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

h1 {
  max-width: 11ch;
  margin-bottom: 1rem;
  font-size: clamp(4.2rem, 10vw, 8.7rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.8;
}

.headline {
  max-width: 640px;
  margin-bottom: 1.2rem;
  font-size: clamp(1.35rem, 2.3vw, 2.05rem);
  font-weight: 840;
  line-height: 1.02;
}

.intro {
  max-width: 620px;
  color: #2d332f;
  font-size: clamp(1.02rem, 1.5vw, 1.22rem);
  line-height: 1.55;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--black);
  border-radius: 6px;
  background: var(--paper);
  color: var(--black);
  font-size: 0.94rem;
  font-weight: 850;
  padding: 0.78rem 1rem;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.button:hover,
.button:focus-visible {
  outline: none;
  transform: translateY(-2px);
}

.button-primary {
  background: var(--black);
  color: white;
}

.button-primary:hover,
.button-primary:focus-visible {
  color: var(--green);
}

.hero-console {
  width: min(420px, 100%);
  margin-top: 2rem;
  border: 1px solid var(--black);
  background: var(--black);
  color: #d9ffe0;
  box-shadow: var(--shadow);
}

.console-top {
  display: flex;
  gap: 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0.58rem;
}

.console-top span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
}

.console-top span:nth-child(2) {
  background: var(--cyan);
}

.console-top span:nth-child(3) {
  background: #f4f6ed;
}

pre {
  margin: 0;
  overflow: auto;
  padding: 0.9rem 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.55;
}

.section {
  padding: 6rem max(1.25rem, calc((100vw - var(--max)) / 2));
}

.section-split,
.toolchain {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 6vw, 6rem);
  border-top: 1px solid var(--line);
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 5rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.92;
}

.copy-column {
  max-width: 680px;
  color: #2f3732;
  font-size: 1.1rem;
  line-height: 1.75;
}

.copy-column p:last-child {
  margin-bottom: 0;
}

.systems {
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-heading {
  max-width: 840px;
  margin-bottom: 3rem;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-strong);
  border: 1px solid var(--line-strong);
}

.project-card {
  display: flex;
  min-height: 178px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.4rem;
  background: var(--paper);
  padding: clamp(1rem, 2vw, 1.45rem);
}

.project-card h3 {
  margin-bottom: 0.65rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.08rem;
}

.project-card p {
  max-width: 36rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.project-card a {
  flex: 0 0 auto;
  border-bottom: 2px solid var(--green);
  color: var(--black);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  font-weight: 900;
  padding-bottom: 0.18rem;
}

.project-card a:hover,
.project-card a:focus-visible {
  border-bottom-color: var(--cyan);
  outline: none;
}

.principles {
  background: var(--black);
  color: white;
}

.principles .section-label {
  color: var(--green);
}

.principle-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 3rem 0 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.22);
  list-style: none;
}

.principle-list li {
  min-height: 255px;
  background: var(--black);
  padding: 1.25rem;
}

.principle-list span {
  display: block;
  margin-bottom: 2rem;
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 900;
}

.principle-list strong {
  display: block;
  margin-bottom: 0.8rem;
  font-size: 1.25rem;
  line-height: 1.16;
}

.principle-list p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.55;
}

.toolchain {
  align-items: start;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tag-cloud span {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--paper);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  font-weight: 850;
  padding: 0.74rem 0.82rem;
}

.contact {
  padding-top: 1rem;
}

.contact-panel {
  border: 1px solid var(--black);
  background:
    linear-gradient(90deg, rgba(88, 208, 90, 0.2), transparent 32%),
    var(--paper);
  padding: clamp(1.3rem, 5vw, 4rem);
}

.contact-panel h2 {
  max-width: 920px;
}

.contact-panel p:not(.section-label) {
  max-width: 680px;
  margin-top: 1.2rem;
  color: #313834;
  font-size: 1.08rem;
  line-height: 1.65;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
  padding: 2rem max(1.25rem, calc((100vw - var(--max)) / 2));
}

@media (max-width: 920px) {
  .hero {
    min-height: auto;
    padding-top: 6.8rem;
  }

  .hero::before {
    background:
      linear-gradient(180deg, rgba(247, 248, 244, 0.95) 0%, rgba(247, 248, 244, 0.86) 62%, var(--bg) 100%);
  }

  .hero-portrait {
    position: relative;
    right: auto;
    bottom: auto;
    z-index: 0;
    width: min(72vw, 360px);
    height: min(72vw, 360px);
    margin: 2.8rem 0 0;
    order: 2;
  }

  .hero-copy {
    order: 1;
  }

  .hero-console {
    margin-top: 1.25rem;
    order: 3;
  }

  .section-split,
  .toolchain,
  .project-list,
  .principle-list {
    grid-template-columns: 1fr;
  }

  .project-card,
  .principle-list li {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .site-header {
    align-items: flex-start;
    padding: 0.5rem;
  }

  .brand span:last-child {
    display: none;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-end;
  }

  .nav-links a {
    font-size: 0.82rem;
    padding: 0.62rem 0.48rem;
  }

  h1 {
    font-size: clamp(3.4rem, 18vw, 4.45rem);
  }

  .system-line {
    max-width: 25rem;
    font-size: 0.72rem;
  }

  .button {
    width: 100%;
  }

  .hero {
    min-height: 84vh;
    padding-bottom: 2rem;
  }

  .hero-portrait {
    display: none;
  }

  .hero-console {
    display: none;
  }

  .project-card {
    display: block;
  }

  .project-card a {
    display: inline-block;
    margin-top: 1.1rem;
  }

  .section {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }

  .site-footer {
    display: block;
  }

  .site-footer span {
    display: block;
  }

  .site-footer span + span {
    margin-top: 0.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
