/* chytopys.com.ua homepage (docs/017_homepage_design.md). Same color
   tokens as mobile/lib/theme/app_theme.dart and the already-shipped
   /join/<token> page -- one brand palette, not a separate Web one.
   Cascade: :root (light default) -> prefers-color-scheme (auto dark,
   only while no manual choice) -> [data-theme] (manual choice always
   wins, set by script.js). */
/* The headline face is served from our own host (fonts/, SIL OFL, unmodified),
   not from Google Fonts: a visit to the site sends nothing to a third party. */
@font-face {
  font-family: 'Playfair Display';
  src: url('/fonts/PlayfairDisplay-Variable.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #F6F1E7;
  --surface: #F2ECE1;
  --card: #FFFFFFAA;
  --primary: #9E7741;
  --on-primary: #FBF8F1;
  --primary-container: #E9D9BD;
  --secondary: #C3A273;
  --text-primary: #28231D;
  --text-secondary: #6E675E;
  --border: #DED5C7;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #141310;
    --surface: #1B1814;
    --card: #201C17AA;
    --primary: #E8C07A;
    --on-primary: #141310;
    --primary-container: #554627;
    --secondary: #CFA968;
    --text-primary: #F3F0E8;
    --text-secondary: #B8B1A6;
    --border: #3A332A;
  }
}
:root[data-theme='dark'] {
  --bg: #141310;
  --surface: #1B1814;
  --card: #201C17AA;
  --primary: #E8C07A;
  --on-primary: #141310;
  --primary-container: #554627;
  --secondary: #CFA968;
  --text-primary: #F3F0E8;
  --text-secondary: #B8B1A6;
  --border: #3A332A;
}

/* Real screenshot pixel dimensions (654x1280, both current files --
   resources/web/main_page/) -- NOT 9:16 (0.5625); actual ratio is
   ~0.511. A container sized to plain 9:16 crops real content off the
   top/bottom (2026-09-16 report: the carousel's library screenshot lost
   its bottom nav bar) because `object-fit: cover` has to overflow one
   axis to fill a container with the wrong proportions. One shared
   variable so `.phone-frame` and `.screen-shot` (and any future
   screenshot slot) can't drift out of sync with each other again. */
:root { --screenshot-ratio: 654 / 1280; }

/* Generic theme-swap utility for real app screenshots (any container,
   not just .phone-frame) -- wrap the light/dark variant in an element
   with this class, same [data-theme]/prefers-color-scheme cascade that
   drives the color tokens above swaps which one shows, no extra JS
   beyond what script.js's theme toggle already does (setting
   [data-theme]). */
.theme-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-light { display: none; }
  :root:not([data-theme]) .theme-dark { display: block; }
}
:root[data-theme='dark'] .theme-light { display: none; }
:root[data-theme='dark'] .theme-dark { display: block; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, sans-serif;
}
h1, h2, h3, .serif { font-family: 'Playfair Display', Georgia, serif; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
section { padding: 64px 0; }

/* Mood backgrounds for specific sections (designer assets,
   resources/web/background/ -> images/bg-*.png). A ::before layer, not
   `background-image` directly on the section -- CSS background has no
   opacity of its own, and fading the section itself would fade its text
   too. `background-size: contain` (not `cover`) keeps the whole
   illustration intact regardless of the section's own aspect ratio --
   these are corner compositions on a mostly-transparent canvas, cover
   would crop the actual artwork out unpredictably depending on section
   shape. `position: relative` on `.section-bg` plus `z-index: -1` on the
   pseudo-element keeps it behind the section's own (unpositioned, normal
   flow) content without needing z-index on anything else. One shared
   --section-bg-opacity, not per-section values -- deliberately faint,
   "щоб просто створити настрій" (2026-09-16), same value everywhere
   unless a specific section needs tuning later. */
:root { --section-bg-opacity: 0.1; }
.section-bg { position: relative; }
.section-bg::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background-repeat: no-repeat; opacity: var(--section-bg-opacity); pointer-events: none;
}
.bg-hero::before { background-image: url('images/bg-hero.png'); background-size: contain; background-position: left bottom; }
/* Final CTA reuses the hero illustration rather than a fourth asset (only
   three were provided) -- mirrored so it doesn't read as an exact repeat
   of the hero section further up the same page. */
.bg-final-cta::before {
  background-image: url('images/bg-hero.png'); background-size: contain;
  background-position: left bottom; transform: scaleX(-1);
}
.eyebrow {
  letter-spacing: 0.1em; font-size: 12px; color: var(--text-secondary);
  text-transform: uppercase; margin: 0 0 8px;
}
.section-title { font-size: 30px; margin: 0 0 12px; }
.section-lead { color: var(--text-secondary); max-width: 640px; margin: 0 0 40px; }
.btn {
  display: inline-block; text-align: center; text-decoration: none;
  padding: 14px 28px; border-radius: 999px; font-weight: 600; font-size: 15px;
  min-height: 48px; line-height: 20px;
}
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-secondary { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.play-badge img { height: 60px; }
.cta-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }

/* decorative side borders -- same asset pool/randomization as /join/<token>.
   `width` intentionally unset -- the browser derives it from each image's
   own aspect ratio (script.js). Narrower viewports scale the whole box
   uniformly around its outer top corner instead of forcing a fixed
   width, so nothing stretches or crops differently than on desktop. */
.border {
  position: fixed; z-index: -1; opacity: 0.5; pointer-events: none;
}
.border-left { left: 0; transform-origin: top left; }
.border-right { right: 0; transform-origin: top right; }
@media (max-width: 1023px) { .border { transform: scale(0.5); opacity: 0.35; } }
/* Homepage spec (docs/017) asks for these mostly hidden on mobile,
   unlike /join/<token> (docs/016) which keeps a faint scaled-down strip
   instead -- two different pages, two different documented decisions. */
@media (max-width: 767px) { .border { display: none; } }

/* header */
.site-header {
  position: relative; /* containing block for .site-nav-links.open on mobile, below */
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; max-width: 1080px; margin: 0 auto;
}
.brand { display: flex; flex-direction: column; }
.brand .tagline { font-size: 12px; color: var(--text-secondary); margin: 2px 0 0; }
.site-nav { display: flex; align-items: center; gap: 24px; }
.site-nav a { text-decoration: none; font-size: 14px; color: var(--text-primary); }
/* Bug (2026-09-23 report): this used to be an inline style="display:flex"
   on the element in portal_chrome.ts, which -- being more specific than
   any external stylesheet rule short of !important -- always beat the
   `display: none` the @media block below tried to set on mobile. The
   links never hid, there was no toggle button to begin with, and the
   full-width row broke the rest of the mobile layout. Fixed by moving
   the base state here (a plain class rule the media query can actually
   override) and adding the toggle button the design (docs/017 §1,
   "Mobile: навігація ховається в menu icon") always called for but
   never got implemented. */
.site-nav-links { display: flex; align-items: center; gap: 24px; }
.icon-btn {
  background: none; border: 1px solid var(--border); border-radius: 999px;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-primary);
}
/* Three plain links (UA/EN/PL), not a <select> -- each generated page
   already knows its own locale-siblings' exact URLs at build time
   (portal_chrome.ts), so a real link needs no JS at all, unlike a
   <select> that would need an onchange handler to navigate anywhere. */
.lang-switch {
  display: flex; align-items: center; gap: 4px; border: 1px solid var(--border);
  border-radius: 999px; padding: 4px; font-size: 12px;
}
.lang-switch a {
  text-decoration: none; color: var(--text-secondary); padding: 4px 8px; border-radius: 999px;
}
.lang-switch a.active { color: var(--on-primary); background: var(--primary); }
.nav-toggle { display: none; }
@media (max-width: 767px) {
  .site-nav-links { display: none; }
  .nav-toggle { display: flex; }
  .site-nav-links.open {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    position: absolute; top: 100%; left: 0; right: 0; z-index: 20;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 12px 24px 16px;
  }
  .site-nav-links.open a { padding: 8px 0; width: 100%; }
}

/* hero -- text column flexible (1fr), image column sized to its own
   content (auto) at every width, not just desktop. Kept side-by-side
   down to the narrowest phones on purpose (2026-09-16 request, reversing
   an earlier "stack to one column on mobile" pass) -- only the sizes
   shrink at each breakpoint, the two-column arrangement itself doesn't
   change. */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; padding-top: 40px; }
.hero h1 { font-size: 44px; line-height: 1.15; margin: 0 0 16px; }
.hero p.lead { color: var(--text-secondary); font-size: 17px; margin: 0 0 28px; max-width: 480px; }
.hero-visual { display: flex; justify-content: center; }
.phone-frame {
  width: 260px; aspect-ratio: var(--screenshot-ratio); border-radius: 32px;
  border: 8px solid var(--surface);
  background: var(--primary-container); box-shadow: 0 20px 60px -20px rgba(0,0,0,0.35);
  overflow: hidden;
}
.phone-frame img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 1023px) {
  .hero { gap: 20px; }
  .hero h1 { font-size: 28px; }
  .hero p.lead { font-size: 14px; margin-bottom: 20px; }
  .phone-frame { width: 140px; }
}
@media (max-width: 480px) {
  .hero { gap: 12px; }
  .hero h1 { font-size: 21px; }
  .hero p.lead { font-size: 12px; margin-bottom: 14px; }
  .cta-row { gap: 10px; }
  .btn { padding: 10px 16px; font-size: 13px; }
  .play-badge img { height: 48px; }
  .phone-frame { width: 84px; border-width: 5px; border-radius: 18px; }
}

/* "Що таке Читопис?" -- 4 theses */
.thesis-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.thesis { display: flex; flex-direction: column; gap: 12px; }
.thesis svg { width: 28px; height: 28px; color: var(--primary); }
.thesis h3 { font-size: 16px; margin: 0; font-family: inherit; }
.thesis p { color: var(--text-secondary); font-size: 14px; margin: 0; }
@media (max-width: 1023px) { .thesis-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .thesis-grid { grid-template-columns: 1fr; } }

/* "Як це працює?" -- 4 steps */
.steps { display: flex; gap: 24px; }
.step { flex: 1; text-align: center; position: relative; }
.step .num {
  width: 36px; height: 36px; border-radius: 999px; background: var(--primary-container);
  color: var(--primary); display: flex; align-items: center; justify-content: center;
  font-weight: 700; margin: 0 auto 12px;
}
.step h3 { font-size: 15px; margin: 0 0 6px; font-family: inherit; }
.step p { color: var(--text-secondary); font-size: 13px; margin: 0; }
@media (max-width: 767px) {
  .steps { flex-direction: column; text-align: left; }
  .step { display: flex; gap: 16px; text-align: left; align-items: flex-start; }
  .step .num { margin: 0; flex-shrink: 0; }
}

.screenshot-placeholder {
  width: 100%; max-width: 320px; aspect-ratio: 9/16; border-radius: 20px;
  background: var(--surface); border: 1px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 13px; text-align: center; padding: 16px;
}
/* Declared here (before the responsive overrides below), not down in the
   "screens carousel" section with .screen-shot's other properties -- same
   specificity as those media-query rules, so declaration order decides
   ties, and this needs to lose to them at narrow widths, not win by
   virtue of coming later in the file. */
.screen-shot { max-width: 320px; }
@media (max-width: 1023px) {
  .screenshot-placeholder, .screen-shot { max-width: 150px; }
}
@media (max-width: 480px) {
  .screenshot-placeholder { max-width: 90px; padding: 8px; font-size: 10px; }
  .screen-shot { max-width: 90px; }
}

/* screens carousel */
.screens-track {
  display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 8px 0 24px; -webkit-overflow-scrolling: touch;
}
.screens-track::-webkit-scrollbar { display: none; }
.screen-slide { flex: 0 0 auto; scroll-snap-align: center; width: 240px; }
.screen-slide .screenshot-placeholder, .screen-slide .screen-shot { max-width: none; }
/* Real screenshots (carousel slides -- as opposed to still-placeholder
   ones -- and the two feature-block visuals). Border + shadow -- without
   them the image just floats with no visible edge against the page
   background (2026-09-16 report: looked frameless next to the
   still-dashed-border placeholder slides). `max-width` (declared up near
   .screenshot-placeholder, not here -- see that comment) sizes this
   predictably in .feature-visual (a flex item with no width of its own,
   so a bare `width: 100%` here would have nothing concrete to be 100%
   of) -- cancelled inside .screen-slide above, where the fixed-width
   slide itself should govern sizing instead. */
.screen-shot {
  width: 100%; aspect-ratio: var(--screenshot-ratio); border-radius: 20px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 12px 32px -18px rgba(0,0,0,0.35);
}
.screen-shot img { width: 100%; height: 100%; object-fit: cover; }
.screen-slide figcaption { text-align: center; margin-top: 10px; font-size: 13px; color: var(--text-secondary); }
.screens-nav { display: flex; align-items: center; justify-content: center; gap: 16px; }
.screens-dots { display: flex; justify-content: center; gap: 8px; }
.screens-dots button {
  width: 8px; height: 8px; border-radius: 999px; border: none; background: var(--border);
  padding: 0; cursor: pointer;
}
.screens-dots button.active { background: var(--primary); }

/* feature carousel (docs/035) -- replaces the old pair of alternating
   .feature/.feature.reverse two-column sections. Same scroll-snap +
   dots/arrows pattern as the screens carousel above (shared JS,
   script.js's initCarousel), but each slide stacks a screenshot above
   its own title+paragraph instead of just a one-line caption, so the
   slide needs to be its own (wider) component rather than reusing
   .screen-slide as-is. */
.features-track {
  display: flex; gap: 32px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 8px 0 24px; -webkit-overflow-scrolling: touch;
}
.features-track::-webkit-scrollbar { display: none; }
.feature-slide {
  flex: 0 0 auto; scroll-snap-align: center; width: 280px; margin: 0;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.feature-slide .screen-shot { max-width: none; margin-bottom: 20px; }
.feature-slide h3 { font-size: 20px; margin: 0 0 8px; }
.feature-slide p { color: var(--text-secondary); font-size: 14px; margin: 0; }
.features-nav { display: flex; align-items: center; justify-content: center; gap: 16px; }
.features-dots { display: flex; justify-content: center; gap: 8px; }
.features-dots button {
  width: 8px; height: 8px; border-radius: 999px; border: none; background: var(--border);
  padding: 0; cursor: pointer;
}
.features-dots button.active { background: var(--primary); }
@media (max-width: 480px) {
  .feature-slide { width: 200px; }
  .feature-slide h3 { font-size: 16px; }
  .feature-slide p { font-size: 13px; }
}

/* "Для кого це?" */
.audience-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.audience-card {
  background: var(--card); border-radius: 16px; padding: 24px; border: 1px solid var(--border);
}
.audience-card h3 { font-size: 16px; margin: 0 0 8px; font-family: inherit; }
.audience-card p { color: var(--text-secondary); font-size: 14px; margin: 0; }
@media (max-width: 1023px) { .audience-grid { grid-template-columns: 1fr; } }

/* "Коротко про Читопис" + "Часті запитання" (scripts/portal_facts.ts) */
.facts-list { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 40px; margin: 0; }
.facts-list dt { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.facts-list dd { color: var(--text-secondary); font-size: 14px; margin: 0; }
@media (max-width: 767px) { .facts-list { grid-template-columns: 1fr; } }

.faq-list { max-width: 760px; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary { cursor: pointer; font-size: 16px; font-weight: 600; padding: 14px 0; }
.faq-item p { color: var(--text-secondary); font-size: 14px; margin: 0 0 16px; }

/* legal pages (/privacy, /terms, /community-guidelines --
   scripts/generate_legal_pages.ts). Only `max-width` overridden here,
   never `padding` -- a shorthand `padding` on a class sharing an element
   with .container already broke horizontal padding once elsewhere on
   this page (feature-section, 2026-09-16), not repeating that. */
.legal-article { max-width: 720px; padding-top: 48px; padding-bottom: 80px; }
.legal-article h1 { font-size: 32px; margin: 0 0 8px; }
.legal-article h2 { font-size: 20px; margin: 32px 0 8px; color: var(--primary); }
.legal-article p { margin: 0 0 12px; line-height: 1.6; }
.legal-article ul { margin: 0 0 12px; padding-left: 20px; }
.legal-article li { margin-bottom: 4px; line-height: 1.6; }
.legal-article strong { font-weight: 700; }
.legal-article s { text-decoration: line-through; }

/* /join/<token> (docs/016_web_platform_design.md). Since 2026-10-12
   (docs/050) it is built on /u/<username>'s .profile-card below, with
   the space owner in the hero -- the same way the app's join screens
   open with SpaceOwnerHero. Only the book-specific pieces live here;
   .join-divider is shared with /u's Play Store block. */
/* Doubled class: .profile-content (center) is defined further down. */
.profile-content.join-content { text-align: left; }
.join-content .eyebrow { margin-top: 20px; }
.join-content .profile-actions { text-align: center; }
.book-row { display: flex; gap: 16px; align-items: flex-start; }
.book-row .cover {
  width: 96px; height: 138px; object-fit: cover; border-radius: 4px;
  flex-shrink: 0; background: var(--primary-container);
}
.book-row .title { font-size: 24px; margin: 0 0 4px; overflow-wrap: anywhere; }
.book-row .author { color: var(--text-secondary); margin: 0; }
.quote { border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin: 20px 0; font-style: italic; }
.quote.rich-text { font-style: normal; }
.quote.rich-text > :first-child { margin-top: 0; }
.quote.rich-text > :last-child { margin-bottom: 0; }
.join-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-secondary); font-size: 12px; letter-spacing: 0.1em; }
.join-divider::before, .join-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
@media (max-width: 480px) {
  .book-row .cover { width: 76px; height: 110px; }
  .book-row .title { font-size: 19px; }
}

/* Shared review (/r/<public_id>, docs/052): the /join card with the
   review's author in the hero and the full text in .quote.rich-text. */
.review-author-links { margin: 4px 0 8px; }
.review-rating { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; }
.review-stars {
  font-size: 18px; letter-spacing: 2px; line-height: 1;
  background: linear-gradient(90deg, var(--primary) var(--rating), var(--border) var(--rating));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.review-rating-value { color: var(--primary); font-weight: 600; }
.review-date { margin: 16px 0 0; color: var(--text-secondary); font-size: 13px; }
.review-text { line-height: 1.6; overflow-wrap: anywhere; }
.review-text p { margin: 0 0 10px; }
.review-text ul { margin: 0 0 6px; padding-left: 20px; }
.review-text blockquote {
  margin: 0 0 10px; padding: 2px 0 2px 14px;
  border-left: 3px solid var(--primary); color: var(--text-secondary); font-style: italic;
}
.review-text details.spoiler {
  margin: 0 0 10px; padding: 10px 14px; border-radius: 10px; background: var(--surface);
}
.review-text details.spoiler summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.review-text details.spoiler[open] summary { margin-bottom: 8px; }
.review-text details.spoiler > :last-child { margin-bottom: 0; }
.review-counts { margin: 18px auto 6px; }
.review-comments-hint { text-align: center; }
.review-cta {
  margin-top: 24px; padding: 20px; border-radius: 14px;
  background: var(--primary-container); text-align: left;
}
.review-cta h2 { margin: 0 0 8px; font-size: 20px; }
.review-cta p { margin: 0 0 14px; line-height: 1.5; }
.review-cta .btn { display: block; width: 100%; text-align: center; }

/* Public user profile (/u/<username>, docs/032). The narrow, centered
   composition mirrors the mobile profile while retaining the portal's
   shared header, footer, typography, theme tokens, and breakpoints. */
.profile-main { padding: 20px 20px 64px; }
.profile-card {
  width: 100%; max-width: 560px; margin: 0 auto; overflow: hidden;
  background: var(--bg); border: 1px solid var(--border); border-radius: 24px;
}
.profile-hero { position: relative; height: 300px; background: var(--primary-container); }
.profile-cover { width: 100%; height: 100%; object-fit: cover; }
.profile-cover-fallback {
  background: radial-gradient(circle at 50% 30%, var(--primary-container), var(--surface) 75%);
}
.profile-hero-shade {
  position: absolute; inset: 35% 0 0;
  background: linear-gradient(to bottom, transparent, var(--bg));
}
.profile-identity {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 12px;
  min-height: 112px; margin: -56px 32px 0; text-align: left;
}
.profile-identity-text { min-width: 0; }
.profile-identity h1, .profile-identity h2 { margin: 0; font-size: 30px; line-height: 1.15; overflow-wrap: anywhere; }
/* On /join the owner's name is an h2 (the book title is the page's h1)
   and links to their public profile. */
.profile-identity h2 { font-size: 24px; }
.profile-identity a { color: inherit; text-decoration: none; }
.profile-identity a:hover { text-decoration: underline; }
.profile-content { position: relative; width: 100%; padding: 0 32px 32px; text-align: center; }
.profile-avatar {
  width: 112px; height: 112px; margin: 0; position: relative; flex: 0 0 112px;
  border-radius: 50%; border: 3px solid var(--primary); background: var(--surface);
  object-fit: cover; box-shadow: 0 8px 24px #0004;
}
.profile-avatar-fallback { display: flex; align-items: center; justify-content: center; }
.profile-avatar-fallback img { width: 52px; height: 52px; object-fit: contain; }
.profile-username { margin: 4px 0 0; color: var(--text-secondary); font-size: 14px; }
.profile-bio { max-width: 440px; margin: 18px auto 0; line-height: 1.5; white-space: pre-line; }
.profile-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 20px 0; }
.profile-link {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  flex: 0 0 auto; min-width: 0; max-width: 100%; padding: 9px 14px 24px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  text-align: left; text-decoration: none; font-size: 13px;
}
.profile-link:hover { border-color: var(--primary); }
.profile-link-mark {
  display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--primary-container); color: var(--text-primary); font-weight: 700;
}
.profile-link-copy { display: flex; min-width: 0; flex-direction: column; }
.profile-link-label { line-height: 1.2; }
.profile-link-url {
  position: absolute; right: 14px; bottom: 8px; left: 14px;
  overflow: hidden; color: var(--text-secondary); font-size: 10px; line-height: 1.2;
  direction: rtl; text-align: right; text-overflow: ellipsis; white-space: nowrap;
}
.profile-counts { display: flex; justify-content: center; margin: 22px auto; }
.profile-counts div { min-width: 130px; padding: 0 18px; display: flex; flex-direction: column; }
.profile-counts div + div { border-left: 1px solid var(--border); }
.profile-counts strong { font-family: 'Playfair Display', Georgia, serif; font-size: 24px; }
.profile-counts span { margin-top: 2px; color: var(--text-secondary); font-size: 12px; }
.profile-actions { margin-top: 12px; padding: 0; }
.profile-actions .btn { display: block; width: 100%; margin-top: 12px; }
.profile-action-hint { margin: 10px auto 0; color: var(--text-secondary); font-size: 12px; }
.profile-qr {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 14px 0 0; padding: 14px; border-radius: 14px; background: var(--surface); text-align: left;
}
.profile-qr svg { width: 120px; height: 120px; flex: 0 0 120px; border-radius: 6px; }
.profile-qr p { margin: 0; max-width: 190px; color: var(--text-secondary); font-size: 13px; line-height: 1.4; }
.profile-qr-code { margin-top: 10px; letter-spacing: 0.3em; font-weight: 600; font-size: 18px; }
.profile-actions .play-badge { display: inline-block; margin-top: 16px; }
.profile-actions .play-badge img { margin: 0 auto; }
.profile-blurb { margin-top: 28px; padding: 20px; border-radius: 14px; background: var(--surface); text-align: left; }
.profile-blurb h2 { margin: 0 0 8px; font-size: 18px; }
.profile-blurb p { margin: 0; color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
.profile-not-found { max-width: 560px; margin: 30px auto; padding: 72px 24px; text-align: center; }
.profile-not-found h1 { margin: 0 0 12px; }
.profile-not-found p { color: var(--text-secondary); }
@media (max-width: 600px) {
  .profile-main { padding: 0 0 40px; }
  .profile-card { width: 100vw; max-width: 100vw; border-left: 0; border-right: 0; border-radius: 0; }
  .profile-hero { height: 240px; }
  .profile-identity { margin-left: 20px; margin-right: 20px; }
  .profile-identity h1 { font-size: 26px; }
  .profile-identity h2 { font-size: 22px; }
  .profile-content { width: 100vw; max-width: 100vw; padding: 0 20px 24px; }
  .profile-bio { max-width: calc(100vw - 40px); }
  .profile-qr { gap: 12px; padding: 12px; }
  .profile-qr svg { width: 104px; height: 104px; flex-basis: 104px; }
  .profile-qr p { flex: 1; max-width: none; font-size: 12px; }
}

/* final CTA */
.final-cta { text-align: center; }
.final-cta h2 { font-size: 28px; margin: 0 0 8px; }
.final-cta p { color: var(--text-secondary); margin: 0 0 28px; }
.final-cta .cta-row { justify-content: center; }
@media (max-width: 767px) {
  .final-cta .cta-row { flex-direction: column; align-items: stretch; }
  .final-cta .btn { width: 100%; }
}

/* footer -- same visual identity as /join/<token>'s footer, extended
   with the extra links this page's spec calls for (docs/017) */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer-brand .tagline { color: var(--text-secondary); font-size: 13px; margin: 2px 0 0; }
.footer-links { display: flex; gap: 40px; flex-wrap: wrap; }
.footer-links h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary); margin: 0 0 10px; }
.footer-links a { display: block; text-decoration: none; font-size: 14px; margin-bottom: 8px; }
.footer-bottom { color: var(--text-secondary); font-size: 12px; margin-top: 32px; }
@media (max-width: 767px) {
  .footer-inner { flex-direction: column; }
  .footer-links { gap: 24px; }
}
