/* ===== Shared structural ===== */
.section { border-bottom: var(--border); }
.strip { padding: var(--space-xs) var(--space-md); border-bottom: var(--border); display: flex; justify-content: space-between; align-items: center; font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; background: var(--bg); position: relative; z-index: 2; }

/* ===== Scan line ===== */
.scan { position: fixed; top: 0; right: 0; width: 3px; height: 100vh; background: var(--fg-ghost); z-index: 90; pointer-events: none; }
.scan-bar { width: 100%; height: 60px; background: linear-gradient(to bottom, transparent, var(--fg-muted), transparent); position: absolute; animation: scanAnim 6s linear infinite; }
@keyframes scanAnim { 0% { top: -60px; } 100% { top: 100vh; } }

/* ===== Header ===== */
.header { position: fixed; top: 0; left: 0; right: 0; width: auto; max-width: 1440px; margin-left: auto; margin-right: auto; z-index: 100; display: flex; justify-content: center; background: var(--bg); border-bottom: var(--border); border-left: 1px solid transparent; border-right: 1px solid transparent; transition: background 0.4s; }
.header-inner { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 1440px; padding: 12px var(--space-md); gap: var(--space-xs); }
.logo { font-family: var(--serif); font-size: 1.5rem; font-weight: 400; letter-spacing: -0.03em; flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
.logo-icon { width: 20px; height: 20px; }
body.dark .logo-icon.light { display: inline; }
body.dark .logo-icon.dark { display: none; }
.logo-icon.light { display: none; }
.logo-icon.dark { display: inline; }
.header-nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* ===== Toggle button ===== */
.toggle { width: 32px; height: 32px; border: var(--border-strong); background: transparent; color: var(--fg); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: var(--text-sm); font-family: var(--mono); font-weight: 700; transition: background 0.2s, color 0.2s; flex-shrink: 0; }
.toggle:hover { background: var(--fg); color: var(--bg); }

/* ===== Footer ===== */
.footer { padding: var(--space-lg) 0 var(--space-md); max-width: 1440px; margin: 0 auto; border: none; border-top: var(--border); border-left: 1px solid transparent; border-right: 1px solid transparent; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; padding: 0 var(--space-md); }
.footer-brand { display: flex; flex-direction: column; gap: 10px; }
.footer-brand-name { font-family: var(--serif); font-size: 1.3rem; }
.footer-brand-desc { color: var(--fg-muted); font-size: var(--text-sm); line-height: 1.5; max-width: 260px; }
.footer-col { display: flex; flex-direction: column; gap: 6px; }
.footer-col-heading { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-muted); margin-bottom: 6px; }
.footer-col a { color: var(--fg); text-decoration: none; font-size: var(--text-sm); transition: opacity 0.2s; }
.footer-col a:hover { opacity: 0.4; }
.footer-bottom { margin-top: var(--space-lg); padding: 12px var(--space-md) 0; border-top: var(--border); display: flex; justify-content: space-between; font-size: var(--text-xs); color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.footer-bottom > span:last-child { justify-self: end; }

/* ===== Sticky bar ===== */
.bar { display: flex; border-top: var(--border-strong); position: sticky; bottom: 0; background: var(--bg); z-index: 50; transition: background 0.4s; max-width: 1440px; margin: 0 auto; }
.bar-btn { appearance: none; border: none; background: transparent; padding: 14px var(--space-md); font-family: var(--sans); font-weight: 600; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.04em; cursor: pointer; color: var(--fg); transition: background 0.15s, color 0.15s; }
.bar-sec { border-right: var(--border-strong); }
.bar-sec:hover { background: var(--fg-ghost); }
.bar-pri { background: var(--fg); color: var(--bg); flex: 1; }
.bar-pri:hover { opacity: 0.85; }

/* ===== Pill ===== */
.pill { display: inline-flex; align-items: center; padding: var(--space-xs) var(--space-sm); border: var(--border-strong); background: transparent; color: var(--fg); text-decoration: none; font-family: var(--sans); font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; transition: background 0.15s ease, color 0.15s ease; cursor: pointer; white-space: nowrap; will-change: background, color; }
.pill:hover { background: var(--fg); color: var(--bg); }

/* ===== Eyebrow (landing + about + nox) ===== */
.eyebrow { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; color: var(--fg); margin-bottom: var(--space-xs); }

/* ===== Body text (landing + nox) ===== */
.body-text { font-size: var(--text-base); line-height: 1.55; color: var(--fg-muted); max-width: 520px; }

/* ===== Heading display (landing + nox) ===== */
.heading-display { font-family: var(--serif); font-size: var(--text-display); font-weight: 400; line-height: 1.1; letter-spacing: -0.02em; margin-bottom: var(--space-sm); }

/* ===== Tags (landing + nox) ===== */
.tag { border: var(--border); padding: 3px var(--space-xs); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; display: inline-block; }
.tag-fill { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.tag-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ===== Dots overlay (landing + about + nox) ===== */
.dots { position: absolute; inset: 0; background-image: radial-gradient(var(--fg-ghost) 1px, transparent 1px); background-size: 10px 10px; pointer-events: none; z-index: 1; }

/* ===== CTA bar (landing + nox) ===== */
.cta-bar { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: var(--space-md) 0; border-top: 2px solid var(--fg); border-bottom: 2px solid var(--fg); color: var(--fg); text-decoration: none; font-family: var(--serif); font-size: var(--text-display); font-weight: 400; transition: padding-left 0.3s; }
.cta-bar:hover { padding-left: var(--space-md); background: var(--fg-ghost); }
.cta-icon { width: 36px; height: 36px; border: var(--border-strong); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 1rem; flex-shrink: 0; }

/* ===== Dim links (landing + about) ===== */
.dim { color: var(--fg-muted); transition: color 0.3s; }
.dim:hover { color: var(--fg); }

/* ===== Page header (about + writing) ===== */
.page-header { padding: calc(60px + var(--space-lg)) var(--space-md) var(--space-lg); border-bottom: var(--border); }
.page-title { font-family: var(--serif); font-size: clamp(2.5rem, 8vw, 5rem); font-weight: 400; line-height: 0.9; letter-spacing: -0.04em; margin-bottom: var(--space-sm); }
.page-desc { font-size: var(--text-base); color: var(--fg-muted); max-width: 520px; line-height: 1.55; }

/* ===== Hero (landing + nox) ===== */
.hero { position: relative; min-height: 98vh; min-height: 98svh; display: flex; align-items: flex-end; padding: 80px 0 var(--space-lg) 0; overflow: hidden; border-bottom: var(--border); }
.hero-canvas { position: absolute; inset: 0; z-index: 1; opacity: 0.1; }
.hero-grid { position: absolute; inset: 0; z-index: 2; pointer-events: none; background-image: linear-gradient(to right, var(--fg-ghost) 1px, transparent 1px), linear-gradient(to bottom, var(--fg-ghost) 1px, transparent 1px); background-size: 60px 60px; }
.hero-dots { position: absolute; inset: 0; z-index: 3; pointer-events: none; background-image: radial-gradient(circle, var(--fg-faint) 1px, transparent 1px); background-size: 60px 60px; }
body.dark .hero-grid { background-image: linear-gradient(to right, var(--fg-ghost) 1px, transparent 1px), linear-gradient(to bottom, var(--fg-ghost) 1px, transparent 1px); }
body.dark .hero-dots { background-image: radial-gradient(circle, var(--fg-ghost) 1px, transparent 1px); }
.hero-inner { position: relative; z-index: 5; width: 100%; padding: 0 var(--space-md); }
.hero-sub { font-size: var(--text-sm); letter-spacing: 0.02em; margin-bottom: var(--space-sm); color: var(--fg-muted); font-weight: 500; }
.hero-title { font-family: var(--serif); font-size: var(--text-hero); font-weight: 400; line-height: 0.88; letter-spacing: -0.04em; margin-bottom: var(--space-md); }
.hero-desc { font-family: var(--serif); font-style: italic; font-size: var(--text-lg); max-width: 520px; color: var(--fg-muted); line-height: 1.5; }

/* ===== Shared responsive — 1024px ===== */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== Shared responsive — 768px ===== */
@media (max-width: 768px) {
  :root { --space-md: 16px; --space-lg: 28px; --text-display: clamp(1.2rem, 5vw, 1.6rem); }
  .header-inner { padding: 10px var(--space-md); }
  /* Hide "Hisoka" text, show icon only */
  .logo-text { display: none; }
  .logo { font-size: 1.3rem; }
  /* Show nav pills but smaller — all same height */
  .pill-desktop { display: inline-flex; padding: 0 var(--space-xs); font-size: 0.5rem; height: 28px; align-items: center; }
  .header-nav { gap: 4px; align-items: center; }
  .toggle { width: 28px; height: 28px; font-size: 0.65rem; }
  /* Footer stacks vertically */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .footer-brand { grid-column: span 2; }
  .footer-bottom { flex-direction: column; align-items: center; gap: var(--space-sm); text-align: center; }
  .bar-btn { padding: 12px var(--space-sm); }
  .hero { min-height: 85vh; min-height: 85svh; }
  .hero-sub { font-size: var(--text-xs); }
}

/* ===== Shared responsive — 420px ===== */
@media (max-width: 420px) {
  :root { --space-md: 12px; --space-lg: 20px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: span 1; }
}

/* ===== Comfortable layout mode ===== */
/* Page frame loses side borders, sections become floating cards */
body.comfortable .page-frame { border-left: none; border-right: none; padding: 0 var(--space-md); }
/* Sections detach — each is a bordered card with visible gap */
body.comfortable .section { border: var(--border); margin-bottom: var(--space-md); }
body.comfortable .section:last-of-type { margin-bottom: 0; }
body.comfortable .page-header { border: var(--border); margin-bottom: var(--space-md); }
body.comfortable .hero { border: var(--border); margin-bottom: var(--space-md); }
/* Inner grids detach — silence cells get individual borders with gap */
body.comfortable .silence-grid { gap: var(--space-sm); padding: var(--space-sm); }
body.comfortable .silence-cell { border: var(--border); }
body.comfortable .silence-cell:nth-child(2n) { border-right: var(--border); }
body.comfortable .silence-cell:nth-child(n+3) { border-bottom: var(--border); }
/* Product rows become separate cards */
body.comfortable .product-row { border: var(--border); border-bottom: var(--border); margin: var(--space-sm) var(--space-sm) 0; }
body.comfortable .product-row:last-child { margin-bottom: var(--space-sm); border-bottom: var(--border); }
/* Blog cards detach */
body.comfortable .blog-grid { gap: var(--space-sm); padding: var(--space-sm); }
body.comfortable .blog-card { border: var(--border); }
body.comfortable .blog-card:last-child { border-right: var(--border); }
/* Flagship halves detach */
body.comfortable .flagship-split { gap: var(--space-sm); padding: var(--space-sm); }
body.comfortable .flagship { border: var(--border); }
/* Nox — card splits, uc panels detach */
body.comfortable .card-split { border: var(--border); margin: var(--space-sm) var(--space-sm) var(--space-sm); }
body.comfortable .uc-panel.active { margin: var(--space-sm); border: var(--border); }
body.comfortable .uc-tabs { margin: var(--space-sm) var(--space-sm) 0; }
/* Writing — post rows become cards, filters get border */
body.comfortable .filters { border: var(--border); }
body.comfortable .post-list { gap: var(--space-sm); padding: var(--space-sm) 0; }
body.comfortable .post-row { border: var(--border); }
body.comfortable .post-row:hover { padding-left: var(--space-md); }
/* Strip inside sections — no extra border needed, section card provides it.
   Standalone strips (like article meta) get bottom margin for spacing. */
body.comfortable .page-frame > .strip { border: var(--border); margin-bottom: var(--space-md); }
body.comfortable .section > .strip { border: none; border-bottom: var(--border); }
/* Article nav — single bordered card, separated from section above */
body.comfortable .article-nav { gap: 0; padding: 0; border: var(--border); border-top: var(--border); margin-top: var(--space-md); }
body.comfortable .article-nav a { border: none; }
body.comfortable .article-nav > :first-child { border-right: var(--border); }
/* Header matches page-frame content width in comfortable mode.
   page-frame: max-width 1440px, padding 0 var(--space-md).
   Content area = 1440px - 2*space-md. Header must match that. */
body.comfortable .header { left: var(--space-md); right: var(--space-md); max-width: calc(1440px - var(--space-md) * 2); border-bottom: var(--border); border-top: none; border-left: 1px solid transparent; border-right: 1px solid transparent; }
/* Sticky bar gets full border in comfortable */
body.comfortable .bar { border: var(--border-strong); }
/* Footer — no borders, matches comfortable content width */
body.comfortable .footer { border: none; border-top: var(--border); border-left: 1px solid transparent; border-right: 1px solid transparent; margin-top: var(--space-md); max-width: calc(1440px - var(--space-md) * 2); }

/* ===== Comfortable mobile — header loses left/right borders, footer stays in sync ===== */
@media (max-width: 768px) {
  body.comfortable .header { left: var(--space-md); right: var(--space-md); max-width: none; border-left: 1px solid transparent; border-right: 1px solid transparent; }
  body.comfortable .footer { max-width: calc(100% - var(--space-md) * 2); }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .scan-bar { animation: none; }
  .fin { animation: none; }
  .reveal-heading span { opacity: 1; filter: none; transition: none; }
}
