/* =========================================================
   Ragic — a small, editorial tech blog
   ========================================================= */

:root {
  --paper: #f6f2e9;
  --paper-deep: #eee8db;
  --surface: #fbf8f1;
  --surface-soft: #f1ebdf;
  --ink: #1a1c18;
  --ink-soft: #33352f;
  --muted: #6c6d64;
  --line: rgb(26 28 24 / 14%);
  --line-strong: rgb(26 28 24 / 26%);
  --accent: #e8512a;
  --accent-deep: #c63f1c;
  --butter: #f0d9a6;
  --forest: #173b2c;
  --forest-soft: #214a38;
  --cream: #f8f2e5;
  --tag-frontend-bg: #e6eddc;
  --tag-frontend-ink: #38512f;
  --tag-ai-bg: #f5e3d7;
  --tag-ai-ink: #88401f;
  --tag-engineering-bg: #e3e7f0;
  --tag-engineering-ink: #344564;
  --tag-notes-bg: #f1e6cb;
  --tag-notes-ink: #6b5121;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --container: 1180px;
  --font-sans: "Inter", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-serif: Georgia, "Times New Roman", "Songti SC", "STSong", serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
  -webkit-text-size-adjust: 100%;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body[data-page="home"]::before {
  content: "";
  position: fixed;
  z-index: -1;
  top: -22vw;
  right: -14vw;
  width: 56vw;
  height: 56vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(232 81 42 / 8%), transparent 66%);
  pointer-events: none;
}

::selection {
  color: var(--cream);
  background: var(--accent);
}

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

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

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 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;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 10px;
  left: 10px;
  padding: 10px 16px;
  color: var(--cream);
  background: var(--ink);
  border-radius: 999px;
  transform: translateY(-150%);
  transition: transform 180ms ease;
}

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

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

.container {
  width: min(var(--container), calc(100% - 48px));
  margin-inline: auto;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgb(246 242 233 / 84%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
}

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

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--cream);
  background: var(--accent);
  border-radius: 9px;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  padding-bottom: 2px;
  transform: rotate(-3deg);
  transition: transform 240ms var(--ease);
}

.brand:hover .brand-mark {
  transform: rotate(3deg);
}

.brand-word {
  font-family: var(--font-serif);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.065em;
  line-height: 1;
}

.brand-tag {
  margin-left: 4px;
  padding-left: 13px;
  border-left: 1px solid var(--line-strong);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  line-height: 1.3;
  text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 30px;
}

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

.site-nav a {
  position: relative;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
}

.site-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -6px;
  left: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 240ms var(--ease);
}

.site-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  transition:
    color 200ms ease,
    background 200ms ease,
    border-color 200ms ease;
}

.header-cta span {
  color: var(--accent);
  font-size: 14px;
  transition: transform 200ms var(--ease);
}

.header-cta:hover {
  color: var(--cream);
  background: var(--ink);
  border-color: var(--ink);
}

.header-cta:hover span {
  transform: translate(2px, -2px);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 86px 0 76px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.36fr) minmax(330px, 0.64fr);
  gap: 68px;
  align-items: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 24px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow svg {
  flex: none;
}

.hero h1 {
  max-width: 820px;
  margin-bottom: 28px;
  font-size: clamp(3.1rem, 6.15vw, 5.15rem);
  font-weight: 700;
  letter-spacing: -0.062em;
  line-height: 1.12;
}

.highlight {
  position: relative;
  z-index: 0;
  display: inline-block;
}

.highlight::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -0.04em;
  bottom: 0.06em;
  left: -0.03em;
  height: 0.32em;
  background: var(--butter);
  transform: rotate(-1.4deg);
}

.hero-lead {
  max-width: 620px;
  margin-bottom: 32px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.85;
}

.nowrap {
  white-space: nowrap;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 23px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  transition:
    transform 220ms var(--ease),
    color 200ms ease,
    background 200ms ease,
    border-color 200ms ease;
}

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

.button--primary {
  color: var(--cream);
  background: var(--ink);
}

.button--primary:hover {
  background: var(--accent-deep);
}

.button-arrow {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--ink);
  background: var(--butter);
  border-radius: 50%;
  font-size: 13px;
  transition: transform 220ms var(--ease);
}

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

.button--light {
  color: var(--ink);
  background: var(--cream);
}

.button--light:hover {
  background: var(--butter);
}

.text-link {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 5px;
  transition:
    color 180ms ease,
    text-decoration-color 180ms ease;
}

.text-link:hover {
  color: var(--accent-deep);
  text-decoration-color: var(--accent);
}

.text-link--dark {
  color: var(--ink);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
  margin-top: 40px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.hero-stats span {
  display: flex;
  align-items: center;
  gap: 22px;
}

.hero-stats span + span::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--line-strong);
}

.hero-stats strong {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
}

/* Latest article card */

.latest-card {
  position: relative;
  display: flex;
  overflow: hidden;
  min-height: 390px;
  flex-direction: column;
  padding: 30px;
  color: var(--cream);
  background:
    linear-gradient(145deg, rgb(255 255 255 / 5%), transparent 40%),
    var(--forest);
  border-radius: var(--radius-lg);
  box-shadow:
    0 3px 0 rgb(23 59 44 / 10%),
    0 24px 54px rgb(23 59 44 / 16%);
  transform: rotate(1.1deg);
  transition:
    transform 360ms var(--ease),
    box-shadow 360ms var(--ease);
}

.latest-card:hover {
  box-shadow:
    0 3px 0 rgb(23 59 44 / 10%),
    0 32px 70px rgb(23 59 44 / 22%);
  transform: rotate(0deg) translateY(-6px);
}

.latest-orbit {
  position: absolute;
  top: -86px;
  right: -78px;
  width: 230px;
  height: 230px;
  border: 1px solid rgb(248 242 229 / 16%);
  border-radius: 50%;
}

.latest-orbit::before,
.latest-orbit::after {
  content: "";
  position: absolute;
  border: 1px solid rgb(248 242 229 / 12%);
  border-radius: 50%;
  inset: 24px;
}

.latest-orbit::after {
  inset: 58px;
}

.latest-watermark {
  position: absolute;
  right: 8px;
  bottom: -58px;
  color: rgb(248 242 229 / 5%);
  font-family: var(--font-serif);
  font-size: 250px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.latest-top,
.latest-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.latest-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.latest-label i {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgb(232 81 42 / 16%);
}

.latest-number {
  display: grid;
  width: 45px;
  height: 45px;
  place-items: center;
  border: 1px solid rgb(248 242 229 / 22%);
  border-radius: 50%;
  font-family: var(--font-serif);
  font-size: 13px;
  font-style: italic;
}

.latest-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: 42px 0 34px;
}

.latest-meta {
  display: block;
  margin-bottom: 13px;
  color: var(--butter);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.latest-body h2 {
  margin-bottom: 15px;
  font-size: clamp(25px, 2.4vw, 31px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.35;
}

.latest-excerpt {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: rgb(248 242 229 / 63%);
  font-size: 13.5px;
  line-height: 1.8;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.latest-foot {
  padding-top: 18px;
  border-top: 1px solid rgb(248 242 229 / 16%);
  color: rgb(248 242 229 / 68%);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.round-arrow {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  flex: none;
  color: var(--ink);
  background: var(--cream);
  border-radius: 50%;
  font-size: 18px;
  transition:
    color 220ms ease,
    background 220ms ease,
    transform 220ms var(--ease);
}

.latest-card:hover .round-arrow {
  color: var(--cream);
  background: var(--accent);
  transform: rotate(45deg);
}

/* ---------- Archive ---------- */

.archive {
  padding: 74px 0 94px;
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
}

.section-kicker {
  margin-bottom: 12px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section-kicker--dark {
  color: var(--accent-deep);
}

.section-heading h2 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 3.2vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.15;
}

.section-intro {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14.5px;
}

.search-field {
  display: flex;
  align-items: center;
  width: 282px;
  height: 48px;
  flex: none;
  gap: 10px;
  padding: 0 17px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition:
    border-color 200ms ease,
    box-shadow 200ms ease,
    background 200ms ease;
}

.search-field:focus-within {
  background: #fffdf8;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgb(232 81 42 / 8%);
}

.search-field svg {
  flex: none;
}

.search-field input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 13.5px;
}

.search-field input::placeholder {
  color: #97958a;
}

.search-field input::-webkit-search-cancel-button {
  cursor: pointer;
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 30px 0 26px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-chip {
  padding: 7px 15px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.4;
  transition:
    color 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.filter-chip:hover {
  color: var(--ink);
  border-color: var(--line);
}

.filter-chip.is-active {
  color: var(--cream);
  background: var(--ink);
  border-color: var(--ink);
}

.post-count {
  margin: 0;
  flex: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

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

.post-card {
  position: relative;
  overflow: hidden;
  min-height: 312px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition:
    transform 320ms var(--ease),
    border-color 200ms ease,
    box-shadow 320ms var(--ease),
    background 200ms ease;
}

.post-grid.is-animated .post-card {
  animation: card-in 500ms var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

.post-card::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 340ms var(--ease);
}

.post-card:hover {
  background: #fffdf8;
  border-color: var(--line-strong);
  box-shadow: 0 18px 38px rgb(26 28 24 / 7%);
  transform: translateY(-5px);
}

.post-card:hover::before {
  transform: scaleX(1);
}

.post-card__link {
  display: flex;
  height: 100%;
  flex-direction: column;
  padding: 24px;
}

.post-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  color: var(--tag-engineering-ink);
  background: var(--tag-engineering-bg);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.tag::before {
  content: "";
  width: 4px;
  height: 4px;
  background: currentColor;
  border-radius: 50%;
}

.tag--frontend {
  color: var(--tag-frontend-ink);
  background: var(--tag-frontend-bg);
}

.tag--ai {
  color: var(--tag-ai-ink);
  background: var(--tag-ai-bg);
}

.tag--notes {
  color: var(--tag-notes-ink);
  background: var(--tag-notes-bg);
}

.post-card__number {
  color: #b6b0a3;
  font-family: var(--font-serif);
  font-size: 12px;
  font-style: italic;
  letter-spacing: 0.06em;
}

.post-card h3 {
  margin-bottom: 12px;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.4;
  text-wrap: pretty;
  transition: color 180ms ease;
}

.post-card:hover h3 {
  color: var(--accent-deep);
}

.post-card__excerpt {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.8;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.post-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 17px;
  color: #777469;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.03em;
}

.post-card__meta {
  display: flex;
  align-items: center;
  gap: 9px;
}

.post-card__meta i {
  width: 2px;
  height: 2px;
  background: currentColor;
  border-radius: 50%;
}

.post-card__arrow {
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  transition: transform 240ms var(--ease);
}

.post-card:hover .post-card__arrow {
  transform: translate(3px, -3px);
}

.empty-state {
  padding: 66px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
}

.empty-mark {
  display: block;
  margin-bottom: 14px;
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 38px;
  line-height: 1;
}

.empty-state h3 {
  margin-bottom: 8px;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.empty-state p {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 14px;
}

.noscript-note {
  margin: 22px 0 0;
  padding: 14px 18px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

/* ---------- About ---------- */

.about {
  padding-bottom: 94px;
}

.about-panel {
  position: relative;
  display: grid;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  gap: clamp(36px, 6vw, 92px);
  padding: clamp(36px, 5vw, 68px);
  background: var(--paper-deep);
  border: 1px solid rgb(26 28 24 / 10%);
  border-radius: var(--radius-lg);
}

.about-panel::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -130px;
  width: 330px;
  height: 330px;
  border: 1px solid rgb(26 28 24 / 9%);
  border-radius: 50%;
  box-shadow:
    0 0 0 34px rgb(26 28 24 / 3%),
    0 0 0 70px rgb(26 28 24 / 2%);
  pointer-events: none;
}

.about-watermark {
  position: absolute;
  right: 26px;
  bottom: -30px;
  color: rgb(26 28 24 / 4%);
  font-family: var(--font-serif);
  font-size: clamp(110px, 16vw, 220px);
  font-weight: 700;
  letter-spacing: -0.08em;
  line-height: 1;
  pointer-events: none;
}

.about-heading,
.about-copy {
  position: relative;
  z-index: 1;
}

.about-heading h2 {
  margin-bottom: 0;
  font-size: clamp(2.05rem, 3.8vw, 3.15rem);
  font-weight: 700;
  letter-spacing: -0.052em;
  line-height: 1.24;
}

.about-copy p {
  color: #5b5a51;
  font-size: 15px;
  line-height: 1.9;
}

.about-copy .about-lead {
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.75;
}

.about-copy p:not(.about-lead) {
  margin-bottom: 12px;
}

.about-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
  margin-top: 28px;
}

/* ---------- Contact sheet ---------- */

.contact-sheet {
  width: min(430px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100% - 32px);
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  overflow: visible;
}

.contact-sheet::backdrop {
  background: rgb(26 28 24 / 44%);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.contact-sheet__panel {
  overflow: hidden;
  padding: 26px 26px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 30px 70px rgb(26 28 24 / 24%);
}

.contact-sheet__kicker {
  margin-bottom: 8px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.contact-sheet__title {
  margin-bottom: 6px;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.3;
}

.contact-sheet__address {
  margin-bottom: 20px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  word-break: break-all;
}

.contact-sheet__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-option {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 13px;
  padding: 13px 15px;
  color: var(--ink);
  text-align: left;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    transform 200ms var(--ease);
}

.contact-option:hover {
  background: var(--paper-deep);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.contact-option__icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: none;
  color: var(--cream);
  background: var(--forest);
  border-radius: 10px;
  font-family: var(--font-serif);
  font-size: 16px;
  font-style: italic;
  line-height: 1;
}

.contact-option__icon--qq {
  background: var(--accent);
  font-style: normal;
  font-family: var(--font-sans);
  font-weight: 700;
}

.contact-option__body {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.contact-option__body strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.contact-option__body small {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.contact-option__arrow {
  flex: none;
  color: var(--accent);
  font-size: 14px;
  transition: transform 200ms var(--ease);
}

.contact-option:hover .contact-option__arrow {
  transform: translate(2px, -2px);
}

.contact-sheet__close {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 11px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  transition:
    color 180ms ease,
    background 180ms ease;
}

.contact-sheet__close:hover {
  color: var(--ink);
  background: var(--paper-deep);
}

@media (max-width: 680px) {
  .contact-sheet {
    width: 100%;
    max-width: none;
    max-height: 90%;
    margin: auto auto 0;
  }

  .contact-sheet__panel {
    padding: 24px 20px calc(18px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
  }

  .contact-sheet__title {
    font-size: 21px;
  }
}

/* ---------- Footer ---------- */

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

.footer-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  padding-bottom: 28px;
}

.footer-brand {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.07em;
  line-height: 1;
}

.footer-brand span {
  color: var(--accent);
}

.footer-top p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  transition: color 180ms ease;
}

.back-to-top span {
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
}

.back-to-top:hover {
  color: var(--accent-deep);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 18px;
  color: #7d7a70;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
}

/* ---------- Article ---------- */

.reading-progress {
  position: fixed;
  z-index: 100;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
}

.article-main {
  padding: 32px 0 0;
}

.article-shell {
  max-width: 1060px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  transition: color 180ms ease;
}

.back-link span {
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  transition: transform 200ms var(--ease);
}

.back-link:hover {
  color: var(--ink);
}

.back-link:hover span {
  transform: translateX(-3px);
}

.article-header {
  max-width: 900px;
  margin-top: 42px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 11px;
  margin-bottom: 19px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.meta-dot {
  width: 3px;
  height: 3px;
  background: var(--line-strong);
  border-radius: 50%;
}

.article-header h1 {
  max-width: 860px;
  margin-bottom: 25px;
  font-size: clamp(2.45rem, 5.1vw, 4.15rem);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1.18;
}

.article-deck {
  max-width: 730px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.article-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.avatar {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  flex: none;
  color: var(--cream);
  background: var(--forest);
  border-radius: 50%;
  font-family: var(--font-serif);
  font-size: 18px;
  font-style: italic;
}

.byline-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.byline-text strong {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
}

.byline-text span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.02em;
}

.copy-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  margin-left: auto;
  padding: 6px 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 11px;
  transition:
    color 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.copy-button:hover {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
}

.copy-button.is-copied {
  color: var(--forest);
  background: var(--tag-frontend-bg);
  border-color: transparent;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 720px) 190px;
  gap: 68px;
  justify-content: space-between;
  margin-top: 54px;
}

.article-body {
  min-width: 0;
  color: var(--ink-soft);
  font-size: 17.5px;
  line-height: 1.92;
}

.article-body > p {
  margin-bottom: 24px;
}

.article-body > p:first-child {
  color: var(--ink);
  font-size: 19px;
  line-height: 1.88;
}

.article-body h2 {
  position: relative;
  margin: 58px 0 20px;
  padding-top: 24px;
  color: var(--ink);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.35;
  scroll-margin-top: 110px;
}

.article-body h2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 34px;
  height: 2px;
  background: var(--accent);
}

.article-body h3 {
  margin: 38px 0 13px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.5;
}

.article-body strong {
  color: var(--ink);
  font-weight: 650;
}

.article-body a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body ul,
.article-body ol {
  margin: 0 0 26px;
  padding-left: 1.35em;
}

.article-body li {
  margin-bottom: 9px;
  padding-left: 4px;
}

.article-body li::marker {
  color: var(--accent);
  font-size: 0.9em;
}

.article-body blockquote {
  position: relative;
  margin: 34px 0;
  padding: 24px 28px 24px 32px;
  background: var(--surface-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.article-body blockquote::before {
  content: "“";
  position: absolute;
  top: 3px;
  left: 10px;
  color: rgb(232 81 42 / 20%);
  font-family: var(--font-serif);
  font-size: 52px;
  line-height: 1;
}

.article-body blockquote p {
  position: relative;
  margin: 0;
  color: #4d4e46;
  font-family: var(--font-serif);
  font-size: 18.5px;
  line-height: 1.8;
}

.article-body code {
  padding: 0.14em 0.38em;
  color: #a4381a;
  background: rgb(232 81 42 / 8%);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.86em;
}

.article-body pre {
  position: relative;
  overflow-x: auto;
  margin: 28px 0 32px;
  padding: 23px 25px;
  color: #eee7d8;
  background: #1c2f25;
  border: 1px solid rgb(255 255 255 / 6%);
  border-radius: 14px;
  box-shadow: 0 12px 26px rgb(23 59 44 / 10%);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.75;
  tab-size: 2;
}

.article-body pre::before {
  content: "";
  position: absolute;
  top: 14px;
  right: 16px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow:
    -12px 0 0 rgb(248 242 229 / 18%),
    -24px 0 0 rgb(248 242 229 / 18%);
}

.article-body pre code {
  padding: 0;
  color: inherit;
  background: transparent;
  border-radius: 0;
  font-size: inherit;
}

.callout {
  position: relative;
  margin: 34px 0;
  padding: 22px 24px 21px;
  background: #f4ebd9;
  border: 1px solid rgb(26 28 24 / 8%);
  border-radius: var(--radius-sm);
}

.callout-label {
  display: block;
  margin-bottom: 7px;
  color: var(--accent-deep);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.callout p {
  margin: 0;
  color: #4e4f47;
  font-size: 15.5px;
  line-height: 1.85;
}

.article-aside {
  min-width: 0;
}

.toc {
  position: sticky;
  top: 110px;
  padding-top: 18px;
  border-top: 1px solid var(--line-strong);
}

.toc-title {
  margin-bottom: 15px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.toc nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toc a {
  position: relative;
  padding-left: 12px;
  color: #747267;
  font-size: 11.5px;
  line-height: 1.55;
  transition:
    color 180ms ease,
    transform 180ms ease;
}

.toc a::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 4px;
  height: 1px;
  background: var(--line-strong);
  transition:
    width 180ms ease,
    background 180ms ease;
}

.toc a:hover {
  color: var(--ink);
}

.toc a.is-active {
  color: var(--accent-deep);
  font-weight: 500;
}

.toc a.is-active::before {
  width: 7px;
  background: var(--accent);
}

/* Article footer */

.article-footer {
  margin-top: 72px;
  padding-top: 38px;
  border-top: 1px solid var(--line);
}

.article-author {
  display: flex;
  gap: 18px;
  max-width: 560px;
}

.avatar--large {
  width: 52px;
  height: 52px;
  font-size: 25px;
}

.article-author-label {
  margin-bottom: 5px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.article-author h2 {
  margin-bottom: 6px;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.article-author p:not(.article-author-label) {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.75;
}

.article-author .text-link {
  font-size: 12.5px;
}

.next-post {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 46px;
  padding: 23px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition:
    background 220ms ease,
    border-color 220ms ease,
    transform 240ms var(--ease);
}

.next-post:hover {
  background: #fffdf8;
  border-color: var(--line-strong);
  transform: translateY(-3px);
}

.next-post-label {
  flex: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}

.next-post-body {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 5px;
}

.next-post-meta {
  color: var(--accent-deep);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.05em;
}

.next-post strong {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.45;
  text-wrap: balance;
}

.round-arrow--light {
  color: var(--ink);
  background: var(--paper-deep);
}

.next-post:hover .round-arrow--light {
  color: var(--cream);
  background: var(--accent);
  transform: translateX(3px);
}

.site-footer--article {
  margin-top: 84px;
}

/* Article not found */

.not-found {
  max-width: 600px;
  margin: 96px auto;
  padding: 52px 36px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.not-found span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 64px;
  font-style: italic;
  line-height: 1;
}

.not-found h1 {
  margin-bottom: 12px;
  font-size: 32px;
  letter-spacing: -0.04em;
}

.not-found p {
  margin-bottom: 25px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Animation ---------- */

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(13px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .hero-grid {
    gap: 42px;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  }

  .hero h1 {
    font-size: clamp(2.9rem, 6.1vw, 4.5rem);
  }

  .post-card h3 {
    font-size: 20px;
  }

  .article-layout {
    grid-template-columns: minmax(0, 680px) 170px;
    gap: 44px;
  }
}

@media (max-width: 900px) {
  .hero {
    padding: 62px 0 64px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 46px;
  }

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

  .latest-card {
    min-height: 330px;
    max-width: 560px;
    transform: none;
  }

  .latest-card:hover {
    transform: translateY(-5px);
  }

  .latest-body {
    padding: 32px 0 28px;
  }

  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .about-panel {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .article-layout {
    grid-template-columns: 1fr;
    max-width: 740px;
  }

  .article-aside {
    display: none;
  }

  .article-header {
    max-width: 760px;
  }
}

@media (max-width: 680px) {
  .container {
    width: calc(100% - 32px);
  }

  .header-inner {
    height: 68px;
  }

  .brand-mark {
    width: 27px;
    height: 27px;
    border-radius: 8px;
    font-size: 20px;
  }

  .brand-word {
    font-size: 24px;
  }

  .brand-tag {
    display: none;
  }

  .header-right {
    gap: 18px;
  }

  .site-nav {
    gap: 18px;
  }

  .site-nav a {
    font-size: 13px;
  }

  .header-cta {
    display: none;
  }

  .hero {
    padding: 48px 0 56px;
  }

  .eyebrow {
    margin-bottom: 18px;
  }

  .hero h1 {
    margin-bottom: 23px;
    font-size: clamp(2.55rem, 11vw, 3.5rem);
    letter-spacing: -0.055em;
    line-height: 1.18;
  }

  .hero-lead {
    margin-bottom: 27px;
    font-size: 15.5px;
    line-height: 1.8;
  }

  .hero-actions {
    gap: 18px;
  }

  .button {
    min-height: 46px;
    padding: 11px 20px;
  }

  .hero-stats {
    gap: 14px;
    margin-top: 32px;
    font-size: 10px;
  }

  .hero-stats span {
    gap: 14px;
  }

  .hero-stats span + span::before {
    width: 9px;
  }

  .latest-card {
    min-height: 345px;
    padding: 24px;
    border-radius: 22px;
  }

  .latest-body {
    padding: 28px 0 24px;
  }

  .latest-body h2 {
    font-size: clamp(21px, 5.8vw, 25px);
  }

  .latest-excerpt {
    font-size: 13px;
  }

  .archive {
    padding: 54px 0 66px;
  }

  .section-head {
    flex-direction: column;
    align-items: stretch;
    gap: 22px;
  }

  .section-heading h2 {
    font-size: 32px;
  }

  .search-field {
    width: 100%;
  }

  .filter-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    margin: 24px 0 20px;
  }

  .post-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .post-card {
    min-height: 0;
  }

  .post-card__link {
    padding: 22px;
  }

  .post-card__top {
    margin-bottom: 21px;
  }

  .post-card h3 {
    font-size: 21px;
  }

  .post-card__excerpt {
    margin-bottom: 20px;
  }

  .about {
    padding-bottom: 62px;
  }

  .about-panel {
    padding: 30px 24px 34px;
    border-radius: 22px;
  }

  .about-heading h2 {
    font-size: 31px;
  }

  .about-lead {
    font-size: 16px !important;
  }

  .about-copy p {
    font-size: 14px;
  }

  .footer-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 22px;
  }

  .footer-top p {
    order: 3;
  }

  .back-to-top {
    position: absolute;
    right: 16px;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

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

  .article-header {
    margin-top: 32px;
  }

  .article-header h1 {
    font-size: clamp(2.2rem, 9.6vw, 3rem);
    letter-spacing: -0.05em;
  }

  .article-deck {
    font-size: 16px;
  }

  .article-byline {
    flex-wrap: wrap;
  }

  .copy-button {
    margin-left: 0;
  }

  .article-layout {
    margin-top: 36px;
  }

  .article-body {
    font-size: 16.5px;
    line-height: 1.9;
  }

  .article-body > p:first-child {
    font-size: 17.5px;
  }

  .article-body h2 {
    margin-top: 47px;
    font-size: 26px;
  }

  .article-body h3 {
    font-size: 19px;
  }

  .article-body pre {
    margin-right: -8px;
    margin-left: -8px;
    padding: 20px 18px;
    border-radius: 10px;
    font-size: 12px;
  }

  .article-body blockquote {
    padding: 21px 21px 21px 26px;
  }

  .article-body blockquote p {
    font-size: 17px;
  }

  .article-footer {
    margin-top: 54px;
  }

  .next-post {
    gap: 17px;
    padding: 20px;
  }

  .next-post strong {
    font-size: 16px;
  }

  .next-post-label {
    display: none;
  }

  .site-footer--article {
    margin-top: 60px;
  }

  .not-found {
    margin: 60px auto;
    padding: 42px 24px;
  }
}

@media (max-width: 340px) {
  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-stats span:nth-child(2) {
    display: none;
  }

  .latest-card {
    padding: 21px;
  }

  .footer-brand {
    font-size: 27px;
  }
}

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

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