/* ── home-riff.css ─────────────────────────────────────────────────────────────
   Hero re-skin + Connected Business Riff.
   Loads after styles.css via extraCss frontmatter — overrides purple-era rules
   through normal cascade specificity. No token redeclarations.
   All Riff selectors prefixed .riff- to stay scoped.
   ─────────────────────────────────────────────────────────────────────────── */

/* ── 1. Override purple-era hero pseudo-elements ──────────────────────────── */

.hero-section::before {
    background-image: radial-gradient(rgba(21, 23, 20, 0.055) 1px, transparent 1px);
    background-size: 28px 28px;
}

.hero-section::after {
    background: radial-gradient(ellipse at 90% 40%,
        rgba(240, 138, 75, 0.09) 0%,
        rgba(231, 187, 85, 0.05) 45%,
        transparent 72%);
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
}

/* ── 2. Hero rotating word — tangerine ───────────────────────────────────── */

.hero-rotate {
    color: var(--tangerine);
}

/* ── 3. Hero column proportions ──────────────────────────────────────────── */

.hero-section .hero-section__grid {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: clamp(2rem, 4vw, 4rem);
}

/* ── 4. Riff canvas container ────────────────────────────────────────────── */

.riff-canvas {
    position: relative;
    width: 100%;
    aspect-ratio: 500 / 420;
    max-width: 500px;
    margin-inline-start: auto;
}

.riff-svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

/* ── 5. Node hover lift ───────────────────────────────────────────────────── */

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .riff-node {
        transition: transform 0.3s cubic-bezier(.22, 1, .36, 1);
        transform-box: fill-box;
        transform-origin: center;
        cursor: default;
    }
    .riff-node:hover {
        transform: scale(1.03);
    }
}

/* ── 6. Pulse animation ───────────────────────────────────────────────────── */

@keyframes riff-pulse {
    0%, 100% { opacity: 1;   transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(1.5); }
}

.riff-pulse-dot {
    transform-box: fill-box;
    transform-origin: center;
    animation: riff-pulse 2.4s ease-in-out infinite;
}

.riff-pulse-dot:nth-of-type(2) { animation-delay: -0.8s; }
.riff-pulse-dot:nth-of-type(3) { animation-delay: -1.6s; }

.riff-pulse-dot--centre {
    animation: riff-pulse 3.2s ease-in-out infinite;
    animation-delay: -1.0s;
}

.riff-pulse-dot--dark {
    animation: riff-pulse 2s ease-in-out infinite;
    animation-delay: -1.2s;
}

/* ── 7. Sparkline draw ────────────────────────────────────────────────────── */

@keyframes riff-draw-sparkline {
    from { stroke-dashoffset: 160; }
    to   { stroke-dashoffset: 0; }
}

.riff-sparkline {
    stroke-dasharray: 160;
    stroke-dashoffset: 160;
    animation: riff-draw-sparkline 2.4s cubic-bezier(.22, 1, .36, 1) forwards;
    animation-delay: 0.6s;
}

/* ── 8. Health ring draw ──────────────────────────────────────────────────── */
/* Circumference of r=24: 2π×24 ≈ 150.8
   75% filled → dashoffset = 150.8 × 0.25 = 37.7 */

@keyframes riff-ring-in {
    from { stroke-dashoffset: 150.8; }
    to   { stroke-dashoffset: 37.7;  }
}

.riff-health-ring {
    animation: riff-ring-in 1.8s cubic-bezier(.22, 1, .36, 1) forwards;
    animation-delay: 1.0s;
}

/* ── 9. Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 960px) {
    .riff-canvas {
        max-width: 460px;
        margin-inline: auto;
    }
}

@media (max-width: 640px) {
    .riff-canvas {
        max-width: 100%;
    }
}

/* ── 10. Reduced-motion overrides ────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .riff-pulse-dot,
    .riff-pulse-dot--centre,
    .riff-pulse-dot--dark {
        animation: none;
        opacity: 1;
    }

    .riff-sparkline {
        animation: none;
        stroke-dashoffset: 0;
    }

    .riff-health-ring {
        animation: none;
        stroke-dashoffset: 37.7;
    }

    .riff-node {
        transition: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 2 — Service widgets re-skin + Ọ̀rẹ́ bridge
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 11. Services section background ─────────────────────────────────────── */

.svc-section {
    background: var(--paper);
}

/* Override the purple-era --color-card and --color-surface that
   styles.css uses for card backgrounds. We scope overrides to .svc-section
   so other pages with section--light are not affected. */
.svc-section .service-card {
    background: #fff;
    border-color: rgba(21, 23, 20, 0.08);
    box-shadow: 0 2px 8px rgba(21, 23, 20, 0.06);
}

.svc-section .service-card:hover {
    box-shadow: 0 8px 32px rgba(21, 23, 20, 0.12);
}

.svc-section .service-card__eyebrow {
    color: var(--tangerine);
    font-weight: 700;
    letter-spacing: 0.06em;
}

.svc-section .text-link {
    color: var(--olive);
    font-weight: 600;
}

.svc-section .text-link:hover {
    color: var(--ink);
}

/* ── 12. Widget 1: Code terminal — evergreen palette ─────────────────────── */

.svc-section .widget--code {
    background: var(--evergreen);
}

.svc-section .wt-bar {
    background: #161e13;
}

/* Green dot on the right instead of purple */
.svc-section .wt-bar i:nth-child(3) {
    background: var(--sage);
}

.svc-section .wt-line,
.svc-section .wt-cursor {
    color: rgba(147, 155, 126, 0.3); /* sage at low opacity */
}

.svc-section .service-card:hover .wt-line {
    color: rgba(147, 155, 126, 0.75);
}

.svc-section .service-card:hover .wt-line:first-child {
    color: var(--paper);
}

.svc-section .wt-prompt { color: var(--sage); }
.svc-section .wt-ok     { color: var(--sage); }
.svc-section .wt-warn   { color: var(--marigold); }

.svc-section .service-card:hover .wt-cursor {
    color: var(--tangerine);
}

/* ── 13. Widget 2: Calendar — paper/sand palette ─────────────────────────── */

.svc-section .widget--cal {
    background: linear-gradient(145deg, #f0ebe3 0%, var(--paper) 100%);
}

.svc-section .wc-month {
    color: var(--stone);
}

.svc-section .wc-d {
    background: rgba(21, 23, 20, 0.05);
    color: var(--ink);
}

.svc-section .wc-today {
    background: var(--tangerine) !important;
    color: var(--paper) !important;
}

.svc-section .wc-task::after {
    background: var(--tangerine);
}

.svc-section .service-card:hover .wc-d:not(.wc-today) {
    background: rgba(21, 23, 20, 0.09);
}

.svc-section .service-card:hover .wc-today {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--tangerine);
}

/* ── 14. Widget 3: Falling blocks — brand gradient palette ───────────────── */

.svc-section .widget--blocks {
    background: linear-gradient(180deg, var(--evergreen) 0%, #2d3d28 100%);
}

.svc-section .wb-block--1 { background: rgba(248,247,244,0.10); color: var(--paper); }
.svc-section .wb-block--2 { background: rgba(147,155,126,0.20); color: var(--paper); }
.svc-section .wb-block--3 { background: rgba(71,88,65,0.55);    color: var(--paper); }
.svc-section .wb-block--4 { background: var(--olive);            color: var(--paper); }
.svc-section .wb-block--5 { background: rgba(240,138,75,0.75);   color: var(--ink);   }

.svc-section .wb-block span {
    opacity: 0.6;
}

/* ── 15. Widget 4: Process flow — already updated in HTML SVG colours ─────── */
/* The SVG fill/stroke values were updated directly in index.njk.
   Only the wrapper background needs overriding here. */

.svc-section .widget--flow {
    background: linear-gradient(135deg, #1a2416 0%, var(--evergreen) 100%);
}

/* ── 16. Services intro ───────────────────────────────────────────────────── */

.svc-section .services-intro__text {
    color: var(--stone);
}

/* ── 17. Ọ̀rẹ́ bridge ─────────────────────────────────────────────────────── */

.ore-bridge {
    margin-top: 3.5rem;
    display: grid;
    gap: 0;
}

.ore-bridge__connector {
    height: 60px;
    overflow: visible;
}

.ore-bridge__lines {
    width: 100%;
    height: 60px;
    display: block;
}

.ore-bridge__content {
    background: var(--evergreen);
    border-radius: var(--radius);
    padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 4vw, 3.5rem);
    display: grid;
    gap: 1rem;
    text-align: center;
    max-width: 640px;
    margin-inline: auto;
    position: relative;
}

/* Tangerine top border accent */
.ore-bridge__content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 3px;
    background: var(--tangerine);
    border-radius: 0 0 3px 3px;
}

.ore-bridge__headline {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 400;
    color: var(--paper);
    margin: 0;
    line-height: 1.2;
}

.ore-bridge__body {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--sage);
    margin: 0;
    max-width: 46ch;
    margin-inline: auto;
}

.ore-bridge__link {
    color: var(--tangerine) !important;
    font-size: 0.9rem;
    justify-self: center;
}

.ore-bridge__link:hover {
    color: var(--marigold) !important;
}

/* ── 18. Section actions ─────────────────────────────────────────────────── */

.svc-section .section-actions {
    margin-top: 2.5rem;
}

/* ── 19. Reduced-motion: connector lines stay static ────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .ore-bridge__lines {
        opacity: 0.4;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 3 — Why MiddleOut re-skin + case studies
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 20. Philosophy section — brand palette override ─────────────────────── */

.why-section {
    background: var(--evergreen);
}

.why-section .philosophy-eyebrow {
    color: rgba(147, 155, 126, 0.75); /* sage */
}

.why-section .philosophy-eyebrow--accent {
    color: var(--tangerine);
}

.why-section .philosophy-statement {
    color: rgba(248, 247, 244, 0.7);
}

.why-section .philosophy-headline {
    color: var(--paper);
}

.why-section .philosophy-em {
    color: var(--marigold);
    text-decoration-color: rgba(231, 187, 85, 0.35);
}

/* ── 21. Protocol cards — brand palette ──────────────────────────────────── */
/* Override the foreign blue/cyan palette with the brand palette.
   The sticky-stack JS mechanism and transition logic are untouched. */

.protocol-card:nth-child(1) {
    --card-bg: var(--olive);
    --card-ink: #F8F7F4;
    --card-num: rgba(248,247,244,0.5);
}
.protocol-card:nth-child(2) {
    --card-bg: var(--tangerine);
    --card-ink: #1F271B;
    --card-num: rgba(31,39,27,0.55);
}
.protocol-card:nth-child(3) {
    --card-bg: var(--marigold);
    --card-ink: #1F271B;
    --card-num: rgba(31,39,27,0.5);
}
.protocol-card:nth-child(4) {
    --card-bg: var(--paper);
    --card-ink: #1F271B;
    --card-num: rgba(31,39,27,0.45);
}

/* Use currentColor in SVG decos so they inherit --card-ink correctly */
.protocol-card__deco svg {
    color: var(--card-ink, #F8F7F4);
}

/* ── 22. Case studies section ────────────────────────────────────────────── */

.case-section {
    background: var(--ink);
}

.case-section .eyebrow {
    color: var(--tangerine);
}

.case-section h2 {
    color: var(--paper);
}

.case-section__intro {
    display: grid;
    gap: 0.75rem;
    margin-bottom: clamp(2.5rem, 4vw, 3.5rem);
    max-width: 540px;
}

.case-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.case-card {
    border-radius: var(--radius);
    overflow: hidden;
    display: grid;
    background: #1a1a17;
    border: 1px solid rgba(248, 247, 244, 0.07);
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}

.case-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

/* Top-border accent per card */
.case-card--a { border-top: 3px solid var(--tangerine); }
.case-card--b { border-top: 3px solid var(--marigold); }

.case-card__visual {
    background: #0f0f0d;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(248, 247, 244, 0.05);
}

.case-card__visual svg {
    width: 100%;
    height: auto;
    display: block;
}

.case-card__body {
    padding: 1.5rem;
    display: grid;
    gap: 0.75rem;
}

.case-card__tag {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--stone);
    margin: 0;
}

.case-card--a .case-card__tag { color: var(--tangerine); opacity: 0.85; }
.case-card--b .case-card__tag { color: var(--marigold);  opacity: 0.85; }

.case-card__title {
    font-family: var(--font-heading);
    font-size: clamp(1.1rem, 1.8vw, 1.5rem);
    font-weight: 400;
    color: var(--paper);
    margin: 0;
    line-height: 1.2;
}

.case-card__problem,
.case-card__contribution {
    font-size: 0.9rem;
    line-height: 1.7;
    margin: 0;
    color: rgba(248, 247, 244, 0.6);
}

.case-card__problem {
    color: rgba(248, 247, 244, 0.5);
    font-style: italic;
}

.case-card__placeholder {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: rgba(248, 247, 244, 0.25);
    margin: 0.25rem 0 0;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(248, 247, 244, 0.06);
}

/* ── 23. Case grid responsive ────────────────────────────────────────────── */

@media (max-width: 768px) {
    .case-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 4 — Contact section
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 24. Contact section — brand palette ─────────────────────────────────── */
/* Uses the olive/tangerine/marigold/cream palette throughout.
   Scoped to .contact-section so the about page section--accent is unaffected. */

.contact-section {
    background: var(--evergreen);
    position: relative;
    overflow: clip;
}

/* Replace the purple glow with a warm tangerine bloom bottom-left */
.contact-section::before {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -5%;
    width: 55%;
    height: 110%;
    background: radial-gradient(circle,
        rgba(240, 138, 75, 0.10) 0%,
        rgba(231, 187, 85, 0.05) 50%,
        transparent 72%);
    pointer-events: none;
    z-index: 0;
}

.contact-section .container {
    position: relative;
    z-index: 1;
}

/* ── 25. Contact layout — wide column for copy, narrow for aside ─────────── */

.contact-section .contact-layout {
    grid-template-columns: 1.1fr 0.9fr;
    gap: clamp(2.5rem, 5vw, 5rem);
    align-items: start;
}

/* ── 26. Copy column ─────────────────────────────────────────────────────── */

.contact-section__copy {
    display: grid;
    gap: 1.5rem;
}

.contact-section .eyebrow {
    color: var(--tangerine);
}

.contact-section h2 {
    color: var(--paper);
    font-size: clamp(2rem, 3.5vw, 3rem);
    margin: 0;
}

.contact-section p {
    color: rgba(248, 247, 244, 0.65);
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 0;
}

/* ── 27. CTA button row ──────────────────────────────────────────────────── */

.contact-section__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

/* Primary button: tangerine in this context */
.contact-section .button--primary {
    background: var(--tangerine);
    color: var(--ink);
    border-color: var(--tangerine);
}

.contact-section .button--primary::before {
    background: var(--marigold);
}

.contact-section .button--primary:hover {
    color: var(--ink);
}

/* Secondary button: paper outline on evergreen */
.contact-section .button--secondary {
    color: var(--paper);
    border-color: rgba(248, 247, 244, 0.3);
}

.contact-section .button--secondary:hover {
    color: var(--paper);
    border-color: rgba(248, 247, 244, 0.6);
}

/* ── 28. Expandable calendar panel ───────────────────────────────────────── */

.contact-cal-panel {
    /* hidden attribute handles display:none; this gives the opening animation */
}

.contact-cal-panel:not([hidden]) {
    animation: cal-reveal 0.4s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes cal-reveal {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Keep cal-inline from overflowing on mobile */
.contact-section #cal-inline {
    height: auto;
    max-height: 640px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.contact-section .contact-card--cal {
    background: rgba(248, 247, 244, 0.06);
    border: 1px solid rgba(248, 247, 244, 0.10);
    backdrop-filter: blur(12px);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.contact-section .contact-card--cal h3 {
    color: var(--paper);
    margin-bottom: 1rem;
}

/* ── 29. Fallback link ───────────────────────────────────────────────────── */

.contact-section__fallback {
    font-size: 0.82rem !important;
    color: rgba(248, 247, 244, 0.35) !important;
}

.contact-section__fallback a {
    color: rgba(248, 247, 244, 0.5);
    text-underline-offset: 0.15em;
}

.contact-section__fallback a:hover {
    color: var(--tangerine);
}

/* ── 30. Aside card ──────────────────────────────────────────────────────── */

.contact-section__aside {
    display: grid;
    align-content: start;
}

.contact-aside-card {
    background: rgba(248, 247, 244, 0.04);
    border: 1px solid rgba(248, 247, 244, 0.08);
    border-radius: var(--radius);
    padding: 2rem;
    display: grid;
    gap: 1.25rem;
}

.contact-aside-card__label {
    font-size: 0.95rem;
    color: rgba(248, 247, 244, 0.6);
    line-height: 1.5;
    padding-left: 1.25rem;
    position: relative;
    margin: 0;
}

/* Tangerine bullet */
.contact-aside-card__label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--tangerine);
}

/* ── 31. Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 960px) {
    .contact-section .contact-layout {
        grid-template-columns: 1fr;
    }

    .contact-section__aside {
        display: none; /* aside is decorative; hide on mobile to save space */
    }
}

@media (max-width: 640px) {
    .contact-section__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .contact-section__actions .button {
        width: 100%;
        justify-content: center;
    }
}
