/* jp3.dev - plain CSS. Colours come from palette.css (the jp3 palette, default "grey" theme);
   never hard-code a palette hex here - add a token to the palette instead. */

@font-face { font-family: "Roboto"; font-weight: 400; font-style: normal; font-display: swap;
             src: url("../fonts/Roboto-regular.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 500; font-style: normal; font-display: swap;
             src: url("../fonts/Roboto-medium.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 700; font-style: normal; font-display: swap;
             src: url("../fonts/Roboto-bold.woff2") format("woff2"); }

:root {
  --ink: var(--jp3-bot-bubble-text);   /* text on the page: dark on light themes, light on dark ones */
  --ink-soft: color-mix(in srgb, var(--ink) 78%, var(--page));
  --page: var(--jp3-chat-background);
  --panel: var(--jp3-bot-bubble);
  --accent: var(--jp3-user-bubble);
  --accent-text: var(--jp3-user-bubble-text);
  --rule: var(--jp3-border);
  --radius: 10px;
  --max: 68rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 1.0625rem/1.65 var(--jp3-font-ui); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--jp3-link); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }
.narrow { max-width: 42rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-text); padding: .6rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

/* header */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--page) 92%, transparent);
               backdrop-filter: blur(6px); border-bottom: 1px solid var(--rule); }
.bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; column-gap: 1.5rem; min-height: 3.75rem; }
.bar-right { display: flex; align-items: center; gap: .25rem 1.25rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none;
         font-weight: 700; font-size: 1.35rem; letter-spacing: .01em; }
.brand-icon { flex: none; }
.gear-fill { fill: var(--jp3-user-bubble); transition: fill .3s; }   /* the theme's accent: reads on every theme */
nav { display: flex; gap: 1.5rem; }
nav a { color: var(--ink); text-decoration: none; font-weight: 500; padding: .25rem 0; border-bottom: 2px solid transparent; }
nav a:hover { border-bottom-color: var(--accent); }

/* hero */
.hero { background: linear-gradient(180deg, var(--jp3-input-background), color-mix(in srgb, var(--jp3-border) 55%, var(--jp3-input-background)));
        border-bottom: 1px solid var(--rule); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 26rem) minmax(0, 1fr); align-items: center; gap: clamp(1.5rem, 5vw, 4rem);
             padding-block: clamp(2.5rem, 7vw, 5rem); }
.hero-logo { justify-self: center; width: 100%; text-align: center; }
.hero-logo img { width: 100%; max-width: 26rem; margin-inline: auto; }
h1 { margin: 0; font-size: clamp(3.5rem, 11vw, 6rem); line-height: 1; font-weight: 700; letter-spacing: -.02em; }
.lead { font-size: clamp(1.35rem, 3vw, 1.75rem); font-weight: 500; line-height: 1.3; margin: .75rem 0 1rem; }
.hero-text p { max-width: 34rem; color: var(--ink-soft); }
.hero-text .lead { color: var(--ink); }



/* sections */
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section-alt { background: var(--jp3-table-stripe); border-block: 1px solid var(--rule); }
h2 { margin: 0 0 1.25rem; font-size: clamp(1.6rem, 4vw, 2.1rem); line-height: 1.2; }
h3 { margin: 0; font-size: 1.5rem; line-height: 1.2; }
p { margin: 0 0 1rem; }

.card { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); max-width: 46rem; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.badge { font-size: .8rem; font-weight: 500; letter-spacing: .03em; text-transform: uppercase; background: var(--accent);
         color: var(--accent-text); padding: .2rem .65rem; border-radius: 999px; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 1rem 0; }
.tags li { border: 1px solid var(--jp3-border); background: var(--page); padding: .15rem .7rem; border-radius: 999px; font-size: .9rem; }
.note { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.email { font-size: 1.25rem; font-weight: 500; }

/* footer */
.site-footer { background: var(--accent); color: var(--accent-text); padding-block: 1.75rem; }
.site-footer p { margin: 0; }

@media (max-width: 52rem) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-text p { margin-inline: auto; }
  .hero-logo img { max-width: 18rem; }
}
@media (max-width: 30rem) {
  html { scroll-padding-top: 7rem; }
  .bar { padding-block: .4rem; }
  .bar-right { width: 100%; justify-content: space-between; }
  nav { gap: 1rem; font-size: .95rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

.notfound { font-size: clamp(4rem, 14vw, 8rem); }
.home-link { font-weight: 500; }

/* colour picker: one icon in the header; clicking it opens the nine choices */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.picker { position: relative; }
.picker-btn { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; padding: 0; border-radius: 50%; cursor: pointer;
              background: transparent; color: var(--ink); border: 1px solid transparent; transition: background-color .15s, border-color .15s; }
.picker-btn:hover, .picker-btn[aria-expanded="true"] { background: var(--panel); border-color: var(--rule); }
.panel { position: absolute; right: 0; top: calc(100% + .5rem); z-index: 20; width: 17.5rem; padding: 1rem;
         background: var(--page); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: 0 8px 28px rgb(0 0 0 / .22); }
.panel[hidden] { display: none; }
.panel fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.panel legend { padding: 0; margin-bottom: .75rem; font-weight: 500; }
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.swatch { position: relative; display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .5rem .25rem;
          border-radius: 8px; cursor: pointer; text-align: center; font-size: .8rem; line-height: 1.2; }
.swatch:hover { background: var(--panel); }
.swatch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
/* each label carries its own data-jp3-theme, so --jp3-* inside it are that theme's colours */
.chip { display: block; width: 2.25rem; height: 2.25rem; border-radius: 50%;
        background: linear-gradient(135deg, var(--jp3-bar) 0 50%, var(--jp3-user-bubble) 50% 100%);
        border: 2px solid color-mix(in srgb, var(--ink) 30%, transparent); transition: transform .15s, box-shadow .15s; }
.swatch:hover .chip { transform: scale(1.08); }
.swatch input:checked + .chip { box-shadow: 0 0 0 3px var(--page), 0 0 0 5px var(--ink); }
.swatch input:checked ~ .swatch-name { font-weight: 700; }
.swatch input:focus-visible + .chip { outline: 3px solid var(--jp3-link); outline-offset: 5px; }

/* theme changes fade rather than snap */
body, .site-header, .hero, .card, .section-alt, .site-footer, .badge, .tags li { transition: background-color .3s, color .3s, border-color .3s; }
html[data-brightness="dark"] { color-scheme: dark; }

/* long-form pages (privacy policy) */
.page-title { font-size: clamp(2.2rem, 6vw, 3rem); margin-bottom: .25rem; }
.meta { color: var(--ink-soft); margin-bottom: 1.5rem; }
.prose h2 { font-size: 1.4rem; margin: 2.25rem 0 .6rem; }
.prose ul { padding-left: 1.25rem; margin: 0 0 1rem; }
.prose li { margin-bottom: .6rem; }
.summary { background: var(--panel); border: 1px solid var(--rule); border-left: 5px solid var(--accent); border-radius: var(--radius);
           padding: 1rem 1.25rem; }
.site-footer a { color: inherit; }
/* on dark themes a black outline vanishes into the page, so the header gear gets a pale one instead */
html[data-brightness="dark"] .gear-line { stroke: color-mix(in srgb, var(--ink) 60%, transparent); }
