*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body);
  font-size: 17px; line-height: 1.65; -webkit-font-smoothing: antialiased;
  --radius: 18px; --radius-sm: 12px; --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 28px rgba(15, 23, 42, .07);
  --section: clamp(56px, 9vw, 112px);
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-heading); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(34px, 6.4vw, 64px); font-weight: 800; }
h2 { font-size: clamp(26px, 4vw, 40px); font-weight: 800; }
h3 { font-size: 20px; font-weight: 700; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.lead { font-size: clamp(18px, 2.2vw, 21px); color: var(--muted); max-width: 640px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 760px; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 14px 26px; border-radius: 999px; border: 2px solid var(--accent);
  background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: none; font-size: 16px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px var(--accent-soft); }
.btn.ghost { background: transparent; color: var(--accent); }

.preview-bar { position: sticky; top: 0; z-index: 60; background: #111; color: #fff; text-align: center; font: 600 13px/1 system-ui, sans-serif; padding: 9px; }

.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid transparent; }
.mode-preview .site-header { top: 31px; }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { font-family: var(--font-heading); font-weight: 800; font-size: 19px; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-nav { display: flex; gap: 22px; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.site-nav a:hover { color: var(--text); }
.nav-toggle { display: none; width: 42px; height: 42px; border: 0; background: var(--accent-soft); border-radius: 12px; padding: 0; position: relative; cursor: pointer; }
.nav-toggle span { position: absolute; left: 12px; right: 12px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s; }
.nav-toggle span:first-child { top: 16px; }
.nav-toggle span:last-child { top: 24px; }
.nav-open .nav-toggle span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-open .nav-toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }

.blk { padding: var(--section) 0; }
.blk + .blk { padding-top: 0; }
.hero { padding-top: clamp(48px, 9vw, 120px); }
.hero + .blk { padding-top: var(--section); }
.hero-row { display: grid; gap: 40px; align-items: center; }
.hero.has-image .hero-row { grid-template-columns: 1.1fr .9fr; }
.hero h1 { max-width: 15ch; }
.hero .lead { margin-bottom: 28px; }
.hero-media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }

.text-row { display: grid; gap: 40px; align-items: center; }
.text-row.with-image { grid-template-columns: 1fr 1fr; }
.img-left .text-row.with-image .text-media { order: -1; }
.text-media { margin: 0; }
.text-media img { width: 100%; border-radius: var(--radius); aspect-ratio: 4 / 3; object-fit: cover; cursor: zoom-in; }
.prose { font-size: 18px; }
.prose h2 { font-size: 28px; margin-top: 1.6em; }
.prose h3 { font-size: 22px; margin-top: 1.4em; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--accent); color: var(--muted); font-style: italic; }
.prose figure { margin: 1.6em 0; }
.prose figure img { border-radius: var(--radius-sm); width: 100%; }
.prose figcaption { color: var(--muted); font-size: 14px; text-align: center; margin-top: 8px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .3em 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; margin-top: 28px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; position: relative; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card p { color: var(--muted); margin: 0; font-size: 16px; }
.card-num { display: inline-block; font: 700 13px/1 var(--font-heading); color: var(--accent); background: var(--accent-soft); padding: 7px 10px; border-radius: 999px; margin-bottom: 16px; }
.price { display: inline-block; margin-top: 14px; font-weight: 800; color: var(--accent); }

.timeline { list-style: none; margin: 28px 0 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 30px 40px; }
.timeline li::before { content: ''; position: absolute; left: 0; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 4px solid var(--accent); }
.timeline .period { display: inline-block; font-size: 13px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.timeline h3 { margin-bottom: 4px; }
.timeline p { color: var(--muted); margin: 0; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 28px; }
.gallery-item { border: 0; padding: 0; background: none; cursor: zoom-in; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 1; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-ph { aspect-ratio: 1; border-radius: var(--radius-sm); background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent2) 14%, transparent)); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.stat { text-align: center; padding: 28px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stat strong { display: block; font: 800 clamp(32px, 5vw, 46px)/1.1 var(--font-heading); color: var(--accent); }
.stat span { color: var(--muted); font-weight: 600; }

.quote-blk blockquote { margin: 0; text-align: center; }
.quote-blk blockquote p { font: 700 clamp(24px, 3.6vw, 36px)/1.35 var(--font-heading); margin-bottom: 14px; }
.quote-blk blockquote p::before { content: '“'; color: var(--accent); }
.quote-blk blockquote p::after { content: '”'; color: var(--accent); }
.quote-blk cite { color: var(--muted); font-style: normal; font-weight: 600; }

.link-list { display: grid; gap: 12px; margin-top: 24px; }
.link-pill { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 700; transition: border-color .15s, transform .15s; }
.link-pill:hover { border-color: var(--accent); transform: translateY(-1px); }
.link-pill .ico { color: var(--accent); }
.link-pill.ghost { color: var(--muted); font-weight: 500; border-style: dashed; }

.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 24px; }
.contact-item { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; word-break: break-word; }
.contact-item .ico { width: 22px; height: 22px; color: var(--accent); }
a.contact-item:hover { border-color: var(--accent); }

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 28px; }
.post-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--text); text-decoration: none; transition: transform .2s, box-shadow .2s; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.post-card img, .post-card-ph { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.post-card-ph { display: block; background: linear-gradient(135deg, var(--accent), var(--accent2)); opacity: .85; }
.post-card-body { display: flex; flex-direction: column; gap: 6px; padding: 20px; }
.post-card strong { font: 700 20px/1.3 var(--font-heading); }
.post-date { font-size: 13px; color: var(--muted); font-weight: 600; }
.post-excerpt { color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.more { margin-top: 28px; text-align: center; }
.pager { display: flex; justify-content: center; gap: 12px; margin-top: 32px; }

.page-head { padding-bottom: 8px; }
.page-head.center { text-align: center; }
.page-head.center .lead { margin: 0 auto 24px; }
.post .back { display: inline-block; margin-bottom: 22px; text-decoration: none; font-weight: 700; }
.post h1 { font-size: clamp(30px, 5vw, 48px); }
.post-meta { color: var(--muted); font-size: 14px; font-weight: 600; }
.post-cover { width: 100%; border-radius: var(--radius); margin: 24px 0 32px; }

.site-footer { border-top: 1px solid var(--line); padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 14px; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer-links { display: flex; gap: 18px; }
.site-footer a { color: var(--muted); text-decoration: none; font-weight: 600; }
.site-footer a:hover { color: var(--accent); }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .92); display: flex; align-items: center; justify-content: center; padding: 20px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 92vh; border-radius: 8px; }
.lightbox-close { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; font-size: 28px; cursor: pointer; }

/* classic */
.layout-classic .hero { text-align: center; }
.layout-classic .hero h1, .layout-classic .hero .lead { margin-left: auto; margin-right: auto; }
.layout-classic .hero.has-image .hero-row { grid-template-columns: 1fr; justify-items: center; }
.layout-classic .hero-media img { width: 220px; height: 220px; aspect-ratio: 1; border-radius: 50%; order: -1; }
.layout-classic .hero-media { order: -1; }
.layout-classic h2 { text-align: center; }
.layout-classic .blk h2::after { content: ''; display: block; width: 56px; height: 3px; background: var(--accent); margin: 18px auto 0; border-radius: 2px; }
.layout-classic .text-body h2 { text-align: left; }
.layout-classic .text-body h2::after { margin-left: 0; }
.layout-classic .card { text-align: center; }

/* minimal */
.layout-minimal { --radius: 6px; --radius-sm: 4px; }
.layout-minimal .hero h1 { font-weight: 700; max-width: 18ch; }
.layout-minimal .card { border: 0; border-top: 2px solid var(--text); border-radius: 0; padding: 22px 0 0; background: transparent; }
.layout-minimal .card:hover { transform: none; box-shadow: none; }
.layout-minimal .card-num { background: none; padding: 0; color: var(--muted); }
.layout-minimal .stat { border: 0; background: transparent; text-align: left; padding: 0; }
.layout-minimal .btn { border-radius: 6px; }
.layout-minimal h2 { font-weight: 700; }

/* bold */
.layout-bold .hero { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; padding-bottom: clamp(64px, 10vw, 128px); border-radius: 0 0 clamp(24px, 4vw, 48px) clamp(24px, 4vw, 48px); }
.layout-bold .hero .lead { color: rgba(255, 255, 255, .88); }
.layout-bold .hero .btn { background: #fff; color: var(--accent); border-color: #fff; }
.layout-bold .hero h1 { font-size: clamp(38px, 7.4vw, 76px); text-transform: none; }
.layout-bold .hero-media img { border: 6px solid rgba(255, 255, 255, .3); }
.layout-bold .card-num { background: var(--accent); color: var(--on-accent); }
.layout-bold .stat { background: var(--accent); border-color: var(--accent); }
.layout-bold .stat strong, .layout-bold .stat span { color: var(--on-accent); }

/* card */
.layout-card { background: color-mix(in srgb, var(--accent) 6%, var(--bg)); }
.layout-card .blk:not(.hero) > .wrap { background: var(--surface); border-radius: 28px; padding: clamp(28px, 5vw, 56px) clamp(20px, 5vw, 56px); box-shadow: var(--shadow); max-width: 1080px; }
.layout-card .blk:not(.hero) > .wrap.narrow { max-width: 760px; }
.layout-card .blk + .blk { padding-top: 0; }
.layout-card .blk { padding-bottom: 24px; }
.layout-card .card { background: var(--bg); border-color: transparent; }
.layout-card .stat { background: var(--bg); border-color: transparent; }
.layout-card .hero { padding-bottom: 48px; }

/* split */
@media (min-width: 900px) {
  .layout-split .hero-row { grid-template-columns: 1.1fr .9fr; }
  .layout-split .hero:not(.has-image) .hero-text { grid-column: 1 / -1; }
  .layout-split .list-blk .wrap, .layout-split .timeline-blk .wrap { display: grid; grid-template-columns: 300px 1fr; gap: 48px; align-items: start; max-width: 1120px; }
  .layout-split .list-blk h2, .layout-split .timeline-blk h2 { position: sticky; top: 96px; }
  .layout-split .list-blk .cards { margin-top: 0; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
  .layout-split .timeline { margin-top: 0; }
}
.layout-split .hero { background: linear-gradient(180deg, var(--accent-soft), transparent); }
.layout-split .hero h1 span, .layout-split h2 { color: var(--text); }
.layout-split h2::before { content: ''; display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--accent); margin-bottom: 16px; }

/* dark */
.layout-dark { --shadow: 0 0 0 1px var(--line), 0 18px 40px rgba(0, 0, 0, .45); }
.layout-dark .hero h1 { background: linear-gradient(90deg, var(--text), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.layout-dark .card, .layout-dark .stat, .layout-dark .contact-item, .layout-dark .link-pill, .layout-dark .post-card { background: var(--surface); border-color: var(--line); }
.layout-dark .card:hover, .layout-dark .post-card:hover { box-shadow: 0 0 0 1px var(--accent), 0 18px 40px rgba(0, 0, 0, .5); }
.layout-dark .card-num { font-family: 'JetBrains Mono', monospace; }
.layout-dark .btn { box-shadow: 0 0 24px var(--accent-soft); }
.layout-dark .site-header { border-bottom-color: var(--line); }

/* soft */
.layout-soft { --radius: 28px; --radius-sm: 22px; }
.layout-soft .hero { text-align: center; position: relative; overflow: hidden; }
.layout-soft .hero::before, .layout-soft .hero::after { content: ''; position: absolute; border-radius: 50%; filter: blur(10px); opacity: .5; z-index: -1; }
.layout-soft .hero::before { width: 340px; height: 340px; background: var(--accent-soft); top: -80px; left: -100px; }
.layout-soft .hero::after { width: 280px; height: 280px; background: color-mix(in srgb, var(--accent2) 20%, transparent); bottom: -60px; right: -80px; }
.layout-soft .hero h1, .layout-soft .hero .lead { margin-left: auto; margin-right: auto; }
.layout-soft .hero.has-image .hero-row { grid-template-columns: 1fr; justify-items: center; }
.layout-soft .hero-media { order: -1; }
.layout-soft .hero-media img { width: 200px; height: 200px; aspect-ratio: 1; border-radius: 50%; border: 6px solid var(--surface); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.layout-soft h2 { text-align: center; }
.layout-soft .text-body h2 { text-align: left; }
.layout-soft .card { border: 0; box-shadow: var(--shadow); text-align: center; }
.layout-soft .card-num { background: var(--accent); color: var(--on-accent); width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 0; font-size: 15px; }
.layout-soft .stat { border: 0; box-shadow: var(--shadow); }
.layout-soft .btn { box-shadow: 0 10px 24px var(--accent-soft); }

/* magazine */
.layout-magazine .hero { border-bottom: 1px solid var(--line); padding-bottom: 48px; }
.layout-magazine .hero h1 { font-size: clamp(40px, 8vw, 84px); max-width: 16ch; font-weight: 800; }
.layout-magazine h2 { font-size: clamp(22px, 3vw, 30px); text-transform: uppercase; letter-spacing: .06em; border-bottom: 2px solid var(--text); padding-bottom: 12px; }
.layout-magazine .post-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.layout-magazine .post-card { border: 0; background: transparent; border-radius: 0; }
.layout-magazine .post-card:hover { box-shadow: none; transform: none; }
.layout-magazine .post-card img, .layout-magazine .post-card-ph { border-radius: var(--radius-sm); }
.layout-magazine .post-card-body { padding: 14px 0 0; }
.layout-magazine .post-card strong { font-size: 22px; }
.layout-magazine .post-grid > .post-card:first-child { grid-column: 1 / -1; }
@media (min-width: 760px) {
  .layout-magazine .post-grid > .post-card:first-child { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: center; }
  .layout-magazine .post-grid > .post-card:first-child strong { font-size: 32px; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero.has-image .hero-row, .text-row.with-image { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .hero-media img { aspect-ratio: 1; }
  .img-left .text-row.with-image .text-media { order: 0; }
  .nav-toggle { display: block; }
  .site-nav { position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; gap: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 20px 16px; display: none; box-shadow: 0 18px 30px rgba(0, 0, 0, .08); }
  .nav-open .site-nav { display: flex; }
  .site-nav a { padding: 12px 0; font-size: 17px; border-bottom: 1px solid var(--line); }
  .site-nav a:last-child { border-bottom: 0; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .cards { grid-template-columns: 1fr; }
  .layout-card .blk:not(.hero) > .wrap { border-radius: 22px; width: calc(100% - 24px); }
  .footer-row { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
