:root {
  --bg: #f3f1ea;
  --ink: #12222b;
  --muted: #42545f;
  --accent: #dd5a20;
  --accent-deep: #8d3e16;
  --panel: #fffdf8;
  --panel-strong: #f8f2e6;
  --line: #d9d2c3;
  --line-strong: #c6b89c;
  --chart-paper: #f8f1e3;
  --shadow: 0 22px 50px rgba(18, 34, 43, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, #fff8da 0, transparent 38%),
    radial-gradient(circle at 85% 15%, #ffd5c3 0, transparent 35%),
    linear-gradient(180deg, #efece4 0%, var(--bg) 45%, #ebe6dd 100%);
  min-height: 100vh;
}

.hero {
  padding: 2rem clamp(1rem, 3vw, 3rem) 3rem;
}

.post-hero {
  padding-bottom: 1.5rem;
}

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  max-width: 1040px;
  margin: 0 auto 2.5rem;
}

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

.brand img {
  width: min(290px, 65vw);
  height: auto;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

.hero-content {
  max-width: 1040px;
  margin: 0 auto;
}

h1 {
  margin: 0.7rem 0 1rem;
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 7vw, 4.2rem);
  line-height: 0.98;
  max-width: 16ch;
}

.lead {
  max-width: 67ch;
  color: var(--muted);
  font-size: 1.13rem;
  line-height: 1.65;
}

.cta {
  display: inline-block;
  margin-top: 1.3rem;
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  text-decoration: none;
  color: #fff;
  background: var(--accent);
  font-weight: 700;
}

main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 3rem) 4rem;
  display: grid;
  gap: 1.4rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(1.2rem, 2.6vw, 2rem);
  box-shadow: var(--shadow);
}

.panel h2 {
  margin-top: 0;
  font-family: "Fraunces", serif;
}

.post-body {
  font-size: 1.08rem;
  line-height: 1.72;
  text-wrap: pretty;
}

.post-body h2 {
  margin: 2.8rem 0 0.8rem;
  padding-top: 1.55rem;
  border-top: 1px solid rgba(198, 184, 156, 0.55);
  font-size: clamp(1.5rem, 3vw, 1.95rem);
  line-height: 1.08;
  max-width: 19ch;
}

.post-body h3 {
  margin: 1.9rem 0 0.45rem;
  color: var(--accent-deep);
  font-size: 0.92rem;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.post-body > :first-child {
  margin-top: 0;
}

.post-body p,
.post-body ul,
.post-body ol,
.post-body pre,
.post-body figure {
  max-width: 72ch;
  margin-top: 1rem;
  margin-bottom: 0;
}

.post-body figure.post-figure-wide {
  width: 100%;
  max-width: min(88ch, 100%);
}

.post-body ul,
.post-body ol {
  padding-left: 1.25rem;
}

.post-body li + li {
  margin-top: 0.38rem;
}

.source-note-ref {
  margin-left: 0.08em;
  font-size: 0.72em;
  line-height: 0;
  vertical-align: super;
}

.source-note-ref a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.source-notes {
  color: var(--muted);
  font-size: 0.92rem;
}

.source-notes li {
  margin-bottom: 0.75rem;
  padding-left: 0.2rem;
}

.source-notes li:target {
  color: var(--ink);
  background: #fff4cf;
  border-radius: 8px;
  outline: 4px solid #fff4cf;
}

.post-body code {
  font-size: 0.94em;
}

.post-body pre {
  overflow-x: auto;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  border: 1px solid rgba(18, 34, 43, 0.08);
  background: #18252e;
  color: #f3f6f8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.post-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin-top: 1.2rem;
}

.post-body table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.45;
}

.post-body th,
.post-body td {
  padding: 0.72rem 0.78rem;
  border: 1px solid rgba(18, 34, 43, 0.14);
  text-align: left;
  vertical-align: top;
}

.post-body th {
  background: rgba(255, 255, 255, 0.52);
  font-weight: 700;
}

.post-body pre code {
  color: inherit;
}

.post-link {
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: -0.2rem;
}

.post-note {
  margin-top: 1.4rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px dashed var(--line);
  background: #f6f2e8;
}

.post-figure {
  position: relative;
  margin: 1.5rem 0 1.7rem;
  padding: 0.95rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(248, 242, 230, 0.96) 100%);
  box-shadow: 0 14px 34px rgba(18, 34, 43, 0.08);
}

.post-figure[data-figure-label]::before {
  content: attr(data-figure-label);
  display: inline-flex;
  margin-bottom: 0.75rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: rgba(18, 34, 43, 0.08);
  color: var(--accent-deep);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-figure img {
  display: block;
  width: 100%;
  max-width: 760px;
  height: auto;
  margin: 0 auto;
  padding: 0.45rem;
  border: 1px solid rgba(198, 184, 156, 0.8);
  border-radius: 16px;
  background: var(--chart-paper);
}

.post-figure-wide img {
  max-width: min(860px, 100%);
  padding: 0.25rem;
}

.post-figure-workflow img {
  max-width: 1080px;
  padding: 0.15rem;
}

.post-figure figcaption {
  display: grid;
  gap: 0.28rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(198, 184, 156, 0.7);
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

.post-figure figcaption strong {
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.post-figure-hero {
  padding: 0.75rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74) 0%, rgba(247, 241, 230, 0.9) 100%);
}

.post-figure-hero img {
  padding: 0;
  border: 0;
  background: transparent;
}

.figure-note {
  color: var(--muted);
}

.bridge-note {
  background: #eef5ff;
  border-style: solid;
}

.tag-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 0.35rem;
}

.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.tag-personal {
  background: #fdebd3;
  color: #7f3f00;
  border: 1px solid #edcda2;
}

.tag-mqa {
  background: #e0f0ff;
  color: #0c3f72;
  border: 1px solid #b6d7f6;
}

.tag-linkedin {
  background: #e6f6ee;
  color: #135d3a;
  border: 1px solid #b8dfcb;
}

ul {
  margin-bottom: 0;
}

footer {
  border-top: 1px solid var(--line);
  text-align: center;
  padding: 1.2rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .top-nav {
    margin-bottom: 1.4rem;
  }

  h1 {
    line-height: 1;
  }

  .panel {
    padding: 1rem;
  }

  .post-body h2 {
    margin-top: 2.2rem;
    padding-top: 1.2rem;
  }

  .post-figure {
    padding: 0.7rem;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .post-figure-wide,
  .post-figure-wide img,
  .post-figure-hero,
  .post-figure-hero img {
    width: 100%;
    max-width: 100%;
  }
}
