// solid-variant-art.jsx
// "Solid" tone, refined to an editorial / premium feel.
// Palette: ink + ivory + madder + brass hairline.
// Replaces the previous SolidVariant by re-assigning window.SolidVariant
// (load this AFTER variants.jsx).
//
// Key moves vs the original:
//   • Hairline-only borders (no filled cards) → editorial gravity
//   • Cormorant Garamond Italic + Noto Serif JP for the headline pair
//   • Vertical (tategaki) small labels at section heads
//   • Brass (#b08850) used only as a thin accent line / number color
//   • Generous padding and letter-spacing; no rounded corners anywhere
//   • Inputs are underline-only (no boxes); buttons are outline-only

const { useState: useStateS } = React;

// ─── Animation hooks & components ─────────────────────────────
// useInView — fires when element enters viewport. Robust:
//  • synchronous visibility check on mount (in-viewport content fires immediately)
//  • threshold:0 + no rootMargin (any pixel visible counts)
//  • safety timeout so content can never stay hidden indefinitely
function useInView(opts = {}) {
  const ref = React.useRef(null);
  const [seen, setSeen] = React.useState(false);
  React.useEffect(() => {
    const el = ref.current; if (!el) return;
    // sync check: if already on-screen, trigger now
    const r = el.getBoundingClientRect();
    const vh = window.innerHeight || document.documentElement.clientHeight;
    const vw = window.innerWidth || document.documentElement.clientWidth;
    if (r.bottom > 0 && r.top < vh && r.right > 0 && r.left < vw) {
      setSeen(true); return;
    }
    let safety;
    let io;
    try {
      io = new IntersectionObserver(([e]) => {
        if (e.isIntersecting) { setSeen(true); io && io.disconnect(); clearTimeout(safety); }
      }, { threshold: 0, ...opts });
      io.observe(el);
    } catch {}
    // safety: never leave content invisible past 1.5s even if observer fails
    safety = setTimeout(() => { setSeen(true); io && io.disconnect(); }, 1500);
    return () => { io && io.disconnect(); clearTimeout(safety); };
  }, []);
  return [ref, seen];
}

// <Reveal> — scroll-triggered fade-up. stagger=true cascades children.
function Reveal({ children, stagger, as = 'div', style, className = '' }) {
  const [ref, inView] = useInView();
  const cls = `${stagger ? 'clh-rv-stagger' : 'clh-rv'} ${inView ? 'is-in' : ''} ${className}`.trim();
  return React.createElement(as, { ref, className: cls, style }, children);
}

// <CountUp> — number ticks up to target when in view. Supports integer or comma-grouped.
function CountUp({ to, duration = 900, prefix = '', suffix = '', style, className = '' }) {
  const [ref, inView] = useInView({ threshold: 0.3 });
  const [val, setVal] = React.useState(0);
  React.useEffect(() => {
    if (!inView) return;
    setVal(0); // explicit reset so the tick visibly starts from 0
    const start = performance.now();
    const target = parseFloat(String(to).replace(/,/g, ''));
    let raf;
    const tick = (t) => {
      const k = Math.max(0, Math.min(1, (t - start) / duration));
      const eased = 1 - Math.pow(1 - k, 3);
      setVal(target * eased);
      if (k < 1) raf = requestAnimationFrame(tick);
    };
    raf = requestAnimationFrame(tick);
    return () => cancelAnimationFrame(raf);
  }, [inView, to, duration]);
  const display = Math.round(Math.max(0, val)).toLocaleString();
  return <span ref={ref} className={`clh-num ${className}`.trim()} style={style}>{prefix}{display}{suffix}</span>;
}

// <Marquee> — endless horizontal loop, double the children to seam
function Marquee({ children, gap = 56, speed = 42, style }) {
  return (
    <div style={{ overflow: 'hidden', width: '100%', ...style }}>
      <div className="clh-marquee" style={{ ['--mq-gap']: gap + 'px', animationDuration: speed + 's' }}>
        <div style={{ display: 'flex', gap, paddingRight: gap }}>{children}</div>
        <div aria-hidden="true" style={{ display: 'flex', gap, paddingRight: gap }}>{children}</div>
      </div>
    </div>
  );
}

// <MagButton> — magnetic: button shifts toward cursor within a small radius
function MagButton({ as: As = 'button', strength = 16, style, className = '', children, ...rest }) {
  const ref = React.useRef(null);
  const onMove = (e) => {
    const el = ref.current; if (!el) return;
    const r = el.getBoundingClientRect();
    const cx = r.left + r.width / 2, cy = r.top + r.height / 2;
    const dx = (e.clientX - cx) / (r.width / 2) * strength;
    const dy = (e.clientY - cy) / (r.height / 2) * strength;
    el.style.transform = `translate(${dx}px, ${dy}px)`;
  };
  const onLeave = () => { if (ref.current) ref.current.style.transform = ''; };
  return (
    <As ref={ref} className={`clh-mag ${className}`.trim()} style={style}
      onMouseMove={onMove} onMouseLeave={onLeave} {...rest}>
      {children}
    </As>
  );
}

// <CharReveal> — splits Japanese/Latin text into spans and fades each in
function CharReveal({ text, delay = 0, step = 0.035, style }) {
  const chars = Array.from(text);
  return (
    <span style={style}>
      {chars.map((c, i) => (
        <span key={i} className="clh-char" style={{ animationDelay: (delay + i * step) + 's', whiteSpace: c === ' ' ? 'pre' : 'normal' }}>
          {c}
        </span>
      ))}
    </span>
  );
}

// PageCurtain — animates a thin ink sweep on page change. Skips first mount.
function PageCurtain({ trigger }) {
  const ref = React.useRef(null);
  const first = React.useRef(true);
  React.useEffect(() => {
    if (first.current) { first.current = false; return; }
    if (trigger == null) return;
    const el = ref.current; if (!el) return;
    el.classList.remove('is-running');
    void el.offsetWidth; // force reflow to restart anim
    el.classList.add('is-running');
  }, [trigger]);
  return <div ref={ref} className="clh-curtain" aria-hidden="true" />;
}

// ScrollProgress — hairline that tracks document scroll
function ScrollProgress() {
  const ref = React.useRef(null);
  React.useEffect(() => {
    const onScroll = () => {
      const el = ref.current; if (!el) return;
      const h = document.documentElement;
      const max = h.scrollHeight - h.clientHeight;
      const k = max > 0 ? h.scrollTop / max : 0;
      el.style.transform = `scaleX(${k})`;
    };
    window.addEventListener('scroll', onScroll, { passive: true });
    onScroll();
    return () => window.removeEventListener('scroll', onScroll);
  }, []);
  return <div ref={ref} className="clh-progress" />;
}

// Inject animation stylesheet once.
if (typeof document !== 'undefined' && !document.getElementById('clh-anim-styles')) {
  const s = document.createElement('style');
  s.id = 'clh-anim-styles';
  s.textContent = `
    @keyframes clh-fadeUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
    @keyframes clh-fadeIn { from { opacity: 0; } to { opacity: 1; } }
    @keyframes clh-drawLine { from { transform: scaleX(0); } to { transform: scaleX(1); } }
    @keyframes clh-blurIn { from { opacity: 0; filter: blur(10px); transform: translateY(12px); } to { opacity: 1; filter: blur(0); transform: none; } }
    @keyframes clh-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

    /* generic reveal — staggered children */
    .clh-reveal { opacity: 0; animation: clh-fadeUp .8s cubic-bezier(.2,.7,.2,1) both; }
    .clh-stagger > * { opacity: 0; animation: clh-fadeUp .75s cubic-bezier(.2,.7,.2,1) both; }
    .clh-stagger > *:nth-child(1){animation-delay:.05s}
    .clh-stagger > *:nth-child(2){animation-delay:.14s}
    .clh-stagger > *:nth-child(3){animation-delay:.23s}
    .clh-stagger > *:nth-child(4){animation-delay:.32s}
    .clh-stagger > *:nth-child(5){animation-delay:.41s}
    .clh-stagger > *:nth-child(6){animation-delay:.5s}
    .clh-stagger > *:nth-child(7){animation-delay:.59s}
    .clh-stagger > *:nth-child(8){animation-delay:.68s}

    /* headline blur-in */
    .clh-blurin { animation: clh-blurIn 1s cubic-bezier(.2,.7,.2,1) both; }
    .clh-blurin-2 { animation: clh-blurIn 1s .15s cubic-bezier(.2,.7,.2,1) both; }
    .clh-blurin-3 { animation: clh-blurIn 1s .3s cubic-bezier(.2,.7,.2,1) both; }

    /* nav: underline-draw on hover, draw-in for active */
    .clh-nav-btn { position: relative; transition: color .2s; }
    .clh-nav-btn::after {
      content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
      background: currentColor; transform: scaleX(0); transform-origin: left center;
      transition: transform .4s cubic-bezier(.2,.7,.2,1);
    }
    .clh-nav-btn:hover::after { transform: scaleX(1); }
    .clh-nav-btn[data-active="1"]::after { transform: scaleX(1); transform-origin: left center; }

    /* outline button: fill rises on hover */
    .clh-btn-outline { position: relative; overflow: hidden; z-index: 0; transition: color .3s ease; }
    .clh-btn-outline::before {
      content: ''; position: absolute; inset: 0; background: var(--clh-fill, #0a0a0a);
      transform: translateY(101%); transition: transform .4s cubic-bezier(.2,.7,.2,1); z-index: -1;
    }
    .clh-btn-outline:hover { color: var(--clh-fillfg, #fff) !important; }
    .clh-btn-outline:hover::before { transform: translateY(0); }

    /* solid button: arrow nudges, slight raise */
    .clh-btn-solid { transition: transform .25s cubic-bezier(.2,.7,.2,1); }
    .clh-btn-solid:hover { transform: translateY(-2px); }
    .clh-btn-solid .clh-arrow { display: inline-block; transition: transform .3s cubic-bezier(.2,.7,.2,1); }
    .clh-btn-solid:hover .clh-arrow { transform: translateX(4px); }

    /* card hover */
    .clh-card { transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .35s; }
    .clh-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -28px rgba(10,10,10,.35); }

    /* hairline that draws on mount */
    .clh-line-draw { transform-origin: left center; animation: clh-drawLine .9s .15s cubic-bezier(.2,.7,.2,1) both; }

    /* number ticker — counts up on appear */
    @keyframes clh-tick { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
    .clh-tick { animation: clh-tick .9s cubic-bezier(.2,.7,.2,1) both; }

    /* maker color bar grows from left */
    .clh-color-bar { transform-origin: left; transform: scaleX(0); animation: clh-drawLine .8s .3s cubic-bezier(.2,.7,.2,1) forwards; }

    /* reduced motion: turn it all off */
    @media (prefers-reduced-motion: reduce) {
      .clh-reveal, .clh-stagger > *, .clh-blurin, .clh-blurin-2, .clh-blurin-3,
      .clh-line-draw, .clh-tick, .clh-color-bar { animation: none !important; opacity: 1 !important; transform: none !important; filter: none !important; }
      .clh-card:hover, .clh-btn-solid:hover { transform: none !important; }
    }

    /* ─── Advanced (scroll, hero, marquee, page-curtain) ─── */
    @keyframes clh-kenburns {
      0%   { transform: scale(1) translate(0,0); }
      100% { transform: scale(1.08) translate(-1.5%, -1%); }
    }
    .clh-kenburns { animation: clh-kenburns 18s ease-in-out infinite alternate; }

    @keyframes clh-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
    .clh-marquee { display: flex; width: max-content; animation: clh-marquee 42s linear infinite; }
    .clh-marquee:hover { animation-play-state: paused; }

    /* scroll-revealed wrapper (toggled by IntersectionObserver) */
    .clh-rv { opacity: 0; transform: translateY(36px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform 1s cubic-bezier(.2,.7,.2,1); will-change: opacity, transform; }
    .clh-rv.is-in { opacity: 1; transform: none; }
    .clh-rv-stagger > * { opacity: 0; transform: translateY(28px); transition: opacity .85s cubic-bezier(.2,.7,.2,1), transform .95s cubic-bezier(.2,.7,.2,1); }
    .clh-rv-stagger.is-in > * { opacity: 1; transform: none; }
    .clh-rv-stagger.is-in > *:nth-child(1){transition-delay:.04s}
    .clh-rv-stagger.is-in > *:nth-child(2){transition-delay:.13s}
    .clh-rv-stagger.is-in > *:nth-child(3){transition-delay:.22s}
    .clh-rv-stagger.is-in > *:nth-child(4){transition-delay:.31s}
    .clh-rv-stagger.is-in > *:nth-child(5){transition-delay:.4s}
    .clh-rv-stagger.is-in > *:nth-child(6){transition-delay:.49s}
    .clh-rv-stagger.is-in > *:nth-child(7){transition-delay:.58s}
    .clh-rv-stagger.is-in > *:nth-child(8){transition-delay:.67s}

    /* char-by-char reveal */
    @keyframes clh-charIn { from { opacity: 0; transform: translateY(40%); filter: blur(8px); } to { opacity: 1; transform: none; filter: blur(0); } }
    .clh-char { display: inline-block; opacity: 0; animation: clh-charIn .9s cubic-bezier(.2,.7,.2,1) both; }

    /* page-transition curtain: ink slab sweeps across the viewport */
    @keyframes clh-curtain {
      0%   { transform: translateX(-101%); }
      50%  { transform: translateX(0); }
      100% { transform: translateX(101%); }
    }
    .clh-curtain {
      position: fixed; inset: 0; pointer-events: none; z-index: 90;
      background: linear-gradient(90deg, transparent 0%, #0a0a0a 30%, #0a0a0a 70%, transparent 100%);
      transform: translateX(-101%);
    }
    .clh-curtain.is-running { animation: clh-curtain 1s cubic-bezier(.7,.0,.3,1) both; }

    /* scroll-progress hairline at top of viewport */
    .clh-progress {
      position: fixed; top: 0; left: 0; right: 0; height: 2px;
      background: #0a0a0a; transform-origin: left center; transform: scaleX(0);
      z-index: 80; pointer-events: none;
    }

    /* magnetic button — translate handled via JS */
    .clh-mag { transition: transform .25s cubic-bezier(.2,.7,.2,1); will-change: transform; }

    /* number ticker tabular alignment */
    .clh-num { font-variant-numeric: tabular-nums; }

    @media (prefers-reduced-motion: reduce) {
      .clh-kenburns, .clh-marquee { animation: none !important; }
      .clh-rv, .clh-rv-stagger > * { opacity: 1 !important; transform: none !important; }
      .clh-char { opacity: 1 !important; animation: none !important; }
      .clh-curtain { display: none !important; }
    }

    /* ─── Line ornaments ─────────────────────────────────── */
    @keyframes clh-drawLineV { from { transform: scaleY(0); } to { transform: scaleY(1); } }
    .clh-draw-h { transform-origin: left center; animation: clh-drawLine 1.4s .2s cubic-bezier(.2,.7,.2,1) both; }
    .clh-draw-v { transform-origin: top center; animation: clh-drawLineV 1.1s .3s cubic-bezier(.2,.7,.2,1) both; }

    /* corner brackets — thin Lshapes in artboard corners */
    .clh-corner { position: absolute; width: 32px; height: 32px; border: 1px solid currentColor; opacity: .4; pointer-events: none; }
    .clh-corner.tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
    .clh-corner.tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
    .clh-corner.bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
    .clh-corner.br { bottom: 0; right: 0; border-left: 0; border-top: 0; }

    /* hairline underline that draws on visibility */
    .clh-underline { position: relative; display: inline-block; }
    .clh-underline::after {
      content: ''; position: absolute; left: 0; right: 0; bottom: -10px; height: 1px; background: currentColor;
      transform: scaleX(0); transform-origin: left center;
      animation: clh-drawLine 1s .5s cubic-bezier(.2,.7,.2,1) forwards;
    }

    /* dashed/dotted connector */
    .clh-dots { background-image: linear-gradient(to right, currentColor 2px, transparent 2px); background-size: 8px 1px; background-repeat: repeat-x; background-position: center; height: 1px; opacity: .35; }

    /* crosshair section marker */
    .clh-crosshair { position: relative; width: 14px; height: 14px; flex: 0 0 auto; }
    .clh-crosshair::before, .clh-crosshair::after {
      content: ''; position: absolute; background: currentColor;
    }
    .clh-crosshair::before { left: 0; right: 0; top: 50%; height: 1px; transform: translateY(-.5px); }
    .clh-crosshair::after { top: 0; bottom: 0; left: 50%; width: 1px; transform: translateX(-.5px); }

    /* number with circle frame */
    .clh-numframe {
      display: inline-grid; place-items: center; width: 32px; height: 32px;
      border: 1px solid currentColor; border-radius: 999px;
      font-family: ui-monospace, monospace; font-size: 11px; letter-spacing: 0;
    }

    @media (prefers-reduced-motion: reduce) {
      .clh-draw-h, .clh-draw-v, .clh-underline::after { animation: none !important; transform: none !important; }
    }

    /* ─── Bold line frames ───────────────────────────────── */
    /* big card with thick top accent + hover line-draw on bottom */
    .clh-frame { position: relative; }
    .clh-frame::before {
      content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
      background: var(--clh-bar, #0a0a0a);
      transform-origin: left center; transform: scaleX(1);
    }
    .clh-frame::after {
      content: ''; position: absolute; bottom: 0; left: 0; height: 1px; width: 100%;
      background: var(--clh-bar, #0a0a0a);
      transform-origin: right center; transform: scaleX(0);
      transition: transform .55s cubic-bezier(.2,.7,.2,1);
    }
    .clh-frame:hover::after { transform-origin: left center; transform: scaleX(1); }
    .clh-frame[data-rv="1"]::before { animation: clh-drawLine 1s .25s cubic-bezier(.2,.7,.2,1) both; }

    /* tall vertical accent on left of a card */
    .clh-vbar { position: relative; }
    .clh-vbar::before {
      content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 3px;
      background: var(--clh-bar, #0a0a0a);
      transform-origin: top center; transform: scaleY(0);
      animation: clh-drawLineV 1s .35s cubic-bezier(.2,.7,.2,1) forwards;
    }

    /* big chapter divider: thick rule + tick marks every Nx */
    .clh-rule-bold { position: relative; height: 8px; }
    .clh-rule-bold::before {
      content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 3px;
      background: currentColor; transform: translateY(-50%);
      transform-origin: left center;
    }
    .clh-rule-bold.is-draw::before { animation: clh-drawLine 1.4s .2s cubic-bezier(.2,.7,.2,1) both; }
    .clh-tick {
      position: absolute; top: -6px; bottom: -6px; width: 1px; background: currentColor;
    }

    /* edge guidelines that run the full viewport */
    .clh-guide-top, .clh-guide-bot { position: fixed; left: 0; right: 0; height: 1px; background: currentColor; opacity: .07; pointer-events: none; z-index: 70; }
    .clh-guide-top { top: 72px; }
    .clh-guide-bot { bottom: 84px; }

    /* dashed border that animates dasharray */
    @keyframes clh-dash { from { background-position: 0 0, 0 0, 0 0, 0 0; } to { background-position: 24px 0, 0 24px, -24px 0, 0 -24px; } }
    .clh-dashframe {
      background-image:
        linear-gradient(to right, currentColor 50%, transparent 50%),
        linear-gradient(to bottom, currentColor 50%, transparent 50%),
        linear-gradient(to right, currentColor 50%, transparent 50%),
        linear-gradient(to bottom, currentColor 50%, transparent 50%);
      background-position: 0 0, 100% 0, 0 100%, 0 0;
      background-size: 12px 1px, 1px 12px, 12px 1px, 1px 12px;
      background-repeat: repeat-x, repeat-y, repeat-x, repeat-y;
    }

    /* angle-cut accent — 45deg slash in a corner */
    .clh-slash { position: relative; overflow: hidden; }
    .clh-slash::after {
      content: ''; position: absolute; top: -20px; right: -20px; width: 60px; height: 60px;
      background: var(--clh-bar, #0a0a0a); transform: rotate(45deg);
    }

    @media (prefers-reduced-motion: reduce) {
      .clh-frame::before, .clh-vbar::before, .clh-rule-bold::before { animation: none !important; transform: none !important; }
    }

    /* ─── Pop background patterns ────────────────────────── */
    /* dot grid wash — drop on any section to add a subtle "graph paper" feel */
    .clh-pop-dots {
      background-image: radial-gradient(circle, rgba(10,10,10,.08) 1px, transparent 1px);
      background-size: 22px 22px;
      background-position: 0 0;
    }
    /* line grid */
    .clh-pop-grid {
      background-image:
        linear-gradient(to right, rgba(10,10,10,.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(10,10,10,.05) 1px, transparent 1px);
      background-size: 56px 56px;
    }
    /* diagonal hatch */
    .clh-pop-hatch {
      background-image: repeating-linear-gradient(135deg, rgba(10,10,10,.04) 0 1px, transparent 1px 14px);
    }

    /* horizontal sliding stripes (animated) */
    @keyframes clh-stripe { from { background-position: 0 0; } to { background-position: 80px 0; } }
    .clh-stripe-anim {
      background-image: repeating-linear-gradient(90deg, currentColor 0 1px, transparent 1px 80px);
      animation: clh-stripe 6s linear infinite;
      opacity: .2;
    }

    /* color-pop accent chip — used as decorative number/tag */
    .clh-chip {
      display: inline-grid; place-items: center;
      width: 56px; height: 56px; border-radius: 999px;
      font-family: ui-monospace, monospace; font-size: 16px; font-weight: 700;
      color: #fff; background: var(--clh-chip, #1e7a4e);
      box-shadow: 0 4px 14px -6px var(--clh-chip-shadow, rgba(30,122,78,.5));
    }
    .clh-chip-ring {
      position: relative;
    }
    .clh-chip-ring::after {
      content: ''; position: absolute; inset: -6px; border-radius: 999px;
      border: 1px dashed var(--clh-chip, #1e7a4e); opacity: .5;
      animation: clh-spin 14s linear infinite;
    }
    @keyframes clh-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

    /* squiggle wavy divider */
    .clh-squiggle {
      width: 100%; height: 14px;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14' viewBox='0 0 28 14'%3E%3Cpath d='M0 7 Q7 0 14 7 T28 7' fill='none' stroke='%230a0a0a' stroke-opacity='.18' stroke-width='1'/%3E%3C/svg%3E");
      background-repeat: repeat-x;
      background-position: center;
    }

    /* big rotating circle outline — decorative background */
    .clh-circle-deco {
      position: absolute; border: 1px solid currentColor; border-radius: 999px;
      pointer-events: none; opacity: .12;
      animation: clh-spin 60s linear infinite;
    }
    .clh-circle-deco::before {
      content: ''; position: absolute; top: -3px; left: 50%; width: 5px; height: 5px;
      border-radius: 50%; background: currentColor; transform: translateX(-50%);
    }

    @media (prefers-reduced-motion: reduce) {
      .clh-stripe-anim, .clh-chip-ring::after, .clh-circle-deco { animation: none !important; }
    }

    /* hero key-handover image — right side, fade in from left */
    .clh-hero-image {
      position: absolute; inset: 0 0 0 auto;
      width: min(58%, 720px);
      background-image: url('assets/hero-key-handover.jpg');
      background-size: cover;
      background-position: center right;
      background-repeat: no-repeat;
      opacity: .85;
      -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,.55) 30%, rgba(0,0,0,1) 100%);
              mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,.55) 30%, rgba(0,0,0,1) 100%);
      pointer-events: none;
      z-index: 0;
    }
    @media (max-width: 720px) {
      .clh-hero-image {
        width: 70%;
        opacity: .55;
        -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,.3) 35%, rgba(0,0,0,.95) 100%);
                mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,.3) 35%, rgba(0,0,0,.95) 100%);
      }
    }

    /* Works section — mobile optimization */
    @media (max-width: 720px) {
      .clh-works-stat-cell {
        border-right: 0 !important;
        border-bottom: 1px solid rgba(10,10,10,.1);
      }
      .clh-works-stat-cell:last-child {
        border-bottom: 0 !important;
      }
    }

    /* MANIFESTO — mobile: split into 2 lines with fixed sizes */
    @media (max-width: 720px) {
      .clh-manifesto {
        flex-direction: column !important;
        align-items: center !important;
        font-size: 32px !important;
      }
      .clh-manifesto-key {
        font-size: 96px !important;
      }
      .clh-manifesto-line-1 {
        white-space: nowrap;
      }
    }

    /* Partner cards — stack on very narrow viewports + frameless */
    @media (max-width: 480px) {
      .clh-partner-card {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        padding: 14px 2px !important;
        background: transparent !important;
        border: 0 !important;
        border-bottom: 1px solid rgba(10,10,10,.08) !important;
      }
      .clh-partner-card:last-child {
        border-bottom: 0 !important;
      }
      .clh-partner-card > span {
        justify-self: start;
      }
      /* clients marquee — frameless on mobile */
      .clh-clients-marquee {
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
      }
    }
  `;
  document.head.appendChild(s);
}

function SolidVariant() {
  const [page, setPage] = useStateS('home');

  const p = {
    bg: '#ffffff',      // pure white canvas
    paper: '#f6f4ee',   // warm-paper accent block
    ink: '#0a0a0a',     // near-black ink
    sub: 'rgba(10,10,10,.58)',
    line: 'rgba(10,10,10,.1)',
    hair: 'rgba(10,10,10,.18)',
    accent: '#6f231a',  // deep madder (sparingly used)
    brass: '#9a7a44',   // brass hairline / numerals
  };
  const sans = '"Noto Sans JP", "Hiragino Sans", system-ui, sans-serif';
  const serif = '"Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif';
  const italic = '"Cormorant Garamond", "Noto Serif JP", serif';
  const mono = '"JetBrains Mono", ui-monospace, monospace';

  const wrap = {
    width: '100%', minHeight: '100vh', background: p.bg, color: p.ink,
    fontFamily: sans, position: 'relative', overflow: 'hidden',
    backgroundImage: 'radial-gradient(circle, rgba(10,10,10,.06) 1px, transparent 1px)',
    backgroundSize: '24px 24px',
  };

  // ── decorative ornament: thin line + node ──────────────────
  const Ornament = ({ width = 80, style }) => (
    <svg width={width} height={8} viewBox={`0 0 ${width} 8`} style={style}>
      <line x1="0" y1="4" x2={width - 8} y2="4" stroke={p.brass} strokeWidth="0.8" />
      <circle cx={width - 4} cy="4" r="2.4" fill="none" stroke={p.brass} strokeWidth="0.8" />
    </svg>
  );

  // ── tategaki (vertical) micro-label, used at section heads ─
  const Tategaki = ({ children, style }) => (
    <div style={{
      writingMode: 'vertical-rl', textOrientation: 'mixed',
      fontFamily: sans, fontSize: 11, fontWeight: 500, letterSpacing: 4, color: p.sub,
      ...style,
    }}>{children}</div>
  );

  // ── section heading: roman + jp + drawn line (tategaki removed per request) ────
  const SectionHead = ({ en, jp, no }) => (
    <div style={{ marginBottom: 56 }}>
      <div>
        <div style={{ display: 'flex', alignItems: 'center', gap: 14, marginBottom: 14 }}>
          <span className="clh-numframe" style={{ color: p.ink, fontWeight: 600 }}>{no}</span>
          <span style={{ fontFamily: italic, fontStyle: 'italic', fontSize: 13, color: p.brass, letterSpacing: 3 }}>chapter</span>
          <div className="clh-draw-h" style={{ flex: 1, height: 1, background: p.line }} />
          <div className="clh-crosshair" style={{ color: p.brass }} />
        </div>
        <h2 style={{
          fontFamily: sans, fontWeight: 700, fontSize: 48,
          color: p.ink, margin: 0, letterSpacing: -0.5, lineHeight: 1.1,
        }}>{en}</h2>
        <div style={{ display: 'flex', alignItems: 'center', gap: 16, marginTop: 14 }}>
          <div style={{ fontFamily: sans, fontWeight: 500, fontSize: 18, color: p.ink, letterSpacing: 4 }}>{jp}</div>
          <div className="clh-dots" style={{ flex: 1, color: p.ink }} />
        </div>
      </div>
    </div>
  );

  // ── nav ────────────────────────────────────────────────────
  const Nav = () => (
    <header>
      {/* hairline brand bar */}
      <div className="clh-header" style={{
        display: 'grid', gridTemplateColumns: 'auto 1fr auto', alignItems: 'center', gap: 24,
        padding: '20px 56px', borderBottom: `1px solid ${p.line}`,
      }}>
        <div style={{ display: 'flex', alignItems: 'center', whiteSpace: 'nowrap' }}>
          <img src="../会社ロゴ/clh-logo-trim.png" alt="カーロックホームズ Car Lock Homes" style={{ height: 56, width: 'auto', display: 'block' }} />
        </div>
        <nav style={{ display: 'flex', gap: 30, justifyContent: 'center', whiteSpace: 'nowrap' }}>
          {CONTENT.nav.map((n) => (
            <button key={n.id} onClick={() => setPage(n.id)} className="clh-nav-btn" data-active={page === n.id ? '1' : '0'} style={{
              background: 'none', border: 'none', cursor: 'pointer', padding: '6px 0',
              fontFamily: sans, fontSize: 13, letterSpacing: 2,
              fontWeight: page === n.id ? 600 : 400,
              color: page === n.id ? p.ink : p.sub,
            }}>{n.label}</button>
          ))}
        </nav>
        <div style={{ display: 'flex', alignItems: 'center', gap: 14, whiteSpace: 'nowrap' }}>
          <div className="clh-tel-block" style={{ textAlign: 'right', lineHeight: 1.2 }}>
            <div style={{ fontFamily: italic, fontStyle: 'italic', fontSize: 16, color: p.accent, letterSpacing: 4, fontWeight: 700, marginBottom: 4, textTransform: 'uppercase', fontVariantNumeric: 'lining-nums tabular-nums', fontFeatureSettings: '"lnum" 1, "tnum" 1' }}>24h · all year</div>
            <a href={`tel:${CONTENT.company.tel.replace(/[^0-9]/g, '')}`} target="_top" rel="noopener" style={{ fontFamily: serif, fontSize: 26, fontWeight: 700, color: p.ink, letterSpacing: 1.5, textDecoration: 'none', display: 'block' }}>{CONTENT.company.tel}</a>
          </div>
        </div>
      </div>
    </header>
  );

  // ── home ───────────────────────────────────────────────────
  const Home = () => (
    <div>
      {/* HERO ─ editorial */}
      <div style={{ position: 'relative', padding: '48px 56px 44px', borderBottom: `1px solid ${p.line}`, overflow: 'hidden' }}>
        <div className="clh-corner tl" style={{ color: p.ink, top: 18, left: 18 }} />
        <div className="clh-corner tr" style={{ color: p.ink, top: 18, right: 18 }} />
        <div className="clh-corner bl" style={{ color: p.ink, bottom: 18, left: 18 }} />
        <div className="clh-corner br" style={{ color: p.ink, bottom: 18, right: 18 }} />
        {/* big rotating circle ornaments */}
        <div className="clh-circle-deco" style={{ color: p.ink, width: 420, height: 420, top: -100, right: -140 }} />
        <div className="clh-circle-deco" style={{ color: '#1e7a4e', width: 200, height: 200, top: 120, right: 60, animationDuration: '40s', animationDirection: 'reverse', opacity: .15 }} />
        <div className="clh-circle-deco" style={{ color: '#8a3a24', width: 96, height: 96, bottom: 60, left: 36, animationDuration: '24s', opacity: .18 }} />

        {/* hero photo (key handover) — right side, fades in from left */}
        <div className="clh-hero-image" aria-hidden="true" />

        <div style={{ position: 'relative', zIndex: 1 }}>
          <div className="clh-blurin" style={{ display: 'flex', alignItems: 'center', gap: 14, marginBottom: 20 }}>
            <Ornament width={56} />
            <span style={{ fontFamily: italic, fontStyle: 'italic', fontSize: 13, color: p.brass, letterSpacing: 3 }}>est. 2002 · Tokyo</span>
          </div>
          <p className="clh-blurin-2" style={{
            fontFamily: sans, fontSize: 'clamp(15px, 1.6vw, 22px)', letterSpacing: 4,
            fontWeight: 500, color: p.brass, margin: 0,
          }}>SECURE YOUR HOME, PROTECT YOUR LIFE.</p>
          <div className="clh-blurin-3" style={{ display: 'flex', gap: 16, marginTop: 28 }}>
            <MagButton onClick={() => setPage('service')} className="clh-btn-solid" style={{
              background: p.ink, color: p.bg, border: 'none',
              padding: '12px 24px', fontFamily: sans, fontSize: 12, letterSpacing: 3, cursor: 'pointer',
            }}>OUR PRACTICE <span className="clh-arrow">→</span></MagButton>
          </div>
          <div className="clh-blurin-3" style={{
            marginTop: 28, background: p.bg,
            padding: '14px 20px', borderTop: `1px solid ${p.brass}`,
            display: 'inline-flex', alignItems: 'center', gap: 20, minWidth: 260,
          }}>
            <div>
              <div style={{ fontFamily: sans, fontSize: 38, fontWeight: 700, color: p.ink, lineHeight: 1, letterSpacing: -1 }}><CountUp to="3000" /></div>
              <div style={{ fontFamily: sans, fontSize: 11, color: p.sub, marginTop: 6, letterSpacing: 2, fontWeight: 500 }}>件 / 月  対応件数</div>
            </div>
            <div style={{ width: 1, height: 36, background: p.hair }} />
            <div>
              <div style={{ fontFamily: sans, fontSize: 38, fontWeight: 700, color: p.ink, lineHeight: 1, letterSpacing: -1 }}><CountUp to="180" /></div>
              <div style={{ fontFamily: sans, fontSize: 11, color: p.sub, marginTop: 6, letterSpacing: 2, fontWeight: 500 }}>全国拠点</div>
            </div>
          </div>
        </div>
      </div>

      {/* MANIFESTO ─ "鍵" を主役にした宣言 */}
      <div style={{ padding: 'clamp(72px, 12vw, 112px) clamp(12px, 4vw, 56px) clamp(64px, 10vw, 96px)', borderBottom: `1px solid ${p.line}`, textAlign: 'center', position: 'relative' }}>
        <div className="clh-squiggle" style={{ position: 'absolute', top: 40, left: '50%', transform: 'translateX(-50%)', width: 180 }} />
        <div className="clh-squiggle" style={{ position: 'absolute', bottom: 40, left: '50%', transform: 'translateX(-50%)', width: 180 }} />

        <h2 className="clh-manifesto" style={{
          margin: 0,
          fontFamily: sans, fontWeight: 600,
          fontSize: 'clamp(28px, 3.4vw, 44px)',
          letterSpacing: 4, lineHeight: 1.5,
          color: p.ink,
          display: 'flex', alignItems: 'baseline', justifyContent: 'center', flexWrap: 'wrap',
        }}>
          <span className="clh-manifesto-line-1" style={{ display: 'inline-flex', alignItems: 'baseline' }}>
            <span className="clh-manifesto-key" style={{
              fontFamily: serif, fontStyle: 'italic',
              fontSize: 'clamp(96px, 13vw, 180px)',
              fontWeight: 700,
              color: p.accent,
              letterSpacing: 0,
              lineHeight: 1,
              marginRight: 8,
              display: 'inline-block',
              transform: 'translateY(0.08em)',
            }}>鍵</span>
            <span>を入口に、</span>
          </span>
          <span>暮らしを支える。</span>
        </h2>

        <p style={{
          maxWidth: 720, margin: '48px auto 0',
          fontFamily: serif, fontSize: 'clamp(14px, 1.3vw, 17px)',
          lineHeight: 2.4, letterSpacing: 1.5,
          color: p.ink, opacity: 0.82,
        }}>
          月3,000件、180拠点、24時間365日。<br/>
          私たちが守っているのは、<br/>
          誰かの &quot;いつもどおりの一日&quot;。<br/>
          <span style={{ whiteSpace: 'nowrap' }}>その積み重ねが、Car Lock Homes の事業を</span><br/>
          かたちづくってきました。
        </p>
      </div>

      {/* STRENGTHS ─ pop colorful chips */}
      <div className="clh-pop-hatch" style={{ padding: 'clamp(48px, 8vw, 80px) clamp(20px, 5vw, 56px) clamp(40px, 7vw, 72px)', borderBottom: `1px solid ${p.line}` }}>
        <SectionHead en="Strengths" jp="当社の流儀" no="01" />
        <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(180px, 1fr))', gap: 16 }} className="clh-stagger">
          {CONTENT.strengths.map((s, i) => {
            const chipColors = ['#1e7a4e', '#8a3a24', '#1e4d8a', p.ink, p.accent];
            const cc = chipColors[i % chipColors.length];
            return (
              <div key={s.no} className="clh-card" style={{
                padding: '24px 22px 28px',
                background: '#fff', border: `1px solid ${p.line}`,
                borderTop: `4px solid ${cc}`,
                position: 'relative',
              }}>
                <div className="clh-chip clh-chip-ring" style={{ ['--clh-chip']: cc, marginBottom: 22 }}>{s.no}</div>
                <div style={{ fontFamily: sans, fontSize: 16, fontWeight: 700, color: p.ink, letterSpacing: 1, lineHeight: 1.55, marginBottom: 14 }}>{s.t}</div>
                <div style={{ fontFamily: sans, fontSize: 12, lineHeight: 2, color: p.sub, letterSpacing: 0.5 }}>{s.d}</div>
                <div style={{ height: 2, width: 36, background: cc, marginTop: 18 }} />
              </div>
            );
          })}
        </div>
      </div>

    </div>
  );

  // ── service ────────────────────────────────────────────────
  const Service = () => {
    const makers = [
      { name: '美和ロック株式会社', en: 'Miwa Lock', cert: '指定サービス代行店', code: 'SD', color: '#1e7a4e', logo: 'assets/miwa-logo.jpg' },
      { name: '株式会社シブタニ', en: 'Shibutani / Clavis', cert: 'Clavisサービス代行店', code: 'Clavis', color: '#8a3a24', logo: 'assets/clavis-logo.jpg' },
      { name: '株式会社ゴール', en: 'Goal', cert: '指定メンテナンスステーション', code: 'GMS', color: '#1e4d8a', logo: 'assets/goal-logo.jpg' },
    ];
    const groups = [
      { no: '01', tag: '主力', title: 'カギ・防犯セキュリティー', sub: 'Lock & Security',
        desc: '住宅から金庫、マンション共用部のオートロックまで。錠前メーカー3社の正規代行店として、解錠・交換・新規取付から保守点検まで責任を持って対応します。',
        items: ['住宅・金庫等の緊急解錠および修理', '鍵・スマートロックの交換および新規取付', '監視カメラ・インターホン等の通信工事', 'オートロック・電気錠システムの保守点検'] },
      { no: '02', tag: '主力', title: '住宅設備メンテナンス', sub: 'Home Maintenance',
        desc: '玄関まわりだけでなく、暮らしの「困った」全般に。サッシ・水漏れ・退去後清掃まで、住まいに関わるトラブルを24時間365日体制でお引き受けします。',
        items: ['サッシ・網戸・ペアガラスの修理交換', '水漏れ・排水詰まりの24時間緊急対応', '建物共用部の定期安全点検・修繕提案', '退去後清掃・リフレッシュ工事の受託'] },
      { no: '03', tag: '', title: '管理代行アウトソーシング', sub: 'Property Outsourcing',
        desc: '不動産管理会社様向けに、入居前点検から巡回・緊急出動まで業務を一括で代行。全国180拠点のネットワークで建物価値の維持向上をご支援します。',
        items: ['不動産管理会社向けの入居前点検代行', '全国180拠点を活かした巡回点検', '24時間365日の受付・緊急出動体制', '建物価値向上を目指すコンサル業務'] },
    ];

    return (
      <div style={{ padding: '80px 56px 72px' }}>
        <SectionHead en="Services" jp="事業内容" no="02" />

        {/* maker strip — three crests on hairlines */}
        <div style={{ marginBottom: 64, border: `1px solid ${p.line}`, background: p.paper }}>
          <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(180px, 1fr))', gap: 0 }}>
            <div style={{ padding: '28px 28px', borderRight: `1px solid ${p.line}`, display: 'flex', flexDirection: 'column', justifyContent: 'center' }}>
              <div style={{ fontFamily: italic, fontStyle: 'italic', fontSize: 13, color: p.brass, letterSpacing: 3, marginBottom: 6 }}>— authorized</div>
              <div style={{ fontFamily: serif, fontSize: 18, fontWeight: 600, color: p.ink, letterSpacing: 3, lineHeight: 1.5 }}>3メーカー<br/>指定代行店</div>
            </div>
            {makers.map((m, i) => (
              <div key={i} className="clh-card clh-frame" data-rv="1" style={{
                padding: '32px 28px 28px',
                borderRight: i < makers.length - 1 ? `1px solid ${p.line}` : 'none',
                ['--clh-bar']: m.color,
                position: 'relative',
              }}>
                <div style={{ display: 'flex', alignItems: 'center', gap: 12, marginBottom: 14 }}>
                  <span style={{
                    background: m.color, color: '#fff', fontFamily: sans,
                    fontSize: 12, fontWeight: 600, padding: '4px 12px', letterSpacing: 2,
                  }}>{m.code}</span>
                  <span style={{ fontFamily: sans, fontSize: 12, color: p.sub, letterSpacing: 1.5, fontWeight: 500 }}>{m.en}</span>
                </div>
                <div style={{ fontFamily: sans, fontSize: 16, fontWeight: 700, color: p.ink, letterSpacing: 1, lineHeight: 1.5, marginBottom: 6 }}>{m.name}</div>
                <div style={{ fontFamily: sans, fontSize: 11.5, color: p.sub, letterSpacing: 1.5 }}>{m.cert}</div>
                <div className="clh-color-bar" style={{ marginTop: 16, height: 2, width: 40, background: m.color }} />
              </div>
            ))}
          </div>
        </div>

        {/* three categories — vertical, hairline-divided */}
        <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(260px, 1fr))', gap: 0, border: `1px solid ${p.line}`, background: p.paper }} className="clh-stagger">
          {groups.map((g, gi) => (
            <div key={g.no} className="clh-card clh-frame" data-rv="1" style={{
              padding: '44px 36px 44px',
              borderRight: gi < groups.length - 1 ? `1px solid ${p.line}` : 'none',
              ['--clh-bar']: gi === 0 ? p.ink : (gi === 1 ? p.accent : p.brass),
              position: 'relative',
            }}>
              <div style={{ display: 'flex', alignItems: 'flex-start', justifyContent: 'space-between', marginBottom: 28 }}>
                <span className="clh-numframe" style={{ color: p.ink, width: 44, height: 44, fontSize: 14, fontWeight: 700 }}>{g.no}</span>
                {g.tag && <span style={{
                  background: p.ink, color: p.bg,
                  fontFamily: sans, fontSize: 11, padding: '4px 12px', letterSpacing: 2, fontWeight: 500,
                }}>{g.tag}</span>}
              </div>
              <div style={{ fontFamily: sans, fontSize: 12, color: p.accent, letterSpacing: 3, marginBottom: 12, fontWeight: 600, textTransform: 'uppercase' }}>{g.sub}</div>
              <div style={{ fontFamily: sans, fontSize: 22, fontWeight: 700, color: p.ink, letterSpacing: 1, lineHeight: 1.5, marginBottom: 20 }}>{g.title}</div>
              <div style={{ fontFamily: sans, fontSize: 13, lineHeight: 2, color: p.sub, marginBottom: 24, letterSpacing: 0.5 }}>{g.desc}</div>
              <ul style={{ margin: 0, padding: 0, listStyle: 'none', borderTop: `1px solid ${p.line}` }}>
                {g.items.map((it, j) => (
                  <li key={j} style={{
                    display: 'grid', gridTemplateColumns: '32px 1fr', gap: 4, alignItems: 'baseline',
                    padding: '14px 0', borderBottom: `1px solid ${p.line}`,
                    fontFamily: sans, fontSize: 13, lineHeight: 1.6, color: p.ink, letterSpacing: 0.5,
                  }}>
                    <span style={{ fontFamily: sans, fontSize: 12, color: p.sub, fontWeight: 600 }}>{String(j + 1).padStart(2, '0')}</span>
                    <span>{it}</span>
                  </li>
                ))}
              </ul>
            </div>
          ))}
        </div>

      </div>
    );
  };

  // ── works ──────────────────────────────────────────────────
  const Works = () => (
    <div style={{ padding: 'clamp(48px, 8vw, 80px) clamp(20px, 5vw, 56px) clamp(40px, 7vw, 72px)' }}>
      <SectionHead en="Practice & Network" jp="実績・取引先" no="03" />

      <Reveal as="div" stagger style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(180px, 1fr))', gap: 0, border: `1px solid ${p.line}`, marginBottom: 'clamp(48px, 8vw, 80px)' }}>
        {[
        ['3000', '件 / 月', '対応件数'],
        ['180', '拠点', '全国パートナーネットワーク'],
        ['2002', '年創業', '平成14年'],
        ].map(([n, unit, l], i) => (
          <div key={l} className="clh-works-stat-cell" style={{
            padding: 'clamp(28px, 6vw, 48px) clamp(18px, 4.5vw, 36px) clamp(24px, 5vw, 40px)', textAlign: 'left',
            borderRight: i < 2 ? `1px solid ${p.line}` : 'none',
            background: p.bg,
          }}>
            <div style={{ display: 'flex', alignItems: 'baseline', gap: 10, flexWrap: 'wrap' }}>
              <div style={{ fontFamily: sans, fontSize: 'clamp(52px, 9.5vw, 88px)', fontWeight: 700, color: p.ink, lineHeight: 1, letterSpacing: '-0.04em' }}>
                <CountUp to={n} duration={i === 2 ? 1100 : 900} />
              </div>
              <div style={{ fontFamily: sans, fontSize: 'clamp(13px, 1.5vw, 16px)', fontWeight: 500, color: p.ink, letterSpacing: 1 }}>{unit}</div>
            </div>
            <div style={{ fontFamily: sans, fontSize: 12, color: p.sub, marginTop: 'clamp(12px, 2vw, 20px)', letterSpacing: 2, fontWeight: 500 }}>{l}</div>
          </div>
        ))}
      </Reveal>

      <div style={{ marginBottom: 28 }}>
        <div style={{ fontFamily: sans, fontWeight: 600, fontSize: 24, color: p.ink, letterSpacing: 1 }}>加盟・特約・協力店</div>
      </div>
      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(480px, 1fr))', gap: 12, marginBottom: 64 }} className="clh-stagger">
        {CONTENT.partners.map((pt, i) => (
          <div key={i} className="clh-card clh-partner-card" style={{
            padding: '20px 24px',
            background: p.paper,
            border: `1px solid ${p.line}`,
            display: 'grid', gridTemplateColumns: 'auto 1fr', gap: 16, alignItems: 'center',
          }}>
            <span style={{
              border: `1px solid ${p.brass}`, color: p.brass, fontFamily: italic, fontStyle: 'italic',
              fontSize: 12, padding: '3px 12px', letterSpacing: 2, whiteSpace: 'nowrap',
            }}>{pt.cat}</span>
            <div style={{ minWidth: 0 }}>
              <div style={{ fontFamily: serif, fontSize: 16, fontWeight: 600, color: p.ink, letterSpacing: 1.2, lineHeight: 1.4 }}>{pt.name}</div>
              <div style={{ fontFamily: serif, fontSize: 11, color: p.sub, marginTop: 4, letterSpacing: 1, lineHeight: 1.4 }}>{pt.spec}</div>
            </div>
          </div>
        ))}
      </div>

      <div style={{ marginBottom: 28 }}>
        <div style={{ fontFamily: sans, fontWeight: 600, fontSize: 24, color: p.ink, letterSpacing: 1 }}>主要取引先</div>
      </div>
      <div className="clh-clients-marquee" style={{ padding: '32px 36px', border: `1px solid ${p.line}`, background: p.paper, overflow: 'hidden' }}>
        {(() => {
          const half = Math.ceil(CONTENT.clients.length / 2);
          const row1 = CONTENT.clients.slice(0, half);
          const row2 = CONTENT.clients.slice(half);
          const renderItem = (c, n) => (
            <div key={n} style={{ display: 'flex', alignItems: 'center', gap: 14, whiteSpace: 'nowrap' }}>
              <span style={{ fontFamily: italic, fontStyle: 'italic', fontSize: 13, color: p.brass }}>·{String(n).padStart(2, '0')}</span>
              <span style={{ fontFamily: sans, fontSize: 14, fontWeight: 500, color: p.ink, letterSpacing: 0.5 }}>{c}</span>
            </div>
          );
          return (
            <>
              <Marquee gap={48} speed={90} style={{ marginBottom: 18 }}>
                {row1.map((c, i) => renderItem(c, i + 1))}
              </Marquee>
              <Marquee gap={48} speed={90}>
                {row2.map((c, i) => renderItem(c, half + i + 1))}
              </Marquee>
            </>
          );
        })()}
      </div>
    </div>
  );

  // ── company ────────────────────────────────────────────────
  const Company = () => (
    <div style={{ padding: '80px 56px 72px' }}>
      <SectionHead en="The Studio" jp="企業情報" no="04" />

      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(280px, 1fr))', gap: 'clamp(28px, 5vw, 64px)', alignItems: 'flex-start' }}>
        <div>
          <div style={{
            height: 360, position: 'relative', overflow: 'hidden',
            border: `1px solid ${p.line}`,
          }}>
            <iframe
              title="The Studio Map"
              src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d1730.0419150492035!2d139.60129778650392!3d35.70804628141828!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x6018ee0c327e87bd%3A0x3a843081cd4d7b6d!2z44Kr44O844Ot44OD44Kv44Ob44O844Og44K65qCq5byP5Lya56S-IOadieS4puWMuiDpjbXmpa3ogIU!5e0!3m2!1sja!2sjp!4v1776010539256!5m2!1sja!2sjp"
              style={{ width: '100%', height: '100%', border: 0, display: 'block' }}
              loading="lazy"
              referrerPolicy="no-referrer-when-downgrade"
              allowFullScreen
            />
            <div style={{ position: 'absolute', left: 18, top: 16, fontFamily: mono, fontSize: 10, color: p.sub, letterSpacing: 2, textTransform: 'uppercase', background: 'rgba(255,255,255,.85)', padding: '4px 10px', pointerEvents: 'none' }}>plate · studio</div>
            <div style={{ position: 'absolute', right: 18, bottom: 14, fontFamily: italic, fontStyle: 'italic', fontSize: 13, color: p.brass, letterSpacing: 2, background: 'rgba(255,255,255,.85)', padding: '4px 10px', pointerEvents: 'none' }}>— folio 02</div>
          </div>
          <div style={{ marginTop: 24, padding: '20px 24px', border: `1px solid ${p.line}`, background: p.paper }}>
            <div style={{ fontFamily: italic, fontStyle: 'italic', fontSize: 13, color: p.brass, letterSpacing: 2, marginBottom: 8 }}>— access</div>
            <div style={{ fontFamily: serif, fontSize: 13, lineHeight: 2, color: p.ink, letterSpacing: 0.5 }}>
              {CONTENT.company.access}
            </div>
          </div>
        </div>

        <table style={{ borderCollapse: 'collapse', width: '100%' }}>
          <tbody>
            {[
              ['商号', CONTENT.company.name],
              ['英名表記', CONTENT.company.nameEn],
              ['所在地', CONTENT.company.addr],
              ['電話番号', <a href={`tel:${CONTENT.company.tel.replace(/[^0-9]/g, '')}`} target="_top" rel="noopener" style={{ color: 'inherit', textDecoration: 'none', borderBottom: `1px dotted ${p.brass}`, paddingBottom: 2 }}>{CONTENT.company.tel}</a>],
              ['Email', <a href={`mailto:${CONTENT.company.email}`} target="_top" rel="noopener" style={{ color: 'inherit', textDecoration: 'none', borderBottom: `1px dotted ${p.brass}`, paddingBottom: 2 }}>{CONTENT.company.email}</a>],
              ['創業', CONTENT.company.estd],
              ['代表取締役', CONTENT.company.rep],
              ['グループ会社', CONTENT.company.group],
              ['事業内容', CONTENT.company.biz],
            ].map(([k, v], i) => (
              <tr key={i} style={{ borderTop: `1px solid ${p.line}` }}>
                <th style={{
                  textAlign: 'left', padding: '20px 0', width: 180, verticalAlign: 'top',
                  fontFamily: italic, fontStyle: 'italic', fontSize: 14, fontWeight: 400,
                  color: p.brass, letterSpacing: 2,
                }}>— {k}</th>
                <td style={{
                  padding: '20px 0', fontFamily: serif, fontSize: 14, color: p.ink,
                  lineHeight: 1.85, letterSpacing: 1,
                }}>{v}</td>
              </tr>
            ))}
            <tr style={{ borderTop: `1px solid ${p.line}` }} />
          </tbody>
        </table>
      </div>
    </div>
  );

  // ── footer ─────────────────────────────────────────────────
  const Footer = () => (
    <footer style={{ padding: '40px 56px 32px', borderTop: `1px solid ${p.line}`, background: p.paper }}>
      <div style={{ display: 'grid', gridTemplateColumns: '1fr auto 1fr', gap: 32, alignItems: 'center' }}>
        <div style={{ fontFamily: italic, fontStyle: 'italic', fontSize: 12, color: p.sub, letterSpacing: 2 }}>
          © {new Date().getFullYear()} Carlock Homes Co., Ltd.
        </div>
        <Ornament width={120} />
        <div style={{ textAlign: 'right', fontFamily: serif, fontSize: 11, color: p.sub, letterSpacing: 3 }}>
          MIWA · GOAL · CLAVIS  ─  Authorized Service Agent
        </div>
      </div>
    </footer>
  );

  return (
    <div style={wrap}>
      <ScrollProgress />
      <div style={{ maxWidth: 1100, margin: '0 auto', position: 'relative' }}>
        <Nav />
        <div key={page} style={{ animation: 'fade .35s ease' }}>
          {page === 'home' && <Home />}
          {page === 'service' && <Service />}
          {page === 'works' && <Works />}
          {page === 'company' && <Company />}
        </div>
        <Footer />
      </div>
    </div>
  );
}

window.SolidVariant = SolidVariant;
