/* scribe.icu start page — clean, colourful, glass.
   Light and dark are both first-class; every surface is a translucent pane
   floating over a soft aurora field. */

/* ─────────────────────────── tokens ─────────────────────────── */

:root {
  color-scheme: light dark;

  /* Brand + accent hues. Reused by tiles, badges, and gradients. */
  --teal: #1f9d8f;
  --violet: #6d5cf6;
  --sky: #0ea5e9;
  --amber: #f0920b;
  --emerald: #16a34a;
  --rose: #e11d48;
  --purple: #9333ea;
  --orange: #ea580c;
  --blue: #2563eb;

  --ink: #0f1720;
  --ink-soft: #46545f;
  --ink-faint: #6d7c88;

  --page: #eef3f7;
  --pane: rgba(255, 255, 255, 0.62);
  --pane-strong: rgba(255, 255, 255, 0.78);
  --pane-line: rgba(255, 255, 255, 0.75);
  --pane-edge: rgba(15, 23, 32, 0.07);
  --field: rgba(255, 255, 255, 0.72);

  --shadow-sm: 0 1px 2px rgba(15, 23, 32, 0.05), 0 4px 14px rgba(15, 23, 32, 0.05);
  --shadow-md: 0 2px 6px rgba(15, 23, 32, 0.06), 0 14px 40px rgba(15, 23, 32, 0.09);
  --shadow-lg: 0 4px 10px rgba(15, 23, 32, 0.07), 0 30px 70px rgba(15, 23, 32, 0.13);

  --blur: 22px;
  --radius: 18px;
  --radius-lg: 26px;
  --radius-pill: 999px;

  --measure: 1180px;
  --step: clamp(1rem, 0.6rem + 1.4vw, 1.6rem);

  --accent: var(--teal);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

:root[data-theme='dark'],
:root[data-theme='auto'] {
  /* Overridden below by the media query for `auto`; `dark` wins outright. */
}

@media (prefers-color-scheme: dark) {
  :root[data-theme='auto'] {
    --ink: #e9eef3;
    --ink-soft: #a5b3bf;
    --ink-faint: #7d8c99;

    --page: #080c11;
    --pane: rgba(24, 32, 41, 0.55);
    --pane-strong: rgba(26, 35, 45, 0.74);
    --pane-line: rgba(255, 255, 255, 0.11);
    --pane-edge: rgba(0, 0, 0, 0.5);
    --field: rgba(12, 18, 24, 0.5);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.45), 0 14px 40px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 4px 10px rgba(0, 0, 0, 0.5), 0 30px 70px rgba(0, 0, 0, 0.5);

    --teal: #2fc0ad;
    --violet: #9b8bff;
    --sky: #48bdf5;
    --amber: #f7b23f;
    --emerald: #3fcc74;
    --rose: #ff6b8a;
    --purple: #bd7dfa;
    --orange: #ff8a4c;
    --blue: #6ba2f8;
  }
}

:root[data-theme='dark'] {
  --ink: #e9eef3;
  --ink-soft: #a5b3bf;
  --ink-faint: #7d8c99;

  --page: #080c11;
  --pane: rgba(24, 32, 41, 0.55);
  --pane-strong: rgba(26, 35, 45, 0.74);
  --pane-line: rgba(255, 255, 255, 0.11);
  --pane-edge: rgba(0, 0, 0, 0.5);
  --field: rgba(12, 18, 24, 0.5);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.45), 0 14px 40px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 4px 10px rgba(0, 0, 0, 0.5), 0 30px 70px rgba(0, 0, 0, 0.5);

  --teal: #2fc0ad;
  --violet: #9b8bff;
  --sky: #48bdf5;
  --amber: #f7b23f;
  --emerald: #3fcc74;
  --rose: #ff6b8a;
  --purple: #bd7dfa;
  --orange: #ff8a4c;
  --blue: #6ba2f8;
}

/* ─────────────────────────── base ─────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.022em;
  font-weight: 700;
}

p {
  margin: 0;
}

img,
svg {
  max-width: 100%;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.7rem 1.1rem;
  background: var(--pane-strong);
  backdrop-filter: blur(var(--blur));
  border-radius: 0 0 12px 0;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
}

/* ─────────────────────── aurora backdrop ─────────────────────── */

.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.aurora__blob {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.5;
  will-change: transform;
}

.aurora__blob--teal {
  width: 46vw;
  height: 46vw;
  min-width: 320px;
  min-height: 320px;
  top: -12vw;
  left: -8vw;
  background: radial-gradient(circle at 50% 50%, #2fd3bd, transparent 68%);
  animation: drift-a 34s var(--ease) infinite alternate;
}

.aurora__blob--violet {
  width: 42vw;
  height: 42vw;
  min-width: 300px;
  min-height: 300px;
  top: 6vw;
  right: -10vw;
  background: radial-gradient(circle at 50% 50%, #8b7bff, transparent 68%);
  animation: drift-b 40s var(--ease) infinite alternate;
}

.aurora__blob--amber {
  width: 40vw;
  height: 40vw;
  min-width: 280px;
  min-height: 280px;
  top: 78vh;
  left: 4vw;
  background: radial-gradient(circle at 50% 50%, #ffc061, transparent 68%);
  animation: drift-c 46s var(--ease) infinite alternate;
}

.aurora__blob--sky {
  width: 44vw;
  height: 44vw;
  min-width: 300px;
  min-height: 300px;
  top: 150vh;
  right: -6vw;
  background: radial-gradient(circle at 50% 50%, #4fc3f7, transparent 68%);
  animation: drift-b 38s var(--ease) infinite alternate-reverse;
}

:root[data-theme='dark'] .aurora__blob {
  opacity: 0.34;
  filter: blur(88px);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme='auto'] .aurora__blob {
    opacity: 0.34;
    filter: blur(88px);
  }
}

@keyframes drift-a {
  to {
    transform: translate3d(9vw, 7vh, 0) scale(1.16);
  }
}
@keyframes drift-b {
  to {
    transform: translate3d(-11vw, 9vh, 0) scale(1.1);
  }
}
@keyframes drift-c {
  to {
    transform: translate3d(12vw, -8vh, 0) scale(1.2);
  }
}

/* ─────────────────────────── glass ─────────────────────────── */

.glass {
  position: relative;
  background: var(--pane);
  backdrop-filter: blur(var(--blur)) saturate(170%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(170%);
  border: 1px solid var(--pane-line);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.42);
  border-radius: var(--radius-lg);
}

:root[data-theme='dark'] .glass {
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme='auto'] .glass {
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }
}

/* Browsers without backdrop-filter get an honest opaque pane. */
@supports not (backdrop-filter: blur(2px)) {
  .glass {
    background: var(--pane-strong);
  }
}

/* ─────────────────────────── topbar ─────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.85rem var(--step) 0;
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0.55rem 0.6rem 0.55rem 1rem;
  border-radius: var(--radius-pill);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.06rem;
  white-space: nowrap;
}

.brand__mark {
  width: 1.4rem;
  height: 1.4rem;
  color: var(--teal);
  flex: none;
}

.brand__dot {
  color: var(--teal);
}

.topbar__links {
  display: flex;
  gap: 0.15rem;
  list-style: none;
  margin: 0 auto 0 0.6rem;
  padding: 0;
  min-width: 0;
}

.topbar__links a {
  display: block;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 550;
  white-space: nowrap;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}

.topbar__links a:hover {
  color: var(--ink);
  background: var(--pane-strong);
}

/* The two shortcuts that leave the site, marked so they aren't mistaken for
   in-page anchors. */
.topbar__ext::after {
  content: '↗';
  margin-left: 0.28em;
  font-size: 0.82em;
  opacity: 0.55;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: none;
  margin-left: auto;
  padding: 0.42rem 0.85rem 0.42rem 0.7rem;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--field);
  border: 1px solid var(--pane-line);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--accent);
}

.theme-toggle__icon {
  width: 1.05rem;
  height: 1.05rem;
  flex: none;
}

/* Show the icon matching the *current* mode. */
.theme-toggle__icon--moon {
  display: none;
}
:root[data-theme='dark'] .theme-toggle__icon--sun {
  display: none;
}
:root[data-theme='dark'] .theme-toggle__icon--moon {
  display: block;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme='auto'] .theme-toggle__icon--sun {
    display: none;
  }
  :root[data-theme='auto'] .theme-toggle__icon--moon {
    display: block;
  }
}

/* Six items won't fit a phone, but the answer isn't to drop all of them: the
   three shortcuts that leave the site are the whole point of the bar. Below
   this the in-page jumps go instead — that content is one scroll away anyway. */
@media (max-width: 900px) {
  .topbar__jump {
    display: none;
  }
  .theme-toggle__label {
    display: none;
  }
  .theme-toggle {
    padding: 0.42rem 0.6rem;
  }
  .topbar__links {
    margin-left: 0.3rem;
  }
  .topbar__links a {
    padding: 0.4rem 0.5rem;
    font-size: 0.86rem;
  }
}

/* Narrow phones: the wordmark goes so the shortcuts don't have to. The pulse
   mark is still the link home. */
@media (max-width: 520px) {
  .brand__name {
    display: none;
  }
  .topbar__inner {
    gap: 0.3rem;
    padding-left: 0.75rem;
  }
  .topbar__links {
    margin-left: 0.15rem;
  }
  .topbar__links a {
    padding: 0.4rem 0.4rem;
    font-size: 0.83rem;
  }
  /* The ↗ costs ~10px a link — more than it's worth once space is this tight. */
  .topbar__ext::after {
    display: none;
  }
}

/* At 360px the three still fit with ~25px to spare; below roughly 335px they
   don't. Rather than let the bar overflow, drop to the two most-used. */
@media (max-width: 350px) {
  .topbar__third {
    display: none;
  }
}

/* ──────────────────────── layout shells ──────────────────────── */

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--step);
}

.section {
  margin: clamp(4rem, 9vw, 7.5rem) 0;
  scroll-margin-top: 6rem;
}

.section__head {
  max-width: 46rem;
  margin-bottom: clamp(1.8rem, 3.5vw, 2.8rem);
}

.section__title {
  font-size: clamp(1.6rem, 1.15rem + 1.9vw, 2.5rem);
}

.section__sub {
  margin-top: 0.85rem;
  color: var(--ink-soft);
  font-size: clamp(0.98rem, 0.94rem + 0.2vw, 1.1rem);
}

.subhead {
  margin-top: clamp(2.6rem, 5vw, 4rem);
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.42rem);
}

.subhead__sub {
  margin-top: 0.35rem;
  margin-bottom: 1.4rem;
  color: var(--ink-faint);
  font-size: 0.95rem;
}

/* ─────────────────────────── hero ─────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(1rem, 3vw, 2rem);
  scroll-margin-top: 6rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.34rem 0.85rem 0.34rem 0.7rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-pill);
  background: var(--pane);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--pane-line);
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.005em;
}

.eyebrow__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 22%, transparent);
  animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--teal) 6%, transparent);
  }
}

.hero__title {
  font-size: clamp(2rem, 1.15rem + 3.4vw, 3.35rem);
  letter-spacing: -0.032em;
  text-wrap: balance;
}

.hero__title em {
  font-style: normal;
  background: linear-gradient(102deg, var(--teal), var(--sky) 42%, var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  margin-top: 1.25rem;
  max-width: 34rem;
  color: var(--ink-soft);
  font-size: clamp(1rem, 0.95rem + 0.28vw, 1.14rem);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.9rem;
}

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

.chip {
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px dashed color-mix(in srgb, var(--ink-faint) 40%, transparent);
  color: var(--ink-faint);
  font-size: 0.8rem;
  font-weight: 550;
}

/* the notepad — the hero "image" and the page's main call to action */
.hero__card {
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  padding: clamp(2rem, 4vw, 3rem) 1.5rem clamp(1.4rem, 3vw, 2rem);
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.hero__card:hover,
.hero__card:focus-visible {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.hero__glow {
  position: absolute;
  z-index: -1;
  top: -22%;
  left: 50%;
  width: 78%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--teal) 55%, transparent), transparent 66%);
  filter: blur(38px);
  opacity: 0.8;
  transition: opacity 0.4s var(--ease);
}

.hero__card:hover .hero__glow {
  opacity: 1;
}

.hero__art {
  width: clamp(9rem, 17vw, 13.5rem);
  height: auto;
  margin-bottom: 1.1rem;
  filter: drop-shadow(0 22px 34px rgba(15, 23, 32, 0.26));
  animation: float 7s ease-in-out infinite;
}

@keyframes float {
  50% {
    transform: translateY(-11px);
  }
}

.hero__card-title {
  font-size: clamp(1.25rem, 1.05rem + 0.7vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero__card-sub {
  color: var(--ink-faint);
  font-size: 0.86rem;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

.hero__card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1.1rem;
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--teal) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--teal) 40%, transparent);
  color: color-mix(in srgb, var(--teal) 78%, var(--ink));
  font-size: 0.9rem;
  font-weight: 650;
  transition: background 0.25s var(--ease), gap 0.25s var(--ease);
}

.hero__card-cta svg {
  width: 1rem;
  height: 1rem;
}

.hero__card:hover .hero__card-cta {
  background: color-mix(in srgb, var(--teal) 26%, transparent);
  gap: 0.6rem;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: clamp(1.8rem, 5vw, 3rem);
  }
  .hero__card {
    order: -1;
  }
}

/* ─────────────────────────── buttons ─────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.72rem 1.35rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease),
    background 0.25s var(--ease), gap 0.25s var(--ease);
}

.btn--primary {
  background: linear-gradient(135deg, var(--teal), color-mix(in srgb, var(--sky) 62%, var(--teal)));
  color: #fff;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--teal) 36%, transparent);
}

.btn--primary:hover:not(:disabled) {
  transform: translateY(-2px);
  gap: 0.65rem;
  box-shadow: 0 10px 26px color-mix(in srgb, var(--teal) 46%, transparent);
}

.btn--primary:disabled {
  opacity: 0.6;
  cursor: progress;
}

.btn--ghost {
  background: var(--pane);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: var(--pane-line);
  color: var(--ink-soft);
}

.btn--ghost:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--teal) 45%, transparent);
}

.btn__arrow {
  width: 1.05rem;
  height: 1.05rem;
}

/* ────────────────────── explainer cards ────────────────────── */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1.1rem;
}

.card {
  --accent: var(--teal);
  padding: 1.6rem 1.5rem 1.7rem;
  border-radius: var(--radius);
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent 82%);
}

.card--teal {
  --accent: var(--teal);
}
.card--violet {
  --accent: var(--violet);
}
.card--amber {
  --accent: var(--amber);
}

.card__num {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.9rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: color-mix(in srgb, var(--accent) 80%, var(--ink));
  font-size: 0.9rem;
  font-weight: 700;
}

.card__title {
  font-size: 1.08rem;
  margin-bottom: 0.55rem;
}

.card p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.card em {
  font-style: italic;
  color: var(--ink);
}

/* ──────────────────────── live demo ──────────────────────── */

.demo {
  margin-top: 1.6rem;
  padding: clamp(1.4rem, 3vw, 2.2rem);
}

.demo__head {
  max-width: 42rem;
  margin-bottom: 1.4rem;
}

.demo__title {
  font-size: 1.22rem;
}

.demo__note {
  margin-top: 0.45rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.demo__note em {
  font-style: italic;
  color: var(--ink);
}

.demo__panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 760px) {
  .demo__panes {
    grid-template-columns: 1fr;
  }
}

.demo__pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.demo__label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.demo__pip {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex: none;
}

.demo__pip--live {
  background: var(--emerald);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--emerald) 20%, transparent);
}

.demo__pip--lock {
  background: var(--violet);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet) 20%, transparent);
}

.demo__input,
.demo__output {
  display: block;
  width: 100%;
  min-height: 11.5rem;
  padding: 0.95rem 1.05rem;
  border-radius: 14px;
  border: 1px solid var(--pane-line);
  background: var(--field);
  color: var(--ink);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.83rem;
  line-height: 1.65;
  resize: vertical;
}

.demo__input:focus {
  outline: 2px solid var(--teal);
  outline-offset: -1px;
}

.demo__output {
  overflow: auto;
  max-height: 22rem;
  color: var(--violet);
  overflow-wrap: anywhere;
  word-break: break-all;
  resize: none;
  /* Faint scanline so it reads as "machine output", not text you could read. */
  background-image: repeating-linear-gradient(
    180deg,
    transparent 0 1.65rem,
    color-mix(in srgb, var(--violet) 5%, transparent) 1.65rem 3.3rem
  );
}

.demo__help {
  margin-top: 0.5rem;
  color: var(--ink-faint);
  font-size: 0.78rem;
}

/* ─────────────────────────── tiles ─────────────────────────── */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 1rem;
}

.tile {
  --accent: var(--teal);
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.35rem 1rem;
  padding: 1.3rem 1.35rem;
  border-radius: var(--radius);
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease),
    border-color 0.28s var(--ease);
}

.tile:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

/* Coloured wash that blooms from the icon corner on hover. */
.tile::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    120% 90% at 0% 0%,
    color-mix(in srgb, var(--accent) 17%, transparent),
    transparent 62%
  );
  opacity: 0;
  transition: opacity 0.28s var(--ease);
  pointer-events: none;
}

.tile:hover::after {
  opacity: 1;
}

.tile__icon {
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  grid-row: span 2;
  border-radius: 13px;
  background: linear-gradient(
    140deg,
    color-mix(in srgb, var(--accent) 22%, transparent),
    color-mix(in srgb, var(--accent) 8%, transparent)
  );
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--accent);
}

.tile__icon svg {
  width: 1.4rem;
  height: 1.4rem;
}

.tile__body {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-width: 0;
}

/* Stretched link: the whole tile is the click target, but only the title is
   in the accessibility tree as a link. */
.tile__link {
  font-size: 1.03rem;
  font-weight: 680;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.tile__link::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.tile__link:focus-visible {
  outline: none;
}

.tile:has(.tile__link:focus-visible) {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
}

.tile__desc {
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.5;
}

.tile__host {
  grid-column: 2;
  margin-top: 0.35rem;
  color: var(--ink-faint);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.75rem;
}

/* Secondary action sits above the stretched link. */
.tile__alt {
  position: relative;
  z-index: 1;
  grid-column: 2;
  justify-self: start;
  margin-top: 0.6rem;
  padding: 0.28rem 0.7rem;
  border-radius: var(--radius-pill);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: color-mix(in srgb, var(--accent) 76%, var(--ink));
  font-size: 0.76rem;
  font-weight: 620;
  text-decoration: none;
  transition: background 0.2s var(--ease);
}

.tile__alt:hover {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}

.tiles--compact .tile {
  padding: 1.15rem 1.2rem;
}

.tile--openevidence {
  --accent: var(--violet);
}
.tile--uptodate {
  --accent: var(--blue);
}
.tile--mdcalc {
  --accent: var(--emerald);
}
.tile--google {
  --accent: var(--sky);
}
.tile--workday {
  --accent: var(--amber);
}
.tile--eforcse {
  --accent: var(--orange);
}
.tile--heart {
  --accent: var(--rose);
}
.tile--pecarn {
  --accent: var(--purple);
}
.tile--perc {
  --accent: var(--sky);
}

/* ─────────────────────────── forms ─────────────────────────── */

.forms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1.1rem;
  align-items: start;
}

.form {
  --accent: var(--teal);
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  padding: clamp(1.4rem, 3vw, 2rem);
  overflow: hidden;
}

.form::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent 82%);
}

.form--suggest {
  --accent: var(--violet);
}
.form--feedback {
  --accent: var(--rose);
}

.form__head {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin-bottom: 0.3rem;
}

.form__badge {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 13px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent);
}

.form__badge svg {
  width: 1.35rem;
  height: 1.35rem;
}

.form__title {
  font-size: 1.16rem;
}

.form__sub {
  margin-top: 0.2rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field__label {
  font-size: 0.85rem;
  font-weight: 620;
  color: var(--ink-soft);
  padding: 0;
}

.field__req {
  color: var(--accent);
}

.field__hint {
  font-weight: 500;
  color: var(--ink-faint);
}

.field__input {
  width: 100%;
  padding: 0.72rem 0.9rem;
  font: inherit;
  font-size: 0.94rem;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--pane-line);
  border-radius: 12px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.field__input::placeholder {
  color: var(--ink-faint);
  opacity: 0.75;
}

.field__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.field__input--area {
  resize: vertical;
  min-height: 5rem;
  line-height: 1.55;
}

.field__input--tall {
  min-height: 8.5rem;
}

.field__input[aria-invalid='true'] {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rose) 18%, transparent);
}

.segmented__group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.segmented__opt input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.segmented__opt span {
  display: inline-block;
  padding: 0.42rem 0.8rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--pane-line);
  background: var(--field);
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.segmented__opt input:checked + span {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: color-mix(in srgb, var(--accent) 78%, var(--ink));
}

.segmented__opt input:focus-visible + span {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
}

/* Honeypot — off-screen but not display:none, which bots skip. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__submit {
  align-self: flex-start;
  margin-top: 0.3rem;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--violet)));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 34%, transparent);
}

.form__submit:hover:not(:disabled) {
  box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 44%, transparent);
}

.form__status {
  min-height: 1.3rem;
  font-size: 0.88rem;
  font-weight: 550;
  color: var(--ink-soft);
}

.form__status--ok {
  color: color-mix(in srgb, var(--emerald) 82%, var(--ink));
}

.form__status--err {
  color: color-mix(in srgb, var(--rose) 84%, var(--ink));
}

/* ─────────────────────────── footer ─────────────────────────── */

.footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--step) clamp(2.5rem, 5vw, 4rem);
}

.footer__inner {
  padding: 1.5rem clamp(1.3rem, 3vw, 2rem);
  text-align: center;
}

.footer__line {
  font-size: 0.92rem;
}

.footer__line--muted {
  margin-top: 0.5rem;
  max-width: 44rem;
  margin-inline: auto;
  color: var(--ink-faint);
  font-size: 0.82rem;
}

/* ───────────────────── reduced motion ───────────────────── */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .tile:hover,
  .hero__card:hover {
    transform: none;
  }
}
