﻿/* VOICE: confident, technical, warm; a publisher's book site, not a SaaS page.
   IDEA: the book jacket itself: black boards, Apress yellow, light split through a prism.
   PICTURE: the real cover, lit and lifted, with a thin spectrum ray running across the hero.
   COLOUR and TYPE: black and white fields, cover yellow #f8c300 as the single accent; Fira Sans, as on the jacket.
   LAYOUT: black hero, white reading bands, a black band again for the course, footer with the buy button. */
:root {
    color-scheme: light dark;
    --bg: light-dark(#ffffff,#0d0d0d);
    --ink: light-dark(#141414,#efefef);
    --muted: light-dark(#555,#a8a8a8);
    --soft: light-dark(#f4f3ef,#171717);
    --line: light-dark(#e3e1da,#2a2a2a);
    --yellow: #f8c300;
    --yellow-ink: light-dark(#8a6a00,#f8c300);
    --black: #0a0a0a
}

    :root[data-theme=light] {
        color-scheme: light
    }

    :root[data-theme=dark] {
        color-scheme: dark
    }

* {
    box-sizing: border-box;
    min-width: 0
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 72px
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 17px/1.6 "Fira Sans",system-ui,sans-serif;
    overflow-x: clip
}

img {
    max-width: 100%;
    height: auto;
    display: block
}

a {
    color: inherit
}

.wrap {
    max-width: 1240px;
    margin: 0 auto
}

.band {
    padding: clamp(48px,7vw,104px) max(5vw,16px)
}

h1, h2, h3 {
    line-height: 1.08;
    text-wrap: balance;
    margin: 0
}

h2 {
    font-size: clamp(30px,4vw,44px);
    font-weight: 700;
    margin-bottom: .6em
}

h3 {
    font-size: 20px;
    font-weight: 600
}

p {
    margin: 0 0 1em
}

.lede {
    font-size: 19px;
    color: var(--muted);
    max-width: 62ch
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 22px;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    font-size: 16px;
    transition: transform .15s
}

    .btn:hover {
        transform: translateY(-2px)
    }

    .btn:focus-visible, a:focus-visible {
        outline: 3px solid var(--yellow);
        outline-offset: 3px
    }

.btn-y {
    background: var(--yellow);
    color: #111
}

.btn-o {
    border: 2px solid currentColor
}

.btn svg {
    width: 18px;
    height: 18px
}

/* nav */
nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(10,10,10,.92);
    backdrop-filter: blur(8px);
    color: #fff;
    border-bottom: 1px solid #222
}

    nav .wrap {
        display: flex;
        align-items: center;
        gap: 20px;
        padding: 10px max(5vw,16px)
    }

    nav .brand {
        font-weight: 700;
        text-decoration: none;
        white-space: nowrap;
        color: var(--yellow)
    }

    nav .links {
        display: flex;
        gap: 18px;
        overflow-x: auto;
        flex: 1;
        scrollbar-width: none
    }

        nav .links a {
            flex: none;
            text-decoration: none;
            color: #cfcfcf;
            font-size: 15px;
            padding: 10px 0
        }

            nav .links a:hover {
                color: #fff
            }

    nav .btn {
        min-height: 40px;
        padding: 8px 16px;
        font-size: 15px;
        flex: none
    }

/* hero */
.hero {
    background: var(--black);
    color: #fff;
    position: relative;
    overflow: hidden
}

    .hero::before {
        content: "";
        position: absolute;
        left: -10%;
        right: -10%;
        top: 58%;
        height: 3px;
        transform: rotate(-9deg);
        background: linear-gradient(90deg,transparent,#ff3b3b 30%,#ff9d00,#f8c300,#3ddc84,#2fa8ff,#8a5cff 75%,transparent);
        opacity: .55;
        filter: blur(1px)
    }

    .hero::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: -1px;
        height: 90px;
        background: var(--yellow);
        clip-path: polygon(0 70%,100% 15%,100% 100%,0 100%)
    }

    .hero .wrap {
        position: relative;
        z-index: 1;
        display: grid;
        grid-template-columns: minmax(0,1.15fr) minmax(0,.85fr);
        gap: clamp(32px,5vw,72px);
        align-items: center;
        padding-bottom: 70px
    }

    .hero h1 {
        font-size: clamp(36px,5.2vw,62px);
        font-weight: 700;
        color: var(--yellow);
        letter-spacing: -.01em
    }

    .hero .sub {
        font-size: clamp(19px,2vw,24px);
        margin: 18px 0 6px;
        color: #f1f1f1;
        max-width: 34ch
    }

    .hero .by {
        color: var(--yellow);
        font-size: 19px;
        margin: 0 0 28px
    }

    .hero .ctas {
        display: flex;
        flex-wrap: wrap;
        gap: 12px
    }

        .hero .ctas .btn-o {
            color: #fff
        }

    .hero .meta {
        margin-top: 28px;
        font-size: 14px;
        color: #9a9a9a;
        display: flex;
        flex-wrap: wrap;
        gap: 6px 22px
    }

.cover {
    justify-self: center;
    width: min(100%,380px);
    transform: rotate(2deg);
    animation: float 7s ease-in-out infinite
}

    .cover img {
        border-radius: 4px 10px 10px 4px;
        box-shadow: -14px 0 0 -8px #1c1c1c,0 40px 80px rgba(248,195,0,.18),0 30px 60px rgba(0,0,0,.6)
    }

@keyframes float {
    50% {
        transform: rotate(2deg) translateY(-10px)
    }
}

@media(prefers-reduced-motion:reduce) {
    .cover {
        animation: none
    }

    .btn {
        transition: none
    }

    html {
        scroll-behavior: auto
    }
}

/* about the book */
.about .wrap {
    display: grid;
    grid-template-columns: minmax(0,1.3fr) minmax(0,1fr);
    gap: clamp(32px,5vw,72px)
}

.learn {
    background: var(--soft);
    border-radius: 18px;
    padding: clamp(22px,3vw,36px);
    align-self: start
}

    .learn ul {
        list-style: none;
        padding: 0;
        margin: 14px 0 24px
    }

    .learn li {
        position: relative;
        padding-left: 30px;
        margin-bottom: 14px;
        font-size: 16px
    }

        .learn li::before {
            content: "";
            position: absolute;
            left: 0;
            top: .45em;
            width: 14px;
            height: 14px;
            background: var(--yellow);
            transform: rotate(45deg);
            border-radius: 2px
        }

    .learn .for {
        border-top: 1px solid var(--line);
        padding-top: 18px;
        font-size: 16px
    }

/* contents */
.toc {
    background: var(--yellow);
    color: #111
}

    .toc .lede {
        color: #3b3000
    }

.chapters {
    list-style: none;
    padding: 0;
    margin: 28px 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(280px,1fr));
    gap: 2px;
    background: #111;
    border: 2px solid #111;
    border-radius: 14px;
    overflow: hidden
}

    .chapters li {
        background: var(--yellow);
        padding: 16px 18px;
        display: flex;
        gap: 14px;
        align-items: baseline;
        font-weight: 500
    }

    .chapters b {
        font-size: 28px;
        line-height: 1;
        font-weight: 700;
        flex: none;
        width: 1.6em
    }

    .chapters li.app {
        background: #111;
        color: var(--yellow)
    }

/* reading */
.read .wrap {
    max-width: 760px
}

.read h3 {
    margin: 1.8em 0 .6em
}

.read p {
    font-size: 18px
}

.read .first::first-letter {
    float: left;
    font-size: 4.2em;
    line-height: .8;
    padding: 6px 10px 0 0;
    font-weight: 700;
    color: var(--yellow-ink)
}

.ack {
    background: var(--soft)
}

    .ack .wrap {
        max-width: 760px
    }

    .ack p {
        font-size: 19px;
        font-style: italic
    }

/* author */
.author .wrap {
    display: grid;
    grid-template-columns: minmax(0,280px) minmax(0,1fr);
    gap: clamp(28px,5vw,64px);
    align-items: center
}

.author img {
    border-radius: 50%;
    aspect-ratio: 1;
    object-fit: cover;
    box-shadow: 0 0 0 6px var(--yellow)
}

/* articles */
.posts {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(300px,1fr));
    gap: 24px;
    margin-top: 32px
}

.post {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: var(--bg);
    transition: transform .15s,box-shadow .15s
}

    .post:hover {
        transform: translateY(-3px);
        box-shadow: 0 14px 34px rgba(0,0,0,.12)
    }

.thumb {
    aspect-ratio: 2/1;
    background: #111;
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
    color: #777;
    font-size: 13px
}

    .thumb::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(115deg,transparent 40%,rgba(248,195,0,.35) 50%,transparent 60%)
    }

    .thumb span {
        position: relative;
        border: 1px dashed #555;
        padding: 6px 12px;
        border-radius: 6px
    }

    .thumb img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover
    }

.post .body {
    padding: 18px 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1
}

.post .go {
    margin-top: auto;
    font-size: 15px;
    font-weight: 600;
    color: var(--yellow-ink)
}

.note {
    font-size: 13px;
    color: var(--muted);
    margin-top: 18px
}

/* course */
.course {
    background: var(--black);
    color: #fff
}

    .course .wrap {
        display: grid;
        grid-template-columns: minmax(0,1fr) minmax(0,1fr);
        gap: clamp(32px,5vw,72px);
        align-items: center
    }

    .course .lede {
        color: #bdbdbd
    }

.player {
    aspect-ratio: 16/9;
    border-radius: 14px;
    background: radial-gradient(circle at 70% 30%,#2a2a2a,#0f0f0f 70%);
    border: 1px solid #2a2a2a;
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden
}

    .player::after {
        content: "";
        position: absolute;
        left: -20%;
        right: -20%;
        top: 62%;
        height: 2px;
        transform: rotate(-12deg);
        background: linear-gradient(90deg,transparent,#ff3b3b,#f8c300,#2fa8ff,transparent);
        opacity: .6
    }

.play {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: var(--yellow);
    display: grid;
    place-items: center;
    z-index: 1;
    box-shadow: 0 0 0 12px rgba(248,195,0,.15)
}

    .play svg {
        width: 30px;
        height: 30px;
        margin-left: 5px
    }

.modules {
    list-style: none;
    padding: 0;
    margin: 24px 0 28px;
    counter-reset: m
}

    .modules li {
        counter-increment: m;
        display: flex;
        gap: 14px;
        padding: 12px 0;
        border-bottom: 1px solid #262626
    }

        .modules li::before {
            content: counter(m);
            flex: none;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: #1f1f1f;
            color: var(--yellow);
            display: grid;
            place-items: center;
            font-size: 14px;
            font-weight: 600
        }

/* footer */
footer {
    background: var(--yellow);
    color: #111
}

    footer .wrap {
        display: flex;
        flex-wrap: wrap;
        gap: 24px 48px;
        align-items: center;
        justify-content: space-between
    }

    footer h2 {
        margin: 0;
        font-size: clamp(26px,3vw,36px);
        max-width: 22ch
    }

    footer .btn-y {
        background: #111;
        color: var(--yellow)
    }

.legal {
    background: #111;
    color: #9a9a9a;
    font-size: 14px;
    padding: 22px max(5vw,16px)
}

    .legal .wrap {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 24px;
        justify-content: space-between
    }

@media(max-width:860px) {
    .hero .wrap, .about .wrap, .course .wrap {
        grid-template-columns: minmax(0,1fr)
    }

    .hero .cover {
        order: -1;
        width: min(70%,280px)
    }

    .author .wrap {
        grid-template-columns: minmax(0,1fr)
    }

    .author img {
        width: 180px
    }
}

@media(max-width:600px) {
    nav .links {
        display: none
    }

    nav .wrap {
        justify-content: space-between
    }

    body {
        font-size: 16px
    }

    .read p {
        font-size: 17px
    }
}
