:root {
  --bg: #fff8ed;
  --surface: #ffffff;
  --surface-soft: #fff0d6;
  --text: #24180f;
  --muted: #705a45;
  --primary: #ff7a1a;
  --primary-dark: #d95100;
  --secondary: #6536ff;
  --border: #f0d7ba;
  --shadow: 0 20px 60px rgba(83, 45, 14, 0.13);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 248, 237, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: -0.03em; font-size: 1.05rem; }
.brand-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 14px; background: linear-gradient(135deg, #ffe1a3, #ff8735); box-shadow: 0 10px 24px rgba(255, 122, 26, 0.25); }
.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a { padding: 10px 12px; border-radius: 999px; color: var(--muted); font-weight: 700; font-size: 0.94rem; }
.main-nav a:hover { color: var(--text); background: var(--surface-soft); }
.nav-toggle { display: none; border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 8px 11px; font-size: 1.2rem; }

.hero { padding: 72px 0 56px; background: radial-gradient(circle at top left, #ffe3b1, transparent 36%), radial-gradient(circle at 85% 20%, #e4dcff, transparent 34%); }
.hero-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 36px; align-items: center; }
.eyebrow { margin: 0 0 10px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 900; font-size: 0.78rem; color: var(--primary-dark); }
h1, h2, h3 { line-height: 1.12; margin: 0; letter-spacing: -0.045em; }
h1 { font-size: clamp(2.4rem, 7vw, 5rem); max-width: 880px; }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
h3 { font-size: 1.22rem; }
.hero-copy { position: relative; z-index: 2; }
.hero-text { margin: 24px 0 0; font-size: 1.16rem; color: var(--muted); max-width: 690px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.btn { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 13px 20px; font-weight: 900; border: 2px solid transparent; transition: transform .2s ease, box-shadow .2s ease; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--primary), #ffb11a); color: #fff; box-shadow: 0 14px 28px rgba(255, 122, 26, 0.28); }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.trust-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; color: var(--muted); font-weight: 800; font-size: 0.92rem; }
.trust-row span { background: rgba(255,255,255,0.75); border: 1px solid var(--border); border-radius: 999px; padding: 7px 10px; }
.hero-card { background: rgba(255,255,255,0.86); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.card-label { display: inline-flex; border-radius: 999px; padding: 6px 10px; background: #efe9ff; color: var(--secondary); font-weight: 900; font-size: 0.82rem; margin-bottom: 16px; }
.start-list { padding-left: 20px; margin: 20px 0 0; }
.start-list li { margin: 12px 0; font-weight: 800; }
.start-list a { color: var(--primary-dark); }

.section { padding: 64px 0; }
.section-heading { margin-bottom: 26px; max-width: 760px; }
.two-col-heading { max-width: none; display: flex; justify-content: space-between; gap: 24px; align-items: end; }
.grid { display: grid; gap: 18px; }
.cards-4 { grid-template-columns: repeat(4, 1fr); }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.feature-card, .guide-card, .table-card, .tier-list-card, .database-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(83,45,14,0.08); }
.feature-card { padding: 24px; min-height: 220px; transition: transform .2s ease, box-shadow .2s ease; }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature-icon { display: block; font-size: 2rem; margin-bottom: 16px; }
.feature-card p, .guide-card p, .muted { color: var(--muted); margin-bottom: 0; }
.split-layout { display: grid; grid-template-columns: 0.78fr 1.22fr; gap: 32px; align-items: start; }
.text-link { display: inline-flex; margin-top: 16px; color: var(--primary-dark); font-weight: 900; }
.table-card { padding: 20px; overflow-x: auto; }
.table-meta { color: var(--muted); font-weight: 800; margin-bottom: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 540px; }
th, td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 0.88rem; }
code { background: #fff3df; border: 1px solid var(--border); padding: 3px 7px; border-radius: 8px; font-weight: 900; }
.badge { display: inline-flex; border-radius: 999px; padding: 4px 8px; font-weight: 900; font-size: 0.78rem; }
.badge-warn { background: #fff1bf; color: #805300; }
.small-note { color: var(--muted); font-size: 0.9rem; margin: 14px 0 0; }
.tier-list-card { overflow: hidden; }
.tier-row { display: grid; grid-template-columns: 80px 1fr; border-bottom: 1px solid var(--border); }
.tier-row:last-child { border-bottom: 0; }
.tier-label { display: grid; place-items: center; min-height: 82px; font-size: 1.4rem; font-weight: 1000; color: #fff; }
.tier-splus .tier-label { background: #ff5f3d; }
.tier-s .tier-label { background: #ff9f1c; }
.tier-a .tier-label { background: #5b8cff; }
.tier-items { display: flex; flex-wrap: wrap; gap: 10px; padding: 18px; align-items: center; }
.tier-items a { border: 1px solid var(--border); background: #fffaf3; border-radius: 999px; padding: 9px 12px; font-weight: 900; }
.guide-card { padding: 24px; }
.guide-tag { display: inline-flex; margin-bottom: 14px; background: var(--surface-soft); color: var(--primary-dark); border-radius: 999px; padding: 5px 9px; font-size: 0.78rem; font-weight: 900; }
.guide-card h3 a:hover { color: var(--primary-dark); }
.database-box { padding: 34px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: linear-gradient(135deg, #fff, #fff0d6); }
.site-footer { padding: 48px 0; border-top: 1px solid var(--border); background: #23170f; color: #fff8ed; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 28px; }
.footer-grid p { color: #d9c3a9; max-width: 520px; }
.footer-grid h2 { font-size: 1rem; margin-bottom: 14px; }
.footer-grid a:not(.brand) { display: block; color: #d9c3a9; margin: 8px 0; }
.footer-brand { color: #fff; }

@media (max-width: 900px) {
  .hero-grid, .split-layout, .footer-grid { grid-template-columns: 1fr; }
  .cards-4, .cards-3 { grid-template-columns: repeat(2, 1fr); }
  .two-col-heading { align-items: start; flex-direction: column; }
  .main-nav { display: none; position: absolute; left: 16px; right: 16px; top: 72px; padding: 14px; flex-direction: column; align-items: stretch; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); }
  .main-nav.is-open { display: flex; }
  .nav-toggle { display: inline-flex; }
}
@media (max-width: 620px) {
  .cards-4, .cards-3 { grid-template-columns: 1fr; }
  .hero { padding-top: 46px; }
  .hero-actions .btn { width: 100%; }
  .tier-row { grid-template-columns: 62px 1fr; }
  .database-box { flex-direction: column; align-items: start; }
}

.store-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.store-badge { position: relative; z-index: 3; display: inline-flex; flex-direction: column; justify-content: center; min-width: 164px; min-height: 58px; padding: 9px 16px; border-radius: 16px; background: #15100c; color: #fff; border: 1px solid rgba(255,255,255,0.18); box-shadow: 0 12px 26px rgba(35,23,15,0.18); cursor: pointer; text-decoration: none; }
.store-badge:hover { transform: translateY(-2px); }
.store-small { font-size: 0.68rem; letter-spacing: 0.08em; color: #e7d6c3; font-weight: 800; line-height: 1; }
.store-badge strong { font-size: 1.12rem; line-height: 1.2; }
.video-section { background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,240,214,0.72)); }
.video-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 34px; align-items: center; }
.video-card { position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); background: #000; aspect-ratio: 16 / 9; }
.video-card iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.check-list { padding-left: 0; margin: 22px 0 0; list-style: none; display: grid; gap: 10px; }
.check-list li { position: relative; padding-left: 30px; color: var(--muted); font-weight: 750; }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: 0; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; background: var(--surface-soft); color: var(--primary-dark); font-weight: 1000; }
.article-section { background: var(--surface); }
.article-wrap { max-width: 880px; }
.article-wrap h2 { margin-bottom: 22px; }
.article-wrap p { color: var(--muted); font-size: 1.04rem; margin: 0 0 18px; }

@media (max-width: 900px) {
  .video-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .store-actions { flex-direction: column; }
  .store-badge { width: 100%; }
}

.main-nav a.active { background: var(--surface-soft); color: var(--primary-dark); }
.page-hero { padding-bottom: 64px; }
.codes-hero { background: radial-gradient(circle at top left, rgba(255,159,28,0.22), transparent 32%), linear-gradient(180deg, #fff7ea 0%, #fff 100%); }
.code-summary-card p { margin-bottom: 18px; }
.mini-stats { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.mini-stats li { padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: #fffaf3; color: var(--muted); }
.badge-good { background: #dff7d8; color: #246b1f; }
.copy-btn { cursor: pointer; border: 1px solid var(--border); border-radius: 999px; padding: 8px 12px; font-weight: 900; background: #fff3df; color: var(--primary-dark); }
.copy-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(83,45,14,0.1); }
.copy-btn.copied { background: #dff7d8; color: #246b1f; }
.soft-section { background: linear-gradient(180deg, #fff, #fff5e4); }
.two-column-content { display: grid; grid-template-columns: 1.08fr 0.92fr; gap: 32px; align-items: start; }
.step-list { margin: 20px 0 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 14px; }
.step-list li { counter-increment: step; position: relative; padding: 16px 16px 16px 58px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; color: var(--muted); }
.step-list li::before { content: counter(step); position: absolute; left: 16px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; background: var(--primary); color: #fff; font-weight: 1000; }
.tip-box, .empty-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; }
.tip-box p { color: var(--muted); }
.codes-table-card table { min-width: 720px; }

@media (max-width: 900px) {
  .two-column-content { grid-template-columns: 1fr; }
}

/* Compact reading improvements */
.section-short { max-width: 760px; font-size: 1.02rem; }
.read-more-panel { margin-top: 18px; border: 1px solid var(--border); border-radius: 20px; background: var(--card); box-shadow: var(--shadow-soft); overflow: hidden; }
.read-more-panel summary { cursor: pointer; list-style: none; padding: 18px 22px; font-weight: 800; color: var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.read-more-panel summary::-webkit-details-marker { display: none; }
.read-more-panel summary::after { content: '+'; width: 28px; height: 28px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--soft); color: var(--accent-dark); font-size: 1.1rem; flex: 0 0 auto; }
.read-more-panel[open] summary::after { content: '−'; }
.read-more-content { padding: 0 22px 22px; color: var(--muted); }
.read-more-content p { margin: 0 0 14px; }
.section.article-section, .section.soft-section { padding-top: 56px; padding-bottom: 56px; }
.article-wrap { max-width: 900px; }
.faq-item p, .guide-card p, .feature-card p { margin-bottom: 0; }
@media (max-width: 720px) { .read-more-panel summary { padding: 16px; } .read-more-content { padding: 0 16px 18px; } }

.source-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.source-card {
  display: block;
  padding: 1rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 1rem;
  background: rgba(255,255,255,.05);
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}
.source-card:hover {
  transform: translateY(-1px);
}
@media (max-width: 800px) {
  .source-grid { grid-template-columns: 1fr; }
}

/* Hotfix: codes page layout compatibility */
.nav {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-links a {
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.94rem;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
  background: var(--surface-soft);
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffe1a3, #ff8735);
  box-shadow: 0 10px 24px rgba(255, 122, 26, 0.25);
  font-weight: 1000;
}
.hero.page-hero {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 34px;
  align-items: center;
  border-radius: 0 0 28px 28px;
}
.page-hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  max-width: 780px;
}
.hero-lede {
  margin: 22px 0 0;
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 760px;
}
.btn.primary { background: linear-gradient(135deg, var(--primary), #ffb11a); color: #fff; box-shadow: 0 14px 28px rgba(255, 122, 26, 0.28); }
.btn.ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}
.trust-list li {
  background: rgba(255,255,255,0.75);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.92rem;
}
.compact-card { align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.compact-card h2 { font-size: 1.55rem; margin-bottom: 14px; }
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(83,45,14,0.08); padding: 20px; overflow-x: auto; }
.codes-table { min-width: 760px; }
.status { display: inline-flex; border-radius: 999px; padding: 4px 8px; font-size: 0.78rem; font-weight: 900; }
.status.active { background: #dff7d8; color: #246b1f; }
.faq-list { display: grid; gap: 14px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 20px; }
.faq-item h3 { margin-bottom: 8px; }
.anchor-target { position: relative; top: -84px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 10px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
@media (max-width: 900px) {
  .hero.page-hero { grid-template-columns: 1fr; padding-top: 46px; }
  .nav-links { display: none; position: absolute; left: 16px; right: 16px; top: 72px; padding: 14px; flex-direction: column; align-items: stretch; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); }
  .nav-links.is-open { display: flex; }
  .page-hero h1 { font-size: clamp(2.25rem, 9vw, 3.8rem); }
}
@media (max-width: 620px) {
  .hero.page-hero { width: min(100% - 24px, 1120px); }
  .nav { width: min(100% - 24px, 1120px); }
  .trust-list { flex-direction: column; align-items: flex-start; }
}

/* Final layout normalization for article/detail pages */
.section > .section-heading,
.section > .table-wrap,
.section > .note-box,
.section > .steps-grid,
.section > .grid,
.section > .video-card,
.section > .empty-state,
.section > .source-grid,
.section > .faq-list {
  width: min(1120px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}
.section > .section-heading { margin-bottom: 26px; }
.section > .note-box { margin-top: 16px; }
.note-box,
.empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  color: var(--muted);
  box-shadow: 0 10px 28px rgba(83,45,14,0.06);
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.step-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px 22px;
  box-shadow: 0 12px 32px rgba(83,45,14,0.08);
}
.step-card > span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 1000;
  margin-bottom: 16px;
}
.step-card p { color: var(--muted); margin-bottom: 0; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.link-card { display: block; color: inherit; }
.link-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.video-section .video-card { max-width: 1120px; }
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.faq-section details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 10px 28px rgba(83,45,14,0.06);
}
.faq-section details + details { margin-top: 12px; }
.faq-section summary { cursor: pointer; font-weight: 900; font-size: 1.05rem; }
.faq-section details p { color: var(--muted); margin-bottom: 0; }
.site-footer > div {
  width: min(1120px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}
.site-footer .footer-links { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 14px; }
.site-footer .footer-links a { margin: 0; }

@media (max-width: 900px) {
  .steps-grid,
  .grid.two,
  .grid.three,
  .source-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .section > .section-heading,
  .section > .table-wrap,
  .section > .note-box,
  .section > .steps-grid,
  .section > .grid,
  .section > .video-card,
  .section > .empty-state,
  .section > .source-grid,
  .section > .faq-list {
    width: min(100% - 24px, 1120px);
  }
  .table-wrap { padding: 12px; border-radius: 18px; }
}
