:root {
  --bg: #f5f4e8;
  --surface: #ffffff;
  --surface-soft: #f0efe5;
  --text: #171717;
  --text-soft: #454545;
  --text-muted: #727272;
  --line: rgba(0, 0, 0, 0.12);
  --accent: #2d31ff;
  --accent-dark: #2004bf;
  --radius: 14px;
  --btn-primary: #e62346;
  --btn-secondary: #3826e5;
  --btn-stroke: #000000;
  --btn-inner-highlight-primary: rgba(255, 255, 255, 0.3);
  --btn-inner-highlight-secondary: rgba(255, 255, 255, 0.15);
  --btn-inner-shade: rgba(0, 0, 0, 0.3);
  --btn-drop-shadow: rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html, body { overflow-x: clip; }
body {
  min-height: 100vh;
  color: var(--text);
  font-family: "Avenir Next", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
}
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: env(safe-area-inset-top);
  background: var(--accent);
  z-index: 999;
  pointer-events: none;
}

a { color: inherit; }
.site-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 0 16px 64px;
  min-width: 0;
}

.promo-strip {
  margin: 0 calc(50% - 50vw) 0;
  height: 62px;
  position: relative;
  overflow: visible;
  border-radius: 1px;
  background: var(--accent);
}
.promo-strip a {
  height: 62px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  text-align: center;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: -0.01em;
  background: transparent;
}

.site-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  border-bottom: 0;
  margin: 0 calc(50% - 50vw) 24px;
  padding: 12px calc(50vw - 50% + 16px) 12px;
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
  overflow: visible;
}
.site-header::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 7px;
  z-index: 2;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='7' viewBox='0 0 32 7'%3E%3Cpath d='M0 7 L8 1 L16 7 L24 1 L32 7 L32 -1 L0 -1 Z' fill='%232d31ff' shape-rendering='crispEdges'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 32px 7px;
  background-position: left top;
  box-shadow: 0 -1px 0 var(--accent);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
}
.site-header::after { content: none; }
.site-header > * {
  position: relative;
  z-index: 3;
}
.brand {
  margin-right: auto;
  text-decoration: none;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
}
.site-nav {
  order: 3;
  width: 100%;
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.site-nav a {
  text-decoration: none;
  white-space: nowrap;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
}
.site-nav a:hover { color: rgba(255, 255, 255, 0.82); }
.header-cta {
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.3px;
  line-height: 1;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--btn-stroke);
  box-shadow: 0 0 0 1px var(--btn-drop-shadow);
  background: var(--btn-primary);
  position: relative;
  isolation: isolate;
}
.header-cta::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 11px;
  pointer-events: none;
  box-shadow:
    inset 2px 2px 1px var(--btn-inner-highlight-primary),
    inset -2px -2px 1px var(--btn-inner-shade);
}
.header-cta:active {
  transform: scale(0.95);
  box-shadow: none;
}

.header-divider { display: none; }

main { display: grid; gap: 22px; }
.hero,
.cta-panel,
.article-content,
.article-sidebar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}
.hero {
  padding: 26px 18px 22px;
  text-align: center;
}
.hero-guides {
  text-align: left;
}
.hero-guides h1 {
  max-width: 19ch;
  line-height: 1.08;
}
.hero-guides p {
  margin-left: 0;
  max-width: 46ch;
}
.eyebrow {
  margin: 0 0 9px;
  color: #8a8a8a;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.04;
  font-weight: 700;
  font-size: clamp(2rem, 8vw, 3.6rem);
}
h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.1;
  font-weight: 700;
  font-size: clamp(1.35rem, 5vw, 2.25rem);
}
h3 { margin: 0; font-size: 1.08rem; font-weight: 700; letter-spacing: 0; }
.hero p {
  margin: 12px auto 0;
  color: var(--text-soft);
  line-height: 1.46;
  max-width: 54ch;
}
.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 18px;
}

.button {
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 18px;
  line-height: 1;
  letter-spacing: -0.3px;
  border-radius: 12px;
  padding: 0 24px;
  border: 1px solid var(--btn-stroke);
  box-shadow: 0 0 0 1px var(--btn-drop-shadow);
  transition: transform 120ms ease, box-shadow 120ms ease;
  position: relative;
  isolation: isolate;
}
.button::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 11px;
  pointer-events: none;
  box-shadow:
    inset 2px 2px 1px var(--btn-inner-highlight-secondary),
    inset -2px -2px 1px var(--btn-inner-shade);
}
.button:hover { transform: translateY(-1px) scale(1.01); }
.button:active {
  transform: scale(0.95);
  box-shadow: none;
}
.button-primary {
  background: var(--btn-primary);
  color: #fff;
}
.button-primary::before {
  box-shadow:
    inset 2px 2px 1px var(--btn-inner-highlight-primary),
    inset -2px -2px 1px var(--btn-inner-shade);
}
.button-ghost,
.button-secondary {
  background: var(--btn-secondary);
  color: #fff;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.section-head a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.guides-grid,
.related-grid {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.guide-card {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  min-width: 0;
}
.guide-card > :not(.guide-thumb) {
  margin-left: 4px;
}
.guide-thumb {
  display: block;
  aspect-ratio: 3.44;
  border-radius: 12px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  background: var(--thumb-color, #2d31ff);
}
.guide-thumb-label {
  position: absolute;
  left: 10px;
  top: 10px;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0;
}
.tag-pill {
  display: inline-flex;
  margin-bottom: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8b8b8b;
}
.guide-card h2 {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 5.3vw, 2.45rem);
  line-height: 1.05;
}
.guide-card h2 a { text-decoration: none; }
.guide-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.45;
}
.meta-row {
  margin: 0 0 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8b8b8b;
  font-weight: 600;
}
.read-more {
  display: inline-flex;
  margin-top: 18px;
  color: var(--accent);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  font-size: 0.82rem;
}

.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.filters::-webkit-scrollbar { display: none; }
.filter {
  text-decoration: none;
  white-space: nowrap;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  font-weight: 700;
  font-size: 0.82rem;
}
.filter.active {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.pagination a,
.pagination span {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--text-soft);
  background: #fff;
}
.pagination span[aria-current="page"] {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.cta-panel {
  padding: 20px 16px;
  background: linear-gradient(110deg, #fff 0%, #f5f7ff 100%);
}
.cta-panel p {
  margin-top: 10px;
  color: var(--text-soft);
}
.cta-panel .button-primary { margin-top: 12px; }

.article-main { gap: 14px; }
.breadcrumbs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  color: #8d8d8d;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
}
.breadcrumbs a {
  text-decoration: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
.breadcrumbs span {
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
.breadcrumbs a,
.breadcrumbs .separator {
  flex: 0 0 auto;
}
.breadcrumb-current {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.article-layout { display: grid; gap: 14px; }
.article-content,
.article-sidebar { padding: 18px; }
.article-layout,
.article-main,
.article-content,
.article-sidebar,
.article-body { min-width: 0; }
.article-content * { max-width: 100%; }
.article-body { overflow-x: clip; }
.article-main,
.article-layout,
.article-content,
.article-sidebar,
.article-body,
.article-body * {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #888;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.article-meta > * {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  color: inherit;
  text-transform: inherit;
}
.article-meta .tag-pill {
  margin-bottom: 0;
}
.article-content h1 {
  margin-top: 8px;
  margin-bottom: 16px;
}
.article-body p {
  margin: 0 0 13px;
  line-height: 1.62;
  color: #2d2d2d;
}
.article-content h1,
.article-body h2,
.article-body h3,
.article-body p,
.breadcrumbs,
.breadcrumb-current,
.article-meta,
.article-sidebar li,
.article-sidebar a {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.article-body h2,
.article-body h3 { margin: 22px 0 11px; }
.article-body blockquote {
  margin: 15px 0;
  padding: 11px 13px;
  border-left: 3px solid var(--accent);
  background: #f3f5ff;
  border-radius: 8px;
}
.related-guides { margin-top: 26px; }
.related-guides h2 { margin-bottom: 8px; }
.article-sidebar ol {
  margin: 0;
  padding-left: 18px;
}
.article-sidebar li { margin-bottom: 8px; }
.article-sidebar a {
  text-decoration: none;
  color: var(--text-soft);
}
.article-sidebar .button { width: 100%; margin-top: 12px; }
.article-sidebar a.button,
.article-sidebar a.button-secondary,
.article-sidebar a.button-ghost {
  color: #ffffff;
}

.sticky-cta {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  padding: 10px;
  overflow: hidden;
  transform: translateY(calc(100% + env(safe-area-inset-bottom) + 28px));
  opacity: 0;
  pointer-events: none;
  transition: transform 170ms ease, opacity 120ms ease;
  will-change: transform;
}
.sticky-cta p {
  margin: 0;
  flex: 1;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
}
.sticky-cta a {
  text-decoration: none;
  background: var(--btn-primary);
  color: #fff;
  border-radius: 12px;
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--btn-stroke);
  box-shadow: 0 0 0 1px var(--btn-drop-shadow);
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  letter-spacing: -0.3px;
  position: relative;
  isolation: isolate;
}
.sticky-cta a::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 11px;
  pointer-events: none;
  box-shadow:
    inset 2px 2px 1px var(--btn-inner-highlight-primary),
    inset -2px -2px 1px var(--btn-inner-shade);
}
.sticky-cta a:active {
  transform: scale(0.95);
  box-shadow: none;
}
.sticky-cta.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.site-footer {
  margin-top: 30px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: #7a7a7a;
  font-size: 0.86rem;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-links a {
  text-decoration: none;
  color: #5e5e5e;
}

@media (min-width: 740px) {
  .site-shell { padding: 0 24px 72px; }
  .promo-strip {
    margin-top: 0;
    height: 72px;
  }
  .promo-strip a {
    font-size: 1rem;
    height: 72px;
  }
  .site-header {
    flex-wrap: nowrap;
    margin: 0 calc(50% - 50vw) 24px;
    padding: 14px calc(50vw - 50% + 24px) 12px;
  }
  .site-nav { order: 0; width: auto; }
  .breadcrumb-current {
    flex: 1 1 auto;
    white-space: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .guides-grid,
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
  }
  .guide-card h2 {
    font-size: clamp(1.6rem, 3.2vw, 2.5rem);
  }
  .article-layout { grid-template-columns: minmax(0, 1fr) 290px; }
  .article-sidebar {
    position: sticky;
    top: 92px;
    align-self: start;
  }
  .sticky-cta { left: auto; right: 20px; width: 360px; }
}

@media (min-width: 1080px) {
  .site-shell { width: min(100%, 1050px); }
  h1 { font-size: 2.52rem; }
  h2 { font-size: 1.58rem; }
  .guide-card h2 { font-size: 1.75rem; }
  .guides-grid,
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 44px;
  }
}
