:root {
  --bg: #eef2f8;
  --text: #141a2b;
  --muted: #5a6478;
  --accent: #3b6cff;
  --glass-top: rgba(255, 255, 255, 0.62);
  --glass-bottom: rgba(255, 255, 255, 0.28);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-shadow: 0 12px 40px rgba(30, 45, 90, 0.16);
  --glass-inner: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -1px 0 rgba(255, 255, 255, 0.25);
  --shine: rgba(255, 255, 255, 0.55);
  --orb-1: #5ad1ff;
  --orb-2: #a78bfa;
  --orb-3: #ff8fb1;
  --orb-4: #6ee7b7;
  --code-bg: rgba(20, 26, 43, 0.06);
  --radius: 28px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0f1d;
    --text: #e8ecf6;
    --muted: #9aa4bb;
    --accent: #8ab4ff;
    --glass-top: rgba(40, 48, 72, 0.55);
    --glass-bottom: rgba(20, 26, 43, 0.35);
    --glass-border: rgba(255, 255, 255, 0.14);
    --glass-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    --glass-inner: inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 -1px 0 rgba(255, 255, 255, 0.04);
    --shine: rgba(255, 255, 255, 0.12);
    --orb-1: #1f6fd1;
    --orb-2: #6d4bd8;
    --orb-3: #b83d72;
    --orb-4: #1d8f6a;
    --code-bg: rgba(255, 255, 255, 0.07);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Floating colour field behind the glass */
.field { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.orb {
  position: absolute;
  width: 46vmax; height: 46vmax;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.75;
  animation: drift 28s ease-in-out infinite alternate;
}
.orb.o1 { background: var(--orb-1); top: -14vmax; left: -10vmax; }
.orb.o2 { background: var(--orb-2); top: 10vmax; right: -16vmax; animation-duration: 34s; }
.orb.o3 { background: var(--orb-3); bottom: -18vmax; left: 18vmax; animation-duration: 40s; }
.orb.o4 { background: var(--orb-4); bottom: 4vmax; right: 20vmax; width: 28vmax; height: 28vmax; animation-duration: 31s; }

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(6vmax, 4vmax) scale(1.08); }
  100% { transform: translate(-4vmax, 7vmax) scale(0.95); }
}

@media (prefers-reduced-motion: reduce) { .orb { animation: none; } }

/* Liquid glass surface */
.glass {
  position: relative;
  background: linear-gradient(135deg, var(--glass-top), var(--glass-bottom));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow), var(--glass-inner);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
  overflow: hidden;
}
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(120% 70% at 8% -10%, var(--shine), transparent 55%),
    radial-gradient(80% 50% at 110% 120%, var(--shine), transparent 60%);
  pointer-events: none;
}
.glass > * { position: relative; }

.wrap { width: min(860px, 100% - 32px); margin: 0 auto; }

/* Navigation pill */
.nav {
  position: sticky;
  top: 16px;
  z-index: 10;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 18px;
  border-radius: 999px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 650; letter-spacing: -0.01em; }
.brand img { width: 26px; height: 26px; }
.nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.nav a.link {
  display: block;
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  transition: background 0.2s;
}
.nav a.link:hover, .nav a.link[aria-current="page"] { background: var(--code-bg); }

/* Hero */
.hero { margin-top: 40px; padding: 48px 44px; }
.hero h1 { font-size: clamp(34px, 6vw, 52px); line-height: 1.08; letter-spacing: -0.03em; margin: 0 0 14px; }
.hero p { color: var(--muted); font-size: 19px; margin: 0; max-width: 560px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; font-weight: 650; color: var(--accent); margin-bottom: 12px; }

/* Post list */
.section-title { margin: 44px 4px 16px; font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.posts { display: grid; gap: 16px; }
.post-card { display: block; padding: 26px 30px; color: inherit; text-decoration: none; transition: transform 0.25s ease, box-shadow 0.25s ease; }
.post-card:hover { transform: translateY(-3px); }
.post-card h2 { font-size: 23px; letter-spacing: -0.02em; line-height: 1.25; margin: 6px 0 8px; }
.post-card p { margin: 0; color: var(--muted); }
.meta { font-size: 13.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.tag { padding: 2px 10px; border-radius: 999px; background: var(--code-bg); font-size: 12.5px; }

/* Article */
.article { margin-top: 40px; padding: 48px 52px; }
.article h1 { font-size: clamp(30px, 5vw, 42px); line-height: 1.12; letter-spacing: -0.025em; margin: 10px 0 18px; }
.article h2 { font-size: 23px; letter-spacing: -0.015em; margin: 38px 0 10px; }
.article p, .article li { font-size: 17.5px; }
.article a { color: var(--accent); }
.article blockquote { margin: 26px 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); color: var(--muted); font-style: italic; }
.article code { font: 15px/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--code-bg); padding: 2px 6px; border-radius: 6px; }
.article pre { background: var(--code-bg); padding: 16px 18px; border-radius: 16px; overflow-x: auto; }
.article pre code { background: none; padding: 0; }
.article table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15.5px; }
.article th, .article td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--glass-border); }
.back { display: inline-block; margin-top: 30px; color: var(--accent); text-decoration: none; font-weight: 600; }

footer { margin: 56px auto 40px; text-align: center; color: var(--muted); font-size: 14px; }
footer a { color: inherit; }

@media (max-width: 640px) {
  .hero, .article { padding: 32px 22px; }
  .post-card { padding: 22px; }
  .nav { padding-left: 14px; }
  .brand span { display: none; }
}
