:root {
  --bg: #f7f6f9;
  --bg-surface: #ffffff;
  --bg-section: #edeaf3;
  --bg-card: #ffffff;
  --bg-darker: #13111b;
  --text: #23212d;
  --text-head: #13111b;
  --muted: #595568;
  --gold: #8f5c22;
  --gold-hover: #a66d2a;
  --gold-subtle: rgba(143, 92, 34, 0.08);
  --gold-border: rgba(143, 92, 34, 0.22);
  --white: #ffffff;
  --border: rgba(19, 17, 27, 0.09);
  --border-subtle: rgba(19, 17, 27, 0.05);
  --shadow-card: 0 2px 10px rgba(19, 17, 27, 0.04), 0 1px 3px rgba(19, 17, 27, 0.02);
  --shadow-card-hover:
    0 12px 28px -6px rgba(19, 17, 27, 0.08), 0 4px 10px -2px rgba(19, 17, 27, 0.03);
  --shadow-header: 0 1px 12px rgba(19, 17, 27, 0.06);
  --radius: 8px;
  --transition: 0.3s ease;
  --font-head: "Roboto Slab", serif;
  --font-ui: "Poppins", sans-serif;
  --font-body: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: var(--font-body);
  line-height: 1.75;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  width: 100%;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--gold-hover);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  background: var(--bg-card);
  color: var(--gold);
  border: 2px solid var(--gold);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 10000;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 20px;
  color: var(--gold);
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-head);
  overflow-wrap: break-word;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
  background: #ece8f2;
  color: #6e3e08;
  border: 1px solid #dcd6e7;
  padding: 2px 6px;
  border-radius: 4px;
  word-break: break-word;
}

pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: #e6e4ed;
  word-break: normal;
  white-space: pre;
}

.container {
  width: 100%;
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 24px;
}

.text-center {
  text-align: center;
}

.accent {
  color: var(--gold);
}

.section-pad {
  padding: clamp(50px, 8vw, 100px) 0;
}

.page-hero {
  padding: clamp(90px, 12vw, 130px) 0 clamp(28px, 4vw, 44px);
  background: linear-gradient(180deg, var(--bg-section) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  font-size: clamp(1.8rem, 4vw + 0.6rem, 2.6rem);
  color: var(--text-head);
}

.section-kicker {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 8px;
}

.hero-sub {
  color: var(--muted);
  max-width: 680px;
  margin: 14px auto 0;
  font-size: clamp(0.95rem, 1.2vw + 0.4rem, 1.05rem);
}

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-header);
  transition:
    padding var(--transition),
    background var(--transition);
}

.site-header.shrink {
  padding: 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  transition: height var(--transition);
}

.site-header.shrink .header-inner {
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text-head);
}

.brand .logo-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--bg-darker);
  border: 2px solid var(--gold);
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #d8af81;
}

.brand .brand-name span {
  color: var(--gold);
}

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

.header-right .header-back-link {
  order: 1;
}

.header-right .lang-switch {
  order: 2;
}

.header-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 8px 14px;
  transition: var(--transition);
  white-space: nowrap;
}

.header-back-link:hover {
  background: var(--gold);
  color: var(--white);
}

.lang-switch {
  display: inline-flex;
  gap: 2px;
  border: 1px solid var(--border);
  background: #edeaf3;
  border-radius: var(--radius);
  overflow: hidden;
}

.lang-switch button {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 7px 10px;
  cursor: pointer;
  text-transform: uppercase;
  transition: var(--transition);
}

.lang-switch button:hover {
  color: var(--gold);
}

.lang-switch button.active {
  background: var(--gold);
  color: var(--white);
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: var(--radius);
  border: 2px solid var(--gold);
  color: var(--gold);
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  font-weight: 600;
}

.btn:hover {
  background: var(--gold);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(143, 92, 34, 0.2);
}

.btn-solid {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
  font-weight: 600;
}

.btn-solid:hover {
  background: var(--gold-hover);
  border-color: var(--gold-hover);
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition:
    transform var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-border);
  box-shadow: var(--shadow-card-hover);
}

.article-card-thumb-wrap {
  display: block;
  overflow: hidden;
  border-radius: calc(var(--radius) - 2px);
  margin-bottom: 18px;
  border: 1px solid var(--border);
  background: #edeaf3;
  aspect-ratio: 16 / 10;
}

.article-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  display: block;
}

.article-card:hover .article-card-thumb {
  transform: scale(1.05);
}

.article-card-kicker {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 10px;
}

.article-card-title {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--text-head);
}

.article-card-title a {
  color: inherit;
}

.article-card-title a:hover {
  color: var(--gold);
}

.article-card-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 14px;
}

.article-card-excerpt {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 20px;
  flex-grow: 1;
}

.article-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.article-card-tags span {
  background: var(--gold-subtle);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-family: var(--font-ui);
  font-weight: 500;
}

.article-card-footer {
  margin-top: auto;
}

.pagination-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
}

.page-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 14px;
  min-height: 40px;
  min-width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.page-btn:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
}

.page-btn.active {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
  font-weight: 600;
}

.page-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.project {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(100px, 12vw, 130px) 0 clamp(40px, 6vw, 70px);
}

.article-content {
  width: 100%;
  max-width: 740px;
  margin: 0 auto;
}

.article-header {
  margin-bottom: 36px;
  text-align: center;
}

.article-kicker {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 12px;
}

.article-header h1 {
  font-size: clamp(1.75rem, 3.8vw + 0.6rem, 2.5rem);
  color: var(--text-head);
  margin-bottom: 16px;
  line-height: 1.25;
}

.article-subtitle {
  font-size: clamp(1.05rem, 1.4vw + 0.5rem, 1.2rem);
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 18px;
}

.article-meta-info {
  font-size: 0.9rem;
  color: var(--muted);
}

.copy-article-wrapper {
  margin-top: 14px;
}

.copy-article-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.copy-article-btn:hover {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}

.copy-article-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.copy-article-btn.copied {
  background: #2e7d32;
  border-color: #2e7d32;
  color: #ffffff;
}

.article-figure {
  margin: 36px 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(19, 17, 27, 0.08);
}

.article-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.article-body {
  font-size: 1.125rem;
  line-height: 1.85;
  color: var(--text);
}

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

.article-body h2 {
  color: var(--text-head);
  font-size: 1.55rem;
  margin-top: 48px;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}

.article-body ul {
  margin: 0 0 24px 24px;
  list-style-type: disc;
}

.article-body li {
  margin-bottom: 10px;
}

.article-body pre {
  background: var(--bg-darker);
  color: #e6e4ed;
  border: 1px solid rgba(143, 92, 34, 0.25);
  box-shadow: 0 8px 24px rgba(19, 17, 27, 0.08);
  border-radius: var(--radius);
  padding: 20px 22px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 28px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92rem;
  max-width: 100%;
}

.article-callout {
  background: var(--gold-subtle);
  border-left: 4px solid var(--gold);
  padding: 18px 24px;
  margin: 28px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-head);
}

.tweet-quote {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  box-shadow: var(--shadow-card);
  padding: 20px 24px;
  margin: 28px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.tweet-quote p {
  margin-bottom: 8px;
  font-style: italic;
  color: var(--text-head);
}

.tweet-quote cite {
  display: block;
  font-size: 0.88rem;
  color: var(--gold);
  font-style: normal;
  font-weight: 500;
}

.article-taxonomies {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-taxonomy-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.taxonomy-label {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.taxonomy-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--gold-subtle);
  border: 1px solid var(--gold-border);
  color: var(--gold);
}

.article-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article-tags-list .tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text);
  transition:
    border-color var(--transition),
    color var(--transition);
}

.article-tags-list .tag:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.project .back {
  display: inline-block;
  margin-top: 20px;
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
}

.project .back:hover {
  color: var(--gold-hover);
}

.site-footer {
  background: var(--bg-darker);
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  justify-content: center;
  align-items: center;
}

.copyright {
  color: #9a98a6;
  font-size: 0.88rem;
}

.reveal {
  animation: fadeUp 0.8s ease forwards;
}

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  animation: none;
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}

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

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .project {
    padding: 96px 0 50px;
  }
  .articles-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 480px) {
  .project {
    padding: 80px 0 36px;
  }
  .container {
    padding: 0 16px;
  }
  .header-inner {
    height: 60px;
  }
  .brand {
    font-size: 1.05rem;
    gap: 8px;
  }
  .brand .logo-mark {
    width: 34px;
    height: 34px;
    font-size: 0.78rem;
  }
  .header-right {
    gap: 8px;
  }
  .header-back-link {
    padding: 6px 10px;
    font-size: 0.72rem;
    letter-spacing: 0;
  }
  .lang-switch {
    gap: 2px;
  }
  .lang-switch button {
    padding: 5px 8px;
    font-size: 0.72rem;
  }
  .article-card {
    padding: 20px 18px;
  }
  .article-card-title {
    font-size: 1.15rem;
  }
  .article-card-excerpt {
    font-size: 0.88rem;
  }
  .article-card-footer .btn {
    display: block;
    text-align: center;
    width: 100%;
  }
  .article-body {
    font-size: 1.05rem;
    line-height: 1.75;
  }
  .article-body ul {
    margin: 0 0 20px 18px;
  }
  .article-body pre {
    padding: 14px 16px;
    font-size: 0.84rem;
    margin: 18px 0;
  }
  .article-callout,
  .tweet-quote {
    padding: 14px 16px;
    margin: 20px 0;
  }
  .article-figure {
    margin: 22px 0;
  }
}

@media (max-width: 360px) {
  .brand-name {
    display: none;
  }
  .container {
    padding: 0 12px;
  }
  .header-back-link {
    padding: 5px 7px;
    font-size: 0.7rem;
  }
  .lang-switch button {
    padding: 4px 6px;
    font-size: 0.7rem;
  }
  .article-card {
    padding: 16px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
