@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #f6f4ff;
  --ink: #1e1a33;
  --ink-soft: #625d7a;
  --violet: #5b3df5;
  --violet-deep: #4a2ee0;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --glass-line: rgba(255, 255, 255, 0.75);
  --shadow: 0 18px 50px rgba(64, 44, 140, 0.10), 0 2px 6px rgba(64, 44, 140, 0.05);
  --ok: #157a52;
  --error: #b42318;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 400 1rem/1.6 var(--body); overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--violet); }
a:hover { color: var(--violet-deep); }
:focus-visible { outline: 3px solid rgba(91, 61, 245, 0.55); outline-offset: 2px; border-radius: 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 10px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 10px; z-index: 20; }
.skip:focus { left: 12px; }

/* soft colour glows behind the glass */
.glow { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.glow span { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.55; }
.g1 { width: 520px; height: 520px; background: #9b85ff; top: -160px; left: -120px; }
.g2 { width: 460px; height: 460px; background: #ffb89a; top: 120px; right: -160px; opacity: 0.5; }
.g3 { width: 420px; height: 420px; background: #8fe3cf; bottom: -180px; left: 30%; opacity: 0.4; }

.wrap { width: min(760px, 100% - 40px); margin-inline: auto; }

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(255, 255, 255, 0.9); }
}

/* header */
.top { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; }
.logo { display: flex; align-items: center; gap: 9px; font: 700 1.15rem var(--display); color: var(--ink); text-decoration: none; }
.logo img { border-radius: 8px; }
nav { display: flex; gap: 6px; }
nav a { color: var(--ink-soft); text-decoration: none; padding: 6px 12px; border-radius: 999px; }
nav a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.6); }

/* hero */
.hero { text-align: center; padding: clamp(28px, 7vw, 72px) 0 36px; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.02em; }
h1 { font-weight: 600; font-size: clamp(2.1rem, 5.6vw, 3.5rem); line-height: 1.08; }
.lede { color: var(--ink-soft); font-size: 1.1rem; margin: 14px auto 30px; max-width: 46ch; }

.card { border-radius: 28px; padding: 14px; text-align: left; }

/* paste row */
.paste { display: flex; gap: 10px; }
.field {
  flex: 1; display: flex; align-items: center; min-width: 0;
  background: var(--glass-strong); border: 1px solid rgba(30, 26, 51, 0.08); border-radius: 18px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field:focus-within { border-color: rgba(91, 61, 245, 0.45); box-shadow: 0 0 0 4px rgba(91, 61, 245, 0.12); }
.field input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink);
  font: 400 1.05rem var(--body); padding: 16px 6px 16px 18px; outline: none; text-overflow: ellipsis;
}
.field input::placeholder { color: #a39fb8; }
.paste-btn {
  margin-right: 8px; border: 0; background: rgba(91, 61, 245, 0.09); color: var(--violet);
  font: 700 0.9rem var(--body); padding: 8px 14px; border-radius: 12px; cursor: pointer;
}
.paste-btn:hover { background: rgba(91, 61, 245, 0.16); }

button { font: inherit; cursor: pointer; }
.primary {
  border: 0; border-radius: 18px; background: var(--violet); color: #fff;
  font: 700 1.02rem var(--body); padding: 0 26px; min-height: 56px; white-space: nowrap;
  box-shadow: 0 8px 22px rgba(91, 61, 245, 0.28); transition: background 0.15s, transform 0.1s;
}
.primary:hover { background: var(--violet-deep); }
.primary:active { transform: translateY(1px); }
.primary:disabled { background: #b6aee6; box-shadow: none; cursor: default; }
.primary.wide { width: 100%; margin-top: 4px; }
.text-btn { border: 0; background: none; padding: 0; color: var(--violet); font-weight: 700; }
.text-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

.error { color: var(--error); margin: 12px 6px 2px; }

/* result, inside the same card */
.result { padding: 18px 6px 6px; animation: appear 0.3s ease-out; }
@keyframes appear { from { opacity: 0; transform: translateY(6px); } }
.video { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.thumb {
  flex: 0 0 132px; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5.5v13l10.5-6.5z' fill='%235b3df5' fill-opacity='.45'/%3E%3C/svg%3E") center / 30px no-repeat,
    linear-gradient(135deg, #e3dcff, #ffe2d6);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-text { min-width: 0; }
.video-title { font: 600 1.15rem/1.3 var(--display); letter-spacing: -0.01em; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-meta { color: var(--ink-soft); margin: 4px 0 0; font-size: 0.95rem; }

.qualities { border: 0; padding: 0; margin: 0 0 16px; }
.qualities legend { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 8px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: 8px 14px; border-radius: 12px; cursor: pointer;
  background: rgba(255, 255, 255, 0.65); border: 1px solid rgba(30, 26, 51, 0.08);
  font-weight: 700; font-size: 0.95rem; transition: background 0.15s, border-color 0.15s;
}
.chip span small { font-weight: 400; color: var(--ink-soft); margin-left: 6px; }
.chip span:hover { border-color: rgba(91, 61, 245, 0.35); }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip input:checked + span small { color: #cbc6e2; }
.chip input:focus-visible + span { outline: 3px solid rgba(91, 61, 245, 0.55); outline-offset: 2px; }
.chip input:disabled + span { opacity: 0.6; cursor: default; }

.progress { margin-top: 6px; }
.track { height: 10px; border-radius: 999px; background: rgba(30, 26, 51, 0.08); overflow: hidden; }
.bar { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #7c5cff, #ff9f7a); transition: width 0.45s ease; }
.progress-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; color: var(--ink-soft); font-size: 0.95rem; }

.done { text-align: center; padding: 10px 0 4px; }
.done-head { font: 600 1.2rem var(--display); color: var(--ok); margin: 0; }
.done-sub { color: var(--ink-soft); margin: 4px 0 10px; }

/* apps */
.apps, .help { padding: 28px 0; }
.apps h2, .help h2 { font-weight: 600; font-size: 1.4rem; margin: 0 0 14px 4px; }
.app-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.app { border-radius: 22px; padding: 22px; display: flex; flex-direction: column; }
.app h3 { font-weight: 600; font-size: 1.12rem; }
.app p { color: var(--ink-soft); margin: 6px 0 18px; flex: 1; }
.soft {
  align-self: flex-start; text-decoration: none; font-weight: 700; color: var(--violet);
  background: rgba(91, 61, 245, 0.09); padding: 9px 16px; border-radius: 12px;
}
.soft:hover { background: rgba(91, 61, 245, 0.16); color: var(--violet-deep); }
.soft[aria-disabled="true"] { color: var(--ink-soft); background: rgba(30, 26, 51, 0.06); cursor: default; }

/* faq */
.faq { border-radius: 22px; padding: 6px 22px; }
.faq details { padding: 14px 0; }
.faq details + details { border-top: 1px solid rgba(30, 26, 51, 0.08); }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--violet); font: 400 1.4rem/1 var(--display); transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { color: var(--ink-soft); margin: 8px 0 0; max-width: 62ch; }

/* footer */
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 30px 0 44px; color: var(--ink-soft); font-size: 0.95rem; }
.foot p { margin: 0; }
.foot-links { display: flex; gap: 18px; }

@media (max-width: 640px) {
  .paste { flex-direction: column; }
  .primary { width: 100%; }
  .card { padding: 10px; border-radius: 24px; }
  .thumb { flex-basis: 104px; }
  .app-grid { grid-template-columns: 1fr; }
  .glow span { filter: blur(60px); }
}

@media (prefers-reduced-motion: reduce) {
  .result { animation: none; }
  .bar, .field, .chip span, .faq summary::after { transition: none; }
}
