:root {
  --bg: #0a0e14;
  --surface: #0f1419;
  --surface-2: #161b23;
  --line: #21262d;
  --line-light: #30363d;
  --text: #f0f6fc;
  --muted: #8b949e;
  --dim: #6e7681;
  --accent: #58a6ff;
  --accent-soft: #79c0ff;
  --green: #3fb950;
  --red: #f85149;
  --orange: #fb8500;
  --max: 1360px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

img {
  display: block;
  max-width: 100%;
}

.site-header {
  width: min(calc(100% - 48px), var(--max));
  height: 76px;
  margin: 0 auto;
  display: flex;
  background: linear-gradient(180deg, rgba(15, 20, 25, 0.4) 0%, transparent 100%);
  backdrop-filter: blur(10px);
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  object-position: 50% 25%;
  border-radius: 50%;
}

.site-header nav {
  display: flex;
  gap: 28px;
  margin-right: 32px;
  color: var(--muted);
  font-size: 0.94rem;
}

.site-header nav a,
.text-link {
  transition: color 200ms ease, gap 200ms ease;
}

.site-header nav a:hover,
.text-link:hover {
  color: var(--accent);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-soft);
  font-weight: 600;
}

.text-link:hover {
  gap: 12px;
}

.text-link span {
  font-size: 0.9em;
}

.header-link {
  font-size: 0.94rem;
}

.hero {
  width: min(calc(100% - 48px), var(--max));
  min-height: 690px;
  margin: 0 auto;
  padding: 92px 0 84px;
  display: grid;
  grid-template-columns: minmax(390px, 0.72fr) minmax(560px, 1.28fr);
  gap: 56px;
  align-items: center;
}

.kicker,
.section-index,
.story-label {
  margin: 0 0 48px;
  color: var(--dim);
  font: 600 0.8rem/1.2 Consolas, "Courier New", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--green);
}

.kicker span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(63, 185, 80, 0.2);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(63, 185, 80, 0.2);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(63, 185, 80, 0.1);
  }
}

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

h1,
h2 {
  margin: 0;
  font-weight: 540;
  letter-spacing: -0.045em;
}

h1 {
  max-width: 660px;
  font-size: clamp(3.1rem, 5.5vw, 5.25rem);
  line-height: 0.98;
  background: linear-gradient(135deg, #f0f6fc 0%, var(--accent-soft) 60%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-intro {
  max-width: 620px;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: 1.18rem;
}

.actions {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-top: 38px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid var(--line-light);
  border-radius: 6px;
  font-size: 0.96rem;
  font-weight: 600;
  transition: all 200ms ease;
  cursor: pointer;
}

.button:hover {
  border-color: var(--accent);
  background: rgba(88, 166, 255, 0.1);
}

.button.primary {
  color: #0a0e14;
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 4px 12px rgba(88, 166, 255, 0.2);
}

.button.primary:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  box-shadow: 0 6px 16px rgba(88, 166, 255, 0.3);
}

.hero-visual,
.architecture-figure {
  margin: 0;
}

.hero-visual {
  position: relative;
  padding: 10px;
  border: 1px solid var(--line);
  background: #0f1419;
  box-shadow: 0 8px 32px rgba(88, 166, 255, 0.08), 0 0 1px rgba(88, 166, 255, 0.1);
  border-radius: 6px;
}

.hero-visual::before {
  content: "";
  position: absolute;
  width: 72%;
  height: 55%;
  top: -24px;
  right: -22px;
  z-index: -1;
  background: rgba(88, 166, 255, 0.05);
  border-radius: 50%;
  filter: blur(40px);
}

.hero-visual img {
  width: 100%;
  height: auto;
  border-radius: 3px;
  filter: saturate(0.78);
}

.hero-visual figcaption,
.architecture-figure figcaption {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 10px;
  color: var(--dim);
  font: 0.78rem/1.5 Consolas, "Courier New", monospace;
}

.hero-visual figcaption span {
  color: var(--muted);
}

.project-facts {
  width: min(calc(100% - 48px), var(--max));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  row-gap: 0;
}

.project-facts div {
  min-height: 180px;
  padding: 48px 24px 48px 0;
  border-right: 1px solid var(--line);
  transition: background 300ms ease;
  background: linear-gradient(180deg, rgba(88, 166, 255, 0.02) 0%, transparent 100%);
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 16px;
  row-gap: 6px;
  align-content: center;
}

.project-facts div:not(:first-child) {
  padding-left: 24px;
}

.project-facts div:last-child {
  border-right: 0;
}

.project-facts div:hover {
  background: linear-gradient(180deg, rgba(88, 166, 255, 0.06) 0%, transparent 100%);
}

.project-facts span,
.story-number,
.lesson-list span {
  display: block;
  color: var(--accent);
  font: 0.72rem/1 Consolas, "Courier New", monospace;
  margin-bottom: 4px;
}

.project-facts strong {
  display: block;
  margin: 0;
  font-size: 1.12rem;
  font-weight: 600;
}

.project-facts small {
  display: block;
  grid-column: 2;
  color: var(--dim);
  font-size: 0.9rem;
  line-height: 1.5;
}

.section-rule {
  width: min(calc(100% - 48px), var(--max));
  margin: 0 auto;
  padding: 92px 0;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.section-heading.compact {
  margin-bottom: 56px;
}

.section-heading h2,
.closing h2 {
  max-width: 760px;
  font-size: clamp(2.5rem, 4.6vw, 4.4rem);
  line-height: 1.08;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #79c0ff 0%, #58a6ff 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.section-heading > div > p {
  max-width: 690px;
  margin: 32px 0 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

.architecture-figure {
  padding: 10px;
  border: 1px solid var(--line);
  background: #0f1419;
  box-shadow: 0 8px 32px rgba(88, 166, 255, 0.08);
  border-radius: 6px;
}

.architecture-figure img {
  width: 100%;
  border-radius: 3px;
}

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

.principles article:hover {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.08) 0%, rgba(63, 185, 80, 0.08) 100%);
}

.principles article {
  min-height: 230px;
  padding: 28px;
  background: var(--bg);
  transition: background 300ms ease;
}

.principles span {
  display: block;
  color: var(--accent);
  font: 0.78rem Consolas, "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.9;
  margin-bottom: 12px;
}

.principles h3,
.system-story h3,
.lesson-list h3 {
  margin: 40px 0 12px;
  font-size: 1.35rem;
  font-weight: 580;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.principles p,
.system-story p,
.lesson-list p,
.closing > p:not(.section-index),
footer p {
  color: var(--muted);
}

.principles p {
  margin: 0;
  font-size: 1rem;
}

.system-story {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 28px 48px;
  align-items: start;
  padding: 68px 0;
  border-top: 1px solid var(--line);
}

.system-story.reverse {
  grid-template-columns: 280px minmax(0, 1fr);
}

.system-story.reverse .story-copy {
  order: initial;
}

.system-story.reverse .story-images {
  order: initial;
}

.story-copy {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 280px minmax(0, 760px);
  column-gap: 48px;
}

.story-number,
.story-label {
  grid-column: 1;
}

.story-label {
  margin: 18px 0 0;
  color: var(--green);
  opacity: 0.95;
}

.system-story h3 {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin: 0 0 22px;
  font-size: clamp(1.8rem, 3vw, 2.75rem);
}

.system-story p:not(.story-number, .story-label) {
  grid-column: 2;
  margin: 0;
  font-size: 1.06rem;
}

.system-story ul {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  color: var(--dim);
  font: 0.8rem Consolas, "Courier New", monospace;
}

.system-story li::before {
  content: "+ ";
  color: var(--accent);
  font-weight: 600;
}

.story-images {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  min-width: 0;
  align-items: start;
}

.story-images img:hover {
  box-shadow: 0 8px 24px rgba(88, 166, 255, 0.1);
}

.story-images img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--line);
  background: #08090b;
  filter: saturate(0.72);
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(88, 166, 255, 0.06);
  transition: box-shadow 300ms ease;
}

.story-images img:only-child {
  grid-column: auto;
}

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

.lesson-list article:hover {
  background: rgba(88, 166, 255, 0.05);
}

.lesson-list article {
  display: grid;
  grid-template-columns: 70px 0.85fr 1fr;
  gap: 30px;
  align-items: baseline;
  padding: 31px 0;
  border-bottom: 1px solid var(--line);
  transition: background 300ms ease, padding 300ms ease;
}

.lesson-list h3,
.lesson-list p {
  margin: 0;
}

.lesson-list h3 {
  font-size: 1.15rem;
}

.lesson-list p {
  font-size: 1rem;
}

.closing {
  width: min(calc(100% - 48px), 820px);
  margin: 0 auto;
  padding: 130px 0;
  text-align: center;
  background: linear-gradient(180deg, rgba(88, 166, 255, 0.02) 0%, transparent 100%);
}

.closing h2 {
  margin: 0 auto;
}

.closing > p:not(.section-index) {
  max-width: 650px;
  margin: 28px auto 34px;
  font-size: 1.06rem;
}

footer {
  width: min(calc(100% - 48px), var(--max));
  margin: 0 auto;
  padding: 30px 0 38px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 32px;
  align-items: center;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
}

footer .brand {
  margin: 0;
}

footer .brand img {
  width: 26px;
  height: 26px;
}

footer p {
  margin: 0;
}

@media (max-width: 900px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 70px;
  }

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

  .project-facts {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-facts div:nth-child(2) {
    border-right: 0;
  }

  .project-facts div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .principles {
    grid-template-columns: 1fr;
  }

  .principles article {
    min-height: 0;
  }

  .system-story,
  .system-story.reverse {
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .system-story.reverse .story-copy,
  .system-story.reverse .story-images {
    order: initial;
  }

  .story-copy {
    display: block;
    max-width: 650px;
  }

  footer {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 650px) {
  .site-header,
  .hero,
  .project-facts,
  .section-rule,
  footer {
    width: min(calc(100% - 32px), var(--max));
  }

  .site-header {
    height: 66px;
  }

  .site-header nav {
    display: none;
  }

  .header-link {
    font-size: 0.78rem;
  }

  .hero {
    padding: 68px 0 64px;
  }

  h1 {
    font-size: clamp(2.75rem, 14vw, 4rem);
  }

  .hero-intro {
    font-size: 1rem;
  }

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

  .hero-visual {
    padding: 6px;
  }

  .hero-visual::before {
    display: none;
  }

  .hero-visual figcaption {
    display: block;
  }

  .hero-visual figcaption span {
    display: block;
  }

  .project-facts {
    grid-template-columns: 1fr;
  }

  .project-facts div,
  .project-facts div:not(:first-child) {
    min-height: 0;
    padding: 20px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .project-facts div:last-child {
    border-bottom: 0;
  }

  .section-rule {
    padding: 82px 0;
  }

  .section-heading,
  .section-heading.compact {
    margin-bottom: 48px;
  }

  .section-heading h2,
  .closing h2 {
    font-size: 2.55rem;
  }

  .architecture-figure {
    padding: 5px;
    overflow-x: auto;
  }

  .architecture-figure img {
    min-width: 780px;
  }

  .principles {
    margin-top: 38px;
  }

  .system-story {
    padding: 54px 0;
  }

  .story-images {
    grid-template-columns: 1fr;
  }

  .story-images img {
    height: auto;
  }

  .lesson-list article {
    grid-template-columns: 40px 1fr;
    gap: 14px;
  }

  .lesson-list p {
    grid-column: 2;
  }

  .closing {
    width: calc(100% - 32px);
    padding: 90px 0;
  }
}
