:root {
  color-scheme: dark;
  --bg: #111210;
  --surface: #171816;
  --surface-strong: #20211e;
  --text: #f0eee8;
  --muted: #aaa9a2;
  --faint: #777870;
  --line: #30312d;
  --accent: #d06b38;
  --accent-contrast: #17100c;
  --shadow: rgba(6, 7, 6, 0.34);
  --radius: 14px;
  --sans: "Aptos", "Segoe UI Variable", "Microsoft YaHei UI", sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f1ec;
  --surface: #e9e8e2;
  --surface-strong: #deddd6;
  --text: #1a1b19;
  --muted: #5d5e58;
  --faint: #7c7d76;
  --line: #cfcec6;
  --accent: #b65025;
  --accent-contrast: #fff8f2;
  --shadow: rgba(50, 42, 35, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  transition: background-color 240ms ease, color 240ms ease;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  content: "";
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

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

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-contrast);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  border-bottom: 1px solid rgba(240, 238, 232, 0.14);
}

.nav-shell,
.section-shell {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.nav-shell {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 13px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 36px;
  color: rgba(240, 238, 232, 0.72);
  font-size: 14px;
}

.desktop-nav a,
.mobile-nav a {
  transition: color 180ms ease;
}

.desktop-nav a:hover,
.mobile-nav a:hover {
  color: #f0eee8;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.menu-button {
  min-height: 40px;
  border: 1px solid rgba(240, 238, 232, 0.2);
  border-radius: 10px;
  background: rgba(17, 18, 16, 0.38);
  color: #f0eee8;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.icon-button {
  width: 40px;
  font-size: 18px;
}

.menu-button {
  display: none;
  padding-inline: 14px;
  font-size: 13px;
}

.icon-button:active,
.menu-button:active,
.filter:active,
.empty-state button:active {
  transform: translateY(1px);
}

.mobile-nav {
  padding: 18px 24px 24px;
  background: rgba(17, 18, 16, 0.96);
  color: #f0eee8;
}

.mobile-nav a {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid rgba(240, 238, 232, 0.12);
}

.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #111210;
}

.hero-image,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
  object-position: 58% center;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(13, 14, 13, 0.97) 0%, rgba(13, 14, 13, 0.84) 34%, rgba(13, 14, 13, 0.16) 72%),
    linear-gradient(0deg, rgba(13, 14, 13, 0.6) 0%, transparent 34%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 48px));
  margin: 56px auto 0;
  color: #f0eee8;
}

.eyebrow {
  margin: 0 0 22px;
  color: #d99069;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(52px, 7vw, 94px);
  line-height: 0.98;
  letter-spacing: -0.065em;
  font-weight: 650;
}

.hero-copy {
  max-width: 500px;
  margin: 28px 0 32px;
  color: rgba(240, 238, 232, 0.72);
  font-size: 17px;
  line-height: 1.8;
}

.primary-link {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  gap: 28px;
  padding: 0 20px;
  border-radius: 10px;
  background: var(--accent);
  color: #190f0a;
  font-size: 14px;
  font-weight: 700;
  transition: transform 180ms ease, background-color 180ms ease;
}

.primary-link:hover {
  transform: translateY(-2px);
  background: #df7b48;
}

.primary-link:active {
  transform: translateY(1px);
}

.article-section {
  padding-block: 126px 136px;
}

.section-heading {
  max-width: 620px;
}

.section-heading h2,
.notes-intro h2,
.about-copy h2 {
  margin: 0;
  font-size: clamp(38px, 4.6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.055em;
  font-weight: 650;
}

.section-heading p,
.notes-intro p {
  max-width: 530px;
  margin: 20px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.article-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 64px 0 28px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.filter:hover {
  color: var(--text);
  border-color: var(--faint);
}

.filter.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 650;
}

.search-box {
  position: relative;
  min-width: 220px;
}

.search-box input {
  width: 100%;
  height: 42px;
  padding: 0 40px 0 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
}

.search-box input::placeholder {
  color: var(--faint);
}

.search-box > span:last-child {
  position: absolute;
  top: 10px;
  right: 14px;
  color: var(--faint);
  font-size: 18px;
}

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

.featured-article {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 56px;
  padding: 38px 0 56px;
}

.featured-image-link {
  min-height: 370px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.code-visual {
  position: relative;
  height: 100%;
  min-height: 370px;
  padding: 42px;
  overflow: hidden;
  background:
    linear-gradient(rgba(208, 107, 56, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(208, 107, 56, 0.08) 1px, transparent 1px),
    #1b1d1a;
  background-size: 42px 42px;
  color: #b6b8b0;
  font-family: var(--mono);
}

.code-visual::before {
  position: absolute;
  width: 260px;
  height: 260px;
  right: -42px;
  bottom: -46px;
  border: 54px solid #d06b38;
  border-radius: 50%;
  content: "";
  opacity: 0.82;
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.featured-image-link:hover .code-visual::before {
  transform: scale(1.08) rotate(8deg);
}

.code-visual span,
.code-visual strong {
  position: relative;
  z-index: 1;
  display: block;
}

.code-visual span {
  margin-top: 32px;
  color: #72756d;
  font-size: 13px;
}

.code-visual strong {
  max-width: 340px;
  margin-top: 12px;
  color: #e9e7df;
  font-size: clamp(26px, 3vw, 43px);
  line-height: 1.15;
  letter-spacing: -0.045em;
}

.code-visual i {
  position: absolute;
  right: 28px;
  top: 24px;
  color: #85877f;
  font-size: 12px;
  font-style: normal;
}

.featured-copy {
  align-self: center;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
}

.article-meta span:first-child {
  color: var(--accent);
}

.featured-copy h3 {
  margin: 22px 0 18px;
  font-size: clamp(30px, 3.5vw, 48px);
  line-height: 1.18;
  letter-spacing: -0.045em;
  font-weight: 630;
}

.featured-copy h3 a,
.article-row h3 a {
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 1px;
  transition: background-size 260ms ease;
}

.featured-copy h3 a:hover,
.article-row h3 a:hover {
  background-size: 100% 1px;
}

.featured-copy > p {
  margin: 0 0 30px;
  color: var(--muted);
  line-height: 1.8;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
}

.text-link span {
  color: var(--accent);
  transition: transform 180ms ease;
}

.text-link:hover span {
  transform: translateX(4px);
}

.article-row {
  display: grid;
  grid-template-columns: 190px minmax(260px, 1fr) minmax(220px, 0.75fr) 42px;
  gap: 28px;
  align-items: center;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}

.article-row h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.4;
  letter-spacing: -0.025em;
  font-weight: 620;
}

.article-row > p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.row-arrow {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  transition: color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.row-arrow:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translate(2px, -2px);
}

.empty-state {
  padding: 70px 20px;
  text-align: center;
  color: var(--muted);
}

.empty-state button {
  margin-top: 10px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.notes-section {
  padding: 118px 0;
  background: var(--surface);
}

.notes-grid {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 12vw;
  align-items: start;
}

.notes-intro {
  position: sticky;
  top: 40px;
}

.notes-intro .text-link {
  margin-top: 34px;
}

.notes-stack {
  counter-reset: note;
}

.note {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 22px;
  align-items: center;
  min-height: 104px;
  border-bottom: 1px solid var(--line);
  transition: padding 220ms ease, color 180ms ease;
}

.note:first-child {
  border-top: 1px solid var(--line);
}

.note:hover {
  padding-inline: 12px;
  color: var(--accent);
}

.note time,
.note span {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
}

.note strong {
  font-size: 18px;
  font-weight: 560;
}

.about-section {
  display: grid;
  grid-template-columns: 0.55fr 1.2fr 0.45fr;
  gap: 70px;
  align-items: start;
  padding-block: 150px;
}

.about-number {
  display: grid;
  width: 132px;
  height: 132px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 54px;
}

.about-copy h2 {
  font-size: clamp(36px, 4.3vw, 58px);
}

.about-copy p {
  max-width: 650px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.9;
}

.about-links {
  display: grid;
  gap: 12px;
  padding-top: 10px;
}

.about-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.about-links a:hover span {
  color: var(--accent);
}

.site-footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  min-height: 126px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 30px;
  align-items: center;
  color: var(--faint);
  font-size: 12px;
}

.footer-inner .brand {
  color: var(--text);
  font-size: 14px;
}

.footer-inner p {
  margin: 0;
  text-align: center;
}

.icp-link {
  transition: color 180ms ease;
}

.icp-link:hover {
  color: var(--accent);
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 650ms ease, transform 650ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .article-row {
    grid-template-columns: 150px 1fr 42px;
  }

  .article-row > p {
    display: none;
  }

  .about-section {
    grid-template-columns: 0.35fr 1fr;
  }

  .about-links {
    grid-column: 2;
  }
}

@media (max-width: 767px) {
  .nav-shell,
  .section-shell,
  .hero-content {
    width: min(100% - 32px, 1180px);
  }

  .desktop-nav {
    display: none;
  }

  .menu-button {
    display: inline-block;
  }

  .hero {
    min-height: 100dvh;
    align-items: flex-end;
  }

  .hero-image {
    object-position: 67% center;
  }

  .hero-shade {
    background:
      linear-gradient(0deg, rgba(13, 14, 13, 0.98) 3%, rgba(13, 14, 13, 0.72) 62%, rgba(13, 14, 13, 0.32) 100%);
  }

  .hero-content {
    margin-bottom: 56px;
  }

  .hero h1 {
    font-size: clamp(46px, 15vw, 68px);
    letter-spacing: -0.06em;
  }

  .hero-copy {
    max-width: 390px;
    font-size: 15px;
  }

  .article-section {
    padding-block: 90px;
  }

  .article-tools {
    align-items: stretch;
    flex-direction: column;
    margin-top: 42px;
  }

  .search-box {
    min-width: 0;
  }

  .featured-article {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .featured-image-link,
  .code-visual {
    min-height: 300px;
  }

  .article-row {
    grid-template-columns: 1fr 40px;
    gap: 15px;
    padding-block: 26px;
  }

  .article-row .article-meta {
    grid-column: 1;
  }

  .article-row h3 {
    grid-column: 1;
    font-size: 19px;
  }

  .row-arrow {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
  }

  .notes-section {
    padding: 88px 0;
  }

  .notes-grid {
    grid-template-columns: 1fr;
    gap: 54px;
  }

  .notes-intro {
    position: static;
  }

  .note {
    grid-template-columns: 58px 1fr;
  }

  .note span {
    display: none;
  }

  .about-section {
    grid-template-columns: 1fr;
    gap: 38px;
    padding-block: 96px;
  }

  .about-number {
    width: 92px;
    height: 92px;
    font-size: 40px;
  }

  .about-links {
    grid-column: auto;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-block: 34px;
    text-align: left;
  }

  .footer-inner p {
    text-align: left;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
