/* the home page. the app has its own styles in app/style.css */

:root {
    --ink: #0C1230;
    --ink-raised: #151C42;
    --paper: #F4F5FA;
    --paper-alt: #ECEEF6;
    --card: #FFFFFF;
    --text: #151A2D;
    --muted: #5A6178;
    --line: #E1E4EE;

    --blue: #3F81EA;
    --navy: #354D86;
    --pink: #EE6791;
    --turquoise: #5DCAD2;
    --yellow: #F8C463;
    --purple: #AE68F5;
    --orange: #FF9253;

    --sans: "Albert Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.5;
    color: var(--text);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

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

.container {
    max-width: 1160px;
    margin-inline: auto;
    padding-inline: 24px;
}

h1, h2, h3 { margin: 0; letter-spacing: -0.025em; }

/* ---------- shared pieces ---------- */

.logo { display: inline-block; }
.logo img {
    width: auto;
    height: 44px;
}
.logo-small img { height: 32px; }

.button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 28px;
    border-radius: 999px;
    background: var(--yellow);
    color: #1B1B1B;
    font-weight: 700;
    font-size: 17px;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(248, 196, 99, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
}
.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(248, 196, 99, 0.4);
}

.arrow { display: inline-block; transition: transform 0.2s; }
a:hover .arrow { transform: translateX(4px); }

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
}
.glow-blue {
    width: 560px;
    height: 560px;
    top: -200px;
    right: -140px;
    background: var(--blue);
    opacity: 0.4;
}
.glow-pink {
    width: 420px;
    height: 420px;
    bottom: -220px;
    left: -160px;
    background: var(--pink);
    opacity: 0.25;
}

/* ---------- 1. header ---------- */

.hero {
    position: relative;
    overflow: hidden;
    padding-block: 0 104px;
    background: var(--ink);
    color: #FFFFFF;
}
.hero::before,
.cta::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px);
    background-size: 26px 26px;
    -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 95%);
    mask-image: linear-gradient(to bottom, #000 30%, transparent 95%);
    pointer-events: none;
}
.hero .container,
.cta .container { position: relative; }

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: 24px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 64px;
    align-items: center;
    padding-block-start: 56px;
}

.eyebrow {
    margin: 0 0 20px;
    font-family: var(--mono);
    font-size: 14px;
    color: var(--turquoise);
}

h1 {
    margin-bottom: 24px;
    font-size: clamp(42px, 6vw, 70px);
    line-height: 1.02;
    font-weight: 800;
    letter-spacing: -0.035em;
}

.gradient {
    background: linear-gradient(90deg, var(--turquoise), #6FA2F2 45%, var(--pink));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lede {
    max-width: 30ch;
    margin: 0 0 40px;
    font-size: clamp(19px, 2vw, 22px);
    color: rgba(255, 255, 255, 0.72);
}

.window {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    background: rgba(21, 28, 66, 0.85);
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.45);
}

.window-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    font-family: var(--mono);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-pink { background: var(--pink); }
.dot-yellow { background: var(--yellow); }
.dot-turquoise { background: var(--turquoise); }
.window-title { margin-left: 10px; }

#hero-network {
    display: block;
    width: 100%;
    height: auto;
    padding-block: 12px 0;
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 0;
    padding: 8px 18px 20px;
    list-style: none;
}
.steps li {
    padding: 9px 13px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.45);
    transition: color 0.3s, background 0.3s, border-color 0.3s;
}
.steps b {
    display: block;
    margin-bottom: 2px;
    font-weight: 500;
    opacity: 0.6;
}
.steps li.active { color: #FFFFFF; border-color: transparent; }
.steps li.step-guess.active { background: rgba(248, 196, 99, 0.22); }
.steps li.step-mistake.active { background: rgba(238, 103, 145, 0.26); }
.steps li.step-fix.active { background: rgba(93, 202, 210, 0.22); }

/* the network drawn by home.js */
.hn-line {
    stroke: rgba(255, 255, 255, 0.15);
    stroke-linecap: round;
    transition: stroke 0.5s, stroke-width 0.7s;
}
.hn-line.highlighted { stroke: rgba(93, 202, 210, 0.75); }

.hn-pulse { opacity: 0; }
.hn-pulse.forward {
    opacity: 1;
    fill: var(--yellow);
    filter: drop-shadow(0 0 6px var(--yellow));
}
.hn-pulse.backward {
    opacity: 1;
    fill: var(--pink);
    filter: drop-shadow(0 0 6px var(--pink));
}

.hn-halo {
    fill: var(--blue);
    opacity: 0;
    transition: opacity 0.35s;
}
.hn-halo.lit { opacity: 0.35; }
.hn-halo.checking {
    fill: var(--pink);
    animation: hn-check 0.7s ease-in-out infinite alternate;
}
@keyframes hn-check {
    from { opacity: 0.15; }
    to { opacity: 0.6; }
}

.hn-node {
    fill: var(--blue);
    stroke: var(--ink-raised);
    stroke-width: 3;
}
.hn-node.first { fill: #56639A; }

.hn-value {
    font-family: var(--mono);
    font-size: 11px;
    fill: #FFFFFF;
    text-anchor: middle;
    dominant-baseline: central;
    transition: opacity 0.3s;
}
.hn-value.waiting { opacity: 0.3; }

.hn-label {
    font-family: var(--mono);
    font-size: 13px;
    fill: rgba(255, 255, 255, 0.5);
    dominant-baseline: central;
}

/* ---------- sections ---------- */

.section { padding-block: 104px; }
.section-alt { background: var(--paper-alt); }

.section-head {
    max-width: 880px;
    margin-bottom: 56px;
}
h2 {
    font-size: clamp(34px, 4.4vw, 50px);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.sub {
    margin: 14px 0 0;
    font-size: 20px;
    color: var(--muted);
}

/* ---------- 2. how it works ---------- */

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature {
    padding: 24px 24px 30px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--card);
    transition: transform 0.25s, box-shadow 0.25s;
}
.feature:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 44px rgba(21, 26, 45, 0.08);
}
.feature h3 {
    margin-bottom: 6px;
    font-size: 23px;
}
.feature p {
    margin: 0;
    color: var(--muted);
}

.mini {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 132px;
    margin-bottom: 26px;
    border-radius: 14px;
    background-color: var(--paper);
    background-image: radial-gradient(#D6DAE6 1px, transparent 1px);
    background-size: 16px 16px;
    font-family: var(--mono);
}

.bubble {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 3px solid #FFFFFF;
    font-size: 13px;
    font-weight: 500;
    color: #FFFFFF;
    position: relative;
    z-index: 1;
    background: var(--blue);
}

.wire {
    position: relative;
    width: 72px;
    height: 5px;
    margin-inline: -10px;
    border-radius: 3px;
    background: #C5CCDA;
}
.weight {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: var(--pink);
    font-size: 12px;
    font-weight: 600;
    color: #FFFFFF;
    transform: translate(-50%, -50%);
    animation: weight-pulse 1.8s ease-in-out infinite alternate;
}
@keyframes weight-pulse {
    from { scale: 1; }
    to { scale: 1.08; }
}

/* numbers racing along three connections */
.race {
    position: relative;
    width: 240px;
    height: 104px;
}
.race-lines {
    position: absolute;
    inset: 0;
    overflow: visible;
}
.race-lines line {
    stroke: #C5CCDA;
    stroke-width: 5;
    stroke-linecap: round;
}
.race-node {
    fill: var(--blue);
    stroke: #FFFFFF;
    stroke-width: 3;
}
.race-number {
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 2px solid #FFFFFF;
    border-radius: 50%;
    background: var(--yellow);
    box-shadow: 0 2px 8px rgba(21, 26, 45, 0.18);
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text);
    offset-rotate: 0deg;
    animation: race 4.2s ease-in-out infinite;
}
/* one shared 4.2s cycle, each number takes its turn: top, then middle, then bottom */
.race-1 {
    offset-path: path("M24 16 L216 52");
    offset-distance: 30%;
}
.race-2 {
    offset-path: path("M24 52 L216 52");
    offset-distance: 55%;
    animation-delay: -2.8s;
}
.race-3 {
    offset-path: path("M24 88 L216 52");
    offset-distance: 75%;
    animation-delay: -1.4s;
}
@keyframes race {
    0% { offset-distance: 0%; opacity: 0; }
    3% { opacity: 1; }
    24% { opacity: 1; }
    28.5% { offset-distance: 100%; opacity: 0; }
    100% { offset-distance: 100%; opacity: 0; }
}

/* a larger network whose connections thicken and thin */
.mini-network {
    width: auto;
    height: 116px;
}

/* ---------- 3. start wherever you are ---------- */

.levels {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
}

/* the dashed track joining the three markers */
.levels::before {
    content: "";
    position: absolute;
    top: 25px;
    left: 26px;
    right: calc((100% - 96px) / 3 - 26px);
    height: 2px;
    background: repeating-linear-gradient(90deg, #B9C0D2 0 8px, transparent 8px 16px);
}

.level {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    color: inherit;
    text-decoration: none;
}

.level-marker {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 26px;
    border-radius: 50%;
    box-shadow: 0 0 0 8px var(--paper-alt);
    font-family: var(--mono);
    font-weight: 600;
    font-size: 15px;
    transition: transform 0.25s;
}
.level:hover .level-marker { transform: scale(1.1); }
.level-beginner .level-marker { background: var(--turquoise); color: var(--ink); }
.level-intermediate .level-marker { background: var(--blue); color: #FFFFFF; }
.level-advanced .level-marker { background: var(--purple); color: #FFFFFF; }

.level-name {
    margin-bottom: 6px;
    font-family: var(--mono);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}
.level h3 {
    margin-bottom: 6px;
    font-size: 26px;
}
.level p {
    margin: 0 0 18px;
    color: var(--muted);
}
.level-link {
    margin-top: auto;
    font-weight: 700;
    color: var(--blue);
}

/* ---------- 4. networks you'll build ---------- */

.networks {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.network-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--card);
    color: inherit;
    text-decoration: none;
    transition: transform 0.25s, box-shadow 0.25s;
}
.network-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 26px 54px rgba(21, 26, 45, 0.12);
}

.network-art {
    aspect-ratio: 16 / 10;
    max-width: 100%;
    padding: 10px;
    border-bottom: 1px solid var(--line);
    background-color: #F8F9FC;
    background-image: radial-gradient(#DDE1EB 1px, transparent 1px);
    background-size: 16px 16px;
}
.network-art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s;
}
.network-card:hover .network-art img { transform: scale(1.04); }

.network-body { padding: 20px 24px 26px; }
.network-body h3 {
    margin-bottom: 4px;
    font-size: 21px;
}
.network-body p {
    margin: 0;
    color: var(--muted);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-family: var(--mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}
.tag::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tag-color);
}
.tag-beginner { --tag-color: var(--turquoise); }
.tag-intermediate { --tag-color: var(--blue); }
.tag-advanced { --tag-color: var(--purple); }
.tag-examples { --tag-color: var(--orange); }

/* ---------- 5. call to action ---------- */

.cta {
    position: relative;
    overflow: hidden;
    padding-block: 128px;
    background: var(--ink);
    color: #FFFFFF;
    text-align: center;
}
.cta .glow-blue { top: auto; bottom: -300px; right: 10%; }
.cta .glow-pink { bottom: auto; top: -260px; left: 10%; }
.cta h2 { margin-bottom: 40px; }
.cta p {
    margin: 16px 0 40px;
    font-size: 21px;
    color: rgba(255, 255, 255, 0.72);
}

.footer {
    padding-block: 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--ink);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.45);
}
.footer-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    text-align: center;
}
.footer-credit { margin: 0; }
.footer-credit a {
    color: rgba(255, 255, 255, 0.72);
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.25);
    text-underline-offset: 3px;
    transition: color 0.2s, text-decoration-color 0.2s;
}
.footer-credit a:hover {
    color: #FFFFFF;
    text-decoration-color: rgba(255, 255, 255, 0.6);
}

/* ---------- smaller screens ---------- */

@media (max-width: 960px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 56px;
        padding-block-start: 32px;
    }
    .features { grid-template-columns: 1fr; }
    .networks { grid-template-columns: repeat(2, 1fr); }
    .levels {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .levels::before { display: none; }
}

@media (max-width: 640px) {
    .container { padding-inline: 20px; }
    .section { padding-block: 72px; }
    .section-head { margin-bottom: 40px; }
    .hero { padding-block: 0 72px; }
    .cta { padding-block: 88px; }
    .networks { grid-template-columns: 1fr; }
    .steps { padding-inline: 12px; gap: 6px; }
    .steps li { padding: 8px 9px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }
}
