:root {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    /* [Accessibility Fix] フッター背景(#0b0f19)におけるテキストコントラスト比(4.5:1以上)を満たす高明度グレー */
    --text-muted-high: #cbd5e1; 
    /* [Accessibility Fix] 背景に対してWCAG AAの最低コントラスト比を完全に突破する高視認性シアン */
    --accent-cyan: #38bdf8; 
    --accent-teal: #2dd4bf;
    --border-color: #334155;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-family: var(--font-stack);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4 {
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.2;
}

h2 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
    text-align: center;
}

p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5rem 1.5rem;
}

/* ==========================================================================
   Header & Navigation (Tap Target & Reflow Optimizations)
   ========================================================================== */
.site-header {
    background-color: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

@supports (backdrop-filter: blur(8px)) {
    .site-header {
        backdrop-filter: blur(8px);
        background-color: rgba(15, 23, 42, 0.8);
    }
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 1.5rem; /* モバイルの垂直方向ターゲット領域確保のためパディングを調整 */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ロゴの最小タップ領域を44pxに拡張 */
.site-logo {
    color: var(--text-main);
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: -0.05em;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    min-width: 44px;
    padding: 0.25rem 0.5rem;
}

.site-nav {
    display: flex;
    align-items: center;
}

/* 各ナビゲーションリンクの最小ターゲットサイズ(44px)確保と、誤選択を防ぐ安全なマージン分離 */
.site-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 0.5rem 0.75rem;
    margin-left: 0.5rem;
}

.site-nav a:hover, .site-nav a:focus {
    color: var(--accent-cyan);
    outline: none;
}

/* ==========================================================================
   Hero & Layout Content Components
   ========================================================================== */
.hero-section {
    padding-top: 9rem;
    background: radial-gradient(circle at top right, rgba(14, 165, 233, 0.1), transparent 45%);
    text-align: center;
}

.badge {
    display: inline-block;
    background-color: rgba(14, 165, 233, 0.15);
    color: var(--accent-cyan);
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.hero-section h1 {
    font-size: 3.5rem;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}

.hero-lead {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.25rem;
    color: var(--text-muted-high); /* モバイルでの視認性を考慮したコントラスト色に補正 */
    line-height: 1.7;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 2.5rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-cyan);
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.card-meta {
    font-size: 0.85rem;
    color: var(--accent-teal);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.card-list {
    list-style: none;
    margin-top: 1.5rem;
}

.card-list li {
    color: var(--text-muted-high);
    margin-bottom: 0.75rem;
    padding-left: 1.25rem;
    position: relative;
}

.card-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent-teal);
}

.four-pillars-container {
    margin-top: 5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 4rem;
}

.four-pillars-container h3 {
    font-size: 1.75rem;
    text-align: center;
    margin-bottom: 2.5rem;
}

.four-pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.pillar-box {
    background-color: rgba(30, 41, 59, 0.5);
    border-left: 3px solid var(--accent-cyan);
    padding: 1.5rem;
    border-radius: 0 0.5rem 0.5rem 0;
}

.pillar-box h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 3rem auto;
}

/* ==========================================================================
   Design Pyramid Layer Structuring
   ========================================================================== */
.pyramid-display {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.pyramid-layer {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    padding: 1.5rem 2rem;
    transition: background-color 0.2s ease;
}

.pyramid-layer:hover {
    background-color: var(--bg-card-hover);
}

.layer-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-muted-high); /* 低コントラスト警告を回避する明度 */
    opacity: 0.8;
    margin-right: 2rem;
    min-width: 3.5rem;
}

.layer-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

@media (min-width: 768px) {
    .layer-1 { width: 100%; }
    .layer-2 { width: 95%; margin: 0 auto; }
    .layer-3 { width: 90%; margin: 0 auto; }
    .layer-4 { width: 85%; margin: 0 auto; }
}

/* ==========================================================================
   SOLID Framework Accordion Blocks
   ========================================================================== */
.solid-intro {
    text-align: center;
    margin-bottom: 3rem;
}

.solid-accordion {
    max-width: 800px;
    margin: 0 auto 5rem auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.solid-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.solid-title {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 0.75rem;
}

.solid-letter {
    font-size: 1.5rem;
    font-weight: 900;
    background-color: var(--accent-cyan);
    color: var(--bg-main);
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.35rem;
}

.solid-title h4 {
    font-size: 1.3rem;
}

.solid-body p {
    margin-bottom: 0;
    padding-left: 3.75rem;
    color: var(--text-muted-high);
}

.uml-patterns-block {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 3rem;
    border-top: 1px solid var(--border-color);
    padding-top: 4rem;
}

.standard-list {
    list-style: none;
    margin-top: 1rem;
}

.standard-list li {
    color: var(--text-muted-high);
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
}

.standard-list li::before {
    content: "•";
    color: var(--accent-cyan);
    font-size: 1.5rem;
    position: absolute;
    left: 0;
    top: -0.25rem;
}

/* ==========================================================================
   Pattern Matcher Tool Engine (Form Controls Optimization)
   ========================================================================== */
.tool-wrapper {
    max-width: 750px;
    margin: 3rem auto 0 auto;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 3rem;
}

.field-label {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.form-select {
    width: 100%;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    min-height: 44px; /* タップターゲット高の絶対最小値を保証 */
    padding: 1rem;
    font-size: 1rem;
    border-radius: 0.5rem;
    outline: none;
    margin-bottom: 1.5rem;
    transition: border-color 0.2s ease;
}

.form-select:focus {
    border-color: var(--accent-cyan);
}

.primary-button {
    background-color: var(--accent-cyan);
    color: var(--bg-main);
    border: none;
    min-height: 44px; /* タップターゲット高の絶対最小値を保証 */
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 0.5rem;
    cursor: pointer;
    width: 100%;
    transition: opacity 0.2s ease;
}

.primary-button:hover, .primary-button:focus {
    opacity: 0.9;
    outline: none;
}

.tool-result-pane {
    margin-top: 2.5rem;
    border-top: 2px dashed var(--border-color);
    padding-top: 2rem;
    animation: fadeIn 0.4s ease forwards;
}

.hidden {
    display: none !important;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.result-badge {
    background-color: rgba(20, 184, 166, 0.15);
    color: var(--accent-teal);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.solid-linkage-box {
    margin-top: 1.5rem;
    background-color: rgba(15, 23, 42, 0.4);
    padding: 0.75rem 1.25rem;
    border-radius: 0.35rem;
    font-size: 0.9rem;
}

.solid-linkage-box span {
    color: var(--accent-cyan);
    font-weight: 600;
}

/* ==========================================================================
   Footer & Contrast Fixes (Strict Lighthouse Audit Area)
   ========================================================================== */
.site-footer {
    margin-top: auto;
    background-color: #0b0f19;
    border-top: 1px solid var(--border-color);
    padding: 3rem 1.5rem;
    font-size: 0.9rem;
    text-align: center;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.site-footer p {
    color: var(--text-muted-high);
    margin-bottom: 0.5rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* フッターナビゲーションリンクの最小ターゲット領域(44px)確保 */
.footer-links a {
    color: var(--text-muted-high);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 0.5rem 1rem;
    transition: color 0.2s ease;
}

.footer-links a:hover, .footer-links a:focus {
    color: var(--accent-cyan);
}

.external-references p {
    color: var(--text-muted-high);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* [Contrast Fix Engine] 
   背景色 #0b0f19 に対し、アクセントシアン(var(--accent-cyan) = #38bdf8)をマッピングすることで、
   WCAG 2.1 AA基準を完璧に突破(4.5:1以上)するハイコントラストなリンク領域を確立します。
========================================================================== */
.external-references-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.external-references-nav a {
    color: var(--accent-cyan);
    text-decoration: underline;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 0.5rem 0.75rem;
}

.external-references-nav a:hover, .external-references-nav a:focus {
    opacity: 0.8;
    outline: none;
}

/* ==========================================================================
   Utilities & Keyframes
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .hero-section h1 { font-size: 2.5rem; }
    .comparison-grid { grid-template-columns: 1fr; }
    .uml-patterns-block { grid-template-columns: 1fr; gap: 2rem; }
    .tool-wrapper { padding: 1.5rem; }
    .header-container { flex-direction: column; gap: 1rem; }
    .site-nav a { margin-left: 0.5rem; margin-right: 0.5rem; }
}
