/*
  refresh.css — visual refresh layered on top of the compiled theme (built/casper.css).

  Plain CSS, loaded directly from default.hbs AFTER casper.css. It is not part of the
  gulp pipeline on purpose: no build step is needed and nothing in built/ changes.
  Only colours, type and spacing are touched; markup and JS stay as they are.
  To revert the refresh, remove the single <link> in default.hbs.
*/

:root {
  --rf-bg: #08090a;
  --rf-bg-elev: #0f1011;
  --rf-surface: #101113;
  --rf-input: #141516;
  --rf-line: #1c1d1f;
  --rf-line-soft: #17181a;
  --rf-line-strong: #2a2b2e;
  --rf-text: #f7f8f8;
  --rf-text-2: #8a8f98;
  --rf-text-3: #62666d;
  --rf-prose: #d0d6e0;
  --rf-font: Inter, "Inter Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --rf-container: 1280px;
  --rf-prose-w: 640px;
}

/* ---------- base */
html.dark-mode body {
  background: var(--rf-bg);
  color: var(--rf-text);
  font-family: var(--rf-font);
  font-size: 16px;
  line-height: 1.6;
  font-optical-sizing: auto;
  font-feature-settings: "cv01", "ss03";
}
html.dark-mode img { opacity: 1; }
.inner { max-width: var(--rf-container); }
::selection { background: rgba(255, 255, 255, 0.18); }

/* ---------- header */
html.dark-mode .gh-head {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(8, 9, 10, 0.86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rf-line);
  color: var(--rf-text-2);
  padding: 0 max(4vmin, 20px);
}
.gh-navbar { height: 64px; }
.gh-navbar__logo img { display: block; height: 18px; width: auto; }
.gh-navbar .nav a {
  color: var(--rf-text-2);
  opacity: 1;
  font-size: 15px;
  font-weight: 500;
  padding: 6px 12px;
}
.gh-navbar .nav a:hover,
.gh-navbar .nav a.nav__link--active { color: var(--rf-text); }
.gh-search-icon:hover { color: var(--rf-text); }

/* mobile menu (toggled with d-none by the theme JS, unchanged) */
.navbar__mobile__toggle {
  border-radius: 0;
  color: var(--rf-text-2);
  font-size: 15px;
  padding: 6px 8px;
}
.navbar__mobile__toggle:hover,
.navbar__mobile__toggle:focus,
.navbar__mobile__toggle:active { background: rgba(255, 255, 255, 0.04); color: var(--rf-text); }
.navbar__mobile__menu {
  width: 100%;
  max-width: 320px;
  gap: 16px;
  padding: 16px 16px 32px;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--rf-bg-elev);
  border-left: 1px solid var(--rf-line);
}
.navbar__mobile__menu .nav { padding: 0 4px; }
.navbar__mobile__menu .nav li a {
  display: block;
  padding: 10px 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--rf-text);
}
.navbar__mobile__menu .nav--lang {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 16px 4px 0;
  border-top: 1px solid var(--rf-line);
}
.navbar__mobile__menu .nav--lang li a {
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 400;
  color: var(--rf-text-2);
}
.navbar__mobile__menu .nav--lang li a:hover { color: var(--rf-text); }

/* ---------- post feed */
.post-feed {
  gap: 64px 64px;
  padding: 56px 0 0;
}
.post-card-image-link {
  margin-bottom: 20px;
  border-radius: 6px;
  border: 1px solid var(--rf-line-soft);
  background: var(--rf-surface);
}
html.dark-mode .post-card-image { background: var(--rf-surface); }
html.dark-mode body .post-card-tags {
  gap: 0;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.3;
  color: var(--rf-text-3);
}
.post-card-tags > * + *::before { content: "\00b7"; margin: 0 7px; color: var(--rf-text-3); }
html.dark-mode body .post-card-primary-tag { color: var(--rf-text-2); }
html.dark-mode body .post-card-featured {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-left: 0;
  color: var(--rf-text-2);
}
.post-card-featured svg { position: static; width: 13px; height: 13px; color: var(--rf-text-3); }
html.dark-mode body .post-card-title {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.014em;
  line-height: 1.3;
  color: var(--rf-text);
}
.post-card-content-link:hover .post-card-title { opacity: 1; }
html.dark-mode body .post-card-excerpt {
  margin-top: 8px;
  font-family: var(--rf-font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--rf-text-2);
}
.post-card:not(.post-card-large):not(.post-card-full):not(.dynamic):not(.no-image) .post-card-excerpt { -webkit-line-clamp: 3; }
html.dark-mode body .post-card-meta {
  margin-top: 16px;
  font-size: 14px;
  color: var(--rf-text-3);
}
.post-card-meta > * + :not(script):before { background-color: var(--rf-text-3); }

/* large (first) card: image left, text right */
@media (min-width: 1001px) {
  .post-card-large {
    grid-template-columns: 3fr 2fr;
    grid-gap: 48px;
    align-items: center;
  }
  .post-card-large .post-card-image-link { grid-column: auto; border-radius: 8px; }
  .post-card-large .post-card-content { grid-column: auto; justify-content: center; }
  .post-card-large .post-card-tags { margin-bottom: 12px; }
  html.dark-mode body .post-card-large .post-card-title {
    font-size: clamp(30px, 3.2vw, 44px);
    letter-spacing: -0.022em;
    line-height: 1.12;
  }
  html.dark-mode body .post-card-large .post-card-excerpt { margin-top: 14px; font-size: 18px; line-height: 1.55; }
  html.dark-mode body .post-card-large .post-card-meta { margin-top: 20px; font-size: 15px; }
  html.dark-mode body .post-card.dynamic .post-card-title { font-size: 26px; letter-spacing: -0.018em; line-height: 1.2; }
  html.dark-mode body .post-card.dynamic .post-card-excerpt { font-size: 17px; }
}
/* two columns on tablets, one on phones */
@media (max-width: 991px) {
  .post-feed { grid-template-columns: 1fr 1fr; gap: 48px 32px; padding-top: 40px; }
  .post-card, .post-card.dynamic { grid-column: span 1; }
  .post-card-large, .newsletter-post-card { grid-column: span 2; }
}
@media (max-width: 640px) {
  .post-feed { grid-template-columns: 1fr; gap: 44px; }
  .post-card-large, .newsletter-post-card { grid-column: span 1; }
}

/* newsletter card inside the feed */
.newsletter-post-card {
  background: none;
  padding: 0;
  align-items: stretch;
  text-align: left;
  color: var(--rf-text-2);
}
.newsletter-post-card__main,
#newsletter-post-card-success {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  width: 100%;
  padding: 28px 24px;
  border: 1px solid var(--rf-line);
  background: var(--rf-surface);
}
.newsletter-post-card h2 { font-size: 22px; font-weight: 500; letter-spacing: -0.014em; line-height: 1.3; color: var(--rf-text); }
.newsletter-post-card h2 span { color: var(--rf-text); }
.newsletter-post-card p { font-size: 16px; line-height: 1.55; color: var(--rf-text-2); }
.newsletter-post-card__form { align-items: stretch; gap: 8px; margin-top: 4px; }
.newsletter-post-card__form__input,
.newsletter-post-card__form__submit { width: 100%; border-radius: 0; height: 40px; font-size: 15px; }
.newsletter-post-card__form__submit { margin: 0; }

/* inputs and buttons: square, quiet */
.newsletter-post-card__form__input,
.newsletter-banner__form__input {
  border: 1px solid var(--rf-line-strong);
  border-radius: 0;
  background: var(--rf-input);
  color: var(--rf-text);
  font-size: 15px;
}
.newsletter-post-card__form__input::placeholder,
.newsletter-banner__form__input::placeholder { color: var(--rf-text-3); }
.newsletter-post-card__form__input:focus,
.newsletter-banner__form__input:focus { outline: none; border-color: #3f4146; }
.newsletter__submit {
  border: 0;
  border-radius: 0;
  background-color: #e6e6e6;
  color: #08090a;
  font-size: 15px;
  font-weight: 500;
}
.newsletter__submit:hover,
.newsletter__submit:focus,
.newsletter__submit:active { background-color: #fff; }
.newsletter__disclaimer,
.newsletter__disclaimer a { font-size: 13px; line-height: 1.5; color: var(--rf-text-3); }
.newsletter__disclaimer a { text-decoration-color: var(--rf-line-strong); text-underline-offset: 2px; }
.newsletter__disclaimer a:hover { color: var(--rf-text-2); }

/* floating newsletter banner (desktop only, as before) */
.newsletter-banner {
  background-color: rgba(8, 9, 10, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--rf-line);
  min-height: 72px;
  padding: 14px max(4vmin, 20px);
}
.newsletter-banner__container { max-width: var(--rf-container); }
.newsletter-banner__title,
.newsletter-banner__body p { font-size: 15px; line-height: 1.45; color: var(--rf-text); }
.newsletter-banner__body .newsletter__disclaimer { font-size: 13px; color: var(--rf-text-3); }
.newsletter-banner__form form { gap: 8px; }
.newsletter-banner__form__input { min-width: 260px; height: 38px; }
.newsletter-banner__form__submit { height: 38px; padding: 0 18px; }
.newsletter-banner__dismiss button { color: var(--rf-text-3); cursor: pointer; }
.newsletter-banner__dismiss button:hover { color: var(--rf-text); }

/* ---------- article */
.post-template .article,
.page-template .article { padding-top: 72px; }
.gh-canvas {
  grid-template-columns:
    [full-start] minmax(max(4vmin, 20px), auto)
    [wide-start] minmax(auto, 200px)
    [main-start] min(var(--rf-prose-w), calc(100% - max(8vmin, 40px)))
    [main-end] minmax(auto, 200px)
    [wide-end] minmax(max(4vmin, 20px), auto)
    [full-end];
}
.article-header { padding-bottom: 56px; }
.article-tag { display: flex; align-items: center; margin-bottom: 18px; font-size: 15px; }
.article-tag > * + *::before { content: "/"; margin: 0 8px; color: var(--rf-text-3); }
html.dark-mode body .article-tag .post-card-featured { color: var(--rf-text-2); }
html.dark-mode body .article-tag a { color: var(--rf-text-2); }
html.dark-mode body .article-tag a:hover { color: var(--rf-text); }
html.dark-mode .article-title {
  grid-column: main-start / wide-end;
  max-width: 880px;
  font-size: clamp(40px, 5vw, 62px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.06;
  color: var(--rf-text);
}
html.dark-mode .article-excerpt {
  margin-top: 22px;
  font-size: 20px;
  line-height: 1.5;
  color: var(--rf-text-2);
}
/* byline moves below the cover image (grid order only, markup unchanged) */
.article-byline { order: 1; margin: 36px 0 0; }
.article-byline-content { flex-wrap: wrap; gap: 12px; }
.article-byline-content .author-list { padding: 0 0 0 4px; }
html.dark-mode .author-avatar {
  width: 28px;
  height: 28px;
  margin: 0 -4px;
  border-color: var(--rf-bg);
  background-color: var(--rf-surface);
}
.article-byline-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  font-size: 16px;
  line-height: 1.4;
  color: var(--rf-text-2);
}
.article-byline-meta .author-name { margin: 0; font-size: 16px; font-weight: 500; letter-spacing: 0; }
html.dark-mode body .byline-meta-content { display: flex; align-items: center; gap: 6px; color: var(--rf-text-2); }
.byline-meta-content::before { content: "\00b7"; margin: 0 6px 0 8px; color: var(--rf-text-3); }
.byline-meta-content .bull { color: var(--rf-text-3); font-size: 0; }
.byline-meta-content .bull::before { content: "\00b7"; font-size: 16px; }
.gh-canvas .article-image { max-width: none; margin: 44px auto 0; }
.gh-canvas .article-image img { border: 1px solid var(--rf-line); border-radius: 10px; }

.gh-content > * + * { margin-top: 22px; }
html.dark-mode .gh-content > [id] { color: var(--rf-text); scroll-margin-top: 88px; }
.gh-content > h2 { font-size: 27px; font-weight: 600; letter-spacing: -0.022em; line-height: 1.25; }
.gh-content > h2:not(:first-child) { margin: 56px 0 0; }
.gh-content > h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.012em; line-height: 1.35; }
.gh-content > h3:not(:first-child) { margin: 32px 0 0; }
.gh-content > p,
.gh-content > ul,
.gh-content > ol,
.gh-content > dl,
.gh-content > blockquote:not([class]) {
  font-family: var(--rf-font);
  font-size: 18px;
  line-height: 1.65;
  letter-spacing: -0.003em;
  color: var(--rf-prose);
}
.gh-content > ul, .gh-content > ol { padding-left: 1.35em; }
.gh-content li + li { margin-top: 6px; }
.gh-content li::marker { color: var(--rf-text-3); }
.gh-content a {
  color: var(--rf-text);
  text-decoration-color: var(--rf-text-3);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.gh-content a:hover { text-decoration-color: var(--rf-text); }
html.dark-mode .gh-content em { color: var(--rf-prose); }
html.dark-mode .gh-content strong { color: var(--rf-text); font-weight: 600; }
.gh-content .kg-card + :not(.kg-card) { margin-top: 40px; }
.gh-content .kg-card + [id] { margin-top: 56px; }
.kg-image-card img { border: 1px solid var(--rf-line); border-radius: 10px; background: var(--rf-surface); }
html.dark-mode figcaption { padding: 12px 0 0; font-family: var(--rf-font); font-size: 14px; line-height: 1.4; color: var(--rf-text-3); }
html.dark-mode .gh-content figcaption a {
  color: var(--rf-text-2);
  text-decoration: none;
  border-bottom: 1px solid var(--rf-line-strong);
}
html.dark-mode .gh-content figcaption a::after { content: "\2197"; margin-left: 5px; font-size: 13px; }
html.dark-mode .gh-content figcaption a:hover { color: var(--rf-text); border-color: var(--rf-text-2); }
@media (max-width: 650px) {
  .post-template .article, .page-template .article { padding-top: 40px; }
  .gh-content > p, .gh-content > ul, .gh-content > ol, .gh-content > dl { font-size: 17px; }
  .gh-content > h2 { font-size: 24px; }
  html.dark-mode .article-excerpt { font-size: 18px; }
}

/* recommended posts */
.read-more-wrap,
.read-more-wrap.paywall { margin-top: 96px; padding-top: 40px; border-top: 1px solid var(--rf-line); }
.read-more-wrap > h2 { max-width: var(--rf-container); margin-bottom: 28px; font-size: 22px; font-weight: 500; letter-spacing: -0.012em; color: var(--rf-text); }
.read-more { grid-gap: 48px 64px; }

/* ---------- footer */
.site-footer {
  margin-top: 96px;
  padding-top: 28px;
  border-top: 1px solid var(--rf-line);
  background: var(--rf-bg);
}
.site-footer .inner { font-size: 14px; color: var(--rf-text-3); }
.site-footer a { color: var(--rf-text-3); }
.site-footer a:hover { color: var(--rf-text); }
.site-footer .copyright a { color: var(--rf-text-2); }
.site-footer-nav li:not(:first-child) a:before { background: var(--rf-text-3); }
