/* internal.css — styling for the internal.drpaulk.ai portal.
 *
 * Layers on top of styles.css + theme.css (loaded first). Reuses the shared
 * Wake glass theme tokens (--wake-teal, --card-bg, --text-light, …) so the
 * internal portal matches the public drpaulk.ai look exactly; only the
 * portal-specific pieces (the "Internal" badge, the account control, the
 * welcome hero, and the area cards) are defined here.
 */

/* --- Logo as a link + "Internal" badge ---------------------------------- */
a.internal-logo {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

a.internal-logo:hover {
    text-decoration: none;
}

.internal-badge {
    font-family: 'Libre Caslon Text', Georgia, serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--wake-teal-deep);
    background: rgba(45, 212, 191, 0.12);
    border: 1px solid rgba(14, 159, 142, 0.32);
    border-radius: 999px;
    padding: 0.18rem 0.6rem;
    line-height: 1;
    white-space: nowrap;
}

/* --- Account control in the nav (signed-in name + Sign out) ------------- */
.nav-account {
    display: none; /* internal.js reveals it once a user is signed in */
    align-items: center;
    gap: 0.75rem;
}

.nav-account .user-name {
    color: var(--text-medium);
    font-weight: 500;
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-signout {
    color: var(--wake-teal-deep);
    font-weight: 600;
    border: 1px solid rgba(14, 159, 142, 0.32);
    border-radius: 999px;
    padding: 0.32rem 0.9rem;
    transition: background 0.25s ease, color 0.25s ease;
}

.nav-signout:hover {
    background: rgba(45, 212, 191, 0.14);
    color: var(--text-light);
}

.nav-signout::after { content: none; } /* suppress the nav underline indicator */

/* --- Welcome hero ------------------------------------------------------- */
.internal-hero {
    padding: 8.5rem 0 1.5rem;
    text-align: center;
}

.internal-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--wake-teal-deep);
    margin-bottom: 0.75rem;
}

.internal-title {
    font-family: 'Libre Caslon Text', Georgia, serif;
    font-weight: 700;
    font-size: clamp(2.2rem, 1.4rem + 3.4vw, 3.6rem);
    color: var(--text-light);
    margin: 0;
}

.internal-subtitle {
    color: var(--text-medium);
    font-size: clamp(1rem, 0.95rem + 0.4vw, 1.2rem);
    max-width: 38rem;
    margin: 0.9rem auto 0;
    line-height: 1.6;
}

/* --- Area cards (Software / Business) ----------------------------------- */
.internal-section {
    padding: 2rem 0 5rem;
}

.internal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    max-width: 880px;
    margin: 0 auto;
}

.internal-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-decoration: none;
    padding: 2rem 1.9rem;
    border-radius: 18px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    backdrop-filter: blur(16px) saturate(1.2);
    box-shadow: 0 12px 34px rgba(45, 90, 110, 0.10);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.internal-card:hover {
    transform: translateY(-4px);
    border-color: rgba(45, 212, 191, 0.45);
    box-shadow: 0 18px 44px rgba(45, 90, 110, 0.16), var(--glow-primary);
    text-decoration: none;
}

.internal-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 14px;
    font-size: 1.3rem;
    color: #053b34;
    background: var(--wake-teal-grad);
    box-shadow: var(--glow-primary);
    margin-bottom: 1.1rem;
}

.internal-card-title {
    font-family: 'Libre Caslon Text', Georgia, serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--text-light);
    margin: 0 0 0.5rem;
}

.internal-card-desc {
    color: var(--text-medium);
    line-height: 1.6;
    margin: 0 0 1.25rem;
}

.internal-card-go {
    margin-top: auto;
    color: var(--wake-teal-deep);
    font-weight: 600;
}

.internal-card-go .fa-arrow-right {
    transition: transform 0.25s ease;
}

.internal-card:hover .internal-card-go .fa-arrow-right {
    transform: translateX(4px);
}

/* --- Scaffolded section pages (software.html / business.html) ----------- */
.internal-page {
    padding: 8.5rem 0 5rem;
}

.internal-page-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.internal-page-header h1 {
    font-family: 'Libre Caslon Text', Georgia, serif;
    font-weight: 700;
    font-size: clamp(2rem, 1.4rem + 3vw, 3.2rem);
    color: var(--text-light);
    margin: 0 0 0.6rem;
}

.internal-page-header p {
    color: var(--text-medium);
    font-size: 1.1rem;
    max-width: 40rem;
    margin: 0 auto;
    line-height: 1.6;
}

.internal-placeholder {
    max-width: 760px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    text-align: center;
    border-radius: 18px;
    border: 1px dashed rgba(14, 159, 142, 0.35);
    background: var(--card-bg);
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
    backdrop-filter: blur(14px) saturate(1.15);
    color: var(--text-medium);
}

.internal-placeholder .fa-screwdriver-wrench {
    font-size: 1.8rem;
    color: var(--wake-teal-deep);
    margin-bottom: 0.9rem;
}

.internal-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    color: var(--wake-teal-deep);
    font-weight: 600;
}

/* --- Embedded System Architecture viewer (software.html) ---------------- */
/* The architecture page widens its container so the embedded viewer (whose
 * L2 diagrams run far wider than the 1200px default) has room to breathe. */
.internal-page--arch .container {
    max-width: min(96vw, 1700px);
}

/* The viewer is a self-contained dark-themed SPA loaded in an iframe; the dark
 * background here avoids a light flash before its own theme paints. */
.arch-frame {
    display: block;
    width: 100%;
    height: min(82vh, 1100px);
    min-height: 560px;
    margin-top: 0.5rem;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    background: #0d1117;
    box-shadow: 0 12px 34px rgba(45, 90, 110, 0.10);
}

/* --- Business page: tabbed gated documents (business.html) -------------- */
/* Slightly wider than the default container so the embedded documents (max
 * 840px) have margins to breathe without running edge-to-edge. */
.internal-page--biz .container {
    max-width: min(94vw, 980px);
}

/* The on-page tab bar is retired — view selection lives in the Business nav
 * dropdown (PO request 2026-07-02); this line names the selected document. */
.biz-current {
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-medium);
    margin: 0 0 1rem;
}

/* The gated business docs are light-themed standalone HTML (unlike the dark
 * architecture viewer), so the iframe gets a white surface. */
.biz-frame {
    display: block;
    width: 100%;
    height: min(80vh, 1200px);
    min-height: 600px;
    margin-top: 0.5rem;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    /* The gated docs paint their own shore gradient + glass card (PO request
     * 2026-07-02) — the frame surface stays a faint glass tint, not white. */
    background: var(--card-bg);
    box-shadow: 0 12px 34px rgba(45, 90, 110, 0.10);
}

/* Wide documents (the Pipeline board) break out of the centered container to
 * span the full viewport width (PO request 2026-07-09) — the board's columns
 * need the room; prose docs stay at container width. The breakout uses the
 * classic calc(50% - 50vw) full-bleed trick, so it composes with any
 * container max-width without touching the page layout. */
.biz-frame--full {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    border-radius: 0;
    border-left: 0;
    border-right: 0;
}

/* --- Loading / empty states (AMI Spec + Sprint Reports subpages) -------- */
.internal-loading,
.internal-empty {
    text-align: center;
    color: var(--text-medium);
    padding: 2.25rem 1rem;
    font-size: 0.98rem;
}

/* --- AMI Spec subpage (ami-spec.html) ---------------------------------- */
/* A normal-theme port of the architecture viewer's dark #ami-spec scoreboard.
 * Data is the gated architecture/ami-spec.json (source of truth: the committed
 * ami_spec/ami-spec.json, flipped each sprint by /sprint G.3.1). Semantic status
 * hues are kept but darkened for legibility on the light sand background. */
.internal-page--ami .container {
    max-width: min(94vw, 1180px);
}

.ami-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    justify-content: center;
    align-items: baseline;
    margin: 0 auto 1.9rem;
    max-width: 820px;
    color: var(--text-medium);
    font-size: 0.95rem;
}

.ami-summary .ami-metric {
    font-weight: 600;
    color: var(--text-light);
}

.ami-summary .ami-metric b {
    color: var(--wake-teal-deep);
}

.ami-spec-body {
    columns: 2;
    column-gap: 1.5rem;
}

@media (max-width: 900px) {
    .ami-spec-body { columns: 1; }
}

.ami-item {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    margin: 0 0 1rem;
    background: var(--card-bg);
    -webkit-backdrop-filter: blur(12px) saturate(1.15);
    backdrop-filter: blur(12px) saturate(1.15);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ami-item .ami-head {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.ami-sec {
    color: #a16207;
    font-weight: 700;
    font-size: 0.82rem;
    white-space: nowrap;
}

.ami-title {
    color: var(--text-light);
    font-weight: 700;
    font-size: 0.92rem;
}

.ami-item ul {
    margin: 0;
    padding-left: 1.1rem;
}

.ami-item li {
    color: var(--text-medium);
    font-size: 0.83rem;
    line-height: 1.5;
    margin: 0.12rem 0;
}

/* A requirement the Wake code actually implements (paper↔code audit): the grey
 * bullet is replaced by a green check. */
.ami-item li.supported {
    list-style: none;
    color: var(--text-light);
}

.ami-item li.supported::before {
    content: '\2713';
    color: #2f9e44;
    font-weight: 700;
    display: inline-block;
    width: 1.1rem;
    margin-left: -1.1rem;
}

/* Partly built or absent core requirements keep their own marker (the same
 * symbols as the companion-paper list) instead of the green check. */
.ami-item li.s-partial,
.ami-item li.s-absent {
    list-style: none;
}

.ami-item li.s-partial::before,
.ami-item li.s-absent::before {
    display: inline-block;
    width: 1.1rem;
    margin-left: -1.1rem;
}

.ami-item li.s-partial::before { content: '\25D0'; color: #b7791f; }
.ami-item li.s-absent::before { content: '\2717'; color: #94a3b8; }

/* Companion-paper sub-checklist (violet accent vs LeCun's bronze §-headers);
 * four status markers replace the green-only check. */
.ami-subspec {
    margin-top: 0.65rem;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--card-border);
}

.ami-subspec-head {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.ami-subspec-plus { color: #7c3aed; font-weight: 700; font-size: 0.9rem; }
.ami-subspec-src { color: #7c3aed; font-weight: 600; font-size: 0.82rem; }
.ami-subspec-cite { color: var(--text-medium); font-size: 0.73rem; margin: 0.14rem 0 0.05rem; }
.ami-subspec-note { color: var(--text-medium); font-size: 0.73rem; font-style: italic; margin-bottom: 0.36rem; }
.ami-subspec-list { margin: 0; padding-left: 1.25rem; list-style: none; }
.ami-subspec-list li { color: var(--text-light); font-size: 0.82rem; line-height: 1.5; margin: 0.16rem 0; }
.ami-subspec-list li::before { display: inline-block; width: 1.25rem; margin-left: -1.25rem; font-weight: 700; }
.ami-subspec-list li.s-present::before { content: '\2713'; color: #2f9e44; }
.ami-subspec-list li.s-partial::before { content: '\25D0'; color: #b7791f; }
.ami-subspec-list li.s-absent { color: var(--text-medium); }
.ami-subspec-list li.s-absent::before { content: '\2717'; color: #94a3b8; }
.ami-subspec-list li.s-rejected { color: var(--text-medium); opacity: 0.8; }
.ami-subspec-list li.s-rejected::before { content: '\2298'; color: #dc2626; }
.ami-subspec-list li.s-rejected .ami-t { text-decoration: line-through; }
.ami-subspec-list li .ami-why { font-style: italic; color: var(--text-medium); font-size: 0.73rem; }
.ami-subspec-legend { color: var(--text-medium); font-size: 0.7rem; margin-top: 0.4rem; }

/* PO-rejected core requirements (top-level `rejected` map): consciously
 * won't-do, excluded from the core denominator. One full-width footnote below
 * the two-column checklist; the ⊘ treatment mirrors the sub-checklist's
 * s-rejected markers. */
.ami-rejected-foot {
    column-span: all;
    break-inside: avoid;
    margin-top: 0.4rem;
    padding: 0.85rem 1rem;
    border: 1px dashed var(--card-border);
    border-radius: 12px;
    background: var(--card-bg);
}

.ami-rejected-foot-head { color: var(--text-medium); font-weight: 700; font-size: 0.8rem; }
.ami-rejected-foot-list { margin: 0.4rem 0 0; padding-left: 1.25rem; list-style: none; }
.ami-rejected-foot-list li { color: var(--text-medium); opacity: 0.8; font-size: 0.82rem; line-height: 1.5; margin: 0.16rem 0; }
.ami-rejected-foot-list li::before { content: '\2298'; color: #dc2626; display: inline-block; width: 1.25rem; margin-left: -1.25rem; font-weight: 700; }
.ami-rejected-foot-list li .ami-t { text-decoration: line-through; }

/* per-item source-paper tag (sub-checklists drawing on >1 paper) */
.ami-subspec-tag {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #7c3aed;
    border: 1px solid rgba(124, 58, 237, 0.28);
    border-radius: 4px;
    padding: 0 0.28rem;
    margin-right: 0.34rem;
    vertical-align: 0.05rem;
    white-space: nowrap;
}

/* deep-link (#ami-<sec>) landing highlight */
.ami-item.highlight {
    border-color: var(--wake-teal);
    box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.35), var(--glow-primary);
}

.ami-item.highlight .ami-title {
    color: var(--wake-teal-deep);
}

/* --- Sprint Reports subpage (sprint-reports.html) ---------------------- */
/* The report bodies are the rendered G.4 sprint-report emails — light,
 * inline-styled — so each sits in a white "document" card. Data is the gated
 * architecture/sprint-reports.json (built by build_sprint_reports.py). */
.internal-page--sprint {
    /* The portal gradient stretches over the full scroll height, so behind a
     * long report it is nearly flat pale sand — 60%-white glass over pale sand
     * reads as solid white. Pin the shore gradient to the VIEWPORT here (the
     * same trick the gated business docs use inside their iframes) so the
     * frosted card has vivid color behind the blur at every scroll position. */
    background: var(--wake-shore);
    background-attachment: fixed;
}

.internal-page--sprint .container {
    max-width: min(94vw, 1040px);
}

.sprint-picker {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.sprint-picker label {
    color: var(--text-medium);
    font-weight: 600;
    font-size: 0.95rem;
}

.sprint-select {
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-light);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 999px;
    padding: 0.5rem 1.1rem;
    cursor: pointer;
    max-width: 100%;
}

.sprint-report-card {
    /* Frosted glass tile (the AMI Spec .ami-item recipe) instead of solid
     * white — the report's light inline-styled body reads fine on the
     * translucent sand card over the shore gradient (PO request 2026-07-02). */
    background: var(--card-bg);
    -webkit-backdrop-filter: blur(12px) saturate(1.15);
    backdrop-filter: blur(12px) saturate(1.15);
    color: #1c2733;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.75rem 2rem 2rem;
    margin: 0 auto;
    max-width: 940px;
    line-height: 1.55;
    overflow-x: auto;
    box-shadow: 0 12px 34px rgba(45, 90, 110, 0.10);
}

.sprint-report-card a { color: #0e7490; }
.sprint-report-card table { max-width: 100%; }

.sprint-report-title {
    font-family: 'Libre Caslon Text', Georgia, serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text-light);
    text-align: center;
    margin: 0 auto 1rem;
    max-width: 900px;
}
