/* ═══════════════════════════════════════════════════════════
   PuniCodex — Tier System Page Styles v11
   Codex Noir: focused, elegant explanation of the tier system.
   ═══════════════════════════════════════════════════════════ */

/* ─── Page Base ─── */
.tier-page {
    background: var(--void);
    color: var(--text-primary);
    overflow-x: hidden;
}

.tier-page-main {
    padding-top: var(--nav-height);
    position: relative;
    z-index: 1;
}

/* ─── Typography Utilities ─── */
.tier-page .display-sm {
    font-family: 'Cinzel', var(--font-display);
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: 0.02em;
}

.tier-page .display-md {
    font-family: 'Cinzel', var(--font-display);
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: 0.02em;
}

.tier-page .body-lg {
    font-family: var(--font-body);
    font-size: clamp(16px, 1.6vw, 20px);
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 760px;
}

.tier-page .body-md {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.75;
    color: var(--text-secondary);
}

.tier-page .body-sm {
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-dim);
}

.tier-page .text-center {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.tier-page .section-eyebrow {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: var(--space-3);
}

.tier-page .section-header {
    text-align: center;
    margin-bottom: var(--space-6);
}

.tier-page .section-header .display-md {
    margin-bottom: var(--space-3);
}

.tier-page .section-divider {
    height: 1px;
    max-width: var(--container-max);
    margin: 0 auto;
    background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

/* ─── Buttons ─── */
.tier-page .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s var(--ease-smooth);
    border: 1px solid transparent;
}

.tier-page .btn-primary {
    background: var(--gold);
    color: var(--void);
    border-color: var(--gold);
    box-shadow: 0 4px 24px rgba(212, 175, 55, 0.2);
}

.tier-page .btn-primary:hover {
    background: var(--gold-bright);
    box-shadow: 0 8px 32px rgba(212, 175, 55, 0.35);
    transform: translateY(-2px);
}

.tier-page .btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--gold-dim);
}

.tier-page .btn-outline:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(212, 175, 55, 0.04);
}

/* ─── Hero ─── */
.tier-hero {
    position: relative;
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6) 0;
    overflow: hidden;
}

.tier-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.tier-hero-bg canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.5;
}

.hero-aurora {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(65, 105, 225, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(212, 175, 55, 0.03) 0%, transparent 60%);
    animation: aurora-drift 20s ease-in-out infinite alternate;
}

@keyframes aurora-drift {
    0% { transform: translateX(-2%) translateY(-1%) scale(1.02); }
    100% { transform: translateX(2%) translateY(1%) scale(1); }
}

.hero-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 0%, var(--void) 80%);
}

.tier-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.tier-eyebrow {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: var(--space-3);
    opacity: 0.9;
}

.tier-hero-title {
    font-family: 'Cinzel', var(--font-display);
    font-size: clamp(56px, 10vw, 120px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.06em;
    /* Gold gradient text comes from .pc-display (css/punicodex-tokens.css),
       loaded after this sheet — brand integration §4.4/A6. */
    text-shadow: 0 0 80px rgba(212, 175, 55, 0.25);
    margin-bottom: var(--space-4);
}

/* Keep the page's own tracking when .pc-display applies its caps preset. */
.tier-hero-title.pc-display {
    letter-spacing: 0.06em;
}

/* The Triad Ziggurat — the page's altar (brand integration §4.13). */
.tier-ziggurat {
    width: min(520px, 72vw);
    margin: 0 auto var(--space-6);
}

/* Tier seal row — the v2 badges replace the bare stat cards. */
.tier-seal-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    max-width: 780px;
    margin: 0 auto var(--space-6);
}

.tier-seal {
    margin: 0;
    text-align: center;
}

.tier-seal img {
    width: min(220px, 100%);
    height: auto;
    margin-inline: auto;
    filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.6))
            drop-shadow(0 0 28px rgba(212, 175, 55, 0.18));
}

.tier-seal figcaption {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-top: var(--space-2);
}

.tier-hero-lead {
    font-family: var(--font-body);
    font-size: clamp(15px, 1.8vw, 19px);
    line-height: 1.8;
    color: var(--text-secondary);
    max-width: 780px;
    margin: 0 auto var(--space-6);
}

.tier-hero-lead strong {
    color: var(--gold);
    font-weight: 500;
}

.tier-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    max-width: 720px;
    margin: 0 auto var(--space-6);
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: var(--space-4) var(--space-3);
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid var(--gold-dim);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(8px);
    transition: border-color 0.3s, transform 0.3s;
}

.hero-stat:hover {
    border-color: var(--gold-glow);
    transform: translateY(-3px);
}

.stat-number {
    font-family: 'Cinzel', var(--font-display);
    font-size: clamp(40px, 5vw, 64px);
    font-weight: 600;
    color: var(--gold);
    line-height: 1;
}

.stat-label {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
    text-align: center;
}

.tier-hero-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .tier-hero-stats {
        grid-template-columns: 1fr;
        max-width: 280px;
    }
    .tier-seal-row {
        gap: var(--space-2);
    }
    .tier-hero-actions {
        flex-direction: column;
        align-items: center;
    }
    .tier-hero-actions .btn {
        width: 100%;
        max-width: 280px;
    }
}

/* ─── Scroll Reveal ─── */
.reveal-up,
.reveal-hero {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease-enter), transform 0.7s var(--ease-enter);
    will-change: opacity, transform;
}

.reveal-hero {
    transform: translateY(30px);
}

.reveal-up.visible,
.reveal-hero.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-hero.visible:nth-child(1) { transition-delay: 0ms; }
.reveal-hero.visible:nth-child(2) { transition-delay: 120ms; }
.reveal-hero.visible:nth-child(3) { transition-delay: 240ms; }
.reveal-hero.visible:nth-child(4) { transition-delay: 360ms; }
.reveal-hero.visible:nth-child(5) { transition-delay: 480ms; }

@media (prefers-reduced-motion: reduce) {
    .reveal-up,
    .reveal-hero {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ─── Tier Cards Section ─── */
.tier-cards-section {
    padding: var(--space-7) 0;
    position: relative;
}

/* Kit tessellation band at a whisper of opacity (brand integration §4.9). */
.tier-cards-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("/assets/brand/09-patterns/punicodex-tessellation-tile.png") repeat;
    background-size: 320px;
    opacity: 0.06;
    pointer-events: none;
}

.tier-cards-section > .container {
    position: relative;
}

.tier-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    margin-top: var(--space-6);
}

.tier-card {
    background: var(--surface);
    border: 1px solid var(--gold-dim);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.tier-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0.6;
}

.tier-card:hover {
    border-color: var(--gold-glow);
    transform: translateY(-6px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.tier-card-dual::before { background: var(--gold); }
.tier-card-t1::before { background: var(--cn-green, #5fd996); }
.tier-card-t2::before { background: var(--cn-blue, #6b8cff); }

.tier-card-dual { border-color: rgba(212, 175, 55, 0.15); }
.tier-card-t1 { border-color: rgba(95, 217, 150, 0.12); }
.tier-card-t2 { border-color: rgba(107, 140, 255, 0.12); }

.tier-card-dual:hover { border-color: rgba(212, 175, 55, 0.35); }
.tier-card-t1:hover { border-color: rgba(95, 217, 150, 0.3); }
.tier-card-t2:hover { border-color: rgba(107, 140, 255, 0.3); }

.tier-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

.tier-card-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tier-card-badge.dual {
    color: var(--gold);
    border: 1px solid rgba(212, 175, 55, 0.25);
    background: rgba(212, 175, 55, 0.08);
}

.tier-card-badge.t1 {
    color: var(--cn-green, #5fd996);
    border: 1px solid rgba(95, 217, 150, 0.2);
    background: rgba(95, 217, 150, 0.06);
}

.tier-card-badge.t2 {
    color: var(--cn-blue, #6b8cff);
    border: 1px solid rgba(107, 140, 255, 0.2);
    background: rgba(107, 140, 255, 0.06);
}

.tier-card-count {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 500;
}

.tier-card-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4);
    background: var(--abyss);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    min-height: 90px;
}

.prosody-mark {
    font-family: 'Cinzel', var(--font-display);
    font-size: 44px;
    color: var(--gold);
    line-height: 1;
}

.prosody-plus {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.prosody-times {
    font-family: var(--font-body);
    font-size: 18px;
    color: var(--text-dim);
    margin: 0 var(--space-1);
}

.tier-card-t1 .prosody-mark { color: var(--cn-green, #5fd996); }
.tier-card-t2 .prosody-mark { color: var(--cn-blue, #6b8cff); }

.tier-card-title {
    font-family: 'Cinzel', var(--font-display);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: var(--space-3);
    color: var(--text-primary);
}

.tier-card-body {
    flex: 1;
}

.tier-card-body p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: var(--space-3);
}

.tier-card-body strong {
    color: var(--text-primary);
    font-weight: 500;
}

.tier-card-list {
    list-style: none;
    margin: var(--space-3) 0;
    padding: 0;
}

.tier-card-list li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
}

.tier-card-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
}

.tier-card-t1 .tier-card-list li::before { background: var(--cn-green, #5fd996); }
.tier-card-t2 .tier-card-list li::before { background: var(--cn-blue, #6b8cff); }

.tier-card-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--gold-dim);
}

.tier-example {
    padding: 6px 12px;
    background: var(--abyss);
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.2s;
    border: 1px solid transparent;
}

.tier-example:hover {
    border-color: var(--gold-glow);
    color: var(--gold);
}

@media (max-width: 1200px) {
    .tier-cards-grid {
        grid-template-columns: 1fr;
        max-width: 720px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ─── Comparison Section ─── */
.comparison-section {
    padding: var(--space-7) 0;
}

.comparison-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--gold-dim);
    border-radius: var(--radius-lg);
    background: var(--surface);
    max-width: 900px;
    margin: 0 auto;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 560px;
}

.comparison-table th,
.comparison-table td {
    padding: 16px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(212, 175, 55, 0.06);
}

.comparison-table th:first-child,
.comparison-table td:first-child {
    text-align: left;
}

.comparison-table th {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    background: var(--abyss);
}

.comparison-table tbody tr {
    transition: background 0.2s;
}

.comparison-table tbody tr:hover {
    background: rgba(212, 175, 55, 0.03);
}

.comparison-table tbody tr:last-child td {
    border-bottom: none;
}

.comparison-table .dual { color: var(--gold); }
.comparison-table .t1 { color: var(--cn-green, #5fd996); }
.comparison-table .t2 { color: var(--cn-blue, #6b8cff); }

/* ─── Prosody Section ─── */
.prosody-section {
    padding: var(--space-7) 0;
}

.prosody-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    margin-top: var(--space-6);
}

.prosody-card {
    background: var(--surface);
    border: 1px solid var(--gold-dim);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    transition: border-color 0.3s, transform 0.3s;
}

.prosody-card:hover {
    border-color: var(--gold-glow);
    transform: translateY(-4px);
}

.prosody-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: var(--space-3);
    padding: var(--space-4);
    background: var(--abyss);
    border-radius: var(--radius-md);
    min-height: 80px;
}

.accent-glyph {
    font-family: 'Cinzel', var(--font-display);
    font-size: 48px;
    line-height: 1;
}

.accent-glyph.acute { color: var(--gold); }
.accent-glyph.macron { color: var(--text-secondary); }
.accent-glyph.plus { font-size: 24px; color: var(--text-dim); }

.prosody-title {
    font-family: 'Cinzel', var(--font-display);
    font-size: 24px;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: var(--space-2);
    text-align: center;
}

.prosody-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: var(--space-4);
    text-align: center;
}

.prosody-desc strong {
    color: var(--text-primary);
    font-weight: 500;
}

.prosody-examples {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.prosody-example {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 10px 14px;
    background: var(--abyss);
    border-radius: var(--radius-md);
    font-size: 14px;
}

.ex-greek {
    font-family: var(--font-display);
    font-size: 18px;
    color: var(--gold);
    min-width: 80px;
}

.ex-arrow {
    color: var(--text-dim);
    font-size: 12px;
}

.ex-latin {
    font-family: var(--font-display);
    font-size: 16px;
    color: var(--text-primary);
    min-width: 100px;
}

@media (max-width: 1024px) {
    .prosody-grid {
        grid-template-columns: 1fr;
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ─── Converter Section ─── */
.converter-section {
    padding: var(--space-5) 0 var(--space-7);
}

.converter-card {
    max-width: 760px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--gold-dim);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
}

.converter-header {
    margin-bottom: var(--space-5);
}

.converter-input-row {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.converter-input {
    flex: 1;
    padding: 16px 22px;
    background: var(--abyss);
    border: 1px solid var(--gold-dim);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.converter-input:focus {
    border-color: var(--gold-glow);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.08);
}

.converter-input::placeholder {
    color: var(--text-dim);
}

.converter-result {
    background: var(--abyss);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.converter-result.hidden {
    display: none;
}

.result-block {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: 12px 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.08);
}

.result-block:last-child {
    border-bottom: none;
}

.result-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    min-width: 130px;
    flex-shrink: 0;
    padding-top: 3px;
}

.result-value {
    font-family: 'SF Mono', monospace;
    font-size: 15px;
    color: var(--gold);
    word-break: break-all;
    line-height: 1.5;
}

@media (max-width: 640px) {
    .converter-card {
        padding: var(--space-4);
    }
    .converter-input-row {
        flex-direction: column;
    }
    .result-block {
        flex-direction: column;
        gap: 6px;
    }
    .result-label {
        min-width: auto;
    }
}

/* ─── Sources Section ─── */
.sources-section {
    padding: var(--space-7) 0;
}

.sources-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
    margin-top: var(--space-6);
}

.source-card {
    background: var(--surface);
    border: 1px solid var(--gold-dim);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    transition: border-color 0.3s, transform 0.3s;
}

.source-card:hover {
    border-color: var(--gold-glow);
    transform: translateY(-3px);
}

.source-abbr {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
    padding: 4px 10px;
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-3);
}

.source-card h4 {
    font-family: 'Cinzel', var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.source-card p {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
}

@media (max-width: 1024px) {
    .sources-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .sources-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Footer tweaks ─── */
.tier-page .site-footer {
    position: relative;
    z-index: 2;
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
    .tier-card,
    .prosody-card,
    .source-card,
    .hero-stat {
        transition: none;
    }
    .hero-aurora {
        animation: none;
    }
}
