/*
 * How to Draw website, v2 (November 2026).
 * Shared tokens, header, footer and buttons for the homepage, the blog listing
 * and the editorial articles. Values come from the app redesign in Figma
 * (file P6rvL2c7Q9lDGOhRQAVb8H): Brand/Primary, Brand/Tint, Surface/Page,
 * Text/Primary, Text/Secondary, Border/Default, radius/sm|lg|full, Quicksand.
 * Sizes are in px on purpose: legacy blog pages set html { font-size: 62.5% }.
 */
@font-face {
    font-family: 'Quicksand';
    font-style: normal;
    font-weight: 500 700;
    font-display: swap;
    src: url('../fonts/quicksand-latin-var.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --brand: #ff1e90;          /* Brand/Primary: decoration, large text */
    --brand-ink: #d81b7a;      /* Brand/Pressed · Text on white: links, buttons (AA) */
    --brand-tint: #ffe8f3;     /* Brand/Tint */
    --brand-ink-strong: #c2156b; /* brand text on Brand/Tint (5.0:1) */
    --page: #f8f9fa;           /* Surface/Page */
    --card: #ffffff;           /* Surface/Card */
    --ink: #2d3436;            /* Text/Primary */
    --muted: #636e72;          /* Text/Secondary */
    --line: #e1e4e8;           /* Border/Default */
    --success: #00b894;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 999px;
    --font-display: 'Quicksand', ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-body: 'Quicksand', ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-reading: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --wrap: 1160px;
    --shadow-card: 0 6px 16px rgba(27, 16, 38, 0.06);
}

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

.v2 {
    margin: 0;
    color: var(--ink);
    background: var(--page);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
.v2 img { max-width: 100%; height: auto; }
.v2 a { color: var(--brand-ink); }
.v2 :focus-visible { outline: 3px solid var(--brand-ink); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(var(--wrap), calc(100% - 40px)); margin: 0 auto; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--ink); color: #fff !important; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons ----------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 22px;
    border: 0; border-radius: var(--radius-full);
    font-family: var(--font-display); font-size: 16px; font-weight: 700; line-height: 1;
    text-decoration: none; white-space: nowrap; cursor: pointer;
    transition: background-color .16s ease, transform .16s ease;
}
.btn:active { transform: scale(.98); }
.v2 .btn--primary { color: #fff; background: var(--brand-ink); }
.v2 .btn--primary:hover { background: #c2156b; }
.v2 .btn--ghost { color: var(--ink); background: var(--card); border: 1px solid var(--line); }
.v2 .btn--ghost:hover { border-color: var(--brand-ink); color: var(--brand-ink); }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: 15px; }

/* Apple logo in front of every custom App Store button (header "Get the app",
   "Start coloring for free", article "Open App Store", the bottom sheet...).
   Drawn with a CSS mask so it takes the button's text colour, adds no markup
   and nothing for screen readers. The official badge already has the logo. */
.v2 a.app-store-track:not(.store-badge)::before {
    content: '';
    display: inline-block;
    flex: 0 0 auto;
    width: 0.95em;
    height: 1.1em;
    margin-right: 0.5em;
    vertical-align: -0.16em;
    background-color: currentColor;
    -webkit-mask: var(--apple-logo) center / contain no-repeat;
    mask: var(--apple-logo) center / contain no-repeat;
}
.v2 .btn.app-store-track::before { margin-right: 0; margin-top: -0.12em; }
:root { --apple-logo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701'/%3E%3C/svg%3E"); }

/* Official App Store badge link: the badge is the visual, no extra chrome. */
.store-badge { display: inline-flex; line-height: 0; border-radius: 10px; background: none; box-shadow: none; }
.store-badge img { display: block; width: 176px; height: auto; }

/* Header ------------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(248, 249, 250, 0.92); border-bottom: 1px solid var(--line); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); }
.site-header__inner { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink) !important; text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 19px; }
.brand img { width: 40px; height: 40px; border-radius: 10px; }
.brand span { white-space: nowrap; }
.site-nav { display: flex; align-items: center; gap: 4px; margin: 0 0 0 auto; padding: 0; list-style: none; }
.site-nav li { flex: 0 0 auto; }
.site-nav a { white-space: nowrap; display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: var(--radius-full); color: var(--ink); font-weight: 600; font-size: 15px; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--brand-ink-strong); background: var(--brand-tint); }
.site-header .btn { flex: 0 0 auto; }

@media (max-width: 760px) {
    /* Compact two-row header (≈92px): brand + CTA, then a sideways-scrolling nav. */
    .site-header__inner { flex-wrap: wrap; gap: 0 12px; min-height: 0; padding-top: 8px; }
    .site-header .btn { margin-left: auto; }
    .site-header nav { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
    .site-header nav::-webkit-scrollbar { display: none; }
    .site-nav { margin: 4px 0 4px -12px; }
    .site-nav a { min-height: 36px; font-size: 14px; }
    .brand { font-size: 17px; }
    .brand img { width: 34px; height: 34px; border-radius: 9px; }
}
@media (min-width: 761px) and (max-width: 900px) {
    .site-header__inner { gap: 12px; }
    .site-nav a { padding: 0 9px; font-size: 14px; }
}
@media (max-width: 374px) {
    .site-header__inner { gap: 0 8px; }
    .brand { gap: 8px; font-size: 16px; }
    .site-header .btn--sm { padding: 0 13px; font-size: 14px; }
}

/* Breadcrumbs -------------------------------------------------------------- */
.breadcrumbs { margin: 0 0 14px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted); font-weight: 600; }
.breadcrumbs li + li::before { content: '/'; margin-right: 6px; color: #b2bec3; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand-ink); text-decoration: underline; }
.breadcrumbs [aria-current] { color: var(--ink); }

/* Footer ------------------------------------------------------------------- */
.site-footer { margin-top: 0; padding: 56px 0 120px; background: var(--card); border-top: 1px solid var(--line); font-size: 15px; }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.site-footer p { margin: 12px 0 0; color: var(--muted); max-width: 34ch; }
.site-footer h2 { margin: 4px 0 12px; font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--ink); }
.site-footer ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.site-footer ul a { color: var(--muted); text-decoration: none; }
.site-footer ul a:hover { color: var(--brand-ink); text-decoration: underline; }
.site-footer .store-badge { margin-top: 18px; }
.site-footer__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
@media (max-width: 860px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } .site-footer__brand { grid-column: 1 / -1; } }
@media (max-width: 420px) { .site-footer__grid { grid-template-columns: 1fr; } }

/* Shared section heading pattern (eyebrow + title + lead), as in the App Store set. */
.eyebrow { display: inline-block; margin: 0 0 10px; color: var(--brand-ink); font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hl { color: var(--brand); }
.section-title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.15; letter-spacing: -0.01em; color: var(--ink); }
.section-lead { margin: 14px 0 0; max-width: 62ch; color: var(--muted); font-size: 18px; }

/* Post cards (homepage "latest articles", blog listing, related articles) --- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.post-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); transition: border-color .16s ease, transform .16s ease; }
.post-card:hover { border-color: #f7a8cf; transform: translateY(-2px); }
.post-card__media { display: block; aspect-ratio: 16 / 9; background: var(--brand-tint); }
.post-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-card__body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 18px 20px 20px; }
.post-card__cat { align-self: flex-start; padding: 4px 10px; border-radius: var(--radius-full); background: var(--brand-tint); color: var(--brand-ink-strong); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.post-card__title { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 700; line-height: 1.3; }
.post-card__title a { color: var(--ink); text-decoration: none; }
.post-card__title a::after { content: ''; position: absolute; inset: 0; }
.post-card { position: relative; }
.post-card__title a:hover { color: var(--brand-ink); }
.post-card__excerpt { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.post-card__meta { margin-top: auto; padding-top: 6px; color: var(--muted); font-size: 13px; font-weight: 600; }

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