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

/* --- DESIGN SYSTEM TOKENS --- */
:root {
    --color-bg-light: #ffffff;
    --color-bg-alt: #f8f9fa;
    --color-bg-dark: #000000;
    --color-bg-card: #ffffff;
    
    --color-text-dark: #000000;
    --color-text-muted: #4e4e4e;
    --color-text-light: #ffffff;
    --color-text-light-muted: #a0a0a0;
    
    --color-border-light: #e5e7eb;
    --color-border-medium: #cccccc;
    --color-border-dark: #1a1a1a;
    
    --color-accent-blue: #0044cc;
    --color-accent-blue-light: #f0f4ff;
    
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Montserrat', sans-serif;
    --font-serif: 'Montserrat', sans-serif;
    
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-fast: all 0.15s ease;
    
    --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-dark-hover: 0 10px 35px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-light);
    color: var(--color-text-dark);
    line-height: 1.6;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.page-wrapper {
    width: 100%;
    margin: 0;
    background-color: var(--color-bg-light);
    overflow: hidden;
}

/* --- TYPOGRAPHY & UTILITIES --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-bottom: 2px solid var(--color-border-dark);
    padding-bottom: 8px;
    margin-bottom: 20px;
    color: var(--color-text-dark);
}

/* --- HEADER SECTION --- */
.doc-header {
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 10px solid var(--color-bg-dark);
    position: relative;
    overflow: hidden;
}

/* Header background wavy visual mesh effect */
.doc-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.15;
    background-image: radial-gradient(circle at 20% 30%, #ffffff 1px, transparent 1px),
                      radial-gradient(circle at 75% 60%, #ffffff 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.header-left {
    padding: 60px 50px 60px 10%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 1;
    position: relative;
}

.header-left::after {
    content: '';
    position: absolute;
    right: 0;
    top: 5%;
    height: 90%;
    width: 1px;
    background-color: var(--color-text-light);
    opacity: 0.56;
}

.brand-container {
    margin-bottom: 40px;
}

.brand-logo-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: fit-content;
}

.brand-logo-text {
    font-family: var(--font-heading);
    font-size: 4.55rem;
    font-weight: 400;
    letter-spacing: 0.25em;
    padding-left: 0.25em;
    line-height: 1;
    display: flex;
    align-items: center;
}

.brand-llp-divider {
    display: flex;
    align-items: center;
    width: 80%;
    margin: 5px auto 20px auto;
}

.brand-llp-divider::before,
.brand-llp-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--color-text-light);
    opacity: 0.8;
}

.brand-llp-text {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    letter-spacing: 0.6em;
    padding: 0 15px;
    font-weight: 500;
    text-transform: uppercase;
}

.brand-tagline {
    font-family: var(--font-heading);
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    padding-left: 0.25em;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.9;
    color: var(--color-text-light);
}

.header-right {
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 1;
}

.doctrine-series-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.series-label {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-text-light-muted);
}

.series-id-pill {
    border: 1px solid var(--color-text-light);
    border-radius: 4px;
    padding: 4px 10px;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.doctrine-main-title {
    font-size: 1.9rem;
    line-height: 1.15;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 10px;
}

.doctrine-subtitle {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.3rem;
    color: var(--color-text-light-muted);
    padding-top: 15px;
    margin-top: 25px;
    margin-bottom: 25px;
    position: relative;
}

.doctrine-subtitle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 30%;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.2);
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding-top: 20px;
}

.metadata-item {
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    padding-right: 15px;
    padding-left: 15px;
}

.metadata-item:first-child {
    padding-left: 0;
}

.metadata-item:last-child {
    border-right: none;
    padding-right: 0;
}

.metadata-label {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-light-muted);
    margin-bottom: 4px;
}

.metadata-value {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* --- MAIN CONTAINER --- */
.main-content {
    display: grid;
    grid-template-columns: 5.5fr 4.5fr;
    border-bottom: 1px solid var(--color-border-light);
}

.content-left {
    padding: 50px;
    border-right: 1px solid var(--color-border-light);
}

.content-right {
    padding: 50px;
    background-color: var(--color-bg-light);
}

/* --- COMMITMENT SECTION --- */
.commitment-section {
    margin-bottom: 45px;
}

.commitment-text {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-bottom: 20px;
    text-align: justify;
}

.commitment-blockquote {
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
    padding: 22px 30px;
    border-radius: 4px;
    margin: 25px 0 10px 0;
    position: relative;
    text-align: center;
    box-shadow: var(--shadow-subtle);
}

.quote-content {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.5;
}

.quote-icon {
    font-family: var(--font-serif);
    font-size: 2rem;
    opacity: 0.7;
    line-height: 0;
    display: inline-block;
    vertical-align: middle;
}

.quote-icon.open {
    margin-right: 12px;
}

.quote-icon.close {
    margin-left: 12px;
}

/* --- DOCTRINE AT A GLANCE GRID --- */
.doctrine-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px 20px;
    margin-top: 30px;
}

.doctrine-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 15px 10px;
    border-radius: 6px;
    background-color: var(--color-bg-card);
    border: 1px solid transparent;
}

.card-icon-container {
    height: 48px;
    width: 48px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-dark);
}

.card-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
}

.card-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 50%;
    margin-right: 8px;
    margin-top: 2px;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.3;
}

.card-desc {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    line-height: 1.4;
    padding-left: 26px;
}

/* --- CHALLENGE LIFECYCLE --- */
.lifecycle-section {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.lifecycle-outer-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 520px;
    margin: -30px 0 10px 0;
    position: relative;
}

/* The SVG connection ring */
.lifecycle-svg-ring {
    position: absolute;
    width: 460px;
    height: 460px;
    z-index: 1;
    pointer-events: none;
}

.lifecycle-circle-container {
    position: relative;
    width: 460px;
    height: 460px;
    z-index: 2;
}

/* Center node */
.lifecycle-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    z-index: 3;
}

.center-logo-wrapper {
    margin-bottom: 15px;
}

.center-brand-logo {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    line-height: 1.2;
}

.center-brand-sub {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.45em;
    border-top: 1px solid var(--color-border-medium);
    padding-top: 4px;
    margin-top: 4px;
    text-transform: uppercase;
}

.center-text {
    font-size: 0.65rem;
    line-height: 1.45;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* Circular states nodes styling */
.lifecycle-state-node {
    position: absolute;
    width: 90px;
    height: 90px;
    margin-left: -45px;
    margin-top: -45px;
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
    border: 1px solid var(--color-bg-dark);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: default;
    z-index: 4;
    box-shadow: var(--shadow-subtle);
}

.node-icon-wrapper {
    height: 28px;
    width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
    margin-bottom: 2px;
}

.node-label {
    font-family: var(--font-heading);
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1.25;
    padding: 0 4px;
}


/* Positioning based on the trigonometry angles computed: */
.node-1 {
    top: calc(50% + 200px * sin(-90deg));
    left: calc(50% + 200px * cos(-90deg));
}

.node-2 {
    top: calc(50% + 200px * sin(-45deg));
    left: calc(50% + 200px * cos(-45deg));
}

.node-3 {
    top: calc(50% + 200px * sin(0deg));
    left: calc(50% + 200px * cos(0deg));
}

.node-4 {
    top: calc(50% + 200px * sin(45deg));
    left: calc(50% + 200px * cos(45deg));
}

.node-5 {
    top: calc(50% + 200px * sin(90deg));
    left: calc(50% + 200px * cos(90deg));
}

.node-6 {
    top: calc(50% + 200px * sin(126deg));
    left: calc(50% + 200px * cos(126deg));
}

.node-7 {
    top: calc(50% + 200px * sin(162deg));
    left: calc(50% + 200px * cos(162deg));
}

.node-8 {
    top: calc(50% + 200px * sin(198deg));
    left: calc(50% + 200px * cos(198deg));
}

.node-9 {
    top: calc(50% + 200px * sin(234deg));
    left: calc(50% + 200px * cos(234deg));
}

/* --- STATE DEFINITIONS --- */
.definitions-container {
    border: 2px solid var(--color-border-medium);
    border-radius: 4px;
    padding: 25px;
    margin-top: 10px;
    background-color: var(--color-bg-card);
}

.definitions-title {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 15px;
    color: var(--color-text-dark);
}

.definitions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.definition-item {
    display: flex;
    align-items: center;
    font-size: 0.82rem;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid transparent;
}

.definition-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 50%;
    margin-right: 12px;
}

.definition-text {
    color: var(--color-text-muted);
}

/* --- BOTTOM DETAILS / METADATA & PRINCIPLES & HISTORY --- */
.bottom-sections {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    border-bottom: 1px solid var(--color-border-light);
}

.bottom-column {
    padding: 40px 50px;
    border-right: 1px solid var(--color-border-light);
}

.bottom-column:last-child {
    border-right: none;
}

/* Document Control Column */
.doc-control-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

.doc-control-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    border-bottom: 1px dashed var(--color-border-light);
    padding-bottom: 6px;
}

.doc-control-row:last-child {
    border-bottom: none;
}

.control-key {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-text-muted);
    letter-spacing: 0.02em;
    width: 38%;
}

.control-val {
    font-weight: 500;
    color: var(--color-text-dark);
    width: 58%;
    text-align: left;
}

.copyright-text {
    font-size: 0.65rem;
    color: var(--color-text-muted);
    margin-top: 15px;
}

.doc-footer .copyright-text {
    color: var(--color-text-light-muted);
    opacity: 0.6;
    margin-top: 0;
}

/* Doctrine Principles Column */
.principles-column {
    display: flex;
    flex-direction: column;
}

.principles-quote-icon {
    font-family: var(--font-serif);
    font-size: 4.4rem;
    line-height: 1;
    color: var(--color-text-dark);
    margin-top: -15px;
    margin-bottom: 5px;
    opacity: 0.85;
}

.principles-list {
    list-style: none;
    border-left: 2px solid var(--color-border-dark);
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.principle-item {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--color-text-dark);
    line-height: 1.4;
}

.principles-close-quote {
    font-family: var(--font-serif);
    font-size: 4.4rem;
    line-height: 1;
    color: var(--color-text-dark);
    align-self: flex-end;
    margin-top: 5px;
    opacity: 0.85;
}

/* Issue History Column */
.history-table-container {
    width: 100%;
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.65rem;
    text-align: left;
}

.history-table th {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    border-bottom: 2px solid var(--color-border-dark);
    padding-bottom: 8px;
    padding-right: 8px;
}

.history-table td {
    height: 48px;
    padding: 0 8px 0 0;
    vertical-align: middle;
    border-bottom: 1px solid var(--color-border-light);
    color: var(--color-text-muted);
}

/* --- FOOTER BANNER --- */
.doc-footer {
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
    padding: 30px 40px;
}

.footer-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.footer-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.85;
}

.footer-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-divider-line {
    width: 1px;
    height: 18px;
    background-color: rgba(255, 255, 255, 0.15);
}

.footer-bottom-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.footer-brand {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
}

.footer-brand-divider {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 300;
}

.footer-tagline {
    font-family: var(--font-heading);
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.8;
}

/* --- RESPONSIVE BREAKPOINTS --- */

/* Tablet layout */
@media (max-width: 992px) {
    body {
        padding: 20px 10px;
    }
    
    .doc-header {
        grid-template-columns: 1fr;
    }
    
    .header-left {
        border-right: none;
        border-bottom: none;
        padding: 40px;
    }
    
    .header-left::after {
        right: 10%;
        left: 10%;
        top: auto;
        bottom: 0;
        width: 80%;
        height: 1px;
    }
    
    .header-right {
        padding: 40px;
    }
    
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .content-left {
        border-right: none;
        border-bottom: 1px solid var(--color-border-light);
        padding: 40px;
    }
    
    .content-right {
        padding: 40px;
    }
    
    .bottom-sections {
        grid-template-columns: 1fr;
    }
    
    .bottom-column {
        border-right: none;
        border-bottom: 1px solid var(--color-border-light);
        padding: 40px;
    }
    
    .bottom-column:last-child {
        border-bottom: none;
    }
    
    .footer-nav {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
        padding-bottom: 25px;
    }
    
    .footer-divider-line {
        display: none;
    }
}

/* Mobile responsive for circular layout */
@media (max-width: 600px) {
    .content-left, .content-right, .header-left, .header-right, .bottom-column {
        padding: 30px 20px;
    }
    
    .doctrine-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* On narrow screens, the circular layout is hard to read.
       We transform the circle into a highly readable, interactive linear stack
       that still maintains the same connections! */
    .lifecycle-outer-container {
        min-height: auto;
        margin: 20px 0;
    }
    
    .lifecycle-svg-ring {
        display: none;
    }
    
    .lifecycle-circle-container {
        width: 100%;
        height: auto;
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .lifecycle-center {
        position: static;
        transform: none;
        width: 100%;
        height: auto;
        border-radius: 6px;
        margin-bottom: 25px;
        padding: 25px;
    }
    
    .lifecycle-state-node {
        position: static;
        width: 100%;
        height: auto;
        margin-left: 0;
        margin-top: 0;
        border-radius: 6px;
        flex-direction: row;
        justify-content: flex-start;
        padding: 15px 20px;
        gap: 15px;
    }
    
    .node-number-bubble {
        position: static;
        transform: none;
        flex-shrink: 0;
    }
    
    .node-icon-wrapper {
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .node-label {
        font-size: 0.75rem;
        text-align: left;
    }
    
    .brand-logo-text {
        font-size: 2.5rem;
    }
    
    .doctrine-main-title {
        font-size: 1.8rem;
    }
}
