@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&family=Noto+Serif+SC:wght@500;600;700&display=swap");

:root {
  --paper: #f4f1ea;
  --paper-deep: #ebe6da;
  --ink: #1a1c1b;
  --muted: #686b67;
  --line: #c9c5ba;
  --blue: #155ee7;
  --blue-soft: #dce8ff;
  --green: #2f6d50;
  --yellow: #a66b00;
  --white: #fffdf8;
  --serif: "Noto Serif SC", "Songti SC", serif;
  --sans: "Noto Sans SC", "PingFang SC", sans-serif;
  --shadow: 0 22px 50px rgba(37, 35, 30, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.7;
  transition: background 0.25s ease, color 0.25s ease;
}

button,
input {
  font: inherit;
}

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

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

button {
  color: inherit;
}

::selection {
  background: var(--blue);
  color: #fff;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-150%);
}

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

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px);
}

.header-inner {
  width: min(1180px, calc(100% - 48px));
  height: 76px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--ink);
  font-family: Georgia, serif;
  font-size: 23px;
  font-style: italic;
  font-weight: 700;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.28em;
}

.primary-nav {
  display: flex;
  gap: 38px;
  height: 100%;
}

.primary-nav a {
  position: relative;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.primary-nav a::after {
  position: absolute;
  bottom: -1px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--blue);
  content: "";
  transform: translateX(-50%);
  transition: width 0.2s ease;
}

.primary-nav a:hover,
.primary-nav a.is-active {
  color: var(--ink);
}

.primary-nav a:hover::after,
.primary-nav a.is-active::after {
  width: 100%;
}

.header-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.icon-button,
.search-trigger {
  min-height: 40px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}

.icon-button {
  width: 40px;
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.search-trigger > span:first-child {
  color: var(--ink);
  font-size: 21px;
  line-height: 1;
}

.search-trigger kbd {
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper-deep);
  font-size: 10px;
}

.icon-button:hover,
.search-trigger:hover {
  border-color: var(--ink);
}

.menu-toggle {
  display: none;
}

.hero {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(color-mix(in srgb, var(--line) 32%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--line) 32%, transparent) 1px, transparent 1px);
  background-size: 44px 44px;
}

.hero-inner {
  width: min(1180px, calc(100% - 48px));
  min-height: 620px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
  align-items: center;
  gap: 100px;
}

.eyebrow,
.section-index {
  margin: 0 0 20px;
  color: var(--blue);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(54px, 6.7vw, 88px);
  font-weight: 600;
  letter-spacing: -0.06em;
  line-height: 1.12;
}

.hero h1 em {
  color: var(--blue);
  font-style: normal;
}

.hero-description {
  max-width: 650px;
  margin: 32px 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 17px;
}

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

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 0 22px;
  font-size: 13px;
  font-weight: 600;
}

.button-primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 5px 5px 0 var(--blue);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button-primary:hover {
  box-shadow: 2px 2px 0 var(--blue);
  transform: translate(3px, 3px);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.text-link span,
.article-link span {
  transition: transform 0.2s ease;
}

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

.hero-note {
  position: relative;
  padding: 42px 34px 34px;
  background: #e5e0d2;
  box-shadow: var(--shadow);
  transform: rotate(2.5deg);
}

.hero-note::after {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(26, 28, 27, 0.13);
  content: "";
  pointer-events: none;
}

.note-pin {
  position: absolute;
  z-index: 1;
  top: -9px;
  left: 50%;
  width: 18px;
  height: 18px;
  border: 4px solid #b9b3a3;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 5px 5px rgba(0, 0, 0, 0.18);
  transform: translateX(-50%);
}

.note-label {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.hero-note blockquote {
  margin: 24px 0 26px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.9;
}

.note-meta {
  display: flex;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(26, 28, 27, 0.2);
  color: #66645e;
  font-size: 10px;
}

.note-sketch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 28px;
  color: var(--blue);
  font-family: Georgia, serif;
  font-size: 28px;
}

.note-sketch div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.note-sketch i {
  display: block;
  width: 60px;
  height: 2px;
  background: var(--blue);
}

.note-sketch i:nth-child(2) {
  width: 42px;
}

.marquee {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--blue);
  color: #fff;
}

.marquee-track {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 36px;
  padding: 12px 0;
  animation: marquee 28s linear infinite;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.marquee-track i {
  font-style: normal;
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

.content-section,
.about-section {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 110px 0;
}

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

.section-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 56px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}

.section-heading > p {
  max-width: 310px;
  margin: 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 14px;
  text-align: right;
}

.featured-article {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  border: 1px solid var(--line);
  background: var(--white);
}

.featured-visual {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 70%, rgba(255, 255, 255, 0.22) 0 2px, transparent 3px),
    var(--blue);
  background-size: 20px 20px;
}

.browser-window {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 70%;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 16px 16px 0 rgba(26, 28, 27, 0.28);
  transform: translate(-50%, -50%) rotate(-3deg);
}

.browser-bar {
  display: flex;
  height: 32px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-bottom: 2px solid var(--ink);
}

.browser-bar i {
  width: 7px;
  height: 7px;
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.browser-bar span {
  margin-left: auto;
  font-family: monospace;
  font-size: 8px;
}

.browser-content {
  padding: 32px;
}

.code-line {
  height: 8px;
  margin-bottom: 12px;
  background: var(--ink);
}

.code-line-short {
  width: 30%;
  background: var(--blue);
}

.code-line-long {
  width: 85%;
}

.code-line-mid {
  width: 64%;
}

.browser-card {
  height: 100px;
  margin-top: 32px;
  border: 2px solid var(--ink);
  background: var(--blue-soft);
}

.visual-number {
  position: absolute;
  right: 20px;
  bottom: -26px;
  color: rgba(255, 255, 255, 0.18);
  font-family: Georgia, serif;
  font-size: 150px;
  font-style: italic;
  font-weight: 700;
  line-height: 1;
}

.visual-caption {
  position: absolute;
  bottom: 20px;
  left: 22px;
  color: white;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.5;
}

.featured-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 54px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
}

.featured-copy h3,
.compact-card h3 {
  margin: 24px 0 18px;
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.45;
}

.featured-copy h3 a,
.compact-card h3 a {
  background-image: linear-gradient(var(--blue), var(--blue));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 2px;
  transition: background-size 0.3s ease;
}

.featured-copy h3 a:hover,
.compact-card h3 a:hover {
  background-size: 100% 2px;
}

.featured-copy > p,
.compact-card > p {
  margin: 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 14px;
}

.article-link {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  border-bottom: 1px solid var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 74px 0 24px;
}

.filter-button {
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  transition: 0.2s ease;
}

.filter-button:hover,
.filter-button.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.compact-card {
  display: flex;
  min-height: 370px;
  flex-direction: column;
  padding: 32px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--white) 64%, transparent);
  transition: background 0.25s ease, transform 0.25s ease;
}

.compact-card:hover {
  position: relative;
  z-index: 1;
  background: var(--white);
  box-shadow: var(--shadow);
  transform: translateY(-5px);
}

.compact-card[hidden],
.featured-article[hidden] {
  display: none;
}

.card-top,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-number {
  color: var(--line);
  font-family: Georgia, serif;
  font-size: 30px;
  font-style: italic;
}

.tag-green {
  background: #dcecdf;
  color: var(--green);
}

.tag-yellow {
  background: #f4e6bd;
  color: var(--yellow);
}

.compact-card h3 {
  margin-top: 44px;
  font-size: 23px;
}

.card-footer {
  gap: 14px;
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.card-footer .arrow {
  margin-left: auto;
  color: var(--ink);
  font-size: 18px;
}

.empty-state {
  margin: 30px 0 0;
  padding: 40px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

.notes-section {
  background: var(--ink);
  color: var(--paper);
}

.notes-inner {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 100px 0;
}

.light-heading > p {
  color: #aeadA6;
}

.notes-list {
  border-top: 1px solid #454744;
}

.notes-list article {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  align-items: start;
  gap: 30px;
  padding: 28px 0;
  border-bottom: 1px solid #454744;
  transition: padding 0.2s ease, color 0.2s ease;
}

.notes-list article:hover {
  padding-right: 14px;
  padding-left: 14px;
  color: #fff;
}

.notes-list time,
.notes-list span {
  color: #9c9e99;
  font-size: 11px;
}

.notes-list p {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
}

.about-section {
  display: grid;
  grid-template-columns: 120px 1.25fr 0.75fr;
  gap: 70px;
}

.about-index {
  color: var(--blue);
  font-family: Georgia, serif;
  font-size: 82px;
  font-style: italic;
  line-height: 1;
}

.about-copy h2 {
  margin: 0 0 28px;
  font-family: var(--serif);
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 600;
}

.about-copy > p:not(.section-index) {
  max-width: 610px;
  margin: 0 0 18px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 16px;
}

.about-copy .text-link {
  margin-top: 12px;
}

.about-stats {
  align-self: center;
  border-top: 1px solid var(--line);
}

.about-stats div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 19px 0;
  border-bottom: 1px solid var(--line);
}

.about-stats strong {
  color: var(--blue);
  font-family: Georgia, serif;
  font-size: 31px;
  font-style: italic;
}

.about-stats span {
  color: var(--muted);
  font-size: 11px;
}

.site-footer {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  padding: 54px 0 32px;
  border-top: 1px solid var(--line);
}

.site-footer > div > p {
  margin: 18px 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 13px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: center;
  font-size: 11px;
}

.site-footer nav a:hover {
  color: var(--blue);
}

.copyright {
  grid-column: 1 / -1;
  margin: 20px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.search-dialog {
  width: min(640px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 12px 12px 0 var(--blue);
}

.search-dialog::backdrop {
  background: rgba(10, 12, 11, 0.62);
  backdrop-filter: blur(4px);
}

.search-dialog form {
  padding: 28px;
}

.search-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
}

.search-dialog-header button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.search-box {
  display: flex;
  align-items: center;
  border-bottom: 2px solid var(--ink);
}

.search-box span {
  font-size: 28px;
}

.search-box input {
  width: 100%;
  padding: 16px 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
}

.search-dialog form > p {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.back-to-top {
  position: fixed;
  z-index: 10;
  right: 24px;
  bottom: 24px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 0.2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

body.dark {
  --paper: #171918;
  --paper-deep: #242725;
  --ink: #eff0eb;
  --muted: #a8aaa5;
  --line: #3c403d;
  --blue: #79a8ff;
  --blue-soft: #273854;
  --green: #86c8a4;
  --yellow: #e7ba62;
  --white: #202321;
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.25);
}

body.dark .hero-note {
  background: #d9d2c2;
  color: #191b1a;
}

body.dark .featured-visual {
  background-color: #255ec3;
}

@media (max-width: 900px) {
  .header-inner {
    grid-template-columns: 1fr auto;
  }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    grid-column: 2;
    grid-row: 1;
  }

  .menu-toggle span {
    width: 18px;
    height: 1px;
    background: var(--ink);
    transition: 0.2s ease;
  }

  .menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(3.5px) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-3.5px) rotate(-45deg);
  }

  .primary-nav {
    position: absolute;
    top: 76px;
    left: 0;
    width: 100%;
    height: auto;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 12px 24px 24px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
  }

  .primary-nav.is-open {
    display: flex;
  }

  .primary-nav a {
    justify-items: start;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }

  .primary-nav a::after {
    display: none;
  }

  .header-actions {
    position: absolute;
    top: 18px;
    right: 54px;
  }

  .search-trigger > span:nth-child(2),
  .search-trigger kbd {
    display: none;
  }

  .search-trigger {
    width: 40px;
    justify-content: center;
    padding: 0;
  }

  .hero-inner {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 70px;
    padding: 90px 0;
  }

  .hero-note {
    width: min(440px, 90%);
    margin: 0 auto;
  }

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

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

  .compact-card {
    min-height: 300px;
  }

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

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

@media (max-width: 620px) {
  .header-inner,
  .hero-inner,
  .content-section,
  .notes-inner,
  .about-section,
  .site-footer {
    width: min(100% - 32px, 1180px);
  }

  .brand-copy {
    display: none;
  }

  .hero-inner {
    padding: 72px 0 80px;
  }

  .hero h1 {
    font-size: 45px;
    line-height: 1.2;
  }

  .hero-description {
    font-size: 15px;
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 22px;
  }

  .hero-note {
    width: calc(100% - 12px);
    padding: 38px 26px 30px;
  }

  .content-section,
  .about-section {
    padding: 80px 0;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 36px;
  }

  .section-heading > p {
    text-align: left;
  }

  .featured-visual {
    min-height: 300px;
  }

  .browser-window {
    width: 82%;
  }

  .featured-copy {
    padding: 34px 26px;
  }

  .article-meta {
    flex-wrap: wrap;
    gap: 10px 15px;
  }

  .featured-copy h3 {
    font-size: 25px;
  }

  .filter-row {
    margin-top: 54px;
  }

  .compact-card {
    padding: 26px;
  }

  .notes-list article {
    grid-template-columns: 60px 1fr;
    gap: 18px;
  }

  .notes-list span {
    grid-column: 2;
  }

  .about-section {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .about-index {
    font-size: 54px;
  }

  .about-stats {
    grid-column: auto;
    margin-top: 20px;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .site-footer nav {
    gap: 20px;
  }
}

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