/* ==========================================================================
   Roy Lab (roylab.cc) — Design System
   Inspired by pomodiary.com: grid canvas + framed vertical sheet +
   floating pill navbar + zinc/lime editorial restraint.
   ========================================================================== */

:root {
  /* Light Theme Tokens */
  --bg-canvas: #f4f4f5;
  --grid-line: rgba(24, 24, 27, 0.055);
  --bg-sheet: rgba(250, 250, 250, 0.92);
  --border-sheet: rgba(24, 24, 27, 0.07);

  --bg-pill: rgba(255, 255, 255, 0.9);
  --border-pill: rgba(24, 24, 27, 0.08);
  --shadow-pill: 0 8px 24px -4px rgba(24, 24, 27, 0.06), 0 1px 2px rgba(24, 24, 27, 0.04);

  --bg-card-hover: rgba(244, 244, 245, 0.95);
  --card-hover-border: rgba(24, 24, 27, 0.22);
  --bg-surface: rgba(255, 255, 255, 0.65);
  --border-subtle: rgba(24, 24, 27, 0.08);
  --border-strong: rgba(24, 24, 27, 0.14);

  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-muted: #71717a;

  --accent: #65a30d;
  --accent-hover: #4d7c0f;
  --accent-soft: rgba(101, 163, 13, 0.1);
  --accent-border: rgba(101, 163, 13, 0.25);

  --btn-primary-bg: #18181b;
  --btn-primary-text: #fafafa;
  --btn-primary-hover: #27272a;

  --icon-badge-bg: #ffffff;
  --icon-badge-border: rgba(24, 24, 27, 0.08);
  --icon-badge-shadow: 0 4px 12px rgba(24, 24, 27, 0.06), 0 1px 2px rgba(24, 24, 27, 0.04);

  --modal-backdrop: rgba(24, 24, 27, 0.45);
  --modal-bg: #ffffff;

  --font-sans: 'Manrope', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  --sheet-max: 1280px;
  --content-max: 1024px;
  --prose-max: 680px;
}

html.dark {
  /* Dark Theme Tokens (Default, matching pomodiary.com) */
  --bg-canvas: #09090b;
  --grid-line: rgba(255, 255, 255, 0.045);
  --bg-sheet: rgba(24, 24, 27, 0.86);
  --border-sheet: rgba(161, 161, 170, 0.16);

  --bg-pill: rgba(39, 39, 42, 0.9);
  --border-pill: rgba(255, 255, 255, 0.1);
  --shadow-pill: 0 10px 28px -6px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.3);

  --bg-card-hover: rgba(39, 39, 42, 0.52);
  --card-hover-border: rgba(161, 161, 170, 0.38);
  --bg-surface: rgba(39, 39, 42, 0.35);
  --border-subtle: rgba(161, 161, 170, 0.16);
  --border-strong: rgba(161, 161, 170, 0.28);

  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  --accent: #a3e635;
  --accent-hover: #bef264;
  --accent-soft: rgba(163, 230, 53, 0.12);
  --accent-border: rgba(163, 230, 53, 0.3);

  --btn-primary-bg: #f4f4f5;
  --btn-primary-text: #18181b;
  --btn-primary-hover: #ffffff;

  --icon-badge-bg: #ffffff;
  --icon-badge-border: rgba(255, 255, 255, 0.14);
  --icon-badge-shadow: 0 6px 16px rgba(0, 0, 0, 0.32), 0 1px 3px rgba(0, 0, 0, 0.2);

  --modal-backdrop: rgba(0, 0, 0, 0.72);
  --modal-bg: #18181b;
}

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

html {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.65;
  position: relative;
}

/* Fixed Full-Viewport Subtle Grid Canvas */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 28px 28px;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

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

/* Framed Vertical Sheet */
.site-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--sheet-max);
  min-height: 100vh;
  margin: 0 auto;
  background-color: var(--bg-sheet);
  border-left: 1px solid var(--border-sheet);
  border-right: 1px solid var(--border-sheet);
  display: flex;
  flex-direction: column;
}

.inner {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
}

/* ==========================================================================
   Sticky Top Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: 24px;
  padding-bottom: 12px;
  pointer-events: none;
}

.header-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  pointer-events: auto;
}

.header-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  background-color: transparent;
  border: 1px solid var(--border-pill);
  box-shadow: var(--shadow-pill);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.header-avatar:hover {
  transform: translateY(-1px);
  border-color: var(--accent-border);
}

.header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9999px;
}

.nav-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 42px;
  padding: 0 12px;
  border-radius: 9999px;
  background-color: var(--bg-pill);
  border: 1px solid var(--border-pill);
  box-shadow: var(--shadow-pill);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  transition: color 0.18s ease;
}

.nav-link:hover {
  color: var(--accent);
}

.nav-link.is-active {
  color: var(--accent);
}

.nav-link.is-active::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  pointer-events: auto;
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  background-color: var(--bg-pill);
  border: 1px solid var(--border-pill);
  box-shadow: var(--shadow-pill);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-secondary);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.theme-btn:hover {
  color: var(--accent);
  border-color: var(--accent-border);
  transform: translateY(-1px);
}

.theme-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html.dark .icon-sun { display: block; }
html.dark .icon-moon { display: none; }
html:not(.dark) .icon-sun { display: none; }
html:not(.dark) .icon-moon { display: block; }

/* ==========================================================================
   Main Content & Hero (Homepage)
   ========================================================================== */
main {
  flex: 1 0 auto;
}

.hero {
  padding-top: 56px;
  padding-bottom: 16px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 9999px;
  background-color: transparent;
  border: 1px solid var(--border-pill);
  box-shadow: var(--shadow-pill);
  overflow: hidden;
  margin-bottom: 24px;
}

.hero-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9999px;
}

.hero-title {
  margin: 0;
  font-size: clamp(36px, 5vw, 48px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.hero-desc {
  margin: 20px 0 0;
  max-width: 620px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-secondary);
}

.hero-meta {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.hero-meta-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background-color: var(--accent);
  margin-right: 6px;
  vertical-align: middle;
}

.hero-meta-sep {
  opacity: 0.4;
}

/* ==========================================================================
   Products Section & Filter Bar
   ========================================================================== */
.products-section {
  margin-top: 64px;
  padding-bottom: 40px;
}

.section-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 44px;
}

.section-title {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  line-height: 1.2;
}

.section-count {
  margin-left: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  vertical-align: middle;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill {
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  background-color: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all 0.18s ease;
}

.filter-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.filter-pill.is-active {
  background-color: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

/* 3-Column Open Product Grid (Pomodiary Signature) */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 48px;
  row-gap: 56px;
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-decoration: none;
  outline: none;
}

/* Full-card hover surface reveal */
.product-card::before {
  content: '';
  position: absolute;
  inset: -18px -22px;
  border-radius: 18px;
  background-color: var(--bg-card-hover);
  border: 1px dashed var(--card-hover-border);
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 0;
  pointer-events: none;
}

.product-card:hover::before,
.product-card:focus-visible::before {
  opacity: 1;
  transform: scale(1);
}

.product-card > * {
  position: relative;
  z-index: 1;
}

.product-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background-color: var(--icon-badge-bg);
  border: 1px solid var(--icon-badge-border);
  box-shadow: var(--icon-badge-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.product-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-icon svg {
  width: 24px;
  height: 24px;
}

.product-head {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 6px 8px;
  flex-wrap: wrap;
}

.product-name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.product-tags {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.platform-tag {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 9999px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  line-height: 1.4;
}

.status-tag {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 9999px;
  background-color: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  line-height: 1.4;
}

.product-summary {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-foot {
  margin-top: 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.18s ease, transform 0.18s ease;
}

.product-card:hover .product-foot,
.product-card:focus-visible .product-foot {
  color: var(--accent);
  transform: translateY(-2px);
}

/* ==========================================================================
   Product Detail Page (product.html)
   ========================================================================== */
.detail-wrap {
  padding-top: 36px;
  padding-bottom: 48px;
  max-width: 780px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.18s ease;
  margin-bottom: 32px;
}

.back-link:hover {
  color: var(--accent);
}

.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.detail-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background-color: var(--icon-badge-bg);
  border: 1px solid var(--icon-badge-border);
  box-shadow: var(--icon-badge-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  margin-top: 4px;
}

.detail-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-icon svg {
  width: 30px;
  height: 30px;
}

.detail-title {
  margin: 0;
  font-size: clamp(30px, 4.5vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-primary);
}

.detail-tagline {
  margin: 10px 0 0;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* 3-Column Metadata Box (Pomodiary Signature) */
.meta-box {
  margin-top: 32px;
  padding: 22px 26px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.meta-cell-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.meta-cell-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
}

/* Action CTA Row */
.detail-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 9999px;
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.btn-primary:hover {
  background-color: var(--btn-primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 9999px;
  background-color: transparent;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.btn-secondary:hover {
  border-color: var(--accent-border);
  color: var(--accent);
  transform: translateY(-1px);
}

.status-notice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  font-size: 14px;
  color: var(--text-secondary);
}

.detail-section {
  margin-top: 48px;
}

.detail-section h2 {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.detail-section p {
  margin: 0 0 16px;
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.detail-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.85;
}

.detail-list li {
  margin-bottom: 8px;
}

.detail-list li::marker {
  color: var(--accent);
}

/* Inline QR Preview Card on Product Detail */
.qr-card {
  margin-top: 20px;
  padding: 20px 24px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  display: inline-flex;
  align-items: center;
  gap: 20px;
  max-width: 100%;
}

.qr-thumb {
  width: 112px;
  height: 112px;
  border-radius: 12px;
  background-color: #ffffff;
  padding: 8px;
  flex-shrink: 0;
}

.qr-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-card-info strong {
  display: block;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.qr-card-info span {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   About Page (about.html — Editorial Prose, matching pomodiary.com/about)
   ========================================================================== */
.prose-wrap {
  padding-top: 44px;
  padding-bottom: 56px;
  max-width: var(--prose-max);
}

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.prose-title {
  margin: 0;
  font-size: clamp(32px, 4.8vw, 46px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-primary);
}

.prose-body {
  margin-top: 28px;
}

.prose-body p {
  margin: 0 0 20px;
  font-size: 16px;
  line-height: 1.82;
  color: var(--text-secondary);
}

.prose-body h2 {
  margin: 44px 0 16px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.prose-body h3 {
  margin: 26px 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.prose-list {
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.85;
}

.prose-list li {
  margin-bottom: 6px;
}

.prose-list a {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 4px;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

.prose-list a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: 96px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 36px;
  padding-bottom: 56px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.footer-copy {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 13px;
  color: var(--text-secondary);
}

.footer-nav a {
  transition: color 0.18s ease;
}

.footer-nav a:hover {
  color: var(--accent);
}

/* ==========================================================================
   QR Code Lightbox Modal
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: var(--modal-backdrop);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  width: 100%;
  max-width: 340px;
  background-color: var(--modal-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 28px 24px 24px;
  text-align: center;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.2s ease;
}

.modal-overlay.is-open .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-qr-frame {
  width: 210px;
  height: 210px;
  margin: 0 auto 18px;
  padding: 12px;
  border-radius: 16px;
  background-color: #ffffff;
  border: 1px solid rgba(24, 24, 27, 0.08);
}

.modal-qr-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-note {
  margin: 0 0 20px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.modal-close {
  padding: 8px 20px;
  border-radius: 9999px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.modal-close:hover {
  border-color: var(--accent-border);
  color: var(--accent);
}

/* ==========================================================================
   Subtle Entrance Motion
   ========================================================================== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-up {
  animation: fadeUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .fade-up {
    animation: none;
  }
  * {
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 960px) {
  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 36px;
    row-gap: 48px;
  }
}

@media (max-width: 640px) {
  .site-sheet {
    border-left: none;
    border-right: none;
  }

  .inner {
    padding-left: 20px;
    padding-right: 20px;
  }

  .hero {
    padding-top: 36px;
  }

  .products-section {
    margin-top: 48px;
  }

  .products-grid {
    grid-template-columns: 1fr;
    row-gap: 40px;
  }

  .product-card::before {
    inset: -14px -14px;
  }

  .detail-header {
    flex-direction: column;
    gap: 16px;
  }

  .meta-box {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px 20px;
  }

  .qr-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-footer {
    margin-top: 72px;
  }
}

/* Keep the portrait exactly as tall as the two-line about heading. */
.about-heading {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 28px);
  font-size: clamp(20px, 4.8vw, 46px);
}
.about-heading .prose-title { font-size: inherit; }
.about-heading-logo {
  display: block;
  width: 2.3em;
  height: 2.3em;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 50%;
}

/* Contact and language links follow the quiet, bottom-of-page navigation. */
.footer-details {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 18px 28px;
  margin-top: 22px;
}
.footer-contact, .language-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  font-size: 13px;
  color: var(--text-secondary);
}
.footer-contact a, .language-switcher a {
  color: inherit;
  text-decoration: none;
  padding-block: 6px;
}
.footer-contact a:hover, .language-switcher a:hover,
.language-switcher a[aria-current="true"] { color: var(--text-primary); }
.language-switcher a[aria-current="true"] { text-decoration: underline; text-underline-offset: 5px; }
.footer-contact a:focus-visible, .language-switcher a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}
@media (max-width: 640px) {
  .footer-details { flex-direction: column; align-items: flex-start; }
}

.header-right { gap: 8px; }
.header-language { position: relative; }
.header-language summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--border-pill);
  border-radius: 9999px;
  background: var(--bg-pill);
  color: var(--text-primary);
  box-shadow: var(--shadow-pill);
  font-size: 12px;
}
.header-language summary::-webkit-details-marker { display: none; }
.header-language summary svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}
.header-language summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.header-language .language-switcher {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 160px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  border: 1px solid var(--border-pill);
  border-radius: 14px;
  background: var(--bg-sheet);
  box-shadow: var(--shadow-pill);
}
.header-language .language-switcher a { padding: 10px 12px; border-radius: 8px; }
.header-language .language-switcher a:hover { background: var(--bg-pill); }
.footer-contact { flex-direction: column; align-items: flex-start; gap: 2px; }
.footer-contact-title { margin-bottom: 4px; color: var(--text-primary); }
.footer-contact a { padding-block: 3px; }
@media (max-width: 640px) {
  .header-row { grid-template-columns: auto 1fr auto; gap: 8px; }
  .header-row > .nav-pill { justify-self: center; }
  .header-row .nav-link { padding-inline: 12px; }
  .header-language summary { padding-inline: 9px; gap: 4px; }
  .header-right { gap: 6px; }
}

/* Share three grid rows so both footer columns align on each baseline. */
.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 14px 40px;
}
.footer-left, .footer-inner > .footer-contact { display: contents; }
.footer-left > .footer-copy { grid-column: 1; grid-row: 1; }
.footer-left > .footer-nav { grid-column: 1; grid-row: 2; }
.footer-left > .language-switcher { grid-column: 1; grid-row: 3; }
.footer-contact > .footer-contact-title { grid-column: 2; grid-row: 1; margin: 0; }
.footer-contact > a[href^="mailto:"] { grid-column: 2; grid-row: 2; }
.footer-contact > a[href^="https://x.com/"] { grid-column: 2; grid-row: 3; }
.footer-inner .language-switcher a, .footer-inner .footer-contact a { padding-block: 0; }
.footer-inner .language-switcher { line-height: inherit; }
@media (max-width: 640px) {
  .footer-inner { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .footer-contact > .footer-contact-title { grid-column: 1; grid-row: 4; margin-top: 14px; }
  .footer-contact > a[href^="mailto:"] { grid-column: 1; grid-row: 5; }
  .footer-contact > a[href^="https://x.com/"] { grid-column: 1; grid-row: 6; }
}
