/* ==========================================================================
   2026 Redesign — How It Works (template-how-it-works.php)
   --------------------------------------------------------------------------
   Loaded conditionally. Foundation tokens + chrome live in marketing.css.
   The page is a long-form 7-day timeline with sticky day-stamps and
   day-specific viz panels.
   ========================================================================== */


/* --- HERO ------------------------------------------------------------- */

.hiw-hero {
    position: relative;
    padding: 180px 48px 120px;
    text-align: center;
    overflow: hidden;
    background:
        radial-gradient(ellipse 1200px 600px at 50% 100%, rgba(244, 168, 92, 0.1), transparent 60%),
        var(--night);
    color: #fff;
}

.hiw-hero .stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hiw-hero .stars canvas {
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0.5;
}

.hiw-hero__inner {
    position: relative;
    z-index: 2;
    max-width: 960px;
    margin: 0 auto;
}

.hiw-hero .eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--sun);
    margin-bottom: 28px;
}

.hiw-hero h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 76px;
    line-height: 1;
    letter-spacing: -0.025em;
    margin: 0 0 28px;
    text-wrap: pretty;
    color: #fff;
}

.hiw-hero h1 em {
    font-style: italic;
    font-weight: 500;
    color: var(--sun);
}

.hiw-hero__lede {
    font-size: 19px;
    color: rgba(255, 255, 255, 0.72);
    max-width: 58ch;
    margin: 0 auto;
    line-height: 1.55;
}


/* --- Week-bar (7 day pips) ------------------------------------------- */

.hiw-weekbar {
    position: relative;
    z-index: 2;
    max-width: 1100px;
    margin: 80px auto 0;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.hiw-pip {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 200ms ease;
    position: relative;
    text-decoration: none;
}

.hiw-pip:hover {
    background: rgba(244, 168, 92, 0.08);
    border-color: var(--sun);
}

.hiw-pip .d {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--stacks-fg);
    margin-bottom: 6px;
}

.hiw-pip .n {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 18px;
    color: #fff;
}

.hiw-pip.sun {
    background: linear-gradient(180deg, rgba(244, 168, 92, 0.15), rgba(212, 120, 47, 0.1));
    border-color: var(--ember);
}

.hiw-pip.sun .d {
    color: var(--sun);
}


/* --- Sunrise band ---------------------------------------------------- */

.hiw-sunrise {
    height: 240px;
    background: linear-gradient(to bottom,
        var(--night) 0%, #1a1a2e 20%, #3a2838 42%, #7a4028 62%, #C87B3E 80%, var(--sand-2) 100%);
    position: relative;
    overflow: hidden;
}

.hiw-sunrise::before {
    content: "";
    position: absolute;
    bottom: -320px;
    left: 50%;
    transform: translateX(-50%);
    width: 1000px;
    height: 1000px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(244, 168, 92, 0.6) 0%, rgba(212, 120, 47, 0.3) 30%, transparent 65%);
    filter: blur(30px);
}


/* --- Timeline -------------------------------------------------------- */

.hiw-timeline {
    background: var(--sand-2);
    color: var(--ink);
    padding: 120px 0 160px;
    position: relative;
}

.hiw-timeline__head {
    max-width: 1100px;
    margin: 0 auto 80px;
    padding: 0 48px;
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 80px;
    align-items: end;
}

.hiw-timeline__head .kicker {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ember);
    margin-bottom: 16px;
}

.hiw-timeline__head h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 52px;
    line-height: 1;
    letter-spacing: -0.02em;
    margin: 0;
}

.hiw-timeline__head h2 em {
    color: var(--ember);
    font-style: italic;
    font-weight: 500;
}

.hiw-timeline__head p {
    font-size: 17px;
    color: rgba(27, 30, 43, 0.7);
    line-height: 1.55;
    padding-bottom: 4px;
    max-width: 52ch;
    margin: 0;
}

/* Day row */
.hiw-day {
    max-width: 1100px;
    margin: 0 auto;
    padding: 56px 48px;
    display: grid;
    grid-template-columns: 180px 1fr 1fr;
    gap: 48px;
    border-top: 1px solid rgba(27, 30, 43, 0.1);
    position: relative;
    /* Anchor offset for the sticky marketing nav (~80px) so footer
       Services links land at the start of the day section, not under
       the header. */
    scroll-margin-top: 96px;
}

.hiw-day:first-of-type { border-top: none; }

/* Each day a slightly different sand */
.hiw-day.d1 { background: var(--sand-2); }
.hiw-day.d2 { background: #F5E8CE; }
.hiw-day.d3 { background: #F1E0BF; }
.hiw-day.d4 { background: #EED8B0; }
.hiw-day.d5 { background: #ECD1A0; }
.hiw-day.d6 { background: #EAC98F; }
.hiw-day.d7 { background: #E9C07C; }

.hiw-day .stamp {
    position: sticky;
    top: 120px;
    align-self: start;
}

.hiw-day .stamp .dow {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 32px;
    line-height: 1;
    color: var(--ink);
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.hiw-day .stamp .date {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--stacks-fg-2);
}

.hiw-day .stamp .num {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ember);
    margin-top: 16px;
}

.hiw-day .body h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 28px;
    line-height: 1.15;
    margin: 0 0 16px;
    letter-spacing: -0.015em;
}

.hiw-day .body h3 em {
    color: var(--ember);
    font-style: italic;
    font-weight: 500;
}

.hiw-day .body p {
    font-size: 15px;
    color: rgba(27, 30, 43, 0.72);
    line-height: 1.65;
    margin: 0 0 14px;
    max-width: 44ch;
}

.hiw-day .body .what {
    margin-top: 14px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--stacks-fg-2);
    border-left: 2px solid var(--ember);
    padding: 6px 0 6px 14px;
}

/* Viz card (right column) */
.hiw-viz {
    background: #fff;
    border: 1px solid rgba(27, 30, 43, 0.08);
    border-radius: 12px;
    padding: 22px;
    min-height: 220px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink);
}

.hiw-viz .title {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--stacks-fg-2);
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
}

.hiw-viz .title .live {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--good);
}

.hiw-viz .title .live::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--good);
}

/* Mon — scan matrix */
.hiw-viz.mon .grid {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 8px 18px;
    align-items: center;
}

.hiw-viz.mon .grid .q { font-weight: 500; font-size: 13px; }
.hiw-viz.mon .grid .head {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--stacks-fg-2);
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(27, 30, 43, 0.08);
}
.hiw-viz.mon .yes { color: var(--good); font-weight: 600; font-size: 14px; }
.hiw-viz.mon .no { color: var(--bad); font-weight: 600; font-size: 14px; }

/* Tue — post preview */
.hiw-viz.tue .post {
    background: #FAFAF5;
    border: 1px solid rgba(27, 30, 43, 0.06);
    border-radius: 8px;
    padding: 14px;
}
.hiw-viz.tue .post .head-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.hiw-viz.tue .post .logo {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--ember); display: grid; place-items: center;
    color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 13px;
}
.hiw-viz.tue .post .biz-name { font-weight: 600; font-size: 13px; }
.hiw-viz.tue .post .time {
    font-size: 11px; color: var(--stacks-fg-2); margin-left: auto;
    font-family: var(--font-mono);
}
.hiw-viz.tue .post .txt { font-size: 13px; line-height: 1.5; color: var(--ink); margin-bottom: 10px; }
.hiw-viz.tue .post .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.hiw-viz.tue .post .tag {
    background: rgba(212, 120, 47, 0.1); color: var(--ember);
    padding: 3px 8px; border-radius: 4px;
    font-size: 11px; font-family: var(--font-mono); letter-spacing: 0.04em;
}

/* Wed — review funnel */
.hiw-viz.wed .msg {
    background: #DCF8C6; color: var(--ink);
    padding: 10px 12px; border-radius: 10px 10px 10px 2px;
    font-size: 13px; max-width: 80%; margin-bottom: 10px;
}
.hiw-viz.wed .msg.them {
    background: #fff; border: 1px solid rgba(27, 30, 43, 0.08);
    border-radius: 10px 10px 2px 10px; margin-left: auto;
}
.hiw-viz.wed .stars {
    color: var(--sun); font-size: 16px; margin-bottom: 2px;
    letter-spacing: 2px; position: static;
}
.hiw-viz.wed .link { color: var(--ember); text-decoration: underline; font-size: 12px; }

/* Thu — competitor chart */
.hiw-viz.thu .bars { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.hiw-viz.thu .bar { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.hiw-viz.thu .bar .lbl { min-width: 120px; font-weight: 500; }
.hiw-viz.thu .bar .track {
    flex: 1; height: 8px; background: rgba(27, 30, 43, 0.06);
    border-radius: 999px; overflow: hidden; position: relative;
}
.hiw-viz.thu .bar .fill { height: 100%; background: var(--ember); border-radius: 999px; }
.hiw-viz.thu .bar.you .fill { background: var(--sun); }
.hiw-viz.thu .bar.you .lbl { color: var(--ember); font-weight: 600; }
.hiw-viz.thu .bar .val {
    font-family: var(--font-mono); font-size: 11px;
    color: var(--stacks-fg-2); min-width: 32px; text-align: right;
}

/* Fri — checklist */
.hiw-viz.fri ul { list-style: none; margin: 0; padding: 0; }
.hiw-viz.fri li {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 8px 0; border-bottom: 1px dashed rgba(27, 30, 43, 0.08);
    font-size: 13px;
}
.hiw-viz.fri li:last-child { border-bottom: none; }
.hiw-viz.fri li .check {
    width: 18px; height: 18px; border-radius: 4px;
    background: var(--ember); color: #fff;
    display: grid; place-items: center; font-size: 11px;
    flex-shrink: 0; margin-top: 1px;
}
.hiw-viz.fri li .check.empty {
    background: transparent; border: 1.5px solid rgba(27, 30, 43, 0.15);
}
.hiw-viz.fri li .meta {
    font-size: 11px; color: var(--stacks-fg-2);
    font-family: var(--font-mono); text-transform: uppercase;
    letter-spacing: 0.1em; margin-top: 2px;
}

/* Sat — quiet */
.hiw-viz.sat {
    background: linear-gradient(180deg, #fff, #FAFAF5);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center;
}
.hiw-viz.sat .glyph {
    font-family: var(--font-display); font-weight: 300;
    font-size: 56px; line-height: 1; color: var(--ember);
    font-style: italic; margin-bottom: 14px;
}
.hiw-viz.sat .q {
    font-size: 13px; color: rgba(27, 30, 43, 0.6);
    max-width: 28ch; line-height: 1.55; font-style: italic;
}

/* Sun — weekly scan trophy */
.hiw-viz.sun {
    background: linear-gradient(180deg, #FDF2DC 0%, #fff 60%);
    border-color: var(--ember);
    box-shadow: 0 14px 40px rgba(212, 120, 47, 0.14);
}
.hiw-viz.sun .q { font-size: 13px; color: rgba(27, 30, 43, 0.65); font-style: italic; margin-bottom: 14px; }
.hiw-viz.sun ol { list-style: none; counter-reset: r; margin: 0; padding: 0; }
.hiw-viz.sun li {
    counter-increment: r; padding: 10px 0;
    border-bottom: 1px dashed rgba(27, 30, 43, 0.08);
    display: flex; align-items: baseline; gap: 14px; font-size: 14px;
}
.hiw-viz.sun li::before {
    content: counter(r); font-family: var(--font-mono); font-size: 11px;
    color: var(--stacks-fg-2); width: 16px;
}
.hiw-viz.sun li:last-child { border-bottom: none; }
.hiw-viz.sun li.you { color: var(--ember); font-weight: 700; }
.hiw-viz.sun li.you::after {
    content: "new"; margin-left: auto;
    font-family: var(--font-mono); font-size: 9px;
    letter-spacing: 0.14em; background: var(--ember); color: #fff;
    padding: 3px 7px; border-radius: 4px; text-transform: uppercase;
}


/* --- Contract section (sand) ----------------------------------------- */

.hiw-contract {
    background: var(--sand);
    color: var(--ink);
    padding: 140px 48px;
}

.hiw-contract__inner {
    max-width: 1100px; margin: 0 auto;
    display: grid; grid-template-columns: 1fr 1.4fr;
    gap: 80px; align-items: start;
}

.hiw-contract .k {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ember);
    margin-bottom: 16px;
}

.hiw-contract h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 48px;
    line-height: 1.02;
    letter-spacing: -0.02em;
    margin: 0;
}

.hiw-contract h2 em {
    color: var(--ember);
    font-style: italic;
    font-weight: 500;
}

.hiw-contract__list {
    display: grid;
    gap: 24px;
}

.hiw-contract__item {
    background: #fff;
    border: 1px solid rgba(27, 30, 43, 0.08);
    border-radius: 12px;
    padding: 24px 28px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    align-items: start;
}

.hiw-contract__item .n {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    color: var(--ember);
    padding-top: 4px;
}

.hiw-contract__item h4 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 18px;
    margin: 0 0 6px;
    line-height: 1.3;
}

.hiw-contract__item p {
    font-size: 14.5px;
    color: rgba(27, 30, 43, 0.72);
    line-height: 1.6;
    margin: 0;
}


/* --- Closing CTA ----------------------------------------------------- */

.hiw-closing {
    background:
        radial-gradient(ellipse 900px 500px at 50% 0%, rgba(212, 120, 47, 0.18), transparent 60%),
        var(--night);
    color: #fff;
    padding: 160px 48px 140px;
    position: relative;
    text-align: center;
    overflow: hidden;
}

.hiw-closing__stars-wrap { position: absolute; inset: 0; pointer-events: none; }
.hiw-closing__stars-wrap canvas { width: 100%; height: 100%; display: block; opacity: 0.5; }

.hiw-closing__inner { position: relative; z-index: 2; max-width: 820px; margin: 0 auto; }

.hiw-closing .k {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--sun);
    margin-bottom: 28px;
}

.hiw-closing h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 56px;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: #fff;
    margin: 0 0 28px;
}

.hiw-closing h2 em {
    font-style: italic;
    font-weight: 500;
    color: var(--sun);
}

.hiw-closing p {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.72);
    max-width: 56ch;
    margin: 0 auto 40px;
    line-height: 1.55;
}

.hiw-closing__cta-row {
    display: flex; gap: 14px;
    justify-content: center; flex-wrap: wrap;
}


/* --- Mobile breakpoints ---------------------------------------------- */

@media (max-width: 880px) {
    .hiw-hero { padding: 120px 24px 80px; }
    .hiw-hero h1 { font-size: 56px; }
    .hiw-weekbar { grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 0 24px; margin-top: 56px; }
    .hiw-pip { padding: 10px 4px; }
    .hiw-pip .d { font-size: 9px; letter-spacing: 0.1em; }
    .hiw-pip .n { font-size: 14px; }

    .hiw-timeline { padding: 80px 0 120px; }
    .hiw-timeline__head { grid-template-columns: 1fr; gap: 24px; padding: 0 24px; margin-bottom: 56px; }
    .hiw-timeline__head h2 { font-size: 36px; }

    .hiw-day { grid-template-columns: 1fr; gap: 24px; padding: 40px 24px; }
    .hiw-day .stamp { position: static; }
    .hiw-day .stamp .dow { font-size: 24px; }
    .hiw-day .body h3 { font-size: 22px; }

    .hiw-contract { padding: 100px 24px; }
    .hiw-contract__inner { grid-template-columns: 1fr; gap: 32px; }
    .hiw-contract h2 { font-size: 36px; }

    .hiw-closing { padding: 100px 24px 80px; }
    .hiw-closing h2 { font-size: 38px; }
}
