:root {
    --paper: #fbf6ec;
    --paper-deep: #f3ead9;
    --surface: #fffdf8;
    --ink: #12302a;
    --body: #3a4a45;
    --muted: #5f6d67;
    --line: #e6dcc9;
    --coral: #f26b3a;
    --link: #b8431a;
    --sun: #f6c445;
    --green: #2f7d66;
    --navy: #1f2a5c;
    --radius: 12px;
    --font: 'Inter', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --display: 'Plus Jakarta Sans', 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--body);
    font: 400 16px/1.6 var(--font);
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--link); }

h1, h2, h3, h4 { margin: 0; color: var(--ink); font-family: var(--display); font-weight: 800; line-height: 1.12; letter-spacing: -0.025em; }

:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 3px; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 32px; }

.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 16px; top: 12px; background: var(--surface); padding: 8px 12px; z-index: 10; }

.meta { margin: 0; color: var(--muted); font-size: 13.5px; }
.meta a { color: var(--link); font-weight: 600; text-decoration: none; }

.button {
    display: inline-block;
    padding: 14px 24px;
    background: var(--coral);
    border-radius: 8px;
    color: var(--ink);
    font-family: var(--display);
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.15s ease-out;
}
.button:hover { transform: translateY(-2px); }

[data-cat] { --tone: #12302a; --tone-text: #fbf6ec; --tone-soft: #cfe0d7; }
[data-cat='start-a-store'] { --tone: #12302a; --tone-text: #fbf6ec; --tone-soft: #cfe0d7; }
[data-cat='product-research'] { --tone: #1f2a5c; --tone-text: #fbf6ec; --tone-soft: #d3daf1; }
[data-cat='marketing'] { --tone: #f26b3a; --tone-text: #12302a; --tone-soft: #2b1a12; }
[data-cat='conversion'] { --tone: #f6c445; --tone-text: #12302a; --tone-soft: #3a4a45; }
[data-cat='shipping-operations'] { --tone: #2f7d66; --tone-text: #fffdf8; --tone-soft: #e6f2ec; }

/* Header */
.site-header { background: var(--ink); }
.site-header .wrap { display: flex; align-items: center; gap: 36px; }
.header-bar { padding-top: 18px; padding-bottom: 18px; }

.logo { color: #fbf6ec; font-family: var(--display); font-size: 25px; font-weight: 800; letter-spacing: -0.04em; text-decoration: none; }
.logo span { color: var(--coral); }
.logo img { width: auto; max-width: 200px; height: 38px; object-fit: contain; }

.topics { display: flex; flex: 1; gap: 26px; overflow-x: auto; scrollbar-width: none; }
.topics::-webkit-scrollbar { display: none; }
.topics a { color: #d9e4de; font-size: 14.5px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.topics a:hover { color: var(--sun); }

.search input {
    width: 190px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 0;
    border-radius: 6px;
    color: #fbf6ec;
    font: inherit;
    font-size: 14px;
}
.search input::placeholder { color: #c3d2ca; }
.search input:focus { background: rgba(255, 255, 255, 0.18); outline: 2px solid var(--sun); }

/* Home */
.hero { padding: 72px 0 84px; background: var(--ink); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: 64px; }
.hero h1 { color: #fbf6ec; font-size: clamp(38px, 5.4vw, 66px); line-height: 1.04; letter-spacing: -0.04em; }
.hero-copy p { max-width: 520px; margin: 24px 0 32px; color: #d9e4de; font-size: 18.5px; }

.hero-feature { display: block; overflow: hidden; background: var(--paper); border-radius: var(--radius); text-decoration: none; }
.hero-feature img { width: 100%; }
.hero-feature-text { display: block; padding: 20px 24px 24px; }
.hero-feature-text .meta { display: block; margin-bottom: 6px; }
.hero-feature-title { display: block; color: var(--ink); font-family: var(--display); font-size: 23px; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
.hero-feature:hover .hero-feature-title { color: var(--link); }

.block { padding-top: 76px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(27px, 3.4vw, 38px); }
.section-head h2 a { color: inherit; text-decoration: none; }
.section-head h2 a:hover { color: var(--link); }
.view-all { flex: none; font-weight: 600; font-size: 15px; text-decoration: none; }

.roadmap { margin-top: 84px; padding: 68px 0 72px; background: var(--sun); }
.roadmap h2 { max-width: 640px; margin-bottom: 36px; font-size: clamp(30px, 4vw, 46px); line-height: 1.08; }
.roadmap-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 40px; margin: 0; padding: 0; counter-reset: step; list-style: none; }
.roadmap-steps li { counter-increment: step; border-top: 2px solid var(--ink); }
.roadmap-steps a { display: grid; grid-template-columns: 48px minmax(0, 1fr); padding: 16px 0 26px; color: var(--ink); text-decoration: none; }
.roadmap-steps a::before { content: counter(step); grid-row: span 2; font-family: var(--display); font-size: 32px; font-weight: 800; line-height: 1; }
.roadmap-label { font-family: var(--display); font-size: 19px; font-weight: 800; letter-spacing: -0.015em; }
.roadmap-title { font-size: 14.5px; line-height: 1.4; }
.roadmap-steps a:hover .roadmap-label { text-decoration: underline; }

.topic-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.topic-tile { grid-column: span 2; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; min-height: 196px; padding: 24px; background: var(--tone); border-radius: var(--radius); color: var(--tone-text); text-decoration: none; transition: transform 0.15s ease-out; }
.topic-tile:nth-child(n + 4) { grid-column: span 3; }
.topic-tile:hover { transform: translateY(-3px); }
.topic-name { font-family: var(--display); font-size: 25px; font-weight: 800; line-height: 1.1; letter-spacing: -0.025em; }
.topic-text { color: var(--tone-soft); font-size: 14.5px; line-height: 1.45; }

/* Card */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 28px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 24px; }

.thumb { display: block; aspect-ratio: 16 / 9; margin-bottom: 14px; overflow: hidden; background: var(--paper-deep); border-radius: var(--radius); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease-out; }
.card:hover .thumb img { transform: scale(1.03); }

.card-title { margin: 6px 0 8px; font-size: 20px; line-height: 1.22; letter-spacing: -0.02em; }
.grid-4 .card-title { font-size: 18.5px; }
.card-title a { color: inherit; text-decoration: none; }
.card-title a:hover { color: var(--link); }
.card-text { display: -webkit-box; margin: 0; overflow: hidden; color: var(--muted); font-size: 15px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

/* Listing */
.listing-head { padding-top: 60px; padding-bottom: 36px; }
.listing-head h1 { margin-bottom: 12px; font-size: clamp(36px, 5vw, 56px); letter-spacing: -0.035em; }
.listing-head p { max-width: 640px; margin: 0; font-size: 18px; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 24px; padding-top: 48px; color: var(--muted); font-size: 15px; }
.pagination a { font-weight: 600; text-decoration: none; }

/* Post */
.post-hero { padding: 48px 0 150px; background: var(--tone, var(--ink)); color: var(--tone-text, #fbf6ec); }
.post-header { max-width: 1000px; margin-left: auto; margin-right: auto; }
.post-hero .breadcrumbs { margin-bottom: 20px; font-size: 14px; }
.post-hero .breadcrumbs a { color: inherit; text-decoration: none; }
.post-hero .breadcrumbs a:hover { text-decoration: underline; }
.post-hero h1 { color: inherit; font-size: clamp(34px, 5.2vw, 58px); line-height: 1.06; letter-spacing: -0.038em; }
.post-lead { max-width: 720px; margin: 18px 0; font-size: 19.5px; line-height: 1.5; }
.post-hero .meta, .post-hero .meta a { color: inherit; }

.post-cover { max-width: 936px; margin: -110px auto 0; }
.post-cover img { width: 100%; border-radius: var(--radius); box-shadow: 0 10px 34px rgba(18, 48, 42, 0.14); }

.post-layout { display: grid; grid-template-columns: minmax(0, 700px) 260px; justify-content: center; gap: 56px; padding-top: 44px; }

.prose { font-size: 18px; line-height: 1.75; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > p:first-child { color: var(--ink); font-size: 20.5px; line-height: 1.6; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.25em; }
.prose h2 { margin: 2.1em 0 0.6em; font-size: 31px; }
.prose h3 { margin: 1.7em 0 0.5em; font-size: 22px; letter-spacing: -0.015em; }
.prose li { margin-bottom: 0.45em; }
.prose li::marker { color: var(--link); font-weight: 600; }
.prose li > ul, .prose li > ol { margin: 0.45em 0 0; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose hr { margin: 2.5em 0; border: 0; border-top: 1px solid var(--line); }
.prose figure { margin: 2em 0; }
.prose figure img { width: 100%; border-radius: var(--radius); }
.prose figcaption { margin-top: 8px; color: var(--muted); font-size: 14.5px; }
.prose blockquote { margin: 1.75em 0; padding: 20px 24px; background: var(--paper-deep); border-radius: var(--radius); color: var(--ink); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code { padding: 2px 5px; background: var(--paper-deep); border-radius: 4px; font-size: 0.88em; }
.prose pre { overflow-x: auto; padding: 16px; background: var(--ink); border-radius: var(--radius); color: #edf0ee; font-size: 15px; }
.prose pre code { padding: 0; background: none; color: inherit; }

.table-wrap { margin: 1.75em 0; overflow-x: auto; background: var(--surface); border-radius: var(--radius); box-shadow: 0 1px 8px rgba(18, 48, 42, 0.06); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.prose th { padding: 12px 16px; background: var(--ink); color: #fbf6ec; font-family: var(--display); font-weight: 700; text-align: left; white-space: nowrap; }
.prose td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.5; }
.prose tr:last-child td { border-bottom: 0; }

.toc ol { margin: 0; padding: 0; list-style: none; }
.toc li { margin-bottom: 10px; line-height: 1.35; }
.toc a { color: var(--body); font-size: 14.5px; text-decoration: none; }
.toc a:hover { color: var(--link); }
.toc-side h2 { margin-bottom: 14px; font-size: 16px; letter-spacing: -0.01em; }
.post-side { position: sticky; top: 24px; align-self: start; max-height: calc(100vh - 48px); overflow-y: auto; }

.toc-inline { display: none; margin-bottom: 28px; padding: 14px 18px; background: var(--paper-deep); border-radius: var(--radius); }
.toc-inline summary { color: var(--ink); font-weight: 600; cursor: pointer; }
.toc-inline ol { padding-top: 14px; }

.author-box { margin-top: 48px; padding: 24px 26px; background: var(--paper-deep); border-radius: var(--radius); font-size: 15.5px; }
.author-box h2 { margin-bottom: 6px; font-size: 18px; }
.author-box p { margin: 0; }

.read-progress { position: fixed; top: 0; left: 0; z-index: 5; width: 100%; height: 4px; background: var(--coral); transform-origin: left; transform: scaleX(0); }
@supports (animation-timeline: scroll()) {
    .read-progress { animation: read-progress linear both; animation-timeline: scroll(root); }
}
@keyframes read-progress { to { transform: scaleX(1); } }

.ad { margin: 2em 0; min-height: 280px; }
.ad-sidebar { min-height: 250px; margin-bottom: 0; }

.page { max-width: 768px; padding-top: 60px; }
.page h1 { margin-bottom: 26px; font-size: clamp(36px, 5vw, 52px); letter-spacing: -0.035em; }

/* Footer */
.site-footer { margin-top: 96px; padding: 60px 0 26px; background: var(--ink); color: #d9e4de; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid p { max-width: 280px; margin: 10px 0 0; }
.footer-grid h2 { margin-bottom: 12px; color: var(--sun); font-size: 14.5px; letter-spacing: 0; }
.footer-grid div > a:not(.logo) { display: block; margin-bottom: 7px; color: #d9e4de; text-decoration: none; }
.footer-grid div > a:not(.logo):hover { color: #fff; }
.copyright { margin-top: 40px; color: #b5c5bd; font-size: 13.5px; }
.copyright a { color: inherit; }

@media (max-width: 1080px) {
    .site-header .wrap { flex-wrap: wrap; gap: 12px 24px; }
    .topics { order: 3; flex-basis: 100%; }
    .search { margin-left: auto; }
    .post-layout { grid-template-columns: minmax(0, 720px); gap: 0; padding-top: 32px; }
    .post-side { display: none; }
    .toc-inline { display: block; }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
    .hero { padding: 52px 0 60px; }
    .roadmap-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .wrap { padding: 0 16px; }
    .search { flex: 1; min-width: 0; }
    .search input { width: 100%; }
    .grid, .grid-4 { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .roadmap-steps { grid-template-columns: minmax(0, 1fr); }
    .roadmap { margin-top: 64px; padding: 48px 0 40px; }
    .topic-tile, .topic-tile:nth-child(n + 4) { grid-column: span 6; min-height: 0; }
    .block { padding-top: 56px; }
    .listing-head { padding-top: 40px; padding-bottom: 26px; }
    .post-hero { padding: 32px 0 96px; }
    .post-cover { margin-top: -68px; }
    .post-lead { font-size: 18px; }
    .prose { font-size: 17px; }
    .prose > p:first-child { font-size: 18.5px; }
    .prose h2 { font-size: 26px; }
    .prose h3 { font-size: 20.5px; }
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-grid > :first-child { grid-column: 1 / -1; }
    .site-footer { margin-top: 72px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .button, .topic-tile, .thumb img { transition: none; }
}
