:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: #101010;
  --text: #f5f5f0;
  --muted: #b9b7ad;
  --line: #2f2f2a;
  --accent: #d8ff72;
  --warm: #d7a86e;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

.site-header {
  align-items: center;
  background: rgba(5, 5, 5, 0.76);
  border-bottom: 1px solid rgba(245, 245, 240, 0.12);
  display: flex;
  justify-content: space-between;
  left: 0;
  min-height: 72px;
  padding: 0 32px;
  position: fixed;
  right: 0;
  top: 0;
  backdrop-filter: blur(18px);
  z-index: 10;
}

.brand {
  border: 1px solid var(--text);
  display: inline-grid;
  font-weight: 800;
  height: 40px;
  letter-spacing: 0.08em;
  place-items: center;
  width: 76px;
}

nav {
  align-items: center;
  display: flex;
  gap: 22px;
  font-size: 0.9rem;
  color: var(--muted);
}

nav a:hover,
.post-card a:hover h3,
.back-link:hover {
  color: var(--accent);
}

.lang-switch {
  border: 1px solid rgba(245, 245, 240, 0.22);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 7px 8px;
}

.lang-switch:hover {
  border-color: var(--accent);
}

.back-control {
  align-items: center;
  background: rgba(16, 16, 16, 0.82);
  border: 1px solid rgba(245, 245, 240, 0.16);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  gap: 10px;
  height: 44px;
  justify-content: center;
  left: 32px;
  overflow: hidden;
  padding: 0;
  position: fixed;
  top: 96px;
  transition: width 180ms ease, border-color 180ms ease, background 180ms ease;
  width: 44px;
  z-index: 9;
}

.back-control:hover,
.back-control:focus-visible {
  background: rgba(16, 16, 16, 0.96);
  border-color: var(--accent);
  outline: none;
  width: 112px;
}

.back-arrow {
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  display: block;
  height: 10px;
  margin-left: 3px;
  transform: rotate(45deg);
  transition: transform 180ms ease;
  width: 10px;
}

.back-control:hover .back-arrow,
.back-control:focus-visible .back-arrow {
  transform: translateX(-3px) rotate(45deg);
}

.back-text {
  font-size: 0.82rem;
  font-weight: 800;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-width 180ms ease, opacity 140ms ease;
  white-space: nowrap;
}

.back-control:hover .back-text,
.back-control:focus-visible .back-text {
  max-width: 72px;
  opacity: 1;
}

.hero {
  min-height: 92vh;
  overflow: hidden;
  position: relative;
}

.hero-bg {
  background:
    linear-gradient(90deg, rgba(5, 5, 5, 0.92) 0%, rgba(5, 5, 5, 0.76) 38%, rgba(5, 5, 5, 0.2) 100%),
    linear-gradient(0deg, rgba(5, 5, 5, 0.9) 0%, rgba(5, 5, 5, 0.05) 45%),
    url("/assets/hero-workbench.png") center right / cover no-repeat;
  inset: 0;
  position: absolute;
}

.hero-copy {
  max-width: 840px;
  padding: 184px 32px 96px;
  position: relative;
  width: min(100%, 1180px);
  margin: 0 auto;
}

.eyebrow,
.meta {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  margin: 0 0 18px;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(3rem, 8vw, 7.8rem);
  letter-spacing: 0;
  line-height: 0.92;
  margin-bottom: 28px;
  max-width: 900px;
  overflow-wrap: break-word;
}

.lead {
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.36rem);
  max-width: 720px;
  overflow-wrap: break-word;
}

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

.button {
  align-items: center;
  border: 1px solid var(--line);
  display: inline-flex;
  font-weight: 800;
  min-height: 48px;
  padding: 0 18px;
}

.button.primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.button.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.intro,
.latest,
.focus-grid,
.page,
.article-page {
  margin: 0 auto;
  width: min(1180px, calc(100% - 64px));
}

.intro {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 48px;
  grid-template-columns: minmax(260px, 0.9fr) minmax(300px, 1.1fr);
  padding: 78px 0;
}

.intro h2,
.section-title h2,
.page-hero h1 {
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 1;
}

.intro p,
.page-hero p,
.text-band p,
.article-body {
  color: var(--muted);
  font-size: 1.08rem;
}

.focus-grid {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 64px;
  background: var(--line);
  border: 1px solid var(--line);
}

.focus-grid > div,
.post-card {
  background: var(--panel);
  min-height: 240px;
  padding: 30px;
}

.focus-grid span {
  color: var(--warm);
  display: block;
  font-weight: 800;
  margin-bottom: 64px;
}

.focus-grid h2,
.post-card h3 {
  font-size: 1.55rem;
  line-height: 1.12;
}

.focus-grid p,
.post-card p {
  color: var(--muted);
}

.latest {
  padding: 88px 0;
}

.section-title {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 28px;
}

.post-list {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, 1fr);
  background: var(--line);
  border: 1px solid var(--line);
}

.post-list.wide {
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 96px;
}

.post-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.post-card .meta {
  margin-bottom: 42px;
}

.page,
.article-page {
  padding-top: 128px;
}

.page-hero {
  border-bottom: 1px solid var(--line);
  padding: 66px 0 72px;
}

.page-hero p {
  max-width: 760px;
}

.about-page {
  margin: 0 auto;
  padding-top: 128px;
  width: min(1180px, calc(100% - 64px));
}

.about-hero {
  border-bottom: 1px solid var(--line);
  padding: 72px 0 86px;
}

.about-hero h1 {
  font-size: clamp(3.2rem, 7vw, 7.6rem);
  line-height: 0.95;
  max-width: 1100px;
  overflow-wrap: anywhere;
}

.about-hero h1 span {
  color: var(--accent);
  display: block;
}

.about-lead {
  color: var(--muted);
  font-size: clamp(1.12rem, 2vw, 1.45rem);
  max-width: 760px;
}

.about-manifest {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 42px;
  grid-template-columns: 0.65fr 1.35fr;
  padding: 74px 0;
}

.about-manifest > p:first-child {
  color: var(--warm);
  font-size: clamp(1.4rem, 2.6vw, 2.4rem);
  font-weight: 800;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.large-line {
  color: var(--text);
  font-size: clamp(2.1rem, 4.6vw, 5.2rem);
  font-weight: 800;
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.about-split,
.about-quiet {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 64px;
  grid-template-columns: 0.8fr 1.2fr;
  padding: 82px 0;
}

.about-split h2,
.about-quiet h2 {
  font-size: clamp(2.2rem, 4.8vw, 4.8rem);
  line-height: 1;
}

.about-copy p {
  color: var(--muted);
  font-size: 1.08rem;
  margin-bottom: 24px;
}

.about-projects {
  border-bottom: 1px solid var(--line);
  padding: 82px 0;
}

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

.project-grid article {
  background: var(--panel);
  min-height: 330px;
  padding: 30px;
}

.project-grid span {
  color: var(--warm);
  display: block;
  font-weight: 800;
  margin-bottom: 82px;
}

.project-grid h3 {
  font-size: 1.65rem;
}

.project-grid p {
  color: var(--muted);
}

.columns {
  columns: 2;
  column-gap: 42px;
}

.columns p {
  break-inside: avoid;
}

.about-close {
  padding: 86px 0 116px;
}

.huge-line {
  color: var(--accent);
  font-size: clamp(3rem, 8vw, 8rem);
  font-weight: 900;
  line-height: 0.9;
  max-width: 980px;
  overflow-wrap: anywhere;
}

.about-close p:not(.huge-line) {
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  max-width: 840px;
}

.closing-line {
  color: var(--text) !important;
  font-weight: 800;
  margin-top: 42px;
}

.text-band {
  display: grid;
  gap: 44px;
  grid-template-columns: 0.7fr 1.3fr;
  padding: 76px 0;
}

.article {
  margin: 0 auto;
  max-width: 820px;
  padding: 58px 0 110px;
}

.article h1 {
  font-size: clamp(2.6rem, 6vw, 5.8rem);
}

.article-body h2 {
  color: var(--text);
  font-size: 1.7rem;
  margin-top: 42px;
}

.article-body p,
.article-body li {
  margin-bottom: 22px;
}

.article-body ul {
  padding-left: 1.2rem;
}

.back-link {
  color: var(--muted);
  display: inline-block;
  margin-bottom: 28px;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: space-between;
  margin: 0 auto;
  padding: 28px 32px;
  width: min(1180px, 100%);
}

@media (max-width: 820px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    position: absolute;
  }

  nav {
    flex-wrap: wrap;
    gap: 12px 18px;
  }

  .back-control {
    left: 16px;
    top: 128px;
  }

  .hero-copy {
    max-width: 100vw;
    padding: 174px 20px 72px;
    width: 100%;
  }

  .hero-copy h1,
  .hero-copy .lead {
    max-width: calc(100vw - 40px);
  }

  .hero-copy .lead {
    display: block;
    font-size: 1.06rem;
    line-height: 1.55;
    max-width: 19rem;
    width: 100%;
  }

  .intro,
  .text-band,
  .focus-grid,
  .post-list,
  .post-list.wide {
    grid-template-columns: 1fr;
  }

  .intro,
  .latest,
  .focus-grid,
  .page,
  .about-page,
  .article-page {
    width: min(100% - 32px, 1180px);
  }

  .about-hero {
    padding-top: 48px;
  }

  .about-hero h1 {
    font-size: clamp(2rem, 8.6vw, 2.65rem);
    line-height: 1;
  }

  .about-hero h1,
  .about-lead,
  .about-manifest > p:first-child,
  .large-line,
  .about-split h2,
  .about-quiet h2,
  .huge-line {
    max-width: 20.25rem;
  }

  .about-manifest,
  .about-split,
  .about-quiet,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .about-manifest,
  .about-split,
  .about-quiet,
  .about-projects,
  .about-close {
    padding: 58px 0;
  }

  .large-line {
    font-size: clamp(1.8rem, 8vw, 2.45rem);
    line-height: 1.02;
  }

  .about-manifest > p:first-child,
  .about-split h2,
  .about-quiet h2,
  .huge-line {
    font-size: clamp(1.8rem, 8vw, 2.45rem);
    line-height: 1.02;
  }

  .project-grid article {
    min-height: auto;
    padding: 24px;
  }

  .project-grid span {
    margin-bottom: 34px;
  }

  .columns {
    columns: 1;
  }

  .focus-grid span {
    margin-bottom: 34px;
  }

  .focus-grid > div,
  .post-card {
    min-height: auto;
    padding: 24px;
  }
}
