﻿/* VOICE  occasion: a publisher's book page, calm and technical, confident
   IDEA   the library on the cover: the book on a shelf, chapters as stacked spines
   PICTURE the cover itself, large, lit like the corridor of light behind the robot
   COLOUR cover slate ground, petrol blue band, silver ink, corridor-light cyan accent
   TYPE   Barlow light for titles (the cover's thin grotesque), Barlow Condensed for the author's name and numerals
   LAYOUT laptop: cover left in a glow, title and buy actions right; phone: title, cover, actions */
:root {
    color-scheme: light dark;
    --bg: light-dark(#f3f5f5,#1c2324);
    --ink: light-dark(#182022,#e7ecee);
    --soft: light-dark(#4b5a5e,#a9b6ba);
    --line: light-dark(#d3dadc,#334043);
    --slate: #2a3334;
    --slate2: #202829;
    --petrol: #1f4a5c;
    --silver: #e9eef0;
    --glow: #9fdcff;
    --amz: #ffb648;
    --card: light-dark(#ffffff,#242d2e)
}

    :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 Barlow,system-ui,sans-serif;
    overflow-x: clip
}

img {
    max-width: 100%;
    display: block
}

a {
    color: inherit
}

h1, h2, h3 {
    font-weight: 300;
    line-height: 1.08;
    letter-spacing: -.02em;
    text-wrap: balance;
    margin: 0
}

h2 {
    font-size: clamp(32px,4.4vw,46px)
}

p {
    margin: 0 0 1em
}

.wrap {
    max-width: 1240px;
    margin: 0 auto
}

.band {
    padding-block: clamp(40px,6vw,88px);
    padding-inline: max(5vw,16px)
}

.dark {
    background: var(--slate);
    color: var(--silver)
}

    .dark .soft {
        color: #b8c6cb
    }

.soft {
    color: var(--soft)
}
/* nav */
nav {
    position: sticky;
    top: 0;
    z-index: 5;
    background: color-mix(in srgb,var(--slate2) 94%,transparent);
    backdrop-filter: blur(8px);
    color: var(--silver);
    padding: 10px max(5vw,16px)
}

    nav .wrap {
        display: flex;
        align-items: center;
        gap: 8px 22px;
        flex-wrap: wrap
    }

    nav .brand {
        font: 600 18px/1 "Barlow Condensed",sans-serif;
        text-decoration: none;
        margin-right: auto;
        letter-spacing: .01em
    }

    nav a.l {
        text-decoration: none;
        font-size: 15px;
        color: #c3d0d4;
        padding: 8px 0
    }

        nav a.l:hover {
            color: #fff
        }

    nav .buy {
        padding: 8px 14px;
        min-height: 38px
    }

@media(max-width:720px) {
    nav a.l {
        display: none
    }
}
/* buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 22px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform .15s,background .15s
}

    .btn:hover {
        transform: translateY(-1px)
    }

    .btn:focus-visible, a:focus-visible {
        outline: 3px solid var(--glow);
        outline-offset: 3px
    }

.buy {
    background: var(--amz);
    color: #1b1404
}

    .buy:hover {
        background: #ffc66d
    }

.ghost {
    border-color: #7f9aa3;
    color: var(--silver)
}

    .ghost:hover {
        background: rgba(255,255,255,.08)
    }

.btn svg {
    width: 20px;
    height: 20px;
    flex: none
}
/* hero */
.hero {
    background: radial-gradient(ellipse 60% 80% at 22% 50%,#3e5560 0%,var(--slate) 62%),var(--slate);
    color: var(--silver);
    padding-block: clamp(36px,6vw,96px);
    padding-inline: max(5vw,16px)
}

    .hero .wrap {
        display: grid;
        grid-template-columns: minmax(0,5fr) minmax(0,6fr);
        gap: clamp(32px,6vw,88px);
        align-items: center
    }

.cover {
    position: relative;
    justify-self: center;
    width: min(420px,100%);
    perspective: 1400px
}

    .cover img {
        width: 100%;
        border-radius: 2px 6px 6px 2px;
        box-shadow: -2px 0 0 #11181a,0 2px 0 rgba(255,255,255,.06),24px 40px 60px rgba(0,0,0,.55),0 0 90px rgba(159,220,255,.18);
        transform: rotateY(-9deg);
        transform-origin: left center;
        transition: transform .6s ease
    }

    .cover:hover img {
        transform: rotateY(0)
    }

    .cover::after {
        content: "";
        position: absolute;
        left: 6%;
        right: 2%;
        bottom: -26px;
        height: 22px;
        background: radial-gradient(ellipse at center,rgba(0,0,0,.5),transparent 70%)
    }

.hero h1 {
    font-size: clamp(36px,5vw,60px);
    color: #fff
}

.hero .sub {
    font-size: clamp(19px,2vw,23px);
    font-weight: 300;
    color: #cfe0e6;
    margin: 18px 0 26px;
    max-width: 32em
}

.author {
    font: 500 clamp(24px,2.6vw,30px)/1.1 "Barlow Condensed",sans-serif;
    color: #fff;
    margin: 0
}

.fw {
    color: #b8c6cb;
    margin: 4px 0 28px;
    font-size: 16px
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px
}

.pub {
    margin-top: 26px;
    font-size: 14px;
    color: #9fb0b6
}

@media(max-width:820px) {
    .hero .wrap {
        grid-template-columns: minmax(0,1fr)
    }

    .hero .txt {
        order: -1
    }

    .cover {
        width: min(300px,78%)
    }

        .cover img {
            transform: none
        }
}
/* about */
.about .wrap {
    display: grid;
    grid-template-columns: minmax(0,7fr) minmax(0,5fr);
    gap: clamp(28px,5vw,72px)
}

.lede {
    font-size: clamp(20px,2vw,23px);
    font-weight: 300;
    line-height: 1.45
}

.feat {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--line)
}

    .feat li {
        display: grid;
        grid-template-columns: 34px minmax(0,1fr);
        gap: 10px;
        padding: 14px 0;
        border-bottom: 1px solid var(--line)
    }

    .feat svg {
        width: 24px;
        height: 24px;
        color: var(--petrol);
        margin-top: 3px
    }

:root[data-theme=dark] .feat svg {
    color: var(--glow)
}

@media(prefers-color-scheme:dark) {
    :root:not([data-theme=light]) .feat svg {
        color: var(--glow)
    }
}

.feat b {
    font-weight: 600
}

h3.k {
    font: 600 19px/1.3 Barlow,sans-serif;
    letter-spacing: 0;
    margin: 0 0 12px
}

@media(max-width:820px) {
    .about .wrap {
        grid-template-columns: minmax(0,1fr)
    }
}
/* dedication */
.ded {
    background: var(--petrol);
    color: #eaf4f7;
    text-align: center
}

    .ded blockquote {
        margin: 0 auto;
        max-width: 34em;
        font-size: clamp(21px,2.4vw,28px);
        font-weight: 300;
        line-height: 1.4;
        font-style: italic
    }

    .ded cite {
        display: block;
        margin-top: 14px;
        font: 500 17px "Barlow Condensed",sans-serif;
        font-style: normal;
        color: #a9d1df
    }
/* chapters */
.chap-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: end;
    gap: 12px 32px;
    margin-bottom: 28px
}

    .chap-head p {
        max-width: 36em;
        margin: 0
    }

.shelf {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 12px 20px
}

.sp {
    display: grid;
    grid-template-columns: 72px minmax(0,1fr);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 3px;
    overflow: hidden
}

    .sp .n {
        background: var(--slate);
        color: #fff;
        font: 600 30px/1 "Barlow Condensed",sans-serif;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding-top: 18px;
        position: relative
    }

    .sp:nth-child(3n+2) .n {
        background: var(--petrol)
    }

    .sp:nth-child(3n+3) .n {
        background: #3a4a4d
    }

    .sp .n::after {
        content: "";
        position: absolute;
        left: 10px;
        right: 10px;
        bottom: 14px;
        height: 2px;
        background: rgba(255,255,255,.22);
        box-shadow: 0 -6px 0 rgba(255,255,255,.12)
    }

    .sp .b {
        padding: 16px 18px 14px
    }

    .sp h3 {
        font: 600 19px/1.25 Barlow,sans-serif;
        letter-spacing: 0;
        margin: 0 0 6px
    }

    .sp p {
        font-size: 16px;
        color: var(--soft);
        margin: 0
    }

    .sp.fwd .n {
        font-size: 15px;
        padding-top: 22px;
        writing-mode: vertical-rl;
        transform: rotate(180deg);
        align-items: center;
        padding: 0
    }

        .sp.fwd .n::after {
            display: none
        }

@media(max-width:860px) {
    .shelf {
        grid-template-columns: minmax(0,1fr)
    }
}

@media(max-width:480px) {
    .sp {
        grid-template-columns: 52px minmax(0,1fr)
    }

        .sp .n {
            font-size: 24px
        }
}
/* code */
.code .wrap {
    display: grid;
    grid-template-columns: minmax(0,6fr) minmax(0,5fr);
    gap: clamp(28px,5vw,72px);
    align-items: center
}

.term {
    background: #11181a;
    border: 1px solid #33464c;
    border-radius: 6px;
    font: 14px/1.7 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
    color: #cfe0e6;
    overflow: hidden
}

    .term .bar {
        display: flex;
        gap: 7px;
        padding: 10px 14px;
        border-bottom: 1px solid #24343a
    }

        .term .bar i {
            width: 11px;
            height: 11px;
            border-radius: 50%;
            background: #3e5158
        }

    .term pre {
        margin: 0;
        padding: 16px 18px;
        overflow-x: auto
    }

    .term .c {
        color: #7f9aa3
    }

    .term .g {
        color: var(--glow)
    }

@media(max-width:820px) {
    .code .wrap {
        grid-template-columns: minmax(0,1fr)
    }
}
/* author */
.bio .wrap {
    display: grid;
    grid-template-columns: minmax(0,4fr) minmax(0,8fr);
    gap: clamp(28px,5vw,72px)
}

.bio .name {
    font: 500 clamp(30px,3.4vw,40px)/1.05 "Barlow Condensed",sans-serif;
    margin: 8px 0 0
}

@media(max-width:820px) {
    .bio .wrap {
        grid-template-columns: minmax(0,1fr)
    }
}
/* course */
.course {
    background: linear-gradient(120deg,var(--petrol) 0%,#163845 100%);
    color: #eef6f8
}

    .course .wrap {
        display: grid;
        grid-template-columns: minmax(0,7fr) minmax(0,5fr);
        gap: clamp(28px,5vw,72px);
        align-items: center
    }

    .course h2 {
        color: #fff
    }

    .course .tag {
        font: 500 18px "Barlow Condensed",sans-serif;
        color: #a9d1df;
        margin: 0 0 10px
    }

.tokens {
    position: relative;
    aspect-ratio: 5/4;
    max-width: 440px;
    justify-self: center;
    width: 100%
}

    .tokens svg {
        width: 100%;
        height: 100%
    }

.li {
    background: #fff;
    color: #0a3d57
}

    .li:hover {
        background: #e6f3f8
    }

@media(max-width:820px) {
    .course .wrap {
        grid-template-columns: minmax(0,1fr)
    }

    .tokens {
        max-width: 320px;
        order: -1
    }
}
/* footer */
footer {
    background: var(--slate2);
    color: #a9b6ba;
    font-size: 15px
}

    footer .wrap {
        display: flex;
        flex-wrap: wrap;
        gap: 16px 32px;
        justify-content: space-between;
        align-items: center
    }

    footer a {
        color: #dfe8eb
    }

    footer .links {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 22px
    }

@media(prefers-reduced-motion:reduce) {
    * {
        transition: none !important;
        animation: none !important
    }

    html {
        scroll-behavior: auto
    }
}
