/* widgrensit - editorial-engineering journal
   Palette: sakura blossom + Swedish midsummer meadow (rose / leaf-green / sky / sun)
   Fraunces (display) + Newsreader (reading) + JetBrains Mono (technical)
   Fonts self-hosted (no external requests / GDPR-safe). */

@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/fraunces-v38-latin-regular.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 400; font-display: swap; src: url("/assets/fonts/fraunces-v38-latin-italic.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/fraunces-v38-latin-600.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 900; font-display: swap; src: url("/assets/fonts/fraunces-v38-latin-900.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/newsreader-v26-latin-regular.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: italic; font-weight: 400; font-display: swap; src: url("/assets/fonts/newsreader-v26-latin-italic.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/newsreader-v26-latin-500.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/jetbrains-mono-v24-latin-500.woff2") format("woff2"); }

:root {
  --paper: #fbf5f4;
  --paper-2: #fffdfc;
  --ink: #21271f;
  --ink-soft: #5c6356;
  --ink-faint: #8d9183;
  --line: #ecdfe1;
  --accent: #d35d7e;
  --accent-ink: #b8446a;
  --leaf: #4f8a5b;
  --sky: #3f6fa6;
  --sun: #d9a534;
  --glow: rgba(211, 93, 126, 0.10);
  --glow-2: rgba(79, 138, 91, 0.09);
  --term-bg: #1f2620;
  --term-fg: #e7eadf;
  --term-line: #36402f94;

  --display: "Fraunces", Georgia, serif;
  --body: "Newsreader", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wide: 940px;
  --measure: 660px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14171a;
    --paper-2: #1b2023;
    --ink: #ece5e6;
    --ink-soft: #a6a59b;
    --ink-faint: #76776d;
    --line: #2a2c2c;
    --accent: #f08aa6;
    --accent-ink: #f5a3b9;
    --leaf: #74b083;
    --sky: #7fa6d6;
    --sun: #e6c25f;
    --glow: rgba(240, 138, 166, 0.12);
    --glow-2: rgba(116, 176, 131, 0.10);
    --term-bg: #0f1311;
    --term-fg: #e2e6da;
    --term-line: #25291f;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--ink);
  background:
    radial-gradient(80% 55% at 88% -6%, var(--glow), transparent 60%),
    radial-gradient(75% 60% at 8% 4%, var(--glow-2), transparent 62%),
    var(--paper);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); }

main { max-width: var(--wide); margin: 0 auto; padding: 0 1.5rem; }

/* ---- header / footer ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 18px;
  height: 18px;
  background: url("/assets/favicon-32.png") center / contain no-repeat;
}
.site-header nav { display: flex; gap: 1.4rem; }
.site-header nav a {
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.site-header nav a:hover { color: var(--accent); }

.site-footer {
  max-width: var(--wide);
  margin: 6rem auto 3rem;
  padding: 0 1.5rem;
}
.footer-cta {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper-2);
  padding: 2.25rem;
  text-align: center;
  box-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.4);
}
.footer-line {
  font-family: var(--display);
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 0.6rem auto 1.4rem;
  max-width: 26ch;
}
.footer-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

/* ---- shared bits ---- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.2rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
  70%, 100% { box-shadow: 0 0 0 8px transparent; }
}

.button {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  padding: 0.7rem 1.3rem;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  transition: transform 0.15s ease, background 0.15s ease;
}
.button:hover { transform: translateY(-2px); background: var(--accent); border-color: var(--accent); color: #fff; }
.button.ghost { background: transparent; color: var(--ink); }
.button.ghost:hover { color: #fff; }

/* ---- hero ---- */
.hero { padding: 5rem 0 3.5rem; max-width: 22ch + 600px; }
.hero h1 {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 900;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0 0 1.4rem;
  max-width: 16ch;
}
.hero h1 em { font-style: italic; font-weight: 400; color: var(--accent); }
.lede {
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 44ch;
  margin: 0 0 2rem;
}
.actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }

/* ---- sections ---- */
.section { padding: 3rem 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.9rem;
  margin-bottom: 0.5rem;
}
.section-head .eyebrow { margin: 0; }
.more { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em; }

h2.eyebrow { font-size: 0.8rem; }

/* ---- post list (editorial rows) ---- */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-row { border-bottom: 1px solid var(--line); }
.post-row > a {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
  padding: 1.6rem 0;
  color: var(--ink);
}
.row-meta { display: flex; align-items: center; gap: 0.8rem; }
.row-meta time { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-faint); }
.row-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.55rem;
  line-height: 1.2;
  transition: color 0.15s ease;
}
.post-row > a:hover .row-title { color: var(--accent); }
.row-summary { color: var(--ink-soft); font-size: 1.02rem; max-width: 60ch; }

.pillar {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--ph, var(--accent)) 14%, transparent);
  color: var(--ph, var(--accent));
}
.pillar-leadership { --ph: var(--accent); }
.pillar-beam { --ph: var(--sun); }
.pillar-agentic { --ph: var(--leaf); }
.pillar-building { --ph: var(--sky); }

/* ---- blog filter ---- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.4rem; }
.chip {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.chip:hover { color: var(--ink); border-color: var(--ph, var(--accent)); }
.chip.is-active {
  color: var(--ph, var(--accent));
  border-color: var(--ph, var(--accent));
  background: color-mix(in srgb, var(--ph, var(--accent)) 12%, transparent);
}
.filter-empty { color: var(--ink-faint); font-family: var(--mono); font-size: 0.85rem; padding: 1.6rem 0; }

/* ---- newsletter ---- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.newsletter {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2.5rem;
}
.newsletter h2 { font-family: var(--display); font-weight: 700; font-size: 1.6rem; margin: 0.6rem 0 0.6rem; }
.newsletter-lede { color: var(--ink-soft); max-width: 52ch; margin: 0 0 1.6rem; }
.newsletter-form { display: flex; flex-wrap: wrap; gap: 0.6rem; max-width: 30rem; }
.nl-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.newsletter-form input {
  flex: 1 1 14rem;
  font-family: inherit;
  font-size: 0.98rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
}
.newsletter-form input:focus { outline: none; border-color: var(--accent); }
.newsletter-form button {
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.7rem 1.3rem;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.newsletter-form button:hover { transform: translateY(-2px); opacity: 0.92; }

/* ---- consulting band ---- */
.band {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2.5rem;
}
.band-lede { font-size: 1.25rem; color: var(--ink-soft); max-width: 48ch; margin: 0 0 2rem; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-bottom: 2rem; }
.card {
  position: relative;
  padding: 1.5rem 1.25rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}
.card-no { font-family: var(--mono); font-size: 0.74rem; color: var(--accent); }
.card h3 { font-family: var(--display); font-weight: 600; font-size: 1.2rem; margin: 0.5rem 0 0.5rem; }
.card p { margin: 0; font-size: 0.98rem; color: var(--ink-soft); }
@media (max-width: 720px) { .cards { grid-template-columns: 1fr; } }

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.2rem; }

/* ---- page head (blog index) ---- */
.page-head { padding: 4rem 0 2rem; border-bottom: 1px solid var(--line); }
.page-head h1 { font-family: var(--display); font-weight: 900; font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: -0.02em; margin: 0 0 0.8rem; }

/* ---- article ---- */
.post { max-width: var(--measure); margin: 0 auto; }
.post-head { padding: 4rem 0 2rem; }
.post-head .eyebrow { gap: 0.7rem; }
.post-head h1 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}
.post-head time { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-faint); }
.post-lede { font-size: 1.3rem; line-height: 1.5; color: var(--ink-soft); font-style: italic; margin: 0; }

.post-body { font-size: 1.18rem; line-height: 1.75; }
.post-body > p:first-of-type::first-letter {
  font-family: var(--display);
  font-weight: 900;
  font-size: 3.6em;
  line-height: 0.72;
  float: left;
  margin: 0.06em 0.1em 0 0;
  color: var(--accent);
}
.post-body h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.7rem;
  line-height: 1.2;
  margin: 2.6rem 0 0.9rem;
}
.post-body h3 { font-family: var(--display); font-weight: 600; font-size: 1.3rem; margin: 2rem 0 0.6rem; }
.post-body p, .post-body ul, .post-body ol { margin: 0 0 1.3rem; }
.post-body ul, .post-body ol { padding-left: 1.3rem; }
.post-body li { margin: 0.4rem 0; }
.post-body a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.post-body img { max-width: 100%; border-radius: 10px; }
.post-body strong { font-weight: 600; }
.post-body blockquote {
  margin: 1.6rem 0;
  padding: 0.4rem 0 0.4rem 1.4rem;
  border-left: 3px solid var(--accent);
  font-style: italic;
  color: var(--ink-soft);
}

/* ---- code (terminal in both themes) ---- */
code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent-ink);
  padding: 0.12em 0.4em;
  border-radius: 5px;
}
pre {
  position: relative;
  background: var(--term-bg);
  color: var(--term-fg);
  border: 1px solid var(--term-line);
  border-radius: 14px;
  padding: 2.4rem 1.3rem 1.2rem;
  margin: 1.6rem 0;
  overflow-x: auto;
  box-shadow: 0 24px 50px -34px rgba(0, 0, 0, 0.6);
}
pre::before {
  content: "";
  position: absolute;
  top: 0.95rem;
  left: 1.3rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 18px 0 0 var(--sun), 36px 0 0 var(--leaf);
  opacity: 0.9;
}
pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: 0.84rem;
  line-height: 1.65;
}

.back { margin-top: 2.5rem; font-family: var(--mono); font-size: 0.82rem; }

/* ---- load reveal ---- */
.reveal { opacity: 0; transform: translateY(14px); animation: rise 0.75s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
.d1 { animation-delay: 0.08s; }
.d2 { animation-delay: 0.16s; }
.d3 { animation-delay: 0.24s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
  .dot { animation: none; }
}

@media (max-width: 600px) {
  .site-header { padding: 0.85rem 1.1rem; }
  .site-header nav { gap: 1rem; }
  .hero { padding: 3rem 0 2.5rem; }
  .footer-cta { padding: 1.75rem 1.25rem; }
  .band { padding: 1.5rem; }
}
