@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  background: light-dark(#fffdf8, #171716);
  color: light-dark(#222222, #f3f3f1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: light-dark(#fffdf8, #171716);
  color: light-dark(#222222, #f3f3f1);
  font-size: 1rem;
  line-height: 1.6;
}

h1,
h2,
h3,
p { margin-top: 0; }

h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -.04em;
  font-weight: 500;
}

h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.2;
  font-weight: 500;
}

h3 {
  font-size: 1.1rem;
  line-height: 1.4;
  font-weight: 500;
}

a { color: inherit; }

.preview-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem max(1rem, calc((100vw - 1180px) / 2));
  background: #292929;
  color: #ffffff;
  border-bottom: 3px solid #ed1c24;
}

.preview-banner a { font-weight: 500; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem max(1rem, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid light-dark(#dedcd6, #3b3b38);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: inherit;
  text-decoration: none;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 500;
}

.site-brand img {
  display: block;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-nav a { text-decoration: none; }

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.social-icon svg {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
}

.article-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4rem) max(1rem, calc((100vw - 1180px) / 2));
  background:
    radial-gradient(circle at 8% 110%, rgba(245, 27, 37, .34), transparent 32%),
    radial-gradient(circle at 78% 0%, rgba(255, 177, 126, .30), transparent 30%),
    light-dark(#f1e9dd, #201b19);
  color: light-dark(#241f1b, #f8f3ed);
}

.article-theme-tips {
  background:
    radial-gradient(circle at 82% 15%, rgba(237, 28, 36, .16), transparent 28%),
    radial-gradient(circle at 92% 110%, rgba(238, 172, 73, .36), transparent 35%),
    light-dark(#f7ecd7, #241f18);
  color: light-dark(#292016, #fff7e9);
}

.article-theme-news {
  background:
    repeating-linear-gradient(90deg, transparent 0 4.9rem, light-dark(rgba(27, 74, 98, .08), rgba(126, 196, 229, .06)) 5rem),
    radial-gradient(circle at 82% 0%, rgba(61, 151, 194, .28), transparent 31%),
    radial-gradient(circle at 8% 110%, rgba(237, 28, 36, .18), transparent 32%),
    light-dark(#e8f0f3, #141d22);
  color: light-dark(#172830, #edf7fa);
}

.article-theme-field-note {
  background:
    radial-gradient(circle at 85% 0%, rgba(237, 28, 36, .18), transparent 28%),
    light-dark(#eeece7, #20201e);
}

.article-theme-mark {
  position: absolute;
  z-index: -1;
  top: 50%;
  right: max(1rem, calc((100vw - 1120px) / 2));
  display: grid;
  place-items: center;
  width: clamp(8rem, 17vw, 13rem);
  height: clamp(8rem, 17vw, 13rem);
  transform: translateY(-50%);
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: .25;
}

.article-theme-mark::before,
.article-theme-mark::after {
  position: absolute;
  content: "";
  border: 1px solid currentColor;
  border-radius: 50%;
  inset: 12%;
  opacity: .55;
}

.article-theme-mark::after { inset: 24%; }

.article-theme-mark svg {
  width: 46%;
  height: 46%;
}

.article-theme-tips .article-theme-mark { color: light-dark(#a86716, #f0ba69); }
.article-theme-news .article-theme-mark { color: light-dark(#246f93, #7ec4e5); }

.article-intro {
  position: relative;
  z-index: 1;
  width: min(58rem, 100%);
  margin: 0 auto;
}

.article-kicker,
.story-meta {
  color: light-dark(#c4141d, #ff5961);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 500;
}

.article-intro h1 {
  max-width: 18ch;
  margin-bottom: 1.25rem;
}

.article-deck {
  max-width: 58ch;
  color: light-dark(#5c5149, #d2c7bf);
}

.article-theme-tips .article-deck { color: light-dark(#66523a, #dfcfb9); }
.article-theme-news .article-deck { color: light-dark(#435f6b, #c2d5dc); }

.article-byline {
  margin-top: 1.5rem;
  color: light-dark(#776960, #b7aaa2);
}

.article-theme-tips .article-byline { color: light-dark(#806d54, #bda98d); }
.article-theme-news .article-byline { color: light-dark(#58717b, #9eb6bf); }

.article-body {
  width: min(43rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}

.article-body > p:first-child {
  color: light-dark(#29231f, #f0e9e2);
  font-weight: 500;
}

.article-body p,
.article-body li { color: light-dark(#3c3b37, #d0d0cc); }

.article-body h2 {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid light-dark(#aaa19a, #5a514c);
}

.article-body h3 { margin-top: 2rem; }

.article-body blockquote {
  margin: 2rem 0;
  padding: .25rem 0 .25rem 1.25rem;
  border-left: 4px solid light-dark(#f51b25, #ff3440);
}

.article-body blockquote p {
  margin-bottom: 0;
  color: light-dark(#222222, #f3f3f1);
  font-weight: 500;
}

.article-figure {
  width: min(32rem, calc(100vw - 2rem));
  margin: 2.5rem 50%;
  transform: translateX(-50%);
}

.article-figure-wide {
  width: min(56rem, calc(100vw - 2rem));
}

.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid light-dark(#cfcdc7, #464642);
  border-radius: 1rem;
  background: light-dark(#f1eee8, #242321);
}

.article-figure figcaption {
  margin-top: .75rem;
  color: light-dark(#6d6b66, #aeadab);
  font-size: .9rem;
  line-height: 1.45;
}

.article-takeaway {
  margin: 2.5rem 0;
  padding: 1.25rem 1.4rem;
  border: 1px solid light-dark(#e4c9a9, #594b38);
  border-left: .3rem solid light-dark(#ed1c24, #ff2933);
  border-radius: 1rem;
  background: light-dark(#fff5e8, #29231d);
  box-shadow: 0 .75rem 2rem light-dark(rgba(65, 42, 24, .08), rgba(0, 0, 0, .18));
}

.article-takeaway h3 {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
}

.article-takeaway p { margin: .6rem 0 0; }

.article-tip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  margin: 2.5rem 0;
  padding: 1.25rem;
  border: 1px solid light-dark(#e4c9a9, #594b38);
  border-radius: 1rem;
  background: light-dark(#fff5e8, #29231d);
  box-shadow: 0 .75rem 2rem light-dark(rgba(65, 42, 24, .08), rgba(0, 0, 0, .18));
}

.article-tip-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  background: light-dark(#ed1c24, #ff2933);
  color: #ffffff;
}

.article-tip-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.article-tip-label {
  margin: 0 0 .2rem;
  color: light-dark(#b0171d, #ff747a) !important;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.article-tip h3 {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
}

.article-tip-content > p:last-child {
  margin: .5rem 0 0;
}

.article-tip a {
  font-weight: 500;
  text-underline-offset: .2em;
}

.article-code {
  position: relative;
  margin: 2rem 0;
  overflow: hidden;
  border: 1px solid #454541;
  border-radius: 1rem;
  background: #121211;
  color: #e8e8e4;
  box-shadow: 0 1rem 2.5rem light-dark(rgba(30, 24, 20, .16), rgba(0, 0, 0, .32));
}
.code-copy {
  position: absolute;
  top: .75rem;
  right: .75rem;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  background: rgba(41, 41, 41, .88);
  color: #fff;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.code-copy:hover { border-color: rgba(255, 255, 255, .55); transform: translateY(-1px); }
.code-copy:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.code-copy.is-copied { background: var(--signal); border-color: var(--signal); }
.code-copy svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; }
.article-code pre {
  margin: 0;
  padding: 1.25rem 3.5rem 1.25rem 1.25rem;
  overflow-x: auto;
  tab-size: 2;
}

.article-code code {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 1rem;
  line-height: 1.6;
  font-variant-ligatures: none;
}

.article-body p code,
.article-body li code {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

.code-comment { color: #92928d; }
.code-string { color: #b9db86; }
.code-variable { color: #86d9ff; }
.code-number { color: #d5adff; }
.code-name { color: #e8e8e4; }
.code-keyword { color: #ff7c82; }

.article-signoff {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 3rem;
}

.article-signoff a {
  color: light-dark(#c4141d, #ff5961);
  font-weight: 500;
}

.article-index {
  width: min(1180px, calc(100% - 2rem));
  min-height: 60vh;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) 0;
}

.index-intro {
  max-width: 42rem;
  margin-bottom: 2rem;
}

.index-intro p:last-child { color: light-dark(#5f5d58, #bbb9b4); }

.story-section + .story-section {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
}

.story-section > h2 {
  margin-bottom: 1.25rem;
}

.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

.story {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 15rem;
  overflow: hidden;
  border: 1px solid light-dark(#d8d4cc, #44423e);
  border-radius: 1rem;
  color: inherit;
  text-decoration: none;
}

.story-series-header {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  height: auto;
  overflow: hidden;
}

.story-theme-journey .story-series-header {
  background:
    radial-gradient(circle at 14% 120%, rgba(245, 27, 37, .54), transparent 34%),
    radial-gradient(circle at 80% 0%, rgba(255, 177, 126, .42), transparent 31%),
    light-dark(#f1e9dd, #201b19);
}

.story-theme-journey .story-series-header::before,
.story-theme-journey .story-series-header::after {
  position: absolute;
  content: "";
  border-radius: 50%;
}

.story-theme-journey .story-series-header::before {
  right: 11%;
  bottom: -4.5rem;
  width: 10rem;
  height: 10rem;
  background: rgba(237, 28, 36, .82);
  box-shadow: 0 0 0 1.5rem rgba(237, 28, 36, .11);
}

.story-theme-journey .story-series-header::after {
  right: calc(11% + 2.3rem);
  bottom: -2.2rem;
  width: 5.4rem;
  height: 5.4rem;
  border: 1px solid rgba(255, 255, 255, .62);
}

.story-theme-tips .story-series-header {
  background:
    linear-gradient(110deg, transparent 0 52%, light-dark(rgba(171, 105, 18, .08), rgba(255, 209, 137, .05)) 52% 53%, transparent 53%),
    radial-gradient(circle at 80% 8%, rgba(237, 28, 36, .18), transparent 30%),
    radial-gradient(circle at 92% 110%, rgba(238, 172, 73, .36), transparent 35%),
    light-dark(#f7ecd7, #241f18);
  color: light-dark(#a86716, #f0ba69);
}

.story-theme-news .story-series-header {
  background:
    repeating-linear-gradient(90deg, transparent 0 3.9rem, light-dark(rgba(27, 74, 98, .08), rgba(126, 196, 229, .06)) 4rem),
    radial-gradient(circle at 80% 0%, rgba(61, 151, 194, .34), transparent 35%),
    radial-gradient(circle at 8% 110%, rgba(237, 28, 36, .18), transparent 32%),
    light-dark(#e8f0f3, #141d22);
  color: light-dark(#246f93, #7ec4e5);
}

.story-theme-field-note .story-series-header {
  background: light-dark(#e7e4de, #20201e);
}

.story-series-mark {
  position: absolute;
  top: 50%;
  right: 10%;
  display: grid;
  place-items: center;
  width: 6rem;
  height: 6rem;
  transform: translateY(-50%);
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: .62;
}

.story-series-mark::before {
  position: absolute;
  content: "";
  border: 1px solid currentColor;
  border-radius: 50%;
  inset: .7rem;
  opacity: .48;
}

.story-series-mark svg {
  width: 3rem;
  height: 3rem;
}

.story-copy {
  position: relative;
  z-index: 1;
  display: block;
  width: min(46rem, 72%);
  padding: clamp(1.5rem, 4vw, 2.75rem);
}

.story h3 {
  margin-top: .7rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.2;
}

.story p {
  margin-bottom: 0;
  color: light-dark(#5f5d58, #bbb9b4);
}

.story-theme-journey { color: light-dark(#241f1b, #f8f3ed); }
.story-theme-journey p { color: light-dark(#5c5149, #d2c7bf); }
.story-theme-tips { color: light-dark(#292016, #fff7e9); }
.story-theme-tips p { color: light-dark(#66523a, #dfcfb9); }
.story-theme-news { color: light-dark(#172830, #edf7fa); }
.story-theme-news p { color: light-dark(#435f6b, #c2d5dc); }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.2rem max(1rem, calc((100vw - 1180px) / 2));
  border-top: 1px solid light-dark(#dedcd6, #3b3b38);
  color: light-dark(#6d6b66, #aeadab);
}

.not-found {
  width: min(43rem, calc(100% - 2rem));
  min-height: 60vh;
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 7rem) 0;
}

.empty-state {
  padding: 2rem 0;
  border-top: 1px solid light-dark(#cfcdc7, #464642);
}

@media (hover: hover) {
  .story { transition: transform 160ms ease, border-color 160ms ease; }
  .story:hover {
    transform: translateY(-.2rem);
    border-color: light-dark(#aaa49a, #68645e);
  }
}

@media (max-width: 700px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .story-copy { width: 100%; }
  .story-series-mark {
    right: -2rem;
    opacity: .14;
  }
  .story-theme-journey .story-series-header::before { right: -2rem; opacity: .42; }
  .story-theme-journey .story-series-header::after { right: .3rem; opacity: .48; }
  .article-theme-mark {
    right: -2rem;
    opacity: .14;
  }
  .article-figure {
    width: 100%;
    margin-right: 0;
    margin-left: 0;
    transform: none;
  }
}
