/*
  Create GUI Applications: shared stylesheet for all four editions.
  Bundled by build.py into /static/css/qt-book-v2.css.
  Colours follow the covers: near-black, Python yellow, Qt green, steel-blue tiles.
*/

/* --- src/common/theme/css/palette.css --- */
/*
  Shared colour spectrum. GENERATED by tools/palette.py: edit that, not this.

  Every hue shares the same luminance ladder, so steps are interchangeable
  between hues for contrast. On white: 600+ >= 4.5:1 (text), 500+ >= 3:1
  (large text, icons, borders). On #1a1a1a: 500 and lighter >= 4.5:1.
*/

:root {
  /* RED */
  --red-50: #fff6f5;
  --red-100: #ffeeea;
  --red-200: #fecfc5;
  --red-300: #fea591;
  --red-400: #fd6f53;
  --red-500: #f3421e;
  --red-600: #d42f08;
  --red-700: #ac2405;
  --red-800: #831f0b;
  --red-900: #501408;
  --red-950: #2f100a;

  /* ORANGE */
  --orange-50: #fff7f2;
  --orange-100: #ffeee3;
  --orange-200: #fed1b3;
  --orange-300: #fea86b;
  --orange-400: #ee7e13;
  --orange-500: #cb6a0b;
  --orange-600: #ad5908;
  --orange-700: #8b4705;
  --orange-800: #6c3603;
  --orange-900: #441f01;
  --orange-950: #2a1404;

  /* YELLOW */
  --yellow-50: #fef8e2;
  --yellow-100: #fff1be;
  --yellow-200: #f9d852;
  --yellow-300: #dcb914;
  --yellow-400: #b7990f;
  --yellow-500: #9b820b;
  --yellow-600: #836e08;
  --yellow-700: #6a5805;
  --yellow-800: #514303;
  --yellow-900: #322801;
  --yellow-950: #201900;

  /* GREEN */
  --green-50: #f0fbf1;
  --green-100: #dff8e1;
  --green-200: #afe8b6;
  --green-300: #73cf83;
  --green-400: #36b155;
  --green-500: #0d983e;
  --green-600: #098133;
  --green-700: #066827;
  --green-800: #03501d;
  --green-900: #01310e;
  --green-950: #081e0c;

  /* TEAL */
  --teal-50: #ebfcf8;
  --teal-100: #d3f9f1;
  --teal-200: #90eadb;
  --teal-300: #17d2bd;
  --teal-400: #12ae9d;
  --teal-500: #0d9485;
  --teal-600: #097d70;
  --teal-700: #06655a;
  --teal-800: #034d45;
  --teal-900: #012f29;
  --teal-950: #011e1a;

  /* BLUE */
  --blue-50: #f4f9ff;
  --blue-100: #e9f2ff;
  --blue-200: #c4dcfe;
  --blue-300: #92befe;
  --blue-400: #5a9cfd;
  --blue-500: #3081f5;
  --blue-600: #1e6cd7;
  --blue-700: #1657af;
  --blue-800: #154384;
  --blue-900: #0d2850;
  --blue-950: #0c1a2e;

  /* PURPLE */
  --purple-50: #faf7ff;
  --purple-100: #f5eeff;
  --purple-200: #e5d2fe;
  --purple-300: #d1abfe;
  --purple-400: #ba82f5;
  --purple-500: #a665e5;
  --purple-600: #8f52c8;
  --purple-700: #7341a3;
  --purple-800: #57337b;
  --purple-900: #341f4a;
  --purple-950: #1f152b;

  /* PINK */
  --pink-50: #fff6f8;
  --pink-100: #ffedf0;
  --pink-200: #feced7;
  --pink-300: #fea1b6;
  --pink-400: #fd6893;
  --pink-500: #f03b7b;
  --pink-600: #d22667;
  --pink-700: #aa1c52;
  --pink-800: #811b3f;
  --pink-900: #4f1226;
  --pink-950: #2e0f18;

  /* BROWN */
  --brown-50: #fcf7f4;
  --brown-100: #faefe7;
  --brown-200: #edd6c4;
  --brown-300: #d8b599;
  --brown-400: #bd9372;
  --brown-500: #a87b56;
  --brown-600: #906745;
  --brown-700: #745236;
  --brown-800: #583f2a;
  --brown-900: #352619;
  --brown-950: #201811;

  /* GREY */
  --grey-50: #f8f8f8;
  --grey-100: #f1f1f1;
  --grey-200: #dadada;
  --grey-300: #bcbcbc;
  --grey-400: #9b9b9b;
  --grey-500: #848484;
  --grey-600: #6f6f6f;
  --grey-700: #595959;
  --grey-800: #444444;
  --grey-900: #292929;
  --grey-950: #191919;

  /* INK */
  --ink-50: #f9f8f7;
  --ink-100: #f3f1ee;
  --ink-200: #ded9d4;
  --ink-300: #c2bab2;
  --ink-400: #a39a91;
  --ink-500: #8c8278;
  --ink-600: #776e65;
  --ink-700: #5f5850;
  --ink-800: #49433e;
  --ink-900: #2c2825;
  --ink-950: #1b1917;

  /* SLATE */
  --slate-50: #f7f8fa;
  --slate-100: #eff1f4;
  --slate-200: #d6dae1;
  --slate-300: #b5bcc7;
  --slate-400: #949ca9;
  --slate-500: #7c8592;
  --slate-600: #68707c;
  --slate-700: #535a64;
  --slate-800: #3f454c;
  --slate-900: #26292e;
  --slate-950: #181a1c;

  /* PAPER (hand-tuned) */
  --paper-100: #ffffff;
  --paper-200: #fefdfb;
  --paper-300: #fdfcf9;
  --paper-400: #fbf9f6;
  --paper-500: #f8f5f0;
  --paper-600: #e9e4dd;
  --paper-700: #d9d2c9;
  --paper-800: #c7bfb5;
  --paper-900: #b4aca1;

  /* Fixed colours */
  --white: #ffffff;
  --black: #000000;
  --paper: #f8f5f0;
  --terminal: #0c1020;
}


:root {
    --night: var(--terminal);                                    /* cover background */
    --night-raised: color-mix(in srgb, var(--white) 7%, var(--terminal));
    --on-night: var(--slate-200);
    --on-night-soft: var(--slate-400);
    --py: var(--yellow-200);                                     /* "Python" on the cover */
    --py-edge: var(--yellow-400);
    --qt: var(--green-300);                                      /* "Qt6" on dark (9.9:1) */
    --qt-tile: var(--green-400);
    --qt-text: var(--green-600);                                 /* green text on light (4.7:1) */
    --tile-blue: var(--blue-700);
    --tile-blue-deep: var(--blue-800);
    --text: var(--slate-900);
    --text-soft: var(--slate-700);
    --light: var(--slate-50);
    --light-2: var(--slate-100);
    --rule: var(--slate-200);
    --card: var(--white);
    --grey-band: color-mix(in srgb, var(--slate-950) 60%, var(--black));  /* author section: near-black neutral grey, as dark as the navy */
    --shadow: color-mix(in srgb, var(--black) 30%, transparent);
    --shadow-soft: color-mix(in srgb, var(--black) 8%, transparent);

    --font-head: 'Jost', 'Century Gothic', sans-serif;
    --font-body: 'Montserrat', 'Verdana', sans-serif;
    --font-mono: 'Inconsolata', 'Consolas', monospace;
    --radius: 0.75rem;
}


/* ── Base ─────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body.cga {
    margin: 0;
    background: var(--light);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.65;
}

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

a { color: var(--tile-blue); }

h1, h2, h3 { font-family: var(--font-head); line-height: 1.1; margin: 0 0 0.75rem; }
h2 { font-size: clamp(1.9rem, 4vw, 2.75rem); font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; font-weight: 600; }

section { position: relative; padding: clamp(3rem, 8vw, 6rem) 0; }

.wrap { position: relative; z-index: 1; max-width: 72rem; margin-inline: auto; padding-inline: 1.25rem; }

.center { text-align: center; }

.kicker {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--qt-text);
    margin: 0 0 0.5rem;
}

.section-lede { font-size: 1.1rem; color: var(--text-soft); max-width: 44rem; margin: 0 0 2.5rem; }

.smallprint { font-size: 0.85rem; opacity: 0.85; margin: 0.75rem 0 0; }

/* dark sections */
.hero, .proof-band, .pricing { background: var(--night); color: var(--on-night); overflow: hidden; }
.hero .kicker, .proof-band .kicker, .pricing .kicker, .author .kicker { color: var(--qt); }
.hero h2, .proof-band h2, .pricing h2 { color: var(--white); }


/* ── Hexagon tiles (decoration, after the covers) ─────────────────── */

.hexes { position: absolute; inset: 0; pointer-events: none; z-index: 0; }

.hex {
    position: absolute;
    width: 9rem;
    aspect-ratio: 1.15;
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    background: var(--qt-tile);
}

/* hero: blue tiles top right, green + one yellow tile bottom left (below the copy) */
.hexes-hero .h1 { left: -3rem; bottom: -5.5rem; width: 10rem; }
.hexes-hero .h2 { left: 6rem; bottom: -6.5rem; width: 8rem; background: var(--green-600); }
.hexes-hero .h3 { left: -1.5rem; bottom: 2rem; width: 4.5rem; background: var(--green-700); }
.hexes-hero .h4 { right: 6rem; top: -3.5rem; width: 10rem; background: var(--tile-blue-deep); }
.hexes-hero .h5 { right: -2.5rem; top: 2rem; width: 8rem; background: var(--tile-blue); }
.hexes-hero .h6 { left: 14rem; bottom: -1.5rem; width: 3.5rem; background: var(--py); transform: rotate(12deg); }

.hexes-proof .h1 { right: -3rem; top: 1.5rem; width: 9rem; background: var(--tile-blue-deep); }
.hexes-proof .h2 { right: 5rem; top: -3rem; width: 6rem; background: var(--tile-blue); }
.hexes-proof .h3 { left: -3rem; bottom: -2rem; width: 8rem; background: var(--green-700); }
.hexes-proof .h4, .hexes-proof .h5, .hexes-proof .h6 { display: none; }

.hexes-pricing .h1 { left: -3rem; top: -2rem; width: 10rem; background: var(--green-700); }
.hexes-pricing .h2 { left: 5rem; top: -4rem; width: 6rem; background: var(--green-600); }
.hexes-pricing .h3 { right: -3rem; bottom: -3rem; width: 11rem; background: var(--tile-blue-deep); }
.hexes-pricing .h4 { right: 6.5rem; bottom: -4rem; width: 6rem; background: var(--tile-blue); }
.hexes-pricing .h5, .hexes-pricing .h6 { display: none; }


/* ── Buttons & prices ─────────────────────────────────────────────── */

.btn {
    display: inline-block;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1.15rem;
    text-decoration: none;
    text-align: center;
    padding: 0.8rem 1.6rem;
    border-radius: 0.5rem;
    border: 0;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-buy {
    background: var(--py);
    color: var(--night);
    border-bottom: 4px solid var(--py-edge);
    box-shadow: 0 6px 18px var(--shadow);
}

.btn-buy:hover, .btn-buy:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 24px var(--shadow); }

.btn-outline { background: transparent; color: var(--white); border: 2px solid var(--on-night-soft); }
.btn-outline:hover, .btn-outline:focus-visible { border-color: var(--py); color: var(--py); }

.btn-small { font-size: 0.95rem; padding: 0.4rem 1rem; border-bottom-width: 3px; box-shadow: none; }

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

.buy { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; margin-top: 1.75rem; }

.buy-price, .plan-price { font-family: var(--font-head); font-weight: 300; font-size: 2.5rem; line-height: 1; }

.price-strikethrough { position: relative; }
.price-strikethrough::before {
    content: "";
    position: absolute;
    left: -0.1em;
    right: -0.1em;
    top: 50%;
    border-top: 0.08em solid currentColor;
    transform: rotate(-15deg);
}

.discount-container {
    background: var(--py);
    color: var(--night);
    border-radius: 0.5rem;
    padding: 0.6rem 1rem;
    margin: 1rem 0 0;
    max-width: 30rem;
    font-size: 0.95rem;
}
.discount-container-ppp { background: var(--purple-100); }
.discount-container h4 { margin: 0 0 0.25rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.discount, .couponcode { font-weight: 700; text-transform: uppercase; }
.couponcode { font-family: var(--font-mono); background: var(--night); color: var(--py); padding: 0.05em 0.45em; border-radius: 0.25rem; }

/* Senja's rating summary centres itself in its iframe, so give the frame the
   summary's own width to keep it flush left under the hero text. The higher
   specificity beats the 'margin: 0 auto' in base.html. */
.hero .senja-frame-embed { width: 272px; max-width: 100%; margin: 1rem 0 0; }


/* ── Top bar ──────────────────────────────────────────────────────── */

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--night);
    color: var(--white);
    border-bottom: 1px solid var(--night-raised);
}

.topbar-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 3.5rem; }

.topbar-title {
    font-family: var(--font-head);
    font-weight: 600;
    color: var(--white);
    text-decoration: none;
    margin-right: auto;
}

.topbar-lib {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--qt);
    border: 1px solid currentColor;
    border-radius: 0.3rem;
    padding: 0.05rem 0.4rem;
    margin-left: 0.4rem;
}

.topbar-nav { display: flex; gap: 1.25rem; }
.topbar-nav a { color: var(--on-night-soft); text-decoration: none; font-size: 0.9rem; }
.topbar-nav a:hover { color: var(--white); }


/* ── Hero ─────────────────────────────────────────────────────────── */

.hero { padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: clamp(4.5rem, 9vw, 7rem); }

.hero-grid { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 3rem; align-items: center; }

.eyebrow {
    font-family: var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--on-night-soft);
    margin: 0 0 1rem;
}

.hero h1 {
    font-size: clamp(2.6rem, 6.5vw, 4.6rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.02;
    color: var(--white);
    margin-bottom: 1.25rem;
}

.hero h1 .py { color: var(--py); font-weight: 600; }
.hero h1 .qt { color: var(--qt); font-weight: 600; }

.lede { font-size: 1.12rem; max-width: 36rem; color: var(--on-night); }
.lede strong { color: var(--white); }

.hero a:not(.btn) { color: var(--white); }

.proof { margin: 1.5rem 0 0; color: var(--on-night-soft); font-size: 0.95rem; }
.proof strong { color: var(--py); }

.cover-link { display: block; max-width: 20rem; margin-inline: auto; }

.cover {
    width: 100%;
    border-radius: 0.3rem;
    transform: rotate(3deg);
    box-shadow: 18px 24px 40px var(--shadow), 0 0 0 1px var(--night-raised);
    transition: transform 0.3s ease;
}

.cover-link:hover .cover { transform: rotate(0deg) scale(1.02); }


/* ── Editions ─────────────────────────────────────────────────────── */

.editions { padding: 1.25rem 0; background: var(--light-2); border-bottom: 1px solid var(--rule); }

.editions-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem 1.5rem; }

.editions-title { margin: 0; font-weight: 600; }
.editions-title span { font-weight: 400; color: var(--text-soft); }

.editions-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }

.edition {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    padding: 0.4rem 0.9rem;
    border-radius: 0.5rem;
    border: 2px solid var(--rule);
    background: var(--card);
    color: var(--text);
    text-decoration: none;
}

.edition em { font-style: normal; font-size: 0.75rem; color: var(--text-soft); }
a.edition:hover { border-color: var(--qt-tile); }
.edition.current { border-color: var(--night); background: var(--night); color: var(--white); }
.edition.current em { color: var(--qt); }

.editions-bundle { margin-left: auto; font-weight: 600; color: var(--qt-text); text-decoration: none; }


/* ── Demo: code → window ──────────────────────────────────────────── */

.demo-grid { display: grid; grid-template-columns: 1.35fr 0.65fr; gap: 2.5rem; align-items: center; }

.editor {
    margin: 0;
    background: var(--night);
    color: var(--on-night);
    border-radius: var(--radius);
    box-shadow: 0 20px 40px var(--shadow);
    overflow: hidden;
}

.editor-bar, .window-bar { display: flex; align-items: center; gap: 0.4rem; padding: 0.55rem 0.8rem; }
.editor-bar { background: var(--night-raised); }
.editor-bar span { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--red-400); }
.editor-bar span:nth-child(2) { background: var(--py); }
.editor-bar span:nth-child(3) { background: var(--qt-tile); }
.editor-bar em { margin-left: auto; font-family: var(--font-mono); font-style: normal; font-size: 0.8rem; color: var(--on-night-soft); }

.editor pre { margin: 0; padding: 1rem 1.25rem 1.25rem; overflow-x: auto; font-family: var(--font-mono); font-size: 0.92rem; line-height: 1.5; }
.editor .k { color: var(--purple-300); }
.editor .c { color: var(--py); }
.editor .f { color: var(--blue-300); }
.editor .s { color: var(--qt); }

.run { text-align: center; }

.run-cmd { font-family: var(--font-mono); color: var(--text-soft); margin: 0 0 1rem; }
.run-cmd span { color: var(--qt-text); }

.window {
    width: min(100%, 16rem);
    margin: 0 auto;
    background: var(--card);
    border-radius: 0.5rem;
    box-shadow: 0 14px 30px var(--shadow), 0 0 0 1px var(--rule);
    overflow: hidden;
    text-align: left;
}

.window-bar { justify-content: space-between; background: var(--light-2); border-bottom: 1px solid var(--rule); font-size: 0.85rem; }
.window-ctl { color: var(--text-soft); letter-spacing: 0.4rem; font-size: 0.8rem; }

.window-body { padding: 1rem; }

.window-button {
    width: 100%;
    font: inherit;
    padding: 0.5rem;
    background: var(--light);
    color: var(--text);
    border: 1px solid var(--slate-300);
    border-radius: 0.25rem;
    cursor: pointer;
}
.window-button:hover { background: var(--light-2); }
.window-button:active { background: var(--rule); }

.run-out {
    min-height: 1.5rem;
    margin: 1rem auto 0;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--qt-text);
    white-space: pre-line;
    max-height: 6rem;
    overflow: hidden;
}

.run-hint { margin: 0.25rem 0 0; font-size: 0.85rem; color: var(--text-soft); font-style: italic; }


/* ── What you'll learn ────────────────────────────────────────────── */

.learn { background: var(--card); }

.topics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }

.topic {
    display: flex;
    flex-direction: column;
    background: var(--light);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    overflow: hidden;
}

.topic-img {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 12rem;
    padding: 1rem;
    background: var(--card);
    border-bottom: 1px solid var(--rule);
}

.topic-img img { max-height: 100%; width: auto; object-fit: contain; }

.topic-text { padding: 1.1rem 1.25rem 1.3rem; }
.topic-text p { margin: 0; color: var(--text-soft); font-size: 0.95rem; }

/* ── Proof ────────────────────────────────────────────────────────── */

.stats {
    list-style: none;
    margin: 0 0 3rem;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    text-align: center;
}

.stats strong { display: block; font-family: var(--font-head); font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 600; color: var(--py); line-height: 1.1; }
.stats li:nth-child(even) strong { color: var(--qt); }
.stats span { color: var(--on-night-soft); }


/* ── Inside ───────────────────────────────────────────────────────── */

.inside-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }

.checklist { list-style: none; margin: 1.5rem 0 0; padding: 0; }
.checklist li { position: relative; padding: 0.5rem 0 0.5rem 2rem; border-bottom: 1px solid var(--rule); }
.checklist li::before {
    content: "\f00c";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--qt-text);
}

.inside-media { position: relative; }
.inside-media .paperback { border-radius: var(--radius); box-shadow: 0 14px 30px var(--shadow-soft); }
.inside-media .pages {
    position: absolute;
    width: 55%;
    right: -1rem;
    bottom: -2.5rem;
    background: var(--card);
    border-radius: 0.5rem;
    padding: 0.5rem;
    box-shadow: 0 14px 30px var(--shadow);
}

.video { margin-top: clamp(4rem, 8vw, 6rem); }
.video-frame { position: relative; aspect-ratio: 16 / 9; max-width: 56rem; margin: 1.5rem auto 0; border-radius: var(--radius); overflow: hidden; background: var(--night); box-shadow: 0 20px 40px var(--shadow); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }


/* ── Contents ─────────────────────────────────────────────────────── */

.contents { background: var(--card); }

.toc { columns: 2 22rem; column-gap: 2.5rem; }

.toc details { break-inside: avoid; border-top: 1px solid var(--rule); }

.toc summary {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.8rem 0;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "+"; margin-left: 0.25rem; font-family: var(--font-mono); color: var(--qt-text); }
.toc details[open] summary::after { content: "−"; }

.toc-num { font-family: var(--font-mono); color: var(--qt-text); }
.toc-name { flex: 1; }
.toc-pages { font-family: var(--font-mono); font-weight: 400; font-size: 0.85rem; color: var(--text-soft); }

.toc ul { margin: 0 0 1rem 2.4rem; padding: 0; color: var(--text-soft); }
.toc li { padding: 0.15rem 0; }


/* ── Author ───────────────────────────────────────────────────────── */

.author { background: var(--grey-band); color: var(--ink-100); }
.author h2 { color: var(--white); }

.author-grid { display: grid; grid-template-columns: 11rem 1fr; gap: 2.5rem; align-items: center; max-width: 54rem; }

.author-photo { width: 11rem; height: 11rem; object-fit: cover; border-radius: 50%; border: 4px solid var(--py); }

.author p { margin: 0; font-size: 1.05rem; }


/* ── Pricing ──────────────────────────────────────────────────────── */

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 2rem; }

.plan {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--night-raised);
    border: 1px solid color-mix(in srgb, var(--white) 12%, transparent);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
}

.plan p { color: var(--on-night); font-size: 0.95rem; }
.plan h3 { color: var(--white); margin: 1rem 0 0.25rem; }
.plan .btn { margin-top: auto; }

.plan-main { border: 2px solid var(--py); box-shadow: 0 20px 40px var(--shadow); }

.plan-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0;
}
.plan .plan-tag { color: var(--qt); }

.plan-img { height: 8rem; width: auto; margin-top: 1rem; }

.plan .plan-price { margin: 0.25rem 0 0.75rem; color: var(--white); font-size: 2.4rem; }

.pricing .discount-container { margin: 1.5rem auto 0; }

.guarantee { margin: 2rem 0 0; text-align: center; color: var(--on-night); }
.guarantee i { color: var(--py); margin-right: 0.4rem; }


/* ── FAQ ──────────────────────────────────────────────────────────── */

.faq-wrap { max-width: 50rem; }

.faq details { background: var(--card); border: 1px solid var(--rule); border-radius: 0.5rem; margin-bottom: 0.6rem; }
.faq summary { cursor: pointer; padding: 1rem 1.25rem; font-family: var(--font-head); font-weight: 600; font-size: 1.1rem; }
.faq details p { margin: 0; padding: 0 1.25rem 1.1rem; color: var(--text-soft); }


/* ── Footer ───────────────────────────────────────────────────────── */

body.cga footer { background: var(--night); color: var(--on-night-soft); padding: 2rem 0; font-size: 0.9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.footer-inner p { margin: 0; }
.footer-inner ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.5rem; }
body.cga footer a { color: var(--py); text-decoration: none; }


/* ── Motion ───────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .btn, .cover { transition: none; }
}


/* ── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 960px) {
    .topbar-nav { display: none; }
    .hero-grid, .demo-grid, .inside-grid { grid-template-columns: 1fr; }
    .hero-art { order: -1; }
    .cover-link { max-width: 15rem; }
    .topics { grid-template-columns: repeat(2, 1fr); }
    .plans { grid-template-columns: 1fr; max-width: 30rem; margin-inline: auto; }
    .inside-media { margin-bottom: 2.5rem; }
    .editions-bundle { margin-left: 0; }
}

@media (max-width: 640px) {
    .topbar-title { font-size: 0.9rem; }
    .topics { grid-template-columns: 1fr; }
    .topic-basics, .topic-apps { grid-column: auto; flex-direction: column; }
    .topic-basics .topic-img, .topic-apps .topic-img { min-height: 0; height: 12rem; border-right: 0; border-bottom: 1px solid var(--rule); }
    .stats { grid-template-columns: repeat(2, 1fr); row-gap: 1.5rem; }
    .editor pre { font-size: 0.78rem; }
    .author-grid { grid-template-columns: 1fr; text-align: center; justify-items: center; }
    .inside-media .pages { right: 0; }
    .hex { opacity: 0.6; }
}
