:root {
  --ag-gold: #f2be3e;
  --ag-gold-soft: #c99a21;
  --ag-bg: #121212;
  --ag-panel: #1b1b1b;
  --ag-panel-2: #202020;
  --ag-line: #414141;
  --ag-text: #f7f7f7;
  --ag-muted: #b9b9b9;
}

/*
 * The original home intro is injected immediately after Astra's masthead,
 * outside the posts-index template. It duplicates the Hub hero and H1.
 * The server-owned body class scopes this to private preview or approved Live.
 */
body.ag-home-hub-active #page > #masthead + div,
body.ag-home-hub-active #page > div[style*="max-width:1200px"][style*="padding:1.1rem 1.2rem .2rem"] {
  display: none !important;
}

body.ag-home-hub-active {
  background: var(--ag-bg);
}

body.ag-home-hub-active .site-content > .ast-container,
body.ag-home-hub-active .ag-home-primary {
  display: block;
  max-width: none;
  padding: 0;
}

body.ag-home-hub-active .site-content > .ast-container > #primary.ag-home-primary {
  width: 100% !important;
}

body.ag-home-hub-active .site-footer {
  display: none !important;
}

/*
 * Optional site-wide shell. Astra still owns the content markup; these rules
 * align its outer canvas, cards, header and footer with the Home Hub palette.
 */
body.ag-site-shell-active {
  background: var(--ag-bg) !important;
  color: var(--ag-text);
  color-scheme: dark;
  font-family: Inter, Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.ag-site-shell-active #page,
body.ag-site-shell-active .site-content,
body.ag-site-shell-active .site-content > .ast-container,
body.ag-site-shell-active #primary,
body.ag-site-shell-active #secondary,
body.ag-site-shell-active .site-main {
  background: var(--ag-bg) !important;
}

body.ag-site-shell-active .site-header,
body.ag-site-shell-active .ast-primary-header-bar,
body.ag-site-shell-active .ast-mobile-header-wrap .ast-primary-header-bar,
body.ag-site-shell-active .main-header-bar {
  border-color: #3a321f !important;
  background: var(--ag-panel-2) !important;
}

body.ag-site-shell-active .site-header a,
body.ag-site-shell-active .main-header-menu > .menu-item > .menu-link,
body.ag-site-shell-active .ast-header-break-point .main-navigation ul .menu-item .menu-link {
  color: var(--ag-gold) !important;
}

body.ag-site-shell-active .site-main > article,
body.ag-site-shell-active .ast-article-single,
body.ag-site-shell-active .ast-article-post,
body.ag-site-shell-active .widget,
body.ag-site-shell-active .ast-author-box,
body.ag-site-shell-active .comments-area {
  border-color: var(--ag-line) !important;
  background: var(--ag-panel) !important;
  color: var(--ag-text);
}

body.ag-site-shell-active .entry-title,
body.ag-site-shell-active .entry-title a,
body.ag-site-shell-active .page-title,
body.ag-site-shell-active .widget-title,
body.ag-site-shell-active .entry-content h1,
body.ag-site-shell-active .entry-content h2,
body.ag-site-shell-active .entry-content h3,
body.ag-site-shell-active .entry-content h4 {
  color: var(--ag-text) !important;
}

body.ag-site-shell-active .entry-meta,
body.ag-site-shell-active .entry-meta a,
body.ag-site-shell-active .entry-content,
body.ag-site-shell-active .entry-content p,
body.ag-site-shell-active .entry-content li,
body.ag-site-shell-active .widget,
body.ag-site-shell-active .widget p,
body.ag-site-shell-active .widget li {
  color: #d0d0d0;
}

body.ag-site-shell-active .entry-content a,
body.ag-site-shell-active .widget a,
body.ag-site-shell-active .navigation a {
  color: var(--ag-gold);
}

body.ag-site-shell-active .site-footer {
  display: none !important;
}

.ag-global-footer {
  box-sizing: border-box;
  width: 100%;
  margin-top: 48px;
  color: var(--ag-text);
  font-family: Inter, Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ag-global-footer *,
.ag-global-footer *::before,
.ag-global-footer *::after {
  box-sizing: border-box;
}

.ag-global-footer a {
  text-decoration: none;
}

.ag-home-hub,
.ag-home-hub * {
  box-sizing: border-box;
}

.ag-home-hub {
  overflow: clip;
  background: var(--ag-bg);
  color: var(--ag-text);
  font-family: Inter, Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ag-home-hub a {
  color: inherit;
  text-decoration: none;
}

.ag-home-hub a:focus-visible,
.ag-home-hub summary:focus-visible {
  outline: 2px solid var(--ag-gold);
  outline-offset: 3px;
}

.ag-home-wrap {
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
}

.ag-home-hero {
  padding: 42px 0 28px;
  background: var(--ag-bg);
}

.ag-home-kicker,
.ag-home-tag,
.ag-home-mini time,
.ag-home-modified,
.ag-home-feature-copy time {
  color: var(--ag-gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.ag-home-hero h1 {
  max-width: 820px;
  margin: 9px 0 13px;
  color: var(--ag-text);
  font-size: clamp(34px, 4.1vw, 58px);
  line-height: 1.08;
  letter-spacing: -.045em;
}

.ag-home-intro {
  max-width: 760px;
  margin: 0;
  color: var(--ag-muted);
  font-size: 17px;
  line-height: 1.65;
}

.ag-home-quick {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.ag-home-quick a {
  min-height: 82px;
  padding: 17px 18px;
  border: 1px solid var(--ag-gold-soft);
  border-radius: 11px;
  background: #171717;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.ag-home-quick a:hover {
  transform: translateY(-2px);
  border-color: var(--ag-gold);
  background: #202020;
}

.ag-home-quick strong,
.ag-home-quick span {
  display: block;
}

.ag-home-quick strong {
  color: var(--ag-gold);
  font-size: 16px;
}

.ag-home-quick span {
  margin-top: 5px;
  color: var(--ag-muted);
  font-size: 13px;
}

.ag-home-section {
  padding: 54px 0;
}

.ag-home-section + .ag-home-section {
  border-top: 1px solid #242424;
}

.ag-home-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.ag-home-section-head h2 {
  margin: 0;
  color: var(--ag-text);
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -.03em;
}

.ag-home-section-head p {
  max-width: 460px;
  margin: 0;
  color: var(--ag-muted);
  font-size: 13px;
  text-align: right;
}

.ag-home-latest-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr);
  gap: 16px;
}

.ag-home-feature,
.ag-home-mini,
.ag-home-card,
.ag-home-more {
  border: 1px solid var(--ag-line);
  border-radius: 13px;
  background: var(--ag-panel);
}

.ag-home-feature {
  min-height: 420px;
  overflow: hidden;
}

.ag-home-feature-link {
  position: relative;
  display: block;
  height: 100%;
  min-height: 420px;
}

.ag-home-feature-image,
.ag-home-feature-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ag-home-feature-image {
  object-fit: cover;
}

.ag-home-feature-shade {
  background: linear-gradient(180deg, rgba(10, 10, 10, .12) 5%, rgba(10, 10, 10, .94) 90%),
    radial-gradient(circle at 80% 10%, rgba(242, 190, 62, .16), transparent 42%);
}

.ag-home-feature-copy {
  position: absolute;
  inset: auto 28px 27px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.ag-home-tag {
  margin-bottom: 12px;
  padding: 5px 9px;
  border: 1px solid var(--ag-gold);
  border-radius: 999px;
  background: rgba(10, 10, 10, .7);
}

.ag-home-feature-title {
  margin-top: 7px;
  color: #fff;
  font-size: clamp(26px, 2.4vw, 38px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.035em;
}

.ag-home-feature-excerpt {
  margin-top: 10px;
  color: #d0d0d0;
  font-size: 14px;
  line-height: 1.55;
}

.ag-home-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ag-home-mini {
  min-height: 202px;
  padding: 22px;
}

.ag-home-mini h3,
.ag-home-update h3,
.ag-home-tool h3 {
  margin: 9px 0 7px;
  color: var(--ag-text);
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: -.02em;
}

.ag-home-mini h3 a:hover,
.ag-home-update h3 a:hover,
.ag-home-more a:hover {
  color: var(--ag-gold);
}

.ag-home-mini p,
.ag-home-update p,
.ag-home-tool p {
  margin: 0;
  color: var(--ag-muted);
  font-size: 14px;
  line-height: 1.55;
}

.ag-home-more {
  margin-top: 14px;
  padding: 20px 22px;
}

.ag-home-more h3 {
  margin: 0 0 10px;
  color: var(--ag-gold);
  font-size: 15px;
  text-transform: uppercase;
}

.ag-home-more ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ag-home-more li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 11px 0;
  border-top: 1px solid #343434;
}

.ag-home-more li:first-child {
  border-top: 0;
}

.ag-home-more a {
  overflow: hidden;
  color: var(--ag-text);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ag-home-more time {
  color: #929292;
  font-size: 12px;
}

.ag-home-ad-boundary {
  min-height: 1px;
}

.ag-home-updates,
.ag-home-tools,
.ag-home-topics {
  display: grid;
  gap: 14px;
}

.ag-home-updates,
.ag-home-topics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ag-home-tools {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ag-home-card {
  padding: 22px;
}

.ag-home-update {
  min-height: 188px;
}

.ag-home-modified {
  margin-bottom: 10px !important;
}

.ag-home-tool {
  position: relative;
  min-height: 220px;
  transition: transform .18s ease, border-color .18s ease;
}

.ag-home-tool:hover {
  transform: translateY(-3px);
  border-color: var(--ag-gold-soft);
}

.ag-home-icon {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--ag-gold-soft);
  border-radius: 9px;
  color: var(--ag-gold);
  font-size: 12px;
  font-weight: 800;
}

.ag-home-tool small {
  position: absolute;
  right: 22px;
  bottom: 18px;
  color: var(--ag-gold);
  font-weight: 800;
}

.ag-home-topics a {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border: 1px solid var(--ag-gold-soft);
  border-radius: 12px;
  background: #181818;
  color: var(--ag-text);
  font-size: 18px;
  font-weight: 800;
}

.ag-home-topics a::after {
  content: "→";
  color: var(--ag-gold);
}

.ag-home-topics a:hover {
  border-color: var(--ag-gold);
  background: #202020;
}

.ag-home-empty {
  margin: 0;
  padding: 24px;
  border: 1px dashed var(--ag-line);
  border-radius: 12px;
  color: var(--ag-muted);
}

.ag-home-footer {
  margin-top: 18px;
  padding: 34px 0 24px;
  border-top: 1px solid #3a3a3a;
  background: #0d0d0d;
}

.ag-home-footer-grid {
  display: grid;
  grid-template-columns: minmax(185px, 1.15fr) repeat(4, minmax(125px, 1fr));
  gap: 28px;
}

.ag-home-footer h2,
.ag-home-footer h3 {
  margin: 0 0 12px;
}

.ag-home-footer h2 {
  color: var(--ag-gold);
  font-size: 17px;
}

.ag-home-footer h3 {
  color: var(--ag-text);
  font-size: 14px;
}

.ag-home-footer p,
.ag-home-footer li,
.ag-home-footer a {
  color: #aaa;
  font-size: 13px;
  line-height: 1.7;
}

.ag-home-footer a:hover {
  color: var(--ag-gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ag-home-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ag-home-socials {
  display: grid;
  grid-template-columns: repeat(4, 42px);
  gap: 9px;
  max-width: 195px;
}

.ag-home-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid #484848;
  border-radius: 10px;
  background: #171717;
  color: #ddd;
  line-height: 1;
}

.ag-home-socials a:hover,
.ag-home-socials a:focus-visible {
  border-color: var(--ag-gold-soft);
  color: var(--ag-gold);
  text-decoration: none;
}

.ag-home-socials svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.ag-home-legal {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #343434;
  text-align: center;
}

.ag-home-legal p {
  margin: 0;
  color: #929292;
  font-size: 12px;
  line-height: 1.65;
}

.ag-home-policy-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  margin: 8px 0;
}

.ag-home-policy-links a {
  color: var(--ag-gold);
  font-size: 12px;
}

.ag-home-principle {
  color: #d2d2d2 !important;
}

.ag-home-copyright {
  margin-top: 3px !important;
}

.ag-home-footer-mobile {
  display: none;
}

@media (max-width: 920px) {
  .ag-home-latest-grid {
    grid-template-columns: 1fr;
  }

  .ag-home-feature,
  .ag-home-feature-link {
    min-height: 380px;
  }

  .ag-home-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }

  .ag-home-footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .ag-home-wrap {
    width: min(100% - 32px, 620px);
  }

  .ag-home-hero {
    padding: 24px 0 16px;
  }

  .ag-home-hero h1 {
    margin: 7px 0 9px;
    font-size: clamp(27px, 8vw, 34px);
  }

  .ag-home-intro {
    font-size: 14px;
    line-height: 1.5;
  }

  .ag-home-quick {
    gap: 6px;
    margin-top: 14px;
  }

  .ag-home-quick a {
    display: flex;
    min-width: 0;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    padding: 9px 6px;
    text-align: center;
  }

  .ag-home-quick strong {
    font-size: 12px;
    line-height: 1.25;
  }

  .ag-home-quick span {
    display: none;
  }

  .ag-home-section {
    padding: 30px 0;
  }

  .ag-home-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
  }

  .ag-home-section-head h2 {
    font-size: 23px;
  }

  .ag-home-section-head p {
    font-size: 12px;
    text-align: left;
  }

  .ag-home-feature,
  .ag-home-feature-link {
    min-height: 315px;
  }

  .ag-home-feature-copy {
    inset: auto 20px 20px;
  }

  .ag-home-feature-title {
    font-size: 25px;
  }

  .ag-home-feature-excerpt {
    display: none;
  }

  .ag-home-mini-grid {
    grid-template-columns: 1fr;
  }

  .ag-home-mini {
    min-height: auto;
    padding: 18px;
  }

  .ag-home-more {
    padding: 17px;
  }

  .ag-home-more li {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }

  .ag-home-more a {
    white-space: normal;
  }

  .ag-home-updates {
    display: flex;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
  }

  .ag-home-update {
    min-width: 78%;
    scroll-snap-align: start;
  }

  .ag-home-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .ag-home-card {
    padding: 16px;
  }

  .ag-home-tool {
    min-height: 190px;
  }

  .ag-home-tool h3 {
    font-size: 16px;
  }

  .ag-home-tool p {
    font-size: 13px;
  }

  .ag-home-tool small {
    right: 16px;
    bottom: 14px;
  }

  .ag-home-topics {
    grid-template-columns: 1fr;
  }

  .ag-home-topics a {
    min-height: 52px;
    padding: 13px 16px;
    font-size: 16px;
  }

  .ag-home-footer {
    padding: 28px 0 20px;
  }

  .ag-home-footer-grid {
    grid-template-columns: 1fr;
  }

  .ag-home-footer-grid > div:not(:first-child) {
    display: none;
  }

  .ag-home-footer-mobile {
    display: block;
    margin-top: 20px;
  }

  .ag-home-socials {
    grid-template-columns: repeat(4, 44px);
    gap: 10px;
    max-width: 206px;
  }

  .ag-home-socials a {
    width: 44px;
    height: 44px;
  }

  .ag-home-footer-mobile details {
    border-bottom: 1px solid #333;
  }

  .ag-home-footer-mobile summary {
    padding: 15px 0;
    color: var(--ag-text);
    cursor: pointer;
    font-weight: 800;
    list-style: none;
  }

  .ag-home-footer-mobile summary::-webkit-details-marker {
    display: none;
  }

  .ag-home-footer-mobile summary::after {
    content: "+";
    float: right;
    color: var(--ag-gold);
  }

  .ag-home-footer-mobile details[open] summary::after {
    content: "−";
  }

  .ag-home-footer-mobile ul {
    padding: 0 0 12px 12px;
  }

  .ag-home-legal {
    margin-top: 24px;
    padding-top: 18px;
    text-align: left;
  }

  .ag-home-policy-links {
    justify-content: flex-start;
    gap: 5px 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ag-home-hub *,
  .ag-home-hub *::before,
  .ag-home-hub *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
