/* Shared appearance and locale controls. Loaded last on every route. */
.header-inner { justify-content: flex-start; gap: 1rem; }
.brand-link { margin-right: auto; flex-shrink: 0; }
.header-preferences { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.language-picker { position: relative; }
.language-toggle, .theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; color: var(--color-text); font: inherit; cursor: pointer;
}
.language-toggle { gap: .45rem; min-width: 88px; padding: .5rem; font-size: .8125rem; white-space: nowrap; }
.theme-toggle { width: 44px; border: 1px solid var(--color-divider); border-radius: 50%; background: var(--color-surface); }
.language-toggle:hover, .theme-toggle:hover { background: var(--color-surface-subtle); }
.language-options {
  position: absolute; top: calc(100% + .5rem); right: 0; min-width: 148px;
  list-style: none; padding: .4rem; background: var(--color-surface);
  border: 1px solid var(--color-divider); border-radius: var(--radius-md); box-shadow: var(--shadow-soft);
}
.language-options[hidden] { display: none; }
.language-options button { width: 100%; min-height: 44px; padding: .5rem .75rem; border-radius: .5rem; text-align: left; font: inherit; font-size: .875rem; color: var(--color-text); cursor: pointer; }
.language-options button:hover, .language-options button[aria-current="true"] { background: var(--color-indigo-mist); }
.theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-icon-moon { display: none; }
.site-footer { padding-block: 2.5rem 1.5rem; background: #0f172a; color: #94a3b8; border-color: #1e293b; }
.footer-top { display: block; padding-bottom: 1.5rem; border-color: #1e293b; }
.footer-brand-col { max-width: 100%; }
.footer-brand-name, .footer-tagline { color: #94a3b8; }
.footer-business-info { margin-top: 1.5rem; color: #a8b4c7; }
.footer-business-info a { color: inherit; display: inline-flex; align-items: center; min-height: 44px; }
.footer-business-info a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { padding-top: 1.25rem; color: #94a3b8; }
.footer-bottom > div:last-child { color: #94a3b8 !important; }

/* Keep white on action buttons; change surfaces and reading colors separately. */
:root[data-theme="dark"] {
  --color-bg: #0b1220; --color-surface: #131e30; --color-surface-subtle: #19263a;
  --color-text: #e8eef8; --color-text-secondary: #b6c3d6; --color-text-muted: #a0aec2;
  --color-midnight: #e8eef8; --color-deep-slate: #d4deec; --color-slate: #b6c3d6;
  --color-slate-gray: #a0aec2; --color-soft-gray: #b6c3d6;
  --color-border: #41516a; --color-divider: #2d3d55;
  --color-cloud: #19263a; --color-soft-cloud: #101a2b; --color-indigo-mist: #222c52;
  --color-mint-deep: #5eead4; --color-focus: #9caaff;
  --shadow-soft: 0 1rem 3rem rgb(0 0 0 / .22);
  --shadow-lift: 0 1.875rem 3.75rem rgb(0 0 0 / .3);
}
[data-theme="dark"] :is(.site-header, .site-header--scrolled) { background: rgb(11 18 32 / .94); }
[data-theme="dark"] :is(.mobile-drawer, .nav-dropdown-menu, .card, .form-control, .contact-form-panel, .gallery-slider, .slider-caption-card, .slider-controls-bar, .slider-btn, .philo-item, .workflow-step, .bento-card, .clean-closing-cta, .gateway-card, .interactive-graph-showcase, .principle-card, .flow-step-card, .service-badge--released, .service-badge--upcoming) { background-color: var(--color-surface); }
[data-theme="dark"] :is(.home-hero, .page-hero) { background: var(--color-bg); }
[data-theme="dark"] .hero-headline-accent { background-image: linear-gradient(135deg, #a3afff, var(--color-sky)); }
[data-theme="dark"] :is(.hero-eyebrow, .hero-unified-console, .card--glass) { background: rgb(19 30 48 / .92); border-color: var(--color-divider); box-shadow: var(--shadow-soft); }
[data-theme="dark"] .btn--secondary { background: var(--color-surface); color: var(--color-text); }
[data-theme="dark"] .form-control[aria-invalid="true"] { background: #331e2a; }
[data-theme="dark"] .form-error { color: #fca5a5; }
[data-theme="dark"] .interactive-graph-container { background-color: var(--color-surface); background-image: radial-gradient(#334155 1.2px, transparent 1.2px); }
[data-theme="dark"] .node-pill-rect { fill: #17253a; }
[data-theme="dark"] .graph-node text { fill: #e8eef8; }
[data-theme="dark"] .graph-caption { border-color: var(--color-divider); }
[data-theme="dark"] .philo-item:hover { background: var(--color-surface-subtle); }
[data-theme="dark"] .swal2-popup { background: var(--color-surface); color: var(--color-text); }
[data-theme="dark"] :is(.swal2-title, .swal2-html-container) { color: var(--color-text); }
[data-theme="dark"] .brand-logo-img { filter: brightness(1.5); }
[data-theme="dark"] :is(.page-eyebrow, .section-eyebrow, .nav-link[aria-current], .link-with-arrow, .hero-eyebrow, .console-pill--active, .graph-eyebrow, .principle-num, .gateway-eyebrow, .case-grid-label, .flow-step-number, .slider-counter-current, .service-badge--released, .badge--indigo) { color: #a3afff; }
[data-theme="dark"] .service-card-visual { background: radial-gradient(ellipse at center, #222c52, #101a2b 75%); }
[data-theme="dark"] a:not(.btn) { color: #a3afff; }
[data-theme="dark"] .site-footer a { color: #a8b4c7; }
[data-theme="dark"] .graph-card-content { border-color: var(--color-divider); }

/* Allow localized copy to wrap within the original grids. */
:is(.header-inner, .cards-grid, .contact-grid, .case-grid-2col, .gateway-grid) > * { min-width: 0; }
html:not([lang="ko"]) :is(h1, h2, h3, p) { overflow-wrap: break-word; word-break: normal; }
html[lang="ja"] { --font-body: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif; }
html[lang="ja"] :is(h1, h2, h3, p) { line-break: strict; }
html:not([lang="ko"]) .contact-hero-title { white-space: normal; text-wrap: balance; }
html:not([lang="ko"]) .hero-headline { font-size: clamp(2.25rem, 5vw, 4.5rem); text-wrap: balance; }
html:not([lang="ko"]) .portfolio-card-desc { display: block; overflow: visible; -webkit-line-clamp: unset; }
html:not([lang="ko"]) .graph-node text { font-size: 9px; letter-spacing: -.02em; }
html:not([lang="ko"]) #node-core text { font-size: 14px; }
.service-card-title { overflow-wrap: break-word; }
.service-card-footer .btn { white-space: normal; }
@media (min-width: 992px) { .header-preferences { margin-left: .5rem; } }
@media (max-width: 991px) {
  .header-inner { gap: .5rem; }
  .mobile-nav-toggle { flex-shrink: 0; }
}
@media (max-width: 420px) {
  .header-inner { gap: .25rem; }
  .header-preferences { gap: .25rem; }
  .language-toggle { min-width: 80px; }
}
