/* thesecond.world — Isometric Technical Docs */
/* Palette:
   #EDF2F7 — Blueprint Light (primary bg)
   #FFFFFF — Spec White (cards/panels)
   #1E3A5F — Technical Navy (primary text, iso strokes)
   #4A6FA5 — Blueprint Blue (secondary text, grid, structural)
   #2B6CB0 — Link Active (hyperlinks, interactive iso)
   #C53030 — Annotation Red (xref markers, callouts)
   #2F855A — Verified Green (confirmed data)
   #CBD5E0 — Grid Line (iso grid overlay, table borders)
*/

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

html {
    scroll-behavior: smooth;
}

body {
    background: #EDF2F7;
    color: #1E3A5F;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.65;
    /* Isometric grid overlay at 30deg and 150deg, 30% opacity per DESIGN.md */
    background-image:
        repeating-linear-gradient(
            30deg,
            transparent,
            transparent 29px,
            rgba(203, 213, 224, 0.3) 29px,
            rgba(203, 213, 224, 0.3) 30px
        ),
        repeating-linear-gradient(
            150deg,
            transparent,
            transparent 29px,
            rgba(203, 213, 224, 0.3) 29px,
            rgba(203, 213, 224, 0.3) 30px
        );
}

/* ===== Blueprint Border Frame ===== */
.blueprint-border {
    border: 2px solid #4A6FA5;
    max-width: 960px;
    margin: 1.5rem auto;
    position: relative;
    background: #EDF2F7;
}

/* Registration Marks — L-shaped corner marks */
.reg-mark {
    position: absolute;
    width: 18px;
    height: 18px;
}

.reg-mark.tl {
    top: -2px;
    left: -2px;
    border-top: 3px solid #1E3A5F;
    border-left: 3px solid #1E3A5F;
}

.reg-mark.tr {
    top: -2px;
    right: -2px;
    border-top: 3px solid #1E3A5F;
    border-right: 3px solid #1E3A5F;
}

.reg-mark.bl {
    bottom: -2px;
    left: -2px;
    border-bottom: 3px solid #1E3A5F;
    border-left: 3px solid #1E3A5F;
}

.reg-mark.br {
    bottom: -2px;
    right: -2px;
    border-bottom: 3px solid #1E3A5F;
    border-right: 3px solid #1E3A5F;
}

/* ===== Typography ===== */
/* Headings: IBM Plex Sans 600 */
.section-heading {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 28px;
    color: #1E3A5F;
    margin-bottom: 0.5rem;
    counter-increment: section;
}

.section-desc {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: #4A6FA5;
    margin-bottom: 1.5rem;
    line-height: 1.65;
}

/* Section number markers — 24px Annotation Red circles */
.section-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #C53030;
    color: #FFFFFF;
    border-radius: 50%;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 400;
    margin-right: 0.5rem;
    vertical-align: middle;
    line-height: 1;
}

/* ===== Hero Section ===== */
.hero {
    padding: 2.5rem 2rem 1.5rem;
    text-align: center;
}

.hero-inner {
    max-width: 100%;
}

.doc-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.doc-id,
.doc-class {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #4A6FA5;
    letter-spacing: 0.05em;
}

.hero-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 28px;
    color: #1E3A5F;
    margin-bottom: 0.25rem;
    letter-spacing: 0.02em;
}

.hero-sub {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: #4A6FA5;
    margin-bottom: 1.5rem;
}

/* Isometric City Illustration */
.iso-city-container {
    max-width: 560px;
    margin: 0 auto 1.5rem;
}

.iso-city {
    display: block;
    width: 100%;
    height: auto;
}

.iso-building {
    opacity: 0;
    animation: isoRender 0.6s ease forwards;
}

.iso-building[data-building="1"] { animation-delay: 0.3s; }
.iso-building[data-building="2"] { animation-delay: 0.6s; }
.iso-building[data-building="3"] { animation-delay: 0.9s; }
.iso-building[data-building="4"] { animation-delay: 1.2s; }
.iso-building[data-building="5"] { animation-delay: 1.5s; }

@keyframes isoRender {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.iso-ground {
    opacity: 0;
    animation: isoRender 0.8s ease forwards;
    animation-delay: 0.1s;
}

/* Compass Rose */
.compass-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.compass-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #4A6FA5;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Diamond Navigation Cards */
.nav-diamonds {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
}

.diamond-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: #2B6CB0;
    background: #FFFFFF;
    border: 1px solid #CBD5E0;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    transform: skewX(-5deg);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    position: relative;
}

.diamond-card:hover {
    background: #EDF2F7;
    border-color: #2B6CB0;
    transform: skewX(-5deg) translateY(-2px);
}

.diamond-num {
    font-size: 10px;
    color: #C53030;
    margin-bottom: 2px;
}

.diamond-label {
    font-size: 13px;
    color: #2B6CB0;
}

/* ===== Table of Contents ===== */
.toc {
    padding: 0 2rem 1.5rem;
    border-bottom: 1px solid #CBD5E0;
    margin-bottom: 0;
}

.toc-entry {
    display: flex;
    align-items: baseline;
    padding: 0.35rem 0;
}

.toc-label {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 13px;
    color: #1E3A5F;
    white-space: nowrap;
}

.toc-dots {
    flex: 1;
    border-bottom: 1px dotted #CBD5E0;
    margin: 0 0.75rem;
    position: relative;
    top: -3px;
}

.toc-page {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #4A6FA5;
    white-space: nowrap;
}

/* ===== Atlas Section ===== */
.atlas {
    padding: 2rem;
}

.spec-sheets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.spec-sheet {
    background: #FFFFFF;
    border: 1px solid #CBD5E0;
    padding: 1.25rem;
    transition: border-color 0.2s ease;
}

.spec-sheet:hover {
    border-color: #4A6FA5;
}

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

.spec-code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #4A6FA5;
    letter-spacing: 0.05em;
}

.spec-status {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 2px;
    letter-spacing: 0.05em;
}

.spec-status.verified {
    color: #2F855A;
    background: rgba(47, 133, 90, 0.1);
    border: 1px solid rgba(47, 133, 90, 0.3);
}

.spec-status.pending {
    color: #C53030;
    background: rgba(197, 48, 48, 0.1);
    border: 1px solid rgba(197, 48, 48, 0.3);
}

.spec-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 18px;
    color: #1E3A5F;
    margin-bottom: 0.15rem;
}

.spec-class {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #4A6FA5;
    display: block;
    margin-bottom: 0.5rem;
}

.spec-iso-mini {
    text-align: center;
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
}

.spec-table tr:nth-child(even) {
    background: rgba(237, 242, 247, 0.5);
}

.spec-table td {
    padding: 5px 0;
    font-size: 13px;
    border-bottom: 1px solid #CBD5E0;
}

.spec-table td.label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #4A6FA5;
    width: 45%;
}

.spec-table td.val {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: #1E3A5F;
    text-align: right;
}

.spec-table td.val.verified {
    color: #2F855A;
}

.spec-table td.val.pending {
    color: #C53030;
}

.spec-footer {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px dotted #CBD5E0;
}

.xref {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #4A6FA5;
}

.xref-marker {
    color: #C53030;
    margin-right: 0.25rem;
}

/* ===== Compare Section ===== */
.compare {
    padding: 2rem;
}

.compare-panel {
    background: #FFFFFF;
    border: 1px solid #CBD5E0;
    padding: 1.25rem;
    overflow-x: auto;
}

.compare-label {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #1E3A5F;
    margin-bottom: 0.75rem;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
}

.compare-table thead th {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 12px;
    color: #4A6FA5;
    text-align: left;
    padding: 8px;
    border-bottom: 2px solid #1E3A5F;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.compare-table tbody tr:nth-child(even) {
    background: rgba(237, 242, 247, 0.5);
}

.compare-table tbody td {
    padding: 8px;
    font-size: 13px;
    border-bottom: 1px solid #CBD5E0;
}

.compare-table td.label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #4A6FA5;
}

.compare-table td.val {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: #1E3A5F;
}

.compare-table td.val.divergent {
    color: #C53030;
}

.compare-table td.val.moderate {
    color: #4A6FA5;
}

/* Annotation markers in tables */
.annotation-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #C53030;
    color: #FFFFFF;
    border-radius: 50%;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    margin-right: 4px;
    vertical-align: middle;
    line-height: 1;
}

.compare-annotations {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px dotted #CBD5E0;
}

.annotation-note {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #4A6FA5;
    padding: 3px 0;
    line-height: 1.5;
}

/* ===== Workshop Section ===== */
.workshop {
    padding: 2rem;
}

.builder-panel {
    background: #FFFFFF;
    border: 1px solid #CBD5E0;
    padding: 1.5rem;
}

.builder-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.field-row {
    margin-bottom: 0.75rem;
}

.field-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #4A6FA5;
    display: block;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.field-input {
    width: 100%;
    background: #EDF2F7;
    border: 1px solid #CBD5E0;
    padding: 0.5rem 0.75rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: #1E3A5F;
    min-height: 36px;
    outline: none;
    transition: border-color 0.2s ease;
}

.field-input::placeholder {
    color: #CBD5E0;
}

.field-input:hover {
    border-color: #4A6FA5;
}

.field-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0,0 L10,0 L5,6 Z' fill='%234A6FA5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
    cursor: pointer;
}

.field-textarea {
    resize: vertical;
    min-height: 72px;
}

.builder-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px dotted #CBD5E0;
}

.submit-btn {
    display: inline-block;
    background: #2B6CB0;
    color: #FFFFFF;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 13px;
    padding: 0.5rem 1.5rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
}

.submit-btn:hover {
    background: #1E3A5F;
}

.reset-btn {
    display: inline-block;
    background: transparent;
    color: #4A6FA5;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 13px;
    padding: 0.5rem 1.5rem;
    border: 1px solid #CBD5E0;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.reset-btn:hover {
    border-color: #4A6FA5;
    color: #1E3A5F;
}

/* Builder Preview */
.builder-preview {
    margin-top: 1.25rem;
    border: 1px solid #CBD5E0;
    background: #EDF2F7;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #CBD5E0;
    background: rgba(203, 213, 224, 0.2);
}

.preview-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: #4A6FA5;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.preview-code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: #1E3A5F;
}

.preview-body {
    padding: 1rem;
    min-height: 60px;
}

.preview-empty {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #CBD5E0;
    text-align: center;
}

.preview-filled {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #1E3A5F;
    line-height: 1.8;
}

.preview-filled .pf-label {
    color: #4A6FA5;
}

.preview-filled .pf-value {
    color: #1E3A5F;
}

/* ===== World Map Section ===== */
.worldmap {
    padding: 2rem;
}

.map-container {
    background: #FFFFFF;
    border: 1px solid #CBD5E0;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.iso-map {
    display: block;
    width: 100%;
    height: auto;
}

.map-node {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.map-node:hover {
    opacity: 0.8;
}

.map-node:hover path {
    stroke-width: 2.5;
}

.map-tooltip {
    position: absolute;
    display: none;
    background: #FFFFFF;
    border: 1px solid #1E3A5F;
    padding: 0.75rem;
    min-width: 180px;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.15);
}

.map-tooltip.active {
    display: block;
}

.tooltip-code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: #4A6FA5;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.tooltip-name {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: #1E3A5F;
    margin-bottom: 2px;
}

.tooltip-class {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: #4A6FA5;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #CBD5E0;
}

.tooltip-row {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    padding: 1px 0;
}

.tooltip-label {
    color: #4A6FA5;
}

.tooltip-pop,
.tooltip-tech {
    color: #1E3A5F;
}

/* ===== Footer ===== */
.footer {
    padding: 1.5rem 2rem;
    text-align: center;
    position: relative;
}

.footer-border {
    border-top: 2px solid #4A6FA5;
    margin-bottom: 1.25rem;
}

.footer-inner {}

.doc-ref {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: #4A6FA5;
    display: block;
    margin-bottom: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.flink {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 13px;
    color: #2B6CB0;
    text-decoration: none;
    transition: color 0.2s ease;
}

.flink:hover {
    color: #1E3A5F;
}

.flink-sep {
    color: #CBD5E0;
    font-size: 11px;
}

.footer-copy {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: #4A6FA5;
    margin-bottom: 0.25rem;
}

.footer-version {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: #CBD5E0;
}

/* ===== Fade-in Animation ===== */
.fade-in {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 700px) {
    .spec-sheets {
        grid-template-columns: 1fr;
    }

    .builder-columns {
        grid-template-columns: 1fr;
    }

    .nav-diamonds {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .doc-header {
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
    }

    .hero-title {
        font-size: 22px;
    }

    .section-heading {
        font-size: 22px;
    }

    .compare-table {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .blueprint-border {
        margin: 0.5rem;
    }

    .hero,
    .atlas,
    .compare,
    .workshop,
    .worldmap,
    .toc,
    .footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .flink-sep {
        display: none;
    }
}
