/**
 * ICP Strategy — "Precision" Theme
 * Clean, structured, data-driven targeting aesthetic.
 * Forest green + emerald palette. IBM Plex Sans typography.
 * Crosshair/target visual metaphors via CSS.
 */

/* ========================================================================
   CSS CUSTOM PROPERTIES
   ======================================================================== */

:root {
    --primary:         #166534;
    --primary-light:   #1a7a3e;
    --accent:          #059669;
    --accent-light:    #10B981;
    --accent-dim:      rgba(5, 150, 105, 0.15);
    --bg-slate:        #F8FAFC;
    --bg-white:        #FFFFFF;
    --bg-hero:         #0F172A;
    --bg-hero-subtle:  #1E293B;
    --text-dark:       #0F172A;
    --text-body:       #334155;
    --text-muted:      #64748B;
    --text-light:      #F8FAFC;
    --text-hero-muted: #94A3B8;
    --border-light:    #E2E8F0;
    --border-medium:   #CBD5E1;
    --border-green:    rgba(22, 101, 52, 0.2);
    --shadow-sm:       0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md:       0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg:       0 8px 24px rgba(0, 0, 0, 0.12);
    --font-main:       'IBM Plex Sans', system-ui, -apple-system, sans-serif;
    --max-width:       860px;
    --max-width-wide:  1080px;
    --nav-height:      56px;
    --radius:          8px;
    --radius-sm:       4px;
    --radius-lg:       12px;
}

/* ========================================================================
   RESET / NORMALIZE
   ======================================================================== */

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-body);
    background: var(--bg-slate);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

a:hover {
    color: var(--accent);
}

/* ========================================================================
   NAVIGATION
   ======================================================================== */

.precision-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.nav-inner {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-height);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.brand-crosshair {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: var(--text-light);
    border-radius: var(--radius-sm);
    font-size: 1.25rem;
    font-weight: 400;
}

.brand-name {
    color: var(--primary);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    width: 32px;
    height: 32px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-dark);
    border-radius: 1px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0;
    align-items: center;
}

.nav-links li a {
    display: block;
    padding: 0 1rem;
    line-height: var(--nav-height);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    letter-spacing: 0.02em;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-links li a:hover {
    color: var(--primary);
}

.nav-links li.active a {
    color: var(--primary);
    border-bottom-color: var(--accent);
}

/* ========================================================================
   HERO SECTIONS
   ======================================================================== */

.precision-hero {
    position: relative;
    background: var(--bg-hero);
    color: var(--text-light);
    overflow: hidden;
}

.home-hero {
    padding: 5rem 2rem 4rem;
}

.landscape-hero,
.compare-hero,
.comparison-hero,
.glossary-index-hero,
.glossary-entry-hero,
.about-hero {
    padding: 3.5rem 2rem 3rem;
}

/* Grid background — precision targeting motif */
.hero-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(22, 101, 52, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(22, 101, 52, 0.06) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

/* Crosshair overlay — centered targeting reticle */
.hero-crosshair {
    position: absolute;
    top: 50%;
    right: 8%;
    width: 200px;
    height: 200px;
    transform: translate(0, -50%);
    pointer-events: none;
    opacity: 0.08;
}

.hero-crosshair::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 180px;
    height: 180px;
    border: 2px solid var(--accent-light);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.hero-crosshair::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    border: 1px solid var(--accent-light);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* Additional crosshair lines via box-shadow trick on a tiny element */
.home-hero .hero-crosshair::before {
    box-shadow:
        0 -100px 0 -99px var(--accent-light),
        0 100px 0 -99px var(--accent-light),
        -100px 0 0 -99px var(--accent-light),
        100px 0 0 -99px var(--accent-light);
}

.hero-inner {
    position: relative;
    z-index: 2;
    max-width: var(--max-width);
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-light);
    background: rgba(5, 150, 105, 0.12);
    border: 1px solid rgba(5, 150, 105, 0.25);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.75rem;
    margin-bottom: 1.25rem;
}

.precision-hero h1 {
    font-family: var(--font-main);
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.hero-accent {
    color: var(--accent-light);
}

.hero-deck {
    font-size: 1.1rem;
    line-height: 1.65;
    color: var(--text-hero-muted);
    max-width: 640px;
}

/* Hero metrics row */
.hero-metrics {
    display: flex;
    gap: 2.5rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(22, 101, 52, 0.3);
}

.metric-block {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-light);
    line-height: 1;
    letter-spacing: -0.02em;
}

.metric-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-hero-muted);
}

/* Hero breadcrumb */
.hero-breadcrumb {
    font-size: 0.8rem;
    margin-bottom: 1rem;
    color: var(--text-hero-muted);
}

.hero-breadcrumb a {
    color: var(--accent-light);
    text-decoration: none;
}

.hero-breadcrumb a:hover {
    color: var(--text-light);
}

.bc-sep {
    margin: 0 0.5rem;
    opacity: 0.4;
}

.bc-current {
    color: var(--text-hero-muted);
}

/* ========================================================================
   MAIN CONTENT AREA
   ======================================================================== */

.content-wrap {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.5rem 2rem 4rem;
}

.content {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    padding: 2.5rem 2.5rem 3rem;
}

/* ========================================================================
   TYPOGRAPHY
   ======================================================================== */

.content h1 {
    font-family: var(--font-main);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary);
}

.content h2 {
    font-family: var(--font-main);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

.content h3 {
    font-family: var(--font-main);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.content h4 {
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    line-height: 1.35;
    margin-top: 1.5rem;
    margin-bottom: 0.4rem;
}

.content p {
    margin-bottom: 1rem;
    line-height: 1.75;
}

.content strong {
    font-weight: 600;
    color: var(--text-dark);
}

.content em {
    font-style: italic;
}

.content ul,
.content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.content li {
    margin-bottom: 0.4rem;
    line-height: 1.65;
}

.content li::marker {
    color: var(--accent);
}

.content blockquote {
    border-left: 3px solid var(--accent);
    background: var(--accent-dim);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-dark);
    font-style: normal;
}

.content blockquote p {
    margin-bottom: 0;
}

.content code {
    font-family: 'IBM Plex Mono', 'Consolas', monospace;
    font-size: 0.875em;
    background: var(--bg-slate);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
    color: var(--primary);
}

.content pre {
    background: var(--bg-hero);
    color: var(--text-light);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.875rem;
    line-height: 1.6;
}

.content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.content hr {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 2rem 0;
}

.content a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-green);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.content a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ========================================================================
   TABLES — Data Panel Aesthetic
   ======================================================================== */

.content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.875rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
}

.content thead {
    background: var(--primary);
    color: var(--text-light);
}

.content thead th {
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    border-bottom: 2px solid var(--primary-light);
}

.content thead th:first-child {
    text-align: left;
}

.content tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s ease;
}

.content tbody tr:nth-child(even) {
    background: var(--bg-slate);
}

.content tbody tr:hover {
    background: var(--accent-dim);
}

.content tbody td {
    padding: 0.65rem 1rem;
    vertical-align: top;
}

.content tbody td:first-child {
    font-weight: 600;
    color: var(--text-dark);
}

/* Centered alignment for harvey ball columns */
.content thead th:not(:first-child),
.content tbody td:not(:first-child) {
    text-align: center;
}

/* ========================================================================
   HARVEY BALLS
   ======================================================================== */

.hb {
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    vertical-align: middle;
    position: relative;
}

.hb .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hb-1 {
    background: var(--bg-white);
    border: 2px solid var(--border-medium);
}

.hb-2 {
    background: linear-gradient(to top, var(--accent) 25%, var(--bg-white) 25%);
    border: 2px solid var(--accent);
}

.hb-3 {
    background: linear-gradient(to top, var(--accent) 50%, var(--bg-white) 50%);
    border: 2px solid var(--accent);
}

.hb-4 {
    background: linear-gradient(to top, var(--primary) 75%, var(--bg-white) 75%);
    border: 2px solid var(--primary);
}

.hb-5 {
    background: var(--primary);
    border: 2px solid var(--primary);
}

/* ========================================================================
   GLOSSARY INDEX — Grid Layout
   ======================================================================== */

.glossary-index h1 {
    display: none; /* hidden because hero handles the heading */
}

.glossary-index h2 {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: none;
    margin-top: 0;
    margin-bottom: 1.5rem;
    padding-bottom: 0;
}

.glossary-index ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.glossary-index li {
    margin: 0;
}

.glossary-index li a {
    display: block;
    padding: 1.25rem 1.5rem;
    background: var(--bg-slate);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-light);
}

.glossary-index li a:hover {
    background: var(--accent-dim);
    border-left-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    color: var(--primary);
}

/* ========================================================================
   GLOSSARY ENTRY — Definition Styling
   ======================================================================== */

.glossary-entry h1 {
    display: none; /* hero handles heading */
}

.glossary-entry h2 {
    position: relative;
    padding-left: 1rem;
    border-bottom: none;
    border-left: 3px solid var(--accent);
}

.glossary-entry h3 {
    color: var(--primary);
}

/* ========================================================================
   COMPARISON INDEX — Card Layout
   ======================================================================== */

.compare-index h1 {
    display: none;
}

.compare-index p {
    color: var(--text-body);
    font-size: 1rem;
}

.compare-index p strong a {
    font-weight: 600;
    color: var(--primary);
    border-bottom: 1px solid var(--border-green);
}

.compare-index p strong a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ========================================================================
   COMPARISON DETAIL
   ======================================================================== */

.comparison-detail h1 {
    display: none;
}

.comparison-detail h2 {
    color: var(--primary);
}

.comparison-detail h3 {
    color: var(--text-dark);
    border-left: 3px solid var(--accent);
    padding-left: 0.75rem;
}

/* ========================================================================
   LANDSCAPE PAGE
   ======================================================================== */

.landscape-detail h1 {
    display: none;
}

.landscape-detail h2 {
    color: var(--primary);
}

.landscape-detail h3 {
    position: relative;
    padding-left: 1rem;
    border-left: 3px solid var(--accent);
    color: var(--text-dark);
}

/* Subtitle and metadata styling */
.landscape-detail p strong:first-child {
    color: var(--text-dark);
}

/* ========================================================================
   ABOUT PAGE
   ======================================================================== */

.about-content h1 {
    display: none;
}

.about-content h2 {
    color: var(--primary);
}

.about-content img {
    border-radius: var(--radius);
    margin: 1.5rem 0;
    box-shadow: var(--shadow-md);
}

/* ========================================================================
   FOOTER
   ======================================================================== */

.precision-footer {
    background: var(--bg-hero);
    color: var(--text-hero-muted);
    padding: 3rem 2rem;
    margin-top: 0;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.footer-brand .brand-crosshair {
    font-size: 1.1rem;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: var(--text-light);
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.footer-disclosure {
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
    color: var(--text-hero-muted);
}

.footer-edition {
    font-size: 0.8rem;
    color: var(--text-hero-muted);
    opacity: 0.7;
}

/* ========================================================================
   DATA PANEL CARDS — Precision Motif
   ======================================================================== */

.content .data-panel {
    background: var(--bg-slate);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.content .data-panel h4 {
    margin-top: 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

/* ========================================================================
   RESPONSIVE — TABLET
   ======================================================================== */

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-white);
        border-bottom: 1px solid var(--border-light);
        box-shadow: var(--shadow-md);
        padding: 0.5rem 0;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links li a {
        padding: 0.75rem 2rem;
        line-height: 1.4;
        border-bottom: none;
    }

    .nav-links li.active a {
        border-bottom: none;
        background: var(--accent-dim);
    }

    .precision-nav .nav-inner {
        position: relative;
    }

    .precision-hero h1 {
        font-size: 1.8rem;
    }

    .home-hero {
        padding: 3rem 1.5rem 2.5rem;
    }

    .landscape-hero,
    .compare-hero,
    .comparison-hero,
    .glossary-index-hero,
    .glossary-entry-hero,
    .about-hero {
        padding: 2.5rem 1.5rem 2rem;
    }

    .hero-metrics {
        gap: 1.5rem;
    }

    .metric-value {
        font-size: 1.5rem;
    }

    .hero-crosshair {
        display: none;
    }

    .content-wrap {
        padding: 1.5rem 1rem 3rem;
    }

    .content {
        padding: 1.5rem 1.25rem 2rem;
    }

    .content h1 {
        font-size: 1.5rem;
    }

    .content h2 {
        font-size: 1.2rem;
    }

    .content table {
        font-size: 0.8rem;
    }

    .content thead th,
    .content tbody td {
        padding: 0.5rem 0.6rem;
    }

    .glossary-index ul {
        grid-template-columns: 1fr;
    }
}

/* ========================================================================
   RESPONSIVE — MOBILE
   ======================================================================== */

@media (max-width: 480px) {
    .nav-inner {
        padding: 0 1rem;
    }

    .nav-brand {
        font-size: 0.95rem;
    }

    .brand-crosshair {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }

    .precision-hero h1 {
        font-size: 1.5rem;
    }

    .hero-deck {
        font-size: 0.95rem;
    }

    .hero-metrics {
        flex-direction: column;
        gap: 1rem;
    }

    .metric-block {
        flex-direction: row;
        align-items: baseline;
        gap: 0.5rem;
    }

    .content {
        padding: 1.25rem 1rem 1.5rem;
        border-radius: var(--radius);
    }

    .content h1 {
        font-size: 1.3rem;
    }

    .content h2 {
        font-size: 1.1rem;
    }

    .content h3 {
        font-size: 1rem;
    }

    /* Responsive table scrolling */
    .content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .content thead,
    .content tbody,
    .content tr,
    .content th,
    .content td {
        display: revert;
    }
}

/* ========================================================================
   PRINT STYLES
   ======================================================================== */

@media print {
    .precision-nav,
    .nav-toggle,
    .precision-footer {
        display: none;
    }

    .precision-hero {
        background: none;
        color: var(--text-dark);
        padding: 1rem 0;
    }

    .hero-grid-bg,
    .hero-crosshair {
        display: none;
    }

    .hero-badge {
        border: 1px solid var(--text-muted);
        color: var(--text-muted);
        background: none;
    }

    .precision-hero h1 {
        color: var(--text-dark);
    }

    .hero-deck {
        color: var(--text-body);
    }

    .content-wrap {
        padding: 0;
    }

    .content {
        border: none;
        box-shadow: none;
        padding: 0;
    }

    body {
        background: white;
    }
}

/* ========================================================================
   ACCESSIBILITY
   ======================================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ========================================================================
   SELECTION
   ======================================================================== */

::selection {
    background: var(--accent-dim);
    color: var(--text-dark);
}
