:root {
  --bg: #07101c;
  --bg-deep: #040915;
  --bg-alt: #0c1828;
  --surface: rgba(10, 18, 31, 0.72);
  --surface-strong: rgba(10, 18, 31, 0.9);
  --surface-soft: rgba(255, 255, 255, 0.03);
  --line: rgba(155, 208, 255, 0.14);
  --line-strong: rgba(255, 190, 117, 0.24);
  --text: #edf6ff;
  --muted: #b5c7db;
  --soft: #87a1be;
  --cyan: #83d3ff;
  --sky: #7ea7ff;
  --amber: #ffc987;
  --rose: #ffb2a6;
  --glow-cyan: rgba(131, 211, 255, 0.18);
  --glow-amber: rgba(255, 201, 135, 0.18);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.36);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Plus Jakarta Sans", sans-serif;
  background:
    radial-gradient(circle at 15% 14%, rgba(110, 154, 255, 0.12), transparent 28%),
    radial-gradient(circle at 84% 18%, rgba(255, 194, 126, 0.11), transparent 26%),
    radial-gradient(circle at 52% 58%, rgba(126, 214, 255, 0.06), transparent 36%),
    linear-gradient(180deg, #040915 0%, #07101c 20%, #081324 52%, #050b16 100%);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.8) 0 1.2px, transparent 1.6px),
    radial-gradient(circle at 74% 24%, rgba(131, 211, 255, 0.88) 0 1.2px, transparent 1.6px),
    radial-gradient(circle at 82% 72%, rgba(255, 201, 135, 0.74) 0 1.2px, transparent 1.6px),
    radial-gradient(circle at 28% 80%, rgba(255, 178, 166, 0.66) 0 1.1px, transparent 1.4px);
  background-size: 340px 280px, 360px 240px, 420px 280px, 380px 300px;
  opacity: 0.22;
}

body::after {
  background:
    linear-gradient(120deg, transparent 0%, rgba(126, 214, 255, 0.05) 34%, transparent 60%),
    linear-gradient(120deg, transparent 30%, rgba(255, 201, 135, 0.06) 56%, transparent 78%);
  mix-blend-mode: screen;
}

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

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

.page-orbit,
.page-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.page-orbit-a {
  background:
    radial-gradient(circle at 12% 46%, rgba(131, 211, 255, 0.09), transparent 22%),
    radial-gradient(circle at 86% 52%, rgba(255, 201, 135, 0.08), transparent 20%);
  filter: blur(10px);
  animation: pulseGlow 11s ease-in-out infinite;
}

.page-orbit-b {
  background:
    radial-gradient(circle at 52% 12%, rgba(255, 201, 135, 0.07), transparent 16%),
    radial-gradient(circle at 48% 80%, rgba(126, 214, 255, 0.07), transparent 18%);
  filter: blur(22px);
  animation: driftGlow 15s linear infinite alternate;
}

.page-grid {
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(140, 191, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 191, 255, 0.05) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: linear-gradient(180deg, transparent, black 14%, black 86%, transparent);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  backdrop-filter: blur(20px);
  background:
    linear-gradient(180deg, rgba(5, 10, 18, 0.92), rgba(5, 10, 18, 0.72));
  border-bottom: 1px solid rgba(148, 198, 255, 0.12);
}

.header-shell,
.site-main,
.site-footer {
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
}

.header-shell {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 10px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-copy strong,
h1,
h2,
h3 {
  font-family: "Sora", sans-serif;
}

.brand-copy strong {
  font-size: 1rem;
  letter-spacing: -0.03em;
}

.brand-copy span {
  color: var(--soft);
  font-size: 0.82rem;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.site-nav a {
  position: relative;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 180ms ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -10px;
  width: 100%;
  height: 2px;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--cyan), var(--amber));
  transition: transform 200ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  transform: scaleX(1);
}

.site-main {
  padding: 34px 0 72px;
}

.section {
  padding-top: 84px;
  scroll-margin-top: 110px;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(9, 16, 28, 0.9), rgba(8, 14, 24, 0.7)),
    var(--surface);
  box-shadow: var(--shadow);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(130deg, rgba(126, 214, 255, 0.08), transparent 34%),
    linear-gradient(310deg, rgba(255, 201, 135, 0.08), transparent 24%);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hero-shell {
  display: grid;
  gap: 28px;
  padding: 36px;
}

.hero-header {
  display: grid;
  gap: 12px;
}

.hero-content {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(520px, 1.1fr);
  gap: 36px;
  align-items: start;
}

.hero-copy,
.thread-copy,
.context-copy {
  position: relative;
  z-index: 1;
}

.kicker,
.meta-row,
.principle-index,
.topic-label {
  font-family: "IBM Plex Mono", monospace;
}

.kicker {
  margin: 0 0 16px;
  color: var(--amber);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.05em;
}

h1 {
  font-size: clamp(2.5rem, 3.0vw, 4.8rem);
  line-height: 1;
  white-space: nowrap;
}

h1 span {
  color: transparent;
  background: linear-gradient(92deg, #f7fbff 0%, #93dcff 44%, #ffd7a0 82%, #fff3df 100%);
  background-clip: text;
  -webkit-background-clip: text;
}

.hero-subtitle {
  margin: 0;
  color: #dce9f8;
  font-size: clamp(1.16rem, 1.9vw, 1.58rem);
  line-height: 1.2;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.hero-lead,
.section-summary,
.thread-lead,
.context-lead,
.tutorial-meta,
.principle-card p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.78;
  text-wrap: pretty;
}

.hero-lead {
  max-width: 43ch;
  font-size: 1.0rem;
  text-align: justify;
}

.hero-principles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 18px;
}

.principle-card {
  position: relative;
  padding: 16px 18px;
  border: 1px solid rgba(151, 201, 255, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    rgba(10, 17, 28, 0.44);
}

.principle-card h2 {
  margin-top: 6px;
  font-size: clamp(1.08rem, 1.4vw, 1.28rem);
  line-height: 1.12;
  color: #f4f9ff;
}

.principle-index {
  margin: 0;
  color: var(--cyan);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
}

.hero-links,
.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-links {
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-weight: 700;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

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

.button-primary {
  color: #07101c;
  background: linear-gradient(135deg, #9fe0ff 0%, #ffd59e 62%, #fff1d9 100%);
  box-shadow: 0 16px 38px rgba(255, 201, 135, 0.18);
}

.button-secondary {
  color: #f3f8ff;
  border-color: rgba(151, 201, 255, 0.16);
  background: rgba(12, 20, 32, 0.62);
}

.hero-visual {
  position: relative;
  z-index: 1;
  align-self: center;
}

.hero-image-frame {
  position: relative;
  padding: 16px;
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01)),
    rgba(8, 13, 24, 0.64);
  border: 1px solid rgba(162, 211, 255, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 24px 72px rgba(0, 0, 0, 0.24);
}

.hero-image-frame::before {
  content: "";
  position: absolute;
  inset: -12% 16% auto 16%;
  height: 28%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 201, 135, 0.18), transparent 70%);
  filter: blur(28px);
}

.hero-image-frame img {
  position: relative;
  z-index: 1;
  width: 100%;
  border-radius: 24px;
}

.section-heading {
  display: grid;
  gap: 14px;
  /* max-width: 980px; */
  margin-bottom: 26px;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.02;
}

.section-summary {
  font-size: 1.03rem;
}

.thread-stack,
.context-stack {
  display: grid;
  gap: 26px;
}

.thread-card,
.context-card,
.tutorial-card {
  padding: 30px;
}

.thread-head,
.context-copy {
  display: grid;
  gap: 14px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--amber);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.meta-row span {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 11px;
  line-height: 1;
  white-space: nowrap;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 201, 135, 0.16);
  background: rgba(255, 201, 135, 0.08);
}

h3 {
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  line-height: 1.03;
}

.thread-lead,
.context-lead {
  color: #d7e6f7;
  font-size: 1.03rem;
}

.thread-body,
.context-body {
  display: grid;
  gap: 24px;
}

.thread-body {
  grid-template-columns: minmax(280px, 0.8fr) minmax(520px, 1.0fr);
  align-items: center;
  margin-top: 18px;
}

.point-list {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 12px;
  color: var(--text);
  text-align: justify;
}

.point-list li {
  padding-left: 4px;
  line-height: 1.76;
}

.point-list strong {
  color: #f7fbff;
}

.thread-copy {
  display: grid;
  gap: 18px;
}

.thread-figure {
  margin: 0;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(151, 201, 255, 0.14);
  background: rgba(255, 255, 255, 0.02);
}

.thread-figure img {
  width: 100%;
}

.context-card {
  display: grid;
  gap: 22px;
  align-items: stretch;
}

.context-head {
  display: grid;
  gap: 14px;
}

.context-body {
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
}

.context-copy {
  display: grid;
  gap: 18px;
  align-content: start;
}

.context-side {
  position: relative;
  display: flex;
  align-items: stretch;
}

.context-card h3 {
  max-width: 34ch;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.04;
}

.topic-block {
  width: 100%;
  min-height: 100%;
  padding: 24px;
  border: 1px solid rgba(151, 201, 255, 0.12);
  border-radius: 26px;
  background:
    radial-gradient(circle at 16% 18%, rgba(131, 211, 255, 0.1), transparent 28%),
    radial-gradient(circle at 82% 22%, rgba(255, 201, 135, 0.1), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    rgba(8, 14, 24, 0.54);
}

.topic-label {
  margin: 0 0 18px;
  color: var(--cyan);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topic-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.topic-chip-grid span {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 18px;
  color: #eef7ff;
  font-size: 0.95rem;
  line-height: 1.45;
  border: 1px solid rgba(151, 201, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.tutorial-card {
  display: grid;
  gap: 18px;
  min-height: 270px;
}

.tutorial-card h3 {
  font-size: clamp(1.45rem, 2.6vw, 1.6rem);
}

.tutorial-meta {
  font-size: 1rem;
}

.site-footer {
  padding: 10px 0 36px;
  color: var(--soft);
  font-size: 0.94rem;
  line-height: 1.7;
}

.site-footer-inner {
  padding-top: 26px;
  border-top: 1px solid rgba(151, 201, 255, 0.1);
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.footer-copy {
  color: #93a9c8;
}

.footer-contact {
  margin-top: 14px;
  color: #b8c8dd;
}

.footer-contact a {
  color: #eef6ff;
}

.footer-contact a:hover,
.footer-contact a:focus-visible {
  color: var(--amber);
}

@keyframes pulseGlow {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.82;
    transform: scale(1.05);
  }
}

@keyframes driftGlow {
  0% {
    transform: translate3d(-1%, 0%, 0);
  }
  100% {
    transform: translate3d(1%, 1.5%, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 1120px) {
  .hero-content,
  .thread-body,
  .context-body {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 820px) {
  .header-shell {
    min-height: auto;
    padding: 16px 0;
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    gap: 16px;
  }

  .site-main {
    padding-top: 24px;
  }

  .hero-shell,
  .thread-card,
  .context-card,
  .tutorial-card {
    padding: 22px;
  }

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

  h1 {
    max-width: none;
    font-size: clamp(2.5rem, 11vw, 4rem);
    white-space: normal;
  }

  .hero-subtitle {
    white-space: normal;
  }

  h2 {
    font-size: clamp(1.8rem, 8vw, 2.6rem);
  }

  h3 {
    font-size: clamp(1.55rem, 7vw, 2.2rem);
  }
}
