/* ===========================================================================
   benwiddowson.com — site components
   Built on top of /site/tokens.css (slots + .btn/.card/.nav/.app-tile/.site-footer).
   Light = purple, dark = green. Components reference tokens only.
   =========================================================================== */

* { box-sizing: border-box; }
img { max-width: 100%; }
html { scroll-behavior: smooth; }
.doc-section, .doc-article [id] { scroll-margin-top: 84px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 24px; }

/* ---- Skip link ---- */
.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--text-on-accent); padding: 12px 18px; border-radius: 0 0 12px 0; font-weight: 700; z-index: 100; }
.skip-link:focus { left: 0; }

/* ---- Segmented / pill switch (language, theme) ---- */
.lang-switch { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-sunken); border-radius: var(--radius-pill); }
.lang-switch a { padding: 6px 12px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 700; color: var(--text-muted); text-decoration: none; line-height: 1.4; }
.lang-switch a:hover { color: var(--accent-strong); }
.lang-switch a[aria-current="page"] { background: var(--surface-card); color: var(--accent-strong); box-shadow: var(--shadow-card); }

.theme-toggle { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid var(--border-subtle); background: var(--surface-card); color: var(--text-heading); font: 600 14px/1 var(--font-body); cursor: pointer; }
.theme-toggle:hover { box-shadow: var(--shadow-card); }

/* ===========================================================================
   Header
   =========================================================================== */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--surface-card); border-bottom: 1px solid var(--border-subtle); }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; }

.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-wordmark); font-size: 20px; line-height: 1.5; color: var(--text-heading); text-decoration: none; white-space: nowrap; }
.brand-mark { width: 32px; height: 32px; object-fit: contain; flex: none; }

.site-nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; justify-content: center; }
.site-header-actions { display: flex; align-items: center; gap: 10px; }
.menu-toggle { display: none; height: 44px; padding: 0 18px; border-radius: var(--radius-pill); border: 1px solid var(--border-subtle); background: var(--surface-card); color: var(--text-heading); font: 600 15px/1 var(--font-body); cursor: pointer; }

.mobile-sheet { display: none; flex-direction: column; gap: 4px; padding: 12px 16px 20px; background: var(--surface-card); border-bottom: 1px solid var(--border-subtle); }
.mobile-sheet.is-open { display: flex; }
.mobile-sheet .nav a { padding: 12px 14px; border-radius: 14px; font-size: 17px; }
.mobile-sheet-controls { display: flex; gap: 8px; align-items: center; padding-top: 10px; flex-wrap: wrap; }

@media (max-width: 819px) {
  .site-nav, .site-header-actions .lang-switch, .site-header-actions .theme-toggle { display: none; }
  .menu-toggle { display: inline-flex; align-items: center; }
}

/* ===========================================================================
   Hero
   =========================================================================== */
.hero { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 40px; align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 14px; }
.hero-eyebrow { font-family: var(--font-display); font-size: 22px; line-height: 1.4; color: var(--accent-strong); }
.hero h1 { margin: 0; font-family: var(--font-wordmark); font-weight: 400; font-size: clamp(40px, 6vw, 62px); line-height: 1.3; color: var(--text-heading); }
.hero-role { font-size: 15px; font-weight: 700; color: var(--text-muted); }
.hero-lead { margin: 0; max-width: 52ch; font-size: 18px; line-height: var(--leading-body); color: var(--text-body); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 8px; }
.hero-photo { aspect-ratio: 4/5; object-fit: cover; max-width: 300px; width: 100%; justify-self: center; border-radius: 40px; background: var(--surface-sunken); box-shadow: var(--shadow-raised); }

@media (max-width: 819px) {
  .hero { grid-template-columns: 1fr; }
  .hero-photo { max-width: 220px; }
}

/* ===========================================================================
   Sections
   =========================================================================== */
main { display: flex; flex-direction: column; gap: 72px; padding: 48px 0 96px; }
.section { display: flex; flex-direction: column; gap: 24px; }
.section-head { display: flex; flex-direction: column; gap: 6px; }
.section-title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1.45; color: var(--text-heading); }
.section-lead { margin: 0; max-width: 60ch; font-size: 17px; line-height: var(--leading-body); color: var(--text-body); }
.page-title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(34px, 5vw, 48px); line-height: 1.4; color: var(--text-heading); }

/* ===========================================================================
   App cards + tiles
   =========================================================================== */
.app-tile { width: 52px; height: 52px; border-radius: 15px; display: flex; align-items: center; justify-content: center; flex: none; font-family: var(--font-wordmark); font-size: 17px; }
.app-tile-lg { width: 72px; height: 72px; border-radius: 20px; font-size: 22px; }
.app-tile-sm { width: 40px; height: 40px; border-radius: 12px; font-size: 14px; }
img.app-tile, img.app-tile-lg, img.app-tile-sm { object-fit: cover; background: var(--surface-sunken); }

.icon-row { display: flex; gap: 10px; flex-wrap: wrap; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--radius-pill); background: var(--surface-sunken); color: var(--text-heading); font-size: 18px; text-decoration: none; transition: background .2s, color .2s, transform .2s; flex: none; }
.icon-btn:hover { background: var(--accent-soft); color: var(--accent-strong); transform: translateY(-2px); }

.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.app-card { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 22px; background: var(--surface-card); border: 1px solid var(--card-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); transition: transform .2s, box-shadow .2s; }
.app-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.app-card-head { display: flex; align-items: center; gap: 14px; }
.app-card-name-group { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.app-card-name-link { text-decoration: none; }
.app-card-name-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg); }
.app-card-name { font-size: 17px; font-weight: 700; line-height: 1.3; color: var(--text-heading); }
.app-card-platform { font-size: 13px; color: var(--text-muted); }
.app-card-desc { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text-body); flex: 1; }
.app-card-links { position: relative; z-index: 1; display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; font-weight: 600; }

.quicklinks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.quicklink { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface-card); border: 1px solid var(--card-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); text-decoration: none; transition: transform .2s; }
.quicklink:hover { transform: translateY(-3px); }
.quicklink-name { font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--text-heading); }
.quicklink-meta { font-size: 13px; color: var(--text-muted); }

/* ===========================================================================
   Projects list
   =========================================================================== */
.projects-list { background: var(--surface-card); border: 1px solid var(--card-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: hidden; }
.project-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 22px; border-top: 1px solid var(--border-subtle); text-decoration: none; }
.project-row:first-child { border-top: none; }
.project-row-name { font-size: 16px; font-weight: 700; color: var(--text-heading); }
.project-row-desc { font-size: 14px; color: var(--text-muted); }
.project-row-kind { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--surface-raised); color: var(--text-body); flex: none; }

/* ===========================================================================
   Contact / promise panels
   =========================================================================== */
.panel-promise { background: var(--accent-soft); border-radius: var(--radius-xl); padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.panel-promise .section-title { color: var(--accent-strong); }
.panel-promise-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.panel-promise-pills a { padding: 9px 14px; border-radius: var(--radius-pill); background: var(--surface-card); color: var(--text-heading); font-size: 14px; font-weight: 600; text-decoration: none; }

.panel-card { display: flex; flex-direction: column; gap: 14px; padding: 32px; background: var(--surface-card); border: 1px solid var(--card-border); border-radius: var(--radius-xl); box-shadow: var(--shadow-card); }
.panel-card .section-title { margin: 0; }
.panel-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===========================================================================
   Breadcrumb + app page header
   =========================================================================== */
.breadcrumb { display: flex; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--text-muted); margin: 0 0 8px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent-strong); }
.breadcrumb .current { color: var(--text-heading); }

.app-page-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 28px; }
.app-page-head h1 { margin: 0; font-family: var(--font-wordmark); font-weight: 400; font-size: clamp(28px, 4vw, 40px); line-height: 1.35; color: var(--text-heading); }
.app-page-meta { font-size: 15px; color: var(--text-muted); }

/* ===========================================================================
   App detail page (overview)
   =========================================================================== */
.app-detail { display: flex; flex-direction: column; gap: 28px; }
.app-detail-body { max-width: 68ch; display: flex; flex-direction: column; gap: 16px; }
.app-detail-body p { margin: 0; font-size: 17px; line-height: var(--leading-body); color: var(--text-body); }
.app-screenshot { display: block; width: 100%; max-width: 420px; height: auto; border-radius: var(--radius-2xl); background: var(--surface-sunken); box-shadow: var(--shadow-raised); }
.app-screenshot-placeholder { display: flex; align-items: center; justify-content: center; width: 100%; max-width: 420px; aspect-ratio: 9/16; border-radius: var(--radius-2xl); background: var(--surface-sunken); border: 2px dashed var(--border-subtle); color: var(--text-faint); font-size: 14px; font-weight: 600; text-align: center; padding: 24px; }
.app-detail-links { display: flex; gap: 16px; flex-wrap: wrap; font-size: 15px; font-weight: 600; }
.app-store-btn { display: inline-flex; align-items: center; gap: 8px; }

/* ===========================================================================
   Doc layout (privacy / support pages)
   =========================================================================== */
.doc-toggle-row { margin-bottom: 8px; }
.doc-grid { display: grid; grid-template-columns: 200px minmax(0,1fr); gap: 40px; align-items: start; }
.doc-toc { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 84px; }
.doc-toc-label { font-size: 13px; font-weight: 700; color: var(--text-muted); padding: 0 12px 8px; }
.doc-toc a { padding: 8px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--text-muted); text-decoration: none; }
.doc-toc a:hover { color: var(--accent-strong); }
.doc-toc a[aria-current="true"] { color: var(--accent-strong); background: var(--accent-soft); }
.doc-article { display: flex; flex-direction: column; gap: 28px; max-width: 68ch; min-width: 0; }

.doc-summary { display: flex; flex-direction: column; gap: 8px; padding: 24px; background: var(--accent-soft); border-radius: var(--radius-xl); }
.doc-summary-eyebrow { font-family: var(--font-display); font-size: 21px; line-height: 1.4; color: var(--accent-strong); }
.doc-summary p { margin: 0; font-size: 17px; font-weight: 600; line-height: var(--leading-body); color: var(--text-heading); }

.doc-section { display: flex; flex-direction: column; gap: 10px; }
.doc-section h2 { margin: 0; font-family: var(--font-body); font-size: 22px; font-weight: 700; line-height: 1.35; color: var(--text-heading); }
.doc-section p, .doc-section li { margin: 0; font-size: 17px; line-height: var(--leading-body); color: var(--text-body); }
.doc-section ul { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }

.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: var(--surface-card); border: 1px solid var(--card-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 0 22px; }
.faq-item summary { list-style: none; cursor: pointer; padding: 18px 0; font-size: 17px; font-weight: 700; color: var(--text-heading); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--accent); font-size: 20px; line-height: 1; flex: none; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { margin: 0; padding: 0 0 20px; font-size: 16px; line-height: var(--leading-body); color: var(--text-body); }

.stuck-panel { display: flex; flex-direction: column; gap: 12px; padding: 24px; background: var(--surface-sunken); border-radius: var(--radius-lg); }
.stuck-panel-title { font-size: 18px; font-weight: 700; color: var(--text-heading); }
.stuck-panel p { margin: 0; font-size: 16px; line-height: var(--leading-body); color: var(--text-body); }

@media (max-width: 819px) {
  .doc-grid { grid-template-columns: 1fr; }
  .doc-toc { display: none; }
}

/* ===========================================================================
   Sitemap
   =========================================================================== */
.sitemap-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.sitemap-group { display: flex; flex-direction: column; gap: 4px; padding: 20px 22px; background: var(--surface-card); border: 1px solid var(--card-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.sitemap-group-title { font-size: 16px; font-weight: 700; color: var(--text-heading); padding-bottom: 6px; }
.sitemap-group a { font-size: 15px; line-height: 1.5; padding: 3px 0; }

.private-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border: 2px dashed var(--border-subtle); border-radius: 14px; background: var(--surface-sunken); margin-bottom: 8px; }
.private-pill { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--text-heading); color: var(--bg-page); }

/* ===========================================================================
   Footer
   =========================================================================== */
.site-footer-inner { display: flex; flex-direction: column; gap: 28px; padding: 40px 24px 28px; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 28px; }
.footer-brand { display: flex; flex-direction: column; gap: 6px; }
.footer-brand .wordmark { font-size: 22px; }
.footer-made { font-family: var(--font-display); font-size: 17px; line-height: 1.5; color: var(--text-muted); }
.footer-links { display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.footer-links a { text-decoration: none; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 20px; border-top: 1px solid var(--border-subtle); }
.footer-copyright { font-size: 13px; color: var(--text-muted); }

/* ===========================================================================
   "Hi" landing page
   =========================================================================== */
.hi-wrap { min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.hi-card { max-width: 520px; width: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; padding: 48px 32px; background: var(--surface-card); border: 1px solid var(--card-border); border-radius: var(--radius-2xl); box-shadow: var(--shadow-raised); }
.hi-card img { width: 104px; height: 104px; border-radius: var(--radius-pill); object-fit: cover; background: var(--surface-sunken); }
.hi-card h1 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 44px; line-height: 1.4; color: var(--text-heading); }
.hi-card p { margin: 0; font-size: 18px; line-height: var(--leading-body); color: var(--text-body); }
.hi-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; padding-top: 8px; }

/* ===========================================================================
   Placeholder screenshots (generic use)
   =========================================================================== */
.placeholder-note { font-size: 13px; color: var(--text-faint); font-style: italic; }
