:root {
      --ink: #382b58;
      --muted: #6d6285;
      --pink: #ff6ba8;
      --purple: #8f6be8;
      --teal: #37bdb6;
      --gold: #ffbd59;
      --paper: #fffdfd;
      --line: rgba(90,60,130,.12);
      --shadow: 0 16px 45px rgba(88,49,132,.11);
      --bg: #f9f3ff;
    }
    * { box-sizing: border-box; }
    html { scroll-behavior: smooth; }
    body {
      margin: 0;
      font-family: ui-rounded, "Trebuchet MS", "Segoe UI", Arial, sans-serif;
      color: var(--ink);
      background:
        radial-gradient(circle at 4% 7%, #ffe1ed 0, transparent 27%),
        radial-gradient(circle at 93% 9%, #d9f8f0 0, transparent 28%),
        radial-gradient(circle at 60% 72%, #fff2d4 0, transparent 32%),
        var(--bg);
      min-height: 100vh;
      transition: background-color .35s, color .35s;
    }
    body.night {
      --ink: #f9f1ff;
      --muted: #d6c7ea;
      --paper: #30254b;
      --line: rgba(255,255,255,.13);
      --shadow: 0 16px 45px rgba(13,8,30,.26);
      --bg: #211936;
      background: radial-gradient(circle at 5% 5%, #492a66 0, transparent 30%),
                  radial-gradient(circle at 92% 65%, #244d57 0, transparent 32%), var(--bg);
    }
    button, a { -webkit-tap-highlight-color: transparent; }
    button { font: inherit; }
    button:focus-visible, a:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; }
    .wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
    header { padding: 24px 0; }
    .topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
    .logo { text-decoration: none; color: var(--ink); font-weight: 900; font-size: 1.27rem; letter-spacing: -.5px; }
    .logo span { color: var(--pink); }
    .header-actions { display: flex; flex: 1; justify-content: flex-end; gap: 24px; align-items: center; }
    .site-nav, .header-tools { display: flex; align-items: center; gap: 16px; }
    .navlink { text-decoration: none; color: var(--muted); font-weight: 700; font-size: .95rem; }
    .account-link {
      display: inline-flex; align-items: center; justify-content: center; min-height: 42px;
      padding: 10px 16px; border: 1px solid var(--pink); border-radius: 999px;
      background: var(--paper); color: var(--ink); text-decoration: none; font-weight: 800;
      box-shadow: var(--shadow); white-space: nowrap;
    }
    .pill, .small-button {
      border: 0; background: var(--paper); color: var(--ink); border-radius: 999px;
      padding: 11px 17px; cursor: pointer; box-shadow: var(--shadow); font-weight: 800;
      transition: transform .2s;
    }
    .pill:hover, .small-button:hover, .primary:hover { transform: translateY(-3px); }
    .hero { min-height: 520px; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 28px; padding: 55px 0 75px; }
    .eyebrow { display: inline-flex; gap: 9px; align-items: center; background: #fff1b9; color: #7b4c14; border-radius: 100px; padding: 9px 17px; font-size: .85rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
    h1 { font-size: clamp(3.7rem, 8vw, 6.5rem); line-height: .98; letter-spacing: -4px; margin: 28px 0 22px; }
    .gradient { background: linear-gradient(115deg,var(--pink),var(--purple) 52%,var(--teal)); background-clip: text; -webkit-background-clip: text; color: transparent; }
    .intro { color: var(--muted); font-size: 1.22rem; line-height: 1.7; max-width: 480px; margin: 0 0 30px; }
    .primary { border: none; border-radius: 18px; padding: 17px 25px; font-weight: 900; background: linear-gradient(110deg,var(--pink),var(--purple)); color: white; box-shadow: 0 10px 24px #ca81cd55; cursor: pointer; transition: transform .2s; }
    .hero-art { position: relative; width: min(100%, 445px); aspect-ratio: 1; margin: 0 auto; display: grid; place-items: center; }
    .hero-circle { width: 77%; aspect-ratio: 1; border-radius: 46% 54% 46% 54%; background: linear-gradient(145deg,#ffe3aa,#ffb9cf 46%,#b5b4ff); box-shadow: 18px 24px 0 rgba(196,156,255,.18); display: grid; place-items: center; animation: bob 5s ease-in-out infinite; }
    .hero-circle span { font-size: clamp(7rem,19vw,12rem); filter: drop-shadow(0 15px 7px #8c4d8222); }
    .sticker { position: absolute; background: var(--paper); border: 3px solid #fff; box-shadow: var(--shadow); border-radius: 22px; padding: 13px 18px; font-size: clamp(1.6rem,3vw,2.3rem); animation: bob 4s ease-in-out infinite; }
    .sticker.one { top: 8%; left: 4%; transform: rotate(-12deg); }
    .sticker.two { right: 2%; top: 17%; animation-delay: -1s; }
    .sticker.three { bottom: 11%; left: 4%; animation-delay: -2s; }
    .sticker.four { bottom: 6%; right: 7%; animation-delay: -1.5s; }
    @keyframes bob { 0%,100% { translate: 0 0; } 50% { translate: 0 -13px; } }
    .section-title { font-size: clamp(1.9rem,4vw,2.7rem); letter-spacing: -1.3px; margin: 0 0 8px; }
    .section-subtitle { color: var(--muted); margin: 0 0 28px; line-height: 1.6; }
    .cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
    .card { background: var(--paper); padding: 30px; border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); }
    .card-icon { width: 67px; height: 67px; display: grid; place-items: center; border-radius: 19px; font-size: 2rem; margin-bottom: 20px; }
    .card:nth-child(1) .card-icon { background: #ffe2ed; }
    .card:nth-child(2) .card-icon { background: #e2f9f4; }
    .card:nth-child(3) .card-icon { background: #eee4ff; }
    .card h3 { margin: 0 0 10px; font-size: 1.3rem; }
    .card p { margin: 0; color: var(--muted); line-height: 1.65; }
    .feature-link-card { text-align: center; max-width: 650px; margin: auto; }
    .feature-link-icon { font-size: 5rem; margin-bottom: 14px; }
    .card .feature-link-description { margin: 0 0 20px; color: var(--muted); }
    .feature-link-button { display: inline-block; text-decoration: none; }
    section { padding: 30px 0 65px; }
    .playground { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
    .activity { padding: 32px; border-radius: 29px; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); min-height: 280px; }
    .activity h3 { font-size: 1.45rem; margin: 0 0 12px; }
    .activity p { color: var(--muted); line-height: 1.6; }
    .message { min-height: 69px; font-weight: 800; font-size: 1.15rem; color: var(--ink) !important; }
    .colour-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 25px; }
    .swatch { width: 46px; height: 46px; border: 4px solid var(--paper); outline: 2px solid var(--line); border-radius: 50%; cursor: pointer; transition: transform .2s; }
    .swatch-pink { background: #ffb4d4; }
    .swatch-purple { background: #cdb5ff; }
    .swatch-mint { background: #a5e9e0; }
    .swatch-yellow { background: #ffe39a; }
    .swatch-blue { background: #b5d7ff; }
    .swatch:hover { transform: scale(1.13); }
    .swatch[aria-pressed="true"] { outline: 3px solid var(--ink); }
    .preview { margin-top: 23px; padding: 16px; background: var(--chosen, #ffb4d4); border-radius: 16px; text-align: center; color: #36213d; font-weight: 900; transition: background .25s; }
    .closing { text-align: center; padding: 40px 24px 65px; }
    .closing .star { font-size: 2.4rem; }
    .closing p { color: var(--muted); line-height: 1.6; }
    footer { border-top: 1px solid var(--line); padding: 25px 0 35px; color: var(--muted); font-size: .9rem; text-align: center; }
    #confetti { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 10; }
    .confetti { position: absolute; top: -30px; width: 12px; height: 18px; opacity: 0; animation: fall var(--duration) linear forwards; left: var(--left); background: var(--colour); border-radius: 3px; transform: rotate(var(--rotation)); }
    @keyframes fall { 5% { opacity: 1; } 100% { opacity: 0; top: 110vh; transform: translateX(var(--drift)) rotate(700deg); } }

    /* VIRTUAL PET — preview components on the home page */
    @media (max-width: 760px) {
      .hero { grid-template-columns: 1fr; text-align: center; padding: 38px 0 30px; min-height: auto; }
      .hero-art { max-width: 360px; grid-row: 1; }
      h1 { letter-spacing: -2.5px; margin-top: 18px; }
      .intro { margin-left: auto; margin-right: auto; }
      .cards { grid-template-columns: 1fr; }
      .playground { grid-template-columns: 1fr; }
      .topbar { flex-wrap: wrap; }
      .header-actions { flex: 1 1 100%; flex-wrap: wrap; justify-content: center; gap: 14px; min-width: 0; }
      .site-nav { flex: 1 1 100%; flex-wrap: wrap; justify-content: center; gap: 10px 20px; min-width: 0; }
      .header-tools { flex: 1 1 100%; flex-wrap: wrap; justify-content: space-between; gap: 10px; min-width: 0; }
      .account-link { margin-left: auto; }
      .section-title, .section-subtitle { text-align: center; }
    }
    @media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
