*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* Base viewport color — the fluid canvas paints its own warm-white → blue
   gradient, so leaving body transparent lets the fluid show through every
   section (Hero, Domains, Services, ...) instead of only inside Hero. */
html { background: #f5f7fb; }
body {
    font-family: system-ui, -apple-system, 'Hiragino Kaku Gothic ProN', sans-serif;
    background: transparent;
    color: #0f1a2e;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Body-level fluid background ─────────────────── */
.site-fluid-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}
.site-fluid-bg .fluid-canvas {
    display: block;
    width: 100%;
    height: 100%;
}
a { color: inherit; text-decoration: none; }
a:hover { color: #1a4dcc; }

/* ── Header / Nav ─────────────────────────────────── */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(15, 26, 46, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-logo {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #0f1a2e;
}
.site-nav ul {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-nav a {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2a3550;
    padding: 0.4rem 0.2rem;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
}
.site-nav a:hover { border-bottom-color: #1a4dcc; }
.lang-toggle {
    background: #0f1a2e;
    color: #fff;
    border: 0;
    padding: 0.4rem 0.9rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}
.lang-toggle:hover { background: #1a4dcc; }
.nav-hamburger {
    display: none;
    background: transparent;
    border: 0;
    font-size: 1.6rem;
    cursor: pointer;
}
@media (max-width: 900px) {
    .nav-hamburger { display: block; }
    .site-nav { display: none; position: absolute; top: 100%; right: 0; background: #fff; padding: 1rem 2rem; box-shadow: 0 8px 16px rgba(0,0,0,0.1); }
    .site-nav.open { display: block; }
    .site-nav ul { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
}

/* ── Main / Page ─────────────────────────────────── */
.site-main {
    flex: 1;
    max-width: 1080px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 2rem;
}
.page-placeholder {
    text-align: center;
    padding: 4rem 1rem;
}
.page-placeholder h1 {
    font-size: 2.5rem;
    margin: 0 0 1rem;
    color: #0f1a2e;
}
.muted { opacity: 0.55; }
.not-found { text-align: center; padding: 4rem; font-size: 1.5rem; opacity: 0.5; }

/* ── Home page sections ─────────────────────────── */
.home-hero {
    position: relative;
    text-align: center;
    padding: 4rem 1rem 3rem;
    overflow: hidden;
    /* Keep Hero taller than the IntersectionObserver "middle band" so at
       scroll 0 the palette signal locks to HERO (blue). Previously Hero was
       ~500 px, letting Domains (which starts right after) also intersect the
       middle band and win the last-observer race → teal palette on load. */
    min-height: 65vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.home-hero-sdf {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto 1.2rem;
    z-index: 1;
}
.home-hero-sdf .sdf-canvas {
    display: block;
    width: 100%;
    height: 240px;
}
.home-hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    margin: 0 0 0.8rem;
    color: #0f1a2e;
    letter-spacing: 0.01em;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.home-hero-tagline {
    font-size: clamp(1.2rem, 3vw, 2rem);
    margin: 0 0 0.6rem;
    color: #1a4dcc;
    font-weight: 600;
}
.home-hero-sub {
    font-size: 1.1rem;
    color: #2a3550;
    font-weight: 600;
    margin: 0 0 2rem;
}
.home-hero-lead {
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.9;
    color: #4a5570;
    font-size: 0.95rem;
}

.home-section {
    padding: 3rem 1rem;
    border-top: 1px solid rgba(15, 26, 46, 0.06);
}
.home-section-head {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}
.home-section-head h2 {
    font-size: 2rem;
    margin: 0;
    color: #0f1a2e;
}
.home-section-sub {
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    color: #8794b0;
    text-transform: uppercase;
}
.home-body {
    line-height: 1.9;
    color: #2a3550;
}
.home-link {
    display: inline-block;
    margin-top: 1rem;
    font-weight: 600;
    color: #1a4dcc;
}

.home-domains, .home-service-list, .home-products, .home-portfolio {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: grid;
    gap: 1rem;
}
.home-domains { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.home-service-list { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.home-products { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.home-portfolio { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.home-domain, .home-service-list li, .home-products li, .home-portfolio li {
    background: #fff;
    padding: 1rem 1.2rem;
    border-radius: 6px;
    border: 1px solid rgba(15, 26, 46, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.home-domain strong, .home-service-list strong, .home-products strong, .home-portfolio strong {
    font-size: 1.05rem;
    color: #0f1a2e;
}
.home-domain span, .home-service-list span, .home-products span, .home-portfolio span {
    font-size: 0.9rem;
    color: #4a5570;
    line-height: 1.55;
}
.home-portfolio-year {
    font-size: 0.75rem !important;
    color: #8794b0 !important;
    letter-spacing: 0.1em;
    margin-bottom: 0.2rem;
}
.home-services-summary {
    background: linear-gradient(135deg, #f2f5ff, #e8eeff);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}
.home-services-summary h3 { margin: 0 0 0.6rem; color: #0f1a2e; font-size: 1.15rem; }
.home-services-summary p  { margin: 0; color: #4a5570; }

.home-about {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.6rem 1.6rem;
    max-width: 640px;
}
.home-about dt { font-weight: 600; color: #4a5570; }
.home-about dd { margin: 0; color: #0f1a2e; }

/* ── SDF Text canvases (Phase C.1 body impl) ────── */
.sdf-text {
    display: inline-block;
    vertical-align: middle;
    pointer-events: none;
}
/* NOTE: earlier revisions applied `filter: drop-shadow(... white ...)` here
   to add a halo for contrast over the fluid palette. That looked good on
   isolated glyphs but composited badly at internal stroke intersections
   (vertical + horizontal crossings) — the drop-shadow's white shadow bled
   through the SDF's anti-aliased edges, producing visible white dots inside
   each CJK glyph. Palette softening + dark text colour + Hero min-height
   deliver enough contrast on their own; the halo is not worth the artefact.

   If a section palette ever needs extra text pop (Hero paragraphs over dense
   blob peaks), prefer a per-section semi-transparent CSS backdrop like:

       .home-hero-tagline {
           background: linear-gradient(to bottom,
               rgba(255,255,255,0) 0%,
               rgba(255,255,255,0.35) 40%,
               rgba(255,255,255,0.35) 60%,
               rgba(255,255,255,0) 100%);
           padding: 0.4em 1em;
       }

   which doesn't touch the glyph alpha. */
.site-logo .sdf-text-hero-display {
    width: 140px;
    height: 32px;
}
.site-nav a .sdf-text-nav-item {
    width: 96px;
    height: 22px;
}
.home-section-head h2 {
    line-height: 0;
    display: inline-flex;
    align-items: center;
}
.home-section-head h2 .sdf-text-section-heading {
    width: 320px;
    height: 44px;
}

/* ── SDF Text canvases (Phase C.2 body — body text) ── */

/* Hero paragraphs */
.home-hero-tagline {
    line-height: 0;
    margin: 0 0 0.6rem;
}
.home-hero-tagline .sdf-text-body-large {
    width: 640px;
    height: 40px;
    max-width: 90vw;
}
.home-hero-sub {
    line-height: 0;
    margin: 0 0 2rem;
}
.home-hero-sub .sdf-text-body-large {
    width: 420px;
    height: 30px;
    max-width: 80vw;
}

/* Section head caption (uppercase muted) */
.home-section-sub {
    line-height: 0;
    display: inline-flex;
    align-items: center;
}
.home-section-sub .sdf-text-caption {
    width: 140px;
    height: 16px;
}

/* Card strong / span text */
.home-domain strong,
.home-service-list strong,
.home-products strong,
.home-portfolio strong,
.home-services-summary h3 {
    line-height: 0;
    display: inline-flex;
    align-items: center;
    margin: 0;
}
.home-domain strong .sdf-text-label,
.home-service-list strong .sdf-text-label,
.home-products strong .sdf-text-label,
.home-portfolio strong .sdf-text-label {
    width: 200px;
    height: 24px;
}
.home-services-summary h3 .sdf-text-label {
    width: 320px;
    height: 26px;
}
.home-domain span .sdf-text-body-large {
    width: 260px;
    height: 22px;
    max-width: 100%;
}
.home-portfolio-year {
    line-height: 0;
    display: inline-flex;
    align-items: center;
}
.home-portfolio-year .sdf-text-caption {
    width: 80px;
    height: 14px;
}

/* About definition list */
.home-about dt {
    line-height: 0;
    display: inline-flex;
    align-items: center;
}
.home-about dt .sdf-text-label {
    width: 110px;
    height: 22px;
}
.home-about dd {
    line-height: 0;
    display: inline-flex;
    align-items: center;
}
.home-about dd .sdf-text-body-large {
    width: 320px;
    height: 24px;
    max-width: 100%;
}

/* Gallery / short body text */
.home-body .sdf-text-body-large {
    width: 360px;
    height: 28px;
    max-width: 100%;
}

/* HomeLink CTA */
.home-link {
    line-height: 0;
    display: inline-flex;
    align-items: center;
}
.home-link .sdf-text-link {
    width: 220px;
    height: 22px;
}

/* ── Font demo page — 15 family × 39 variant showcase ────── */
.font-demo {
    max-width: 1100px;
    margin: 3rem auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}
.font-demo-header {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    border-bottom: 1px solid rgba(15, 26, 46, 0.12);
    padding-bottom: 1.6rem;
}
.font-demo-title {
    line-height: 0;
    display: inline-flex;
}
.font-demo-title .sdf-text-biz-udpgothic-bold {
    width: 620px;
    height: 64px;
    max-width: 92vw;
}
.font-demo-subtitle {
    line-height: 0;
    display: inline-flex;
}
.font-demo-subtitle .sdf-text-m-plus-1p-regular {
    width: 520px;
    height: 24px;
    max-width: 92vw;
}
.font-demo-group {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding-top: 1.4rem;
    border-top: 1px solid rgba(15, 26, 46, 0.06);
}
.font-demo-group-heading {
    line-height: 0;
    display: inline-flex;
    margin-bottom: 0.4rem;
}
.font-demo-group-heading .sdf-text-biz-udgothic-bold {
    width: 320px;
    height: 32px;
}
.font-demo-family {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px dashed rgba(15, 26, 46, 0.06);
}
.font-demo-family-name {
    line-height: 0;
    display: inline-flex;
}
.font-demo-family-name .sdf-text-m-plus-1p-regular {
    width: 480px;
    height: 20px;
    max-width: 92vw;
}
.font-demo-family-line {
    line-height: 0;
    display: inline-flex;
}
/* Every family sample line — target 44 px height, 720 px width, scales to viewport */
.font-demo-family-line canvas {
    width: 780px;
    height: 44px;
    max-width: 96vw;
}
.font-demo-footer {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding-top: 1.6rem;
    border-top: 1px solid rgba(15, 26, 46, 0.12);
}
.font-demo-footer-note {
    line-height: 0;
    display: inline-flex;
}
.font-demo-footer-note .sdf-text-m-plus-1p-regular {
    width: 540px;
    height: 20px;
}
.font-demo-footer-tagline {
    line-height: 0;
    display: inline-flex;
}
.font-demo-footer-tagline .sdf-text-biz-udpgothic-regular {
    width: 640px;
    height: 32px;
    max-width: 92vw;
}

/* ── Footer ─────────────────────────────────────── */
.site-footer {
    background: #0f1a2e;
    color: #d0d8ec;
    padding: 2.5rem 2rem 1.5rem;
}
.site-footer-inner {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}
.site-footer-brand strong {
    display: block;
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 0.3rem;
}
.site-footer-brand p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.75;
}
.site-footer-copy {
    font-size: 0.8rem;
    opacity: 0.55;
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── Playground (interactive typography) ────────── */
.playground {
    max-width: 1100px;
    margin: 3rem auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.playground-stage {
    border-radius: 14px;
    padding: 2rem 1rem;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: background 0.3s ease;
}
.playground-canvas {
    line-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}
.playground-stage-inner {
    position: relative;
    display: block;
    width: min(900px, 92vw);
    height: 140px;
}
.playground-stage-inner canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}
.playground-stage-particles {
    pointer-events: none;
}
.playground-stage-inner.playground-clickable {
    cursor: crosshair;
}
.playground-controls {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1rem 1.2rem;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid rgba(15, 26, 46, 0.08);
}
.playground-input {
    width: 100%;
    font-size: 1rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(15, 26, 46, 0.14);
    border-radius: 8px;
    background: #f8f8f5;
    color: #0f1a2e;
    font-family: inherit;
    box-sizing: border-box;
}
.playground-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.playground-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid rgba(15, 26, 46, 0.14);
    border-radius: 8px;
    background: #f8f8f5;
    color: #0f1a2e;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.playground-btn:hover {
    background: #efeee9;
}
.playground-btn.active {
    background: #0f1a2e;
    color: #f5efe0;
    border-color: #0f1a2e;
}
.playground-btn-effect {
    padding: 0.45rem 0.7rem;
    font-size: 1.1rem;
    min-width: 2.3rem;
}
.playground-colors {
    gap: 1rem;
    padding-top: 0.4rem;
    border-top: 1px dashed rgba(15, 26, 46, 0.08);
}
.playground-swatch {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #4a5570;
}
.playground-swatch input[type="color"] {
    width: 44px;
    height: 32px;
    padding: 0;
    border: 1px solid rgba(15, 26, 46, 0.14);
    border-radius: 6px;
    cursor: pointer;
}
