@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@100..900&display=swap');

:root {
    --color-bg: #12161d;
    --color-surface: #1b212b;
    --color-surface-alt: #202632;
    --color-surface-muted: #232a36;
    --color-border: #2c3341;
    --color-border-strong: #38414f;
    --color-text: #dbe1ea;
    --color-text-muted: #93a0b3;
    --color-heading: #e8edf4;
    --color-accent: #4d7cc7;
    --color-link: #6ea8ff;
    --color-link-hover: #9cc4ff;
    --color-table-header-bg: #232f45;
    --color-table-header-text: #eef2f8;
    --color-table-stripe: #202632;
    --color-disclaimer-bg: #2c2717;
    --color-disclaimer-border: #d8a325;
    --color-highlight-bg: #1c2c3d;
    --shadow-header: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-card-hover: 0 12px 28px rgba(0, 0, 0, 0.35);
    --topbar-height: 8px;
}

:root[data-theme="light"] {
    --color-bg: #f4f6f9;
    --color-surface: #ffffff;
    --color-surface-alt: #f5f5f5;
    --color-surface-muted: #f8fafc;
    --color-border: #e5e7eb;
    --color-border-strong: #d7dee6;
    --color-text: #2b2f36;
    --color-text-muted: #64748b;
    --color-heading: #2c3e50;
    --color-accent: #2c3e50;
    --color-link: #1268dd;
    --color-link-hover: #0d4fac;
    --color-table-header-bg: #2c3e50;
    --color-table-header-text: #ffffff;
    --color-table-stripe: #f2f2f2;
    --color-disclaimer-bg: #fff8e1;
    --color-disclaimer-border: #ffc107;
    --color-highlight-bg: #e3f2fd;
    --shadow-header: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.04);
    --shadow-card-hover: 0 12px 28px rgba(15, 23, 42, 0.09);
}

* {
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

html {
    background: var(--color-bg);
    overflow-x: hidden;
}

body {
    line-height: 1.65;
    color: var(--color-text);
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
    background: var(--color-bg);
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: linear-gradient(90deg, var(--color-accent), var(--color-link));
    z-index: 100;
}

h1,
h2,
h3 {
    color: var(--color-heading);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 10px;
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

p {
    color: var(--color-text);
}

a {
    color: var(--color-link);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--color-link);
    outline-offset: 2px;
    border-radius: 4px;
}

code {
    background-color: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.1em 0.45em;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.92em;
    color: var(--color-accent);
}

.site-header,
.header {
    text-align: center;
    margin-bottom: 30px;
    width: 100%;
}

.site-header {
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    border-radius: 14px;
    box-shadow: var(--shadow-header);
    padding: 24px;
}

.eyebrow,
.document-id {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.gdd-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 18px;
}

.gdd-nav a {
    background-color: var(--color-surface-muted);
    border: 1px solid var(--color-border-strong);
    border-radius: 999px;
    color: var(--color-heading);
    font-size: 0.9rem;
    padding: 6px 12px;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.gdd-nav a:hover {
    background-color: var(--color-accent);
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
}

.theme-toggle {
    background-color: var(--color-surface-muted);
    border: 1px solid var(--color-border-strong);
    border-radius: 999px;
    color: var(--color-heading);
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 16px;
    padding: 8px 18px;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.theme-toggle:hover {
    background-color: var(--color-accent);
    color: #ffffff;
    transform: translateY(-1px);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--color-link);
    outline-offset: 2px;
}

.document {
    display: grid;
    gap: 20px;
}

.document-title,
.card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-accent);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
    padding: 24px;
    transition: box-shadow 0.2s ease;
    min-width: 0;
}

.card:hover {
    box-shadow: var(--shadow-card-hover);
}

.metadata-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin: 0;
}

.metadata-grid div {
    background-color: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 14px;
}

.metadata-grid dt {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.metadata-grid dd {
    margin: 0;
}

.principle-list {
    display: grid;
    gap: 14px;
}

.principle-list article,
.scenario,
.flow-list,
.official-list {
    background-color: var(--color-surface-alt);
    border-radius: 10px;
    padding: 15px;
}

.flow-list,
.official-list {
    margin: 0;
}

.flow-list li,
.official-list li {
    margin-bottom: 8px;
}

.flow-list li:last-child,
.official-list li:last-child {
    margin-bottom: 0;
}

.data-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.data-table th,
.data-table td {
    text-align: left;
    white-space: nowrap;
}

.data-table th {
    background-color: var(--color-table-header-bg);
    color: var(--color-table-header-text);
    padding: 12px;
    position: sticky;
    top: 0;
}

.table-compact {
    max-width: 960px;
}

.table-compact th,
.table-compact td {
    white-space: normal;
}

.data-table td {
    padding: 10px;
    border: 1px solid var(--color-border);
}

.data-table tr:nth-child(even) {
    background-color: var(--color-table-stripe);
}

.disclaimer {
    background-color: var(--color-disclaimer-bg);
    padding: 15px;
    border-left: 4px solid var(--color-disclaimer-border);
    border-radius: 0 10px 10px 0;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.highlight {
    background-color: var(--color-highlight-bg);
    font-weight: bold;
}

.footer {
    margin-top: 40px;
    font-size: 0.8em;
    text-align: center;
    color: var(--color-text-muted);
}

@media (max-width: 640px) {
    body {
        padding: 14px;
    }

    .site-header,
    .document-title,
    .card {
        padding: 18px;
    }

    .data-table th,
    .data-table td {
        white-space: normal;
        min-width: 110px;
    }
}
