/* ============================================================
   Te Huata — Guided Spotlight Walkthrough
   Coach-mark overlay: dims the screen, spotlights one element,
   narrates the pitch story. Pou brand (navy / cream / gold).
   ============================================================ */

.tut-root {
    position: fixed;
    inset: 0;
    z-index: 100000;
    font-family: var(--font-body);
    /* container itself does not catch clicks — its children do */
    pointer-events: none;
    opacity: 0;
    transition: opacity .28s ease;
}
.tut-root.tut-visible { opacity: 1; }
/* When not running, the overlay must be fully inert so it never blocks the
   page underneath (otherwise the app becomes unclickable after the tour). */
.tut-root:not(.tut-visible) {
    visibility: hidden;
    pointer-events: none;
}
.tut-root:not(.tut-visible) .tut-mask,
.tut-root:not(.tut-visible) .tut-callout,
.tut-root:not(.tut-visible) .tut-spot {
    pointer-events: none;
}

/* ---- Dim mask: catches clicks, blocks the page underneath ---- */
.tut-mask {
    position: fixed;
    inset: 0;
    background: transparent;           /* dim comes from the spot's box-shadow */
    pointer-events: auto;
    cursor: default;
}
/* On title-card (no target) steps, the mask itself carries the full dim */
.tut-root.tut-no-target .tut-mask {
    background: rgba(14, 26, 47, 0.86);
    transition: background .3s ease;
}

/* ---- Spotlight cut-out ---- */
.tut-spot {
    position: fixed;
    top: 0; left: 0; width: 0; height: 0;
    border-radius: 12px;
    pointer-events: none;
    box-shadow:
        0 0 0 9999px rgba(14, 26, 47, 0.82),   /* the dim everywhere else */
        0 0 0 2px var(--kowhai),                /* crisp gold ring */
        0 0 26px 4px rgba(192, 144, 44, 0.45),  /* soft gold glow */
        inset 0 0 0 1px rgba(255, 255, 255, 0.35);
    transition: top .38s cubic-bezier(.4,0,.2,1),
                left .38s cubic-bezier(.4,0,.2,1),
                width .38s cubic-bezier(.4,0,.2,1),
                height .38s cubic-bezier(.4,0,.2,1);
}
.tut-root.tut-no-target .tut-spot { display: none; }

/* ---- Callout card ---- */
.tut-callout {
    position: fixed;
    top: 0; left: 0;
    width: 340px;
    max-width: calc(100vw - 32px);
    background: var(--white);
    color: var(--ink);
    border-radius: 14px;
    border: 1px solid rgba(20, 35, 63, 0.10);
    border-left: 4px solid var(--kowhai);
    box-shadow:
        0 18px 48px -12px rgba(14, 26, 47, 0.45),
        0 4px 12px -4px rgba(14, 26, 47, 0.30);
    padding: 22px 24px 18px;
    pointer-events: auto;
    z-index: 2;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .26s ease, transform .26s ease,
                top .38s cubic-bezier(.4,0,.2,1), left .38s cubic-bezier(.4,0,.2,1);
}
.tut-callout.tut-in { opacity: 1; transform: translateY(0); }

/* centred title card */
.tut-root.tut-no-target .tut-callout {
    border-left: 1px solid rgba(20, 35, 63, 0.10);
    border-top: 4px solid var(--kowhai);
    width: 460px;
    padding: 30px 34px 24px;
    text-align: center;
}

.tut-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--kowhai-text);
    margin-bottom: 10px;
}
.tut-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 27px;
    line-height: 1.15;
    color: var(--pounamu-deep);
    margin: 0 0 10px;
}
.tut-root.tut-no-target .tut-title { font-size: 34px; }
.tut-body {
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--ink-soft);
    margin: 0 0 18px;
}
.tut-root.tut-no-target .tut-body { font-size: 15.5px; }

/* footer */
.tut-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
}
.tut-root.tut-no-target .tut-footer { margin-top: 18px; }
.tut-skip {
    background: none;
    border: none;
    padding: 6px 2px;
    font-family: var(--font-body);
    font-size: 12.5px;
    color: var(--ink-faint);
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: color .18s ease;
}
.tut-skip:hover { color: var(--pounamu); text-decoration: underline; }
.tut-footer-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.tut-count {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 12px;
    color: var(--ink-faint);
    letter-spacing: 0.04em;
    min-width: 44px;
    text-align: right;
}
.tut-btn {
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 500;
    padding: 9px 18px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid rgba(20, 35, 63, 0.18);
    background: var(--white);
    color: var(--pounamu);
    transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.tut-btn:hover { background: var(--paper); border-color: rgba(20,35,63,0.32); }
.tut-btn:disabled { opacity: 0.4; cursor: default; }
.tut-btn.tut-primary {
    background: var(--kowhai);
    border-color: var(--kowhai);
    color: #2a1f05;
    font-weight: 600;
}
.tut-btn.tut-primary:hover { background: var(--kowhai-bright); border-color: var(--kowhai-bright); }
.tut-btn:focus-visible,
.tut-skip:focus-visible {
    outline: 2px solid var(--pounamu);
    outline-offset: 2px;
}

/* ---- pointer arrow toward the target ---- */
.tut-arrow {
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--white);
    border: 1px solid rgba(20, 35, 63, 0.10);
    transform: rotate(45deg);
    z-index: 1;
    display: none;
}
.tut-callout.tut-has-arrow .tut-arrow { display: block; }
/* placement-specific arrow edges (only two borders show) */
.tut-arrow.tut-arrow-left  { border-right: none; border-top: none; }
.tut-arrow.tut-arrow-right { border-left: none; border-bottom: none; }
.tut-arrow.tut-arrow-up    { border-right: none; border-bottom: none; }
.tut-arrow.tut-arrow-down  { border-left: none; border-top: none; }

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    .tut-spot,
    .tut-callout,
    .tut-root { transition: opacity .12s ease; }
    .tut-callout { transform: none; }
}

/* ---- small screens: callout becomes a bottom sheet ---- */
@media (max-width: 640px) {
    .tut-callout,
    .tut-root.tut-no-target .tut-callout {
        width: calc(100vw - 24px);
        left: 12px !important;
        right: 12px;
        top: auto !important;
        bottom: 14px;
    }
    .tut-callout.tut-has-arrow .tut-arrow { display: none; }
}
