:root {
  --bg-from: #fefce8;
  --bg-via: #fff7ed;
  --bg-to: #fffbeb;
  --ink: #334155;
  --muted: #64748b;
  --line: #fed7aa;
  --line-soft: #ffedd5;
  --accent: #ea580c;
  --accent-strong: #c2410c;
  --orange-600: #ea580c;
  --amber-600: #d97706;
  --yellow-600: #ca8a04;
  --max: 48rem;
  --site: 52rem;
  --radius: 0.5rem;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  background: linear-gradient(to bottom right, var(--bg-from), var(--bg-via), var(--bg-to));
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 20rem;
  height: 20rem;
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
  filter: blur(48px);
}

body::before {
  top: -6rem;
  right: -6rem;
  background: linear-gradient(to bottom right, rgb(254 240 138 / 0.35), rgb(253 186 116 / 0.25));
}

body::after {
  bottom: -6rem;
  left: -6rem;
  background: linear-gradient(to bottom right, rgb(253 186 116 / 0.28), rgb(253 230 138 / 0.22));
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-strong);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: #0f172a;
  color: white;
  padding: 0.5rem 0.75rem;
  z-index: 20;
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgb(253 186 116 / 0.55);
  background: rgb(255 255 255 / 0.72);
  backdrop-filter: blur(10px);
}

.site-header__inner {
  max-width: var(--site);
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.brand__text {
  background: linear-gradient(to right, #ea580c, #d97706, #ca8a04);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand em {
  font-style: normal;
  font-weight: 700;
  color: #d97706;
  -webkit-text-fill-color: #d97706;
}

.brand__mark {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 999px;
  background: linear-gradient(to right, #f97316, #f59e0b);
  box-shadow: 0 0 0 3px rgb(249 115 22 / 0.18);
  position: relative;
}

.brand__mark::after {
  content: "";
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: linear-gradient(to right, #f97316, #f59e0b);
}

.site-nav {
  display: flex;
  gap: 0.65rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.site-nav a {
  color: #475569;
  text-decoration: none;
  background: white;
  border: 1px solid #fdba74;
  border-radius: var(--radius);
  padding: 0.35rem 0.7rem;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
  transition: all 200ms ease;
}

.site-nav a:hover {
  color: white;
  border-color: transparent;
  background: linear-gradient(to right, #fb923c, #f59e0b);
}

.site-main,
.site-footer {
  max-width: var(--site);
  margin: 0 auto;
  padding: 2.25rem 1.25rem 3.5rem;
  position: relative;
  z-index: 1;
}

.site-footer {
  padding-top: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.site-footer a {
  font-weight: 600;
}

.hero,
.post__header {
  text-align: center;
  margin-bottom: 2rem;
}

.hero h1,
.post__header h1 {
  font-weight: 800;
  font-size: clamp(2rem, 4.5vw, 2.85rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
  margin: 0.35rem 0 0.75rem;
  background: linear-gradient(to right, #ea580c, #d97706, #ca8a04);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.title-rule {
  display: block;
  width: 8rem;
  height: 0.25rem;
  margin: 0 auto 1rem;
  border-radius: 999px;
  background: linear-gradient(to right, #f97316, #f59e0b, #eab308);
}

.eyebrow {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: #ea580c;
}

.eyebrow a {
  text-decoration: none;
}

.lede {
  margin: 0 auto;
  color: #475569;
  font-size: 1.1rem;
  font-weight: 500;
  max-width: 40rem;
  line-height: 1.6;
}

.post-list {
  margin-top: 0.5rem;
}

.post-list ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.post-card a {
  display: block;
  position: relative;
  overflow: hidden;
  padding: 1.2rem 1.3rem;
  border: 1px solid #fed7aa;
  border-radius: 0.5rem;
  background: linear-gradient(to right, #fff7ed, #fffbeb, #fefce8);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
  transition: border-color 300ms ease, box-shadow 300ms ease;
}

.post-card a::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, #f97316, #f59e0b, #eab308);
}

.post-card a:hover {
  border-color: #fdba74;
  box-shadow: 0 8px 20px -12px rgb(234 88 12 / 0.45);
}

.post-card time {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.post-card h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 0.4rem;
  background: linear-gradient(to right, #ea580c, #d97706, #ca8a04);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.post-card p {
  margin: 0;
  color: #475569;
  font-size: 0.95rem;
  font-weight: 500;
}

.post__header {
  margin-bottom: 2rem;
  padding-bottom: 0.25rem;
}

.post__meta {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.prose {
  max-width: var(--max);
  margin: 0 auto;
}

.prose h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 2.25rem 0 0.75rem;
  color: #334155;
}

.prose h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.6rem 0 0.55rem;
  color: #475569;
}

.prose p,
.prose ul,
.prose ol,
.prose table {
  margin: 0 0 1rem;
}

.prose li + li {
  margin-top: 0.35rem;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  padding: 0.08em 0.32em;
  border-radius: 0.3em;
  color: #9a3412;
}

.prose pre {
  overflow-x: auto;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.9rem;
  line-height: 1.5;
  border: 1px solid #1e293b;
}

.prose pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
}

.prose blockquote {
  margin: 1.25rem 0;
  padding: 0.35rem 0 0.35rem 1rem;
  border-left: 3px solid #fb923c;
  color: var(--muted);
}

.prose .figure-caption {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  overflow: hidden;
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  background: rgb(255 255 255 / 0.7);
}

.prose th,
.prose td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #ffedd5;
  vertical-align: top;
}

.prose th {
  background: linear-gradient(to right, #fff7ed, #fffbeb);
  color: #9a3412;
  font-weight: 700;
}

.prose tr:last-child td {
  border-bottom: none;
}

/* Architecture diagrams (coded, not Mermaid) */
.arch-figure {
  max-width: none;
  width: 100%;
  margin: 1.5rem 0 2rem;
  padding: 0 0 1rem;
  border: 1px solid #fed7aa;
  border-radius: 0.75rem;
  background: linear-gradient(to bottom right, rgb(255 255 255 / 0.85), rgb(255 247 237 / 0.9));
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.06);
  overflow: hidden;
}

.arch-figure__bar {
  height: 3px;
  background: linear-gradient(to right, #f97316, #f59e0b, #eab308);
}

.arch-figure__head {
  padding: 1rem 1.1rem 0.35rem;
}

.arch-figure__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  background: linear-gradient(to right, #ea580c, #d97706, #ca8a04);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.arch-lanes {
  display: grid;
  gap: 0.75rem;
  padding: 0.75rem 1rem 0.35rem;
  grid-template-columns: 1fr;
}

@media (min-width: 800px) {
  .arch-lanes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.arch-lane {
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  background: white;
  overflow: hidden;
}

.arch-lane__title {
  margin: 0;
  padding: 0.45rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid #e2e8f0;
}

.arch-lane--slate .arch-lane__title {
  background: #f8fafc;
  color: #475569;
}

.arch-lane--aws .arch-lane__title {
  background: linear-gradient(to right, #fff7ed, #ffedd5);
  color: #c2410c;
  border-bottom-color: #fed7aa;
}

.arch-lane--cloudflare .arch-lane__title {
  background: linear-gradient(to right, #fff7ed, #fef3c7);
  color: #b45309;
  border-bottom-color: #fde68a;
}

.arch-lane--google .arch-lane__title {
  background: #f0fdf4;
  color: #15803d;
  border-bottom-color: #bbf7d0;
}

.arch-lane--residual .arch-lane__title {
  background: #f1f5f9;
  color: #64748b;
}

.arch-lane__nodes {
  list-style: none;
  margin: 0;
  padding: 0.55rem;
  display: grid;
  gap: 0.4rem;
}

.arch-node {
  padding: 0.45rem 0.55rem;
  border-radius: 0.4rem;
  border: 1px solid #ffedd5;
  background: linear-gradient(to right, #fffaf5, #ffffff);
}

.arch-node strong {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  color: #334155;
}

.arch-node span {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}

.arch-flows {
  margin: 0.65rem 1rem 0;
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px dashed #fdba74;
  background: rgb(255 251 235 / 0.65);
}

.arch-flows__heading {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c2410c;
}

.arch-flows ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.arch-flow {
  display: grid;
  gap: 0.3rem;
}

@media (min-width: 700px) {
  .arch-flow {
    grid-template-columns: 7.5rem 1fr;
    align-items: center;
    gap: 0.75rem;
  }
}

.arch-flow__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #9a3412;
}

.arch-flow__steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.arch-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  border: 1px solid #fed7aa;
  background: white;
  color: #9a3412;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 1px 1px rgb(15 23 42 / 0.04);
}

.arch-arrow {
  color: #fb923c;
  font-weight: 800;
  font-size: 0.85rem;
}

.arch-figure .figure-caption {
  padding: 0 1.1rem;
}

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

  .site-nav a,
  .post-card a {
    transition: none;
  }
}
