:root {
  --bg: #f4eee2;
  --surface: #fffaf0;
  --surface-2: #f8f1e5;
  --ink: #152029;
  --muted: #55626a;
  --line: #d8cbb2;
  --teal: #0f8f8b;
  --gold: #a36f38;
  --shadow: 0 16px 34px rgba(35, 39, 42, 0.1);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Sora", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.58;
}

.paper-grain {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.1;
  background-image: radial-gradient(rgba(0, 0, 0, 0.09) 0.45px, transparent 0.45px);
  background-size: 4px 4px;
}

.bg-grad {
  position: fixed;
  z-index: -3;
  border-radius: 999px;
  filter: blur(64px);
  pointer-events: none;
}

.bg-1 {
  width: 28vw;
  height: 28vw;
  min-width: 320px;
  min-height: 320px;
  top: -8vw;
  right: -8vw;
  background: color-mix(in srgb, var(--teal) 28%, transparent);
}

.bg-2 {
  width: 26vw;
  height: 26vw;
  min-width: 280px;
  min-height: 280px;
  bottom: -9vw;
  left: -7vw;
  background: color-mix(in srgb, var(--gold) 24%, transparent);
}

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

.header-inner {
  width: min(1380px, calc(100% - 1.8rem));
  margin: 0 auto;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.brand {
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  gap: 0.65rem;
  align-items: center;
}

.brand-dot {
  width: 0.82rem;
  height: 0.82rem;
  border-radius: 999px;
  background: linear-gradient(140deg, var(--teal), #30beb5);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--teal) 19%, transparent);
}

.brand-text {
  font-family: "Noto Serif SC", serif;
  font-size: 1.48rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.main-nav {
  display: flex;
  gap: 1.05rem;
}

.main-nav a {
  text-decoration: none;
  color: color-mix(in srgb, var(--ink) 86%, white);
  border-radius: 999px;
  padding: 0.42rem 0.72rem;
  font-size: 0.92rem;
  transition: all 0.22s ease;
}

.main-nav a:hover {
  color: var(--teal);
  background: color-mix(in srgb, var(--teal) 10%, transparent);
}

.menu-btn {
  display: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  padding: 0.4rem 0.75rem;
}

.shell {
  width: min(1380px, calc(100% - 1.8rem));
  margin: 1.15rem auto 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 280px;
  gap: 0.92rem;
}

.left-rail,
.right-rail,
.content-flow {
  display: grid;
  gap: 0.85rem;
  align-content: start;
}

.rail-card,
.hero-card,
.post-card,
.steps li,
.ops-grid article {
  border: 1px solid color-mix(in srgb, var(--line) 78%, white);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.rail-card {
  padding: 0.86rem 0.82rem;
}

.rail-card h2 {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  font-size: 1rem;
}

.rail-card a {
  display: block;
  margin-top: 0.46rem;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.85rem;
}

.rail-card a:hover {
  color: var(--teal);
}

.profile p {
  margin: 0.56rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.tags {
  margin-top: 0.58rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.36rem;
}

.tags span {
  border: 1px solid color-mix(in srgb, var(--line) 84%, white);
  border-radius: 999px;
  padding: 0.18rem 0.48rem;
  font-size: 0.76rem;
  background: var(--surface-2);
}

.hero-card {
  padding: 1.35rem 1.25rem;
  background: linear-gradient(160deg, #fffdf8, #f7efe1);
}

.kicker {
  margin: 0 0 0.7rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--gold) 88%, black);
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.14;
}

h1,
h2 {
  font-family: "Noto Serif SC", serif;
}

h1 {
  font-size: clamp(1.9rem, 3vw, 3rem);
  max-width: 20ch;
  letter-spacing: -0.02em;
}

h1 span {
  color: color-mix(in srgb, var(--teal) 86%, black);
}

.hero-card p {
  color: var(--muted);
  margin: 0.96rem 0 0;
  max-width: 66ch;
}

.hero-actions {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.68rem;
  flex-wrap: wrap;
}

.btn {
  min-height: 43px;
  padding: 0.52rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: #e6fffd;
  background: linear-gradient(135deg, var(--teal), #22b6ad);
  box-shadow: 0 9px 18px rgba(15, 143, 139, 0.28);
}

.btn-ghost {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.section-head {
  margin: 0.5rem 0 0.9rem;
}

.section-sub {
  margin: 0.38rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

h2 {
  font-size: clamp(1.5rem, 2.3vw, 2.28rem);
  letter-spacing: -0.015em;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.82rem;
}

.post-card {
  padding: 0.95rem 0.88rem;
}

.post-card h3 {
  font-size: 1.06rem;
}

.post-card p {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.post-meta {
  margin-top: 0.44rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.post-meta span {
  border: 1px solid color-mix(in srgb, var(--line) 86%, white);
  border-radius: 999px;
  padding: 0.12rem 0.4rem;
  background: var(--surface-2);
  color: color-mix(in srgb, var(--ink) 74%, white);
  font-size: 0.74rem;
}

.post-card a {
  margin-top: 0.68rem;
  display: inline-flex;
  text-decoration: none;
  color: var(--teal);
  font-weight: 700;
  font-size: 0.88rem;
}

.post-toolbar {
  margin-top: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.pager-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  min-height: 35px;
  padding: 0.35rem 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.pager-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pager-info {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.72rem;
}

.steps li {
  padding: 0.86rem;
}

.step-title {
  margin: 0;
  font-weight: 700;
}

.steps code {
  display: block;
  margin-top: 0.46rem;
  background: #131e25;
  color: #d7f6f3;
  border-radius: 10px;
  padding: 0.5rem 0.52rem;
  font-size: 0.77rem;
  word-break: break-all;
}

.inline-links {
  margin-top: 0.88rem;
  display: flex;
  gap: 0.68rem;
  flex-wrap: wrap;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.ops-grid article {
  padding: 0.9rem 0.86rem;
}

.ops-grid h3 {
  font-size: 1rem;
}

.ops-grid p {
  margin: 0.42rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.ops-grid code {
  font-size: 0.76rem;
  background: color-mix(in srgb, var(--surface-2) 88%, white);
  border: 1px solid color-mix(in srgb, var(--line) 82%, white);
  border-radius: 8px;
  padding: 0.16rem 0.32rem;
}

.ops-grid a {
  color: var(--teal);
  text-decoration: none;
}

.site-footer {
  margin-top: 1.05rem;
  padding: 1.4rem 0 1.8rem;
}

.footer-inner {
  width: min(1380px, calc(100% - 1.8rem));
  margin: 0 auto;
  border-top: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  padding-top: 0.9rem;
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-inner p {
  margin: 0;
}

.footer-inner a {
  color: color-mix(in srgb, var(--ink) 78%, var(--teal));
  text-decoration: none;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.64s ease, transform 0.64s ease;
}

.reveal.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .right-rail {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .menu-btn {
    display: inline-flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 62px;
    right: 0;
    min-width: 170px;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 0.38rem;
    box-shadow: var(--shadow);
  }

  .main-nav[data-open="true"] {
    display: flex;
  }

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

  .content-flow {
    order: 1;
  }

  .left-rail {
    order: 2;
  }

  .right-rail {
    order: 3;
  }

  .left-rail,
  .right-rail {
    grid-template-columns: 1fr;
  }

  .post-grid,
  .ops-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
  }
}

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

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