/* Inflection Point Engineering — shared site styles */

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

:root {
    --navy-deep: #0a1628;
    --navy-mid: #111f38;
    --navy-light: #1a2d4a;
    --accent: #4a8db7;
    --accent-muted: #3a7199;
    --text-primary: #e8ecf1;
    --text-secondary: #8a9bb5;
    --text-dim: #56677f;
    --border: rgba(74, 141, 183, 0.12);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--navy-deep);
    color: var(--text-primary);
    position: relative;
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(74, 141, 183, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(74, 141, 183, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Standard interior page wrapper */
.page {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 4rem 2rem;
    animation: fadeIn 1.2s ease-out;
}

/* Logo header on interior pages */
.page-logo {
    display: block;
    width: 100%;
    max-width: 300px;
    height: auto;
    margin: 0 0 2.5rem;
}

/* Small plot-icon brand mark on deep sub-pages */
.brand-mark {
    display: inline-block;
    margin-bottom: 1rem;
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.brand-mark img {
    display: block;
    width: 28px;
    height: 28px;
}

.brand-mark:hover {
    opacity: 1;
}

/* Back link — top of page */
.back-link {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.3s ease;
    margin-bottom: 3rem;
}

.back-link:hover {
    color: var(--accent);
}

.back-link::before {
    content: '\2190';
    margin-right: 0.5rem;
}

/* Page title block */
.page-title {
    font-family: 'Merriweather', serif;
    font-weight: 700;
    font-size: clamp(1.3rem, 3.5vw, 1.8rem);
    color: var(--text-primary);
    margin-bottom: 0.6rem;
}

.page-subtitle {
    font-weight: 300;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 3.5rem;
    letter-spacing: 0.01em;
}

/* Section blocks */
.service-section {
    margin-bottom: 3rem;
}

.service-heading {
    font-family: 'Merriweather', serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.service-subheading {
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-muted);
    margin-bottom: 1.2rem;
}

.service-list {
    list-style: none;
    padding: 0;
}

.service-list li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.8rem;
    font-weight: 300;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.service-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6rem;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-muted);
}

.section-divider {
    width: 32px;
    height: 1px;
    background: var(--border);
    margin: 2.5rem 0;
}

/* Index page item lists (calculators, references, etc.) */
.item-list {
    list-style: none;
    padding: 0;
}

.item-list li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 1.4rem;
    font-weight: 300;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.item-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6rem;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-muted);
}

.item-list a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 400;
    font-size: 0.92rem;
    border-bottom: 1px solid transparent;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.item-list a:hover {
    color: var(--text-primary);
    border-bottom-color: var(--accent-muted);
}

.item-list .item-desc {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.82rem;
    color: var(--text-dim);
}

.item-list .soon {
    display: inline-block;
    margin-left: 0.6rem;
    padding: 0.1rem 0.5rem;
    font-size: 0.6rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
    background: var(--navy-mid);
    border: 1px solid var(--border);
    border-radius: 3px;
    vertical-align: middle;
}

/* Full-tile clickable rows — library index and sibling category pages.
   Title + description + right-side chevron inside a single bordered surface. */
.library-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.library-row {
    display: block;
    text-decoration: none;
    padding: 1rem 3rem 1rem 1.1rem;
    background: rgba(74, 141, 183, 0.04);
    border: 1px solid var(--border);
    border-radius: 4px;
    position: relative;
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.library-row::after {
    content: '\2192';
    position: absolute;
    right: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.library-row:hover {
    background: rgba(74, 141, 183, 0.10);
    border-color: var(--accent-muted);
    transform: translateY(-1px);
}

.library-row:hover::after {
    transform: translateY(-50%) translateX(3px);
}

.library-row-title {
    display: block;
    font-weight: 400;
    font-size: 0.92rem;
    color: var(--text-primary);
    letter-spacing: 0.005em;
}

.library-row-desc {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--text-secondary);
    line-height: 1.55;
}

.library-row.soon {
    background: transparent;
    cursor: default;
}

.library-row.soon::after {
    color: var(--text-dim);
}

.library-row.soon:hover {
    background: transparent;
    border-color: var(--border);
    transform: none;
}

.library-row.soon:hover::after {
    transform: translateY(-50%);
}

.library-row.soon .library-row-title {
    color: var(--text-secondary);
}

.library-row .soon-badge {
    display: inline-block;
    margin-left: 0.6rem;
    padding: 0.1rem 0.5rem;
    font-size: 0.58rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-dim);
    background: var(--navy-mid);
    border: 1px solid var(--border);
    border-radius: 3px;
    vertical-align: 2px;
}

/* Body prose (knowledge base, descriptions) */
.prose {
    font-weight: 300;
    font-size: 0.92rem;
    line-height: 1.75;
    color: var(--text-secondary);
}

.prose p { margin-bottom: 1.1rem; }
.prose h2 {
    font-family: 'Merriweather', serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-top: 2.5rem;
    margin-bottom: 0.8rem;
}
.prose h3 {
    font-family: 'Merriweather', serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 0.6rem;
}
.prose ul, .prose ol { margin: 0.6rem 0 1.2rem 1.2rem; }
.prose li { margin-bottom: 0.45rem; }
.prose code {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.85em;
    background: var(--navy-mid);
    color: var(--accent);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
}
.prose pre {
    background: var(--navy-mid);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1.2rem;
}
.prose pre code {
    background: transparent;
    color: var(--text-primary);
    padding: 0;
}
.prose a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}
.prose a:hover { border-bottom-color: var(--accent-muted); }

/* Tables — knowledge base & references */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin: 1rem 0 2rem;
    color: var(--text-secondary);
    font-weight: 300;
}

.data-table th {
    text-align: left;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    border-bottom: 1px solid var(--accent-muted);
    padding: 0.6rem 0.7rem;
}

.data-table td {
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid var(--border);
}

.data-table tbody tr:nth-child(even) td {
    background: rgba(74, 141, 183, 0.03);
}

.data-table tbody tr:hover td {
    background: rgba(74, 141, 183, 0.07);
}

/* Calculator / tool input forms */
.tool-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem 1.5rem;
    margin-bottom: 2rem;
}

.field {
    display: flex;
    flex-direction: column;
}

label {
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.4rem;
    display: block;
}

input, select, textarea {
    background: var(--navy-mid);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    padding: 0.55rem 0.75rem;
    border-radius: 4px;
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
}

textarea {
    min-height: 140px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    resize: vertical;
}

button.calculate, button.tool-btn {
    background: var(--accent);
    color: var(--navy-deep);
    border: none;
    padding: 0.65rem 1.6rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

button.calculate:hover, button.tool-btn:hover {
    opacity: 0.8;
}

.results {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--navy-mid);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.results h3 {
    font-family: 'Merriweather', serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

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

.result-row .result-label {
    color: var(--text-dim);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.result-row .result-value {
    color: var(--accent);
    font-weight: 500;
    font-family: 'Consolas', 'Courier New', monospace;
}

.notes {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    font-weight: 300;
    color: var(--text-dim);
    line-height: 1.7;
}

.notes strong {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Search / filter input above tables */
.filter-input {
    margin-bottom: 1.5rem;
    max-width: 360px;
}

/* Footer */
.disciplines-bar {
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer {
    margin-top: 3rem;
    text-align: center;
}

.footer-email a {
    font-weight: 300;
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
    transition: color 0.3s ease;
}

.footer-email a:hover {
    color: var(--text-primary);
    border-bottom-color: var(--accent-muted);
}

.copyright {
    margin-top: 2rem;
    font-size: 0.65rem;
    font-weight: 300;
    color: var(--text-dim);
    letter-spacing: 0.05em;
    text-align: center;
}

.legal-notice {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.65rem;
    font-weight: 300;
    line-height: 1.7;
    color: var(--text-dim);
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

.legal-notice p { margin-bottom: 0.7rem; }
.legal-notice p:last-child { margin-bottom: 0; }
.legal-notice strong { color: var(--text-secondary); font-weight: 500; }
