/* ============ Time Buddy showcase ============
   Loaded after styles.css. Colours are taken from the app itself
   (lib/home_screen.dart and the launcher icon). */
:root {
  --tb: #6B4DB5;          /* icon background */
  --tb-deep: #5B3F8C;     /* app title / dialog ink */
  --tb-soft: #8A7AA8;     /* app secondary ink */
  --tb-lilac: #E9DEFF;    /* parent-gate badge */
  --tb-sun: #FFC53D;      /* Happy Sun */
  --tb-sun-hi: #FFEE77;
  --tb-cream: #FFF8EE;    /* app background */
  --tb-ink: var(--tb-deep);
  --tb-panel: var(--tb-cream);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --tb-ink: #C9B8F2; --tb-panel: #1E1A26; --tb-lilac: #2D2540; }
}
:root[data-theme="dark"] { --tb-ink: #C9B8F2; --tb-panel: #1E1A26; --tb-lilac: #2D2540; }

.tb-page { background: var(--bg); }
.tb-page .eyebrow b { color: var(--tb-ink); font-weight: 600; }
.tb-page :focus-visible { outline-color: var(--tb-sun); }

.crumbs { font-size: 14px; color: var(--ink-3); margin-bottom: 26px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs a { color: var(--ink-2); text-decoration: none; font-weight: 500; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

.btn--tb { background: var(--tb); color: #fff; }
.btn--sun { background: var(--tb-sun); color: #3A2500; }

/* ============ Hero ============ */
.tb-hero {
  position: relative; overflow: hidden;
  padding: 40px 0 72px;
  background:
    radial-gradient(60% 70% at 85% 30%, color-mix(in srgb, var(--tb) 26%, transparent), transparent 70%),
    radial-gradient(40% 50% at 70% 95%, color-mix(in srgb, var(--tb-sun) 30%, transparent), transparent 70%),
    var(--bg);
}
@media (min-width: 960px) { .tb-hero { padding: 64px 0 112px; } }
.tb-hero__grid { display: grid; gap: 56px; align-items: center; }
@media (min-width: 960px) { .tb-hero__grid { grid-template-columns: 1.1fr .9fr; gap: 56px; } }
.tb-id { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.tb-id img { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 10px 24px -10px rgba(91,63,140,.6); }
.tb-id .eyebrow { margin: 0; }
.tb-id__name { font: 800 22px/1.1 var(--font-display); color: var(--tb-ink); letter-spacing: -0.01em; }
.tb-hero h1 { font-size: clamp(40px, 6.4vw, 78px); font-weight: 800; }
.tb-hero h1 em { font-style: normal; color: var(--tb); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tb-hero h1 em { color: var(--tb-sun); } }
:root[data-theme="dark"] .tb-hero h1 em { color: var(--tb-sun); }
.tb-hero .facts dd { color: var(--ink); }

/* phone mock-up with the live Happy Sun scene */
.tb-stage { position: relative; display: grid; place-items: center; }
.tb-phone {
  position: relative; width: min(300px, 78vw); aspect-ratio: 9 / 16.5;
  border-radius: 44px; padding: 10px;
  background: #1D1530;
  box-shadow: 0 0 0 2px #3A2D57 inset, 0 40px 80px -30px rgba(52,30,95,.65), 0 18px 30px -18px rgba(0,0,0,.4);
  transform: rotate(2.5deg);
}
.tb-phone__screen { position: relative; width: 100%; height: 100%; border-radius: 34px; overflow: hidden; background: #69C8FF; }
.tb-phone canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tb-phone__ui { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding: 28px 0 22px; pointer-events: none; }
.tb-badge {
  font: 900 clamp(40px, 12vw, 54px)/1 var(--font-display); letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: #5A3A00; background: rgba(255,255,255,.28);
  padding: 6px 22px 8px; border-radius: 40px;
  transition: font-size .3s ease;
}
.tb-badge.is-done { font-size: clamp(30px, 9vw, 38px); padding: 10px 24px; }
.tb-paused { margin-top: 8px; font: 800 18px/1 var(--font-body); color: #5A3A00; opacity: 0; transition: opacity .2s; }
.tb-paused.is-on { opacity: 1; }
.tb-controls { margin-top: auto; display: flex; align-items: center; gap: 22px; pointer-events: auto; }
.tb-round {
  display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
  box-shadow: 0 6px 14px -4px rgba(0,0,0,.35);
  transition: transform .15s ease;
}
.tb-round:active { transform: scale(.94); }
.tb-round--stop { width: 52px; height: 52px; background: rgba(255,255,255,.85); }
.tb-round--stop i { width: 18px; height: 18px; border-radius: 4px; background: rgba(0,0,0,.54); }
.tb-round--main { width: 72px; height: 72px; background: var(--tb-sun); }
.tb-round--main svg { width: 40px; height: 40px; fill: #fff; }
.tb-round--back { display: none; border-radius: 999px; width: auto; height: auto; padding: 14px 26px; background: var(--tb-sun); color: #fff; font: 800 18px/1 var(--font-body); }
.tb-phone.is-done .tb-round--stop, .tb-phone.is-done .tb-round--main { display: none; }
.tb-phone.is-done .tb-round--back { display: grid; }
.tb-toast {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  background: #323232; color: #fff; font-size: 13px; padding: 12px 14px; border-radius: 8px;
  opacity: 0; translate: 0 10px; transition: opacity .2s, translate .2s; pointer-events: none;
}
.tb-toast.is-on { opacity: 1; translate: 0 0; }
.tb-stage__chip { position: absolute; z-index: 2; }
.tb-stage__chip--a { top: 8%; left: max(0px, calc(50% - 230px)); transform: rotate(-4deg); }
.tb-stage__chip--b { top: 44%; right: max(0px, calc(50% - 250px)); transform: rotate(3deg); }
@media (max-width: 480px) { .tb-stage__chip { display: none; } }
.tb-stage__caption { margin-top: 26px; font-size: 13px; color: var(--ink-3); text-align: center; }

/* ============ Sections ============ */
.tb-section { padding: 80px 0; }
@media (min-width: 960px) { .tb-section { padding: 120px 0; } }
.tb-section--alt { background: var(--bg-2); }

/* --- Watch time pass (scrubber) --- */
.tb-scrub { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .tb-scrub { grid-template-columns: .8fr 1.2fr; gap: 64px; } }
.tb-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.tb-pick button {
  font: 700 15px/1 var(--font-body); padding: 11px 16px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2);
  transition: background .15s, color .15s, border-color .15s;
}
.tb-pick button:hover { border-color: var(--ink-3); color: var(--ink); }
.tb-pick button[aria-pressed="true"] { background: var(--tb); border-color: var(--tb); color: #fff; }
.tb-frames { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(10px, 2vw, 20px); }
.tb-frame { margin: 0; }
.tb-frame__img {
  position: relative; aspect-ratio: 9 / 16; border-radius: clamp(16px, 2.4vw, 26px); overflow: hidden;
  background: var(--bg-2); box-shadow: var(--shadow);
}
.tb-frame__img img { width: 100%; height: 100%; object-fit: cover; transition: opacity .25s ease; }
.tb-frame__img.is-loading img { opacity: .35; }
.tb-frame figcaption { margin-top: 14px; font-size: 14px; color: var(--ink-2); }
.tb-frame figcaption b { display: block; font: 700 clamp(15px, 1.8vw, 19px)/1.2 var(--font-display); color: var(--ink); letter-spacing: -0.01em; }
.tb-frame:nth-child(2) .tb-frame__img { translate: 0 -14px; }
.tb-scrub__note { margin-top: 22px; font-size: 15px; color: var(--ink-3); }

/* --- Theme gallery --- */
.tb-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 640px) { .tb-gallery { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
@media (min-width: 900px) { .tb-gallery { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1120px) { .tb-gallery { grid-template-columns: repeat(5, 1fr); } }
.tb-card {
  position: relative; display: block; width: 100%; padding: 0; border: 0; cursor: pointer; text-align: left;
  aspect-ratio: 9 / 14; border-radius: 22px; overflow: hidden; background: var(--bg-2);
  box-shadow: var(--shadow); color: #fff; font: inherit;
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.tb-card:hover { transform: translateY(-4px); }
.tb-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; transition: opacity .35s ease; }
.tb-card img.tb-card__end { opacity: 0; }
.tb-card:hover img.tb-card__end, .tb-card:focus-visible img.tb-card__end { opacity: 1; }
.tb-card__text {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 34px 14px 14px; text-align: center;
  background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,.67));
}
.tb-card__name { display: block; font: 800 clamp(16px, 1.7vw, 19px)/1.15 var(--font-body); }
.tb-card__tag { display: block; margin-top: 3px; font-size: 13px; line-height: 1.3; color: rgba(255,255,255,.75); }
.tb-card__sound {
  position: absolute; top: 10px; left: 10px; right: 10px; width: max-content; max-width: calc(100% - 20px);
  font-size: 11.5px; font-weight: 600; line-height: 1.25; color: #fff;
  background: rgba(20,14,34,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 5px 9px; border-radius: 999px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; translate: 0 -4px; transition: opacity .25s, translate .25s;
}
.tb-card:hover .tb-card__sound, .tb-card:focus-visible .tb-card__sound { opacity: 1; translate: 0 0; }
@media (hover: none) { .tb-card__sound { opacity: 1; translate: 0 0; } }
.tb-gallery__hint { margin-top: 22px; font-size: 14px; color: var(--ink-3); }

/* --- Features --- */
.tb-features { display: grid; gap: 18px; }
@media (min-width: 720px) { .tb-features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .tb-features { grid-template-columns: repeat(3, 1fr); gap: 22px; } }
.tb-feature { background: var(--surface); border-radius: var(--radius); padding: 28px 26px 30px; box-shadow: var(--shadow); }
.tb-feature__icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  background: var(--tb-lilac); color: var(--tb-ink); margin-bottom: 20px;
}
.tb-feature__icon svg { width: 28px; height: 28px; }
.tb-feature h3 { font-size: 22px; }
.tb-feature p { margin-top: 10px; color: var(--ink-2); font-size: 16px; }
.tb-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tb-presets li { font-size: 12.5px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); }

/* --- Moments --- */
.tb-moments { display: grid; gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
@media (min-width: 720px) { .tb-moments { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .tb-moments { grid-template-columns: repeat(3, 1fr); } }
.tb-moment { background: var(--surface); padding: 24px 24px 26px; display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: start; }
.tb-moment img { width: 56px; height: 76px; border-radius: 12px; object-fit: cover; box-shadow: 0 6px 14px -8px rgba(0,0,0,.4); }
.tb-moment h3 { font-size: 19px; }
.tb-moment p { margin-top: 6px; font-size: 15px; color: var(--ink-2); }
.tb-moment__time { display: inline-block; margin-top: 10px; font: 800 13px/1 var(--font-body); color: var(--tb-ink); background: var(--tb-lilac); padding: 5px 9px; border-radius: 999px; }

/* --- Grown-ups (dark band) --- */
.tb-grownups { background: var(--tb-deep); color: #F4EEFF; padding: 88px 0 96px; }
@media (min-width: 960px) { .tb-grownups { padding: 120px 0 128px; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tb-grownups { background: #241B36; } }
:root[data-theme="dark"] .tb-grownups { background: #241B36; }
.tb-grownups .section-head .eyebrow { color: rgba(244,238,255,.6); }
.tb-grownups .section-head p:not(.eyebrow) { color: rgba(244,238,255,.78); }
.tb-grownups .principles { background: rgba(244,238,255,.16); }
.tb-grownups .principles li { background: var(--tb-deep); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tb-grownups .principles li { background: #241B36; } }
:root[data-theme="dark"] .tb-grownups .principles li { background: #241B36; }
.tb-grownups .principles__n { color: var(--tb-sun); }
.tb-grownups .principles p { color: rgba(244,238,255,.74); }
.tb-gate {
  margin-top: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px;
  padding: 24px 26px; border-radius: var(--radius); background: rgba(255,255,255,.07);
}
.tb-gate__q { font: 900 30px/1 var(--font-display); background: var(--tb-cream); color: var(--tb-deep); padding: 12px 22px; border-radius: 18px; }
.tb-gate p { flex: 1 1 260px; color: rgba(244,238,255,.8); font-size: 16px; }
.tb-gate p b { color: #fff; }

/* --- CTA --- */
.tb-cta { padding: 88px 0; }
@media (min-width: 960px) { .tb-cta { padding: 120px 0; } }
.tb-cta__card {
  position: relative; overflow: hidden; border-radius: 32px;
  background: linear-gradient(135deg, #8E6AD8 0%, var(--tb) 45%, var(--tb-deep) 100%);
  color: #fff; padding: 44px 26px; display: grid; gap: 32px; align-items: center;
}
@media (min-width: 860px) { .tb-cta__card { grid-template-columns: 1.3fr auto; padding: 64px 60px; } }
.tb-cta__card h2 { font-size: clamp(32px, 4.4vw, 52px); max-width: 14em; }
.tb-cta__card p { margin-top: 16px; font-size: 18px; color: rgba(255,255,255,.82); max-width: 32em; }
.tb-cta__actions { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; position: relative; z-index: 1; }
.tb-cta__actions .link { color: #fff; text-decoration-color: var(--tb-sun); }
.tb-cta__sun { position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, var(--tb-sun-hi), var(--tb-sun)); opacity: .22; }
.tb-stores { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 22px; }
.tb-stores li { font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); color: rgba(255,255,255,.9); }

@media (prefers-reduced-motion: reduce) { .tb-card:hover { transform: none; } }

/* ============ Legal pages (privacy.html, terms.html) ============ */
.footer__legal { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.footer__legal a { color: var(--ink-3); text-decoration: none; }
.footer__legal a:hover, .footer__legal a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

.legal-hero { padding: 40px 0 44px; border-bottom: 1px solid var(--line);
  background: radial-gradient(50% 120% at 90% 0%, color-mix(in srgb, var(--tb) 18%, transparent), transparent 70%), var(--bg); }
@media (min-width: 960px) { .legal-hero { padding: 56px 0 60px; } }
.legal-hero h1 { font-size: clamp(36px, 5.6vw, 64px); font-weight: 800; }
.legal-hero__meta { margin-top: 16px; color: var(--ink-3); font-size: 15px; }
.legal-hero__meta a { color: var(--ink-2); }

.legal { display: grid; gap: 40px; padding-top: 48px; padding-bottom: 96px; }
@media (min-width: 960px) { .legal { grid-template-columns: 240px minmax(0, 1fr); gap: 72px; padding-top: 64px; padding-bottom: 120px; } }
.legal__toc { font-size: 14px; }
@media (min-width: 960px) { .legal__toc { position: sticky; top: 96px; align-self: start; } }
.legal__toc p { font-weight: 700; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.legal__toc ol { display: grid; gap: 2px; counter-reset: toc; }
.legal__toc a { display: block; padding: 6px 10px; margin-left: -10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; }
.legal__toc a:hover { background: var(--bg-2); color: var(--ink); }
@media (max-width: 959px) {
  .legal__toc { background: var(--surface); border-radius: var(--radius-sm); padding: 18px 20px; box-shadow: var(--shadow); }
  .legal__toc ol { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

.legal__body { max-width: 720px; }
.legal__body section { scroll-margin-top: 96px; }
.legal__body section + section { margin-top: 44px; }
.legal__body h2 { font-size: clamp(24px, 2.6vw, 30px); margin-bottom: 14px; }
.legal__body h3 { font-size: 18px; margin: 22px 0 8px; font-family: var(--font-body); font-weight: 700; letter-spacing: 0; }
.legal__body p, .legal__body li { color: var(--ink-2); font-size: 16.5px; }
.legal__body p + p { margin-top: 12px; }
.legal__body ul { margin-top: 12px; display: grid; gap: 8px; }
.legal__body ul li { position: relative; padding-left: 22px; }
.legal__body ul li::before { content: ""; position: absolute; left: 4px; top: .7em; width: 7px; height: 7px; border-radius: 50%; background: var(--tb); }
.legal__body strong { color: var(--ink); }
.legal__body a { color: var(--tb-ink); text-underline-offset: 3px; }
.legal__caps { text-transform: uppercase; font-size: 14.5px !important; letter-spacing: .01em; }

.legal-glance { background: var(--tb-lilac); border-radius: var(--radius); padding: 26px 26px 28px; margin-bottom: 48px; }
.legal-glance h2 { font-size: 22px; margin-bottom: 16px; color: var(--tb-ink); }
.legal-glance ul { margin: 0; display: grid; gap: 12px; }
@media (min-width: 640px) { .legal-glance ul { grid-template-columns: 1fr 1fr; gap: 14px 24px; } }
.legal-glance li { padding-left: 30px !important; color: var(--ink) !important; font-size: 15.5px !important; }
.legal-glance li::before {
  width: 18px !important; height: 18px !important; left: 0 !important; top: .2em !important;
  background: var(--tb) !important;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
  border-radius: 0 !important;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .legal-glance li::before { background: var(--tb-sun) !important; } }
:root[data-theme="dark"] .legal-glance li::before { background: var(--tb-sun) !important; }

.legal-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 15px; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.legal-table th { font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.legal-table td { color: var(--ink-2); }
.legal-table td:first-child { color: var(--ink); font-weight: 600; }
@media (max-width: 560px) {
  .legal-table thead { display: none; }
  .legal-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .legal-table td { display: block; border: 0; padding: 3px 0; }
}
.legal-contact { margin-top: 18px; display: inline-flex; }
.tb-legal-links { margin-top: 26px; font-size: 15px; color: rgba(244,238,255,.75); }
.tb-legal-links a { color: #fff; text-underline-offset: 4px; text-decoration-color: var(--tb-sun); text-decoration-thickness: 2px; font-weight: 600; }
