/*
  Site-wide foundation for quikk.com (redesign, 2026-12).
  Safe to load on every page:
  every token is prefixed `--q-` and every selector is a `.q-*` class, so nothing
  here reaches the older page styles. See design/redesign-notes.md.
*/

/* Self-hosted fonts (OFL, latin subset); no third-party requests. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/inter-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/instrument-serif.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/instrument-serif-italic.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-var.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  /* Dark surfaces (default) */
  --q-bg: #08080a;
  --q-band: #161617;
  --q-band-2: #1d1d1f;
  --q-card: #121214;
  --q-card-2: #1a1a1d;
  --q-card-3: #242428;
  --q-line: rgba(255, 255, 255, 0.08);
  --q-line-2: rgba(255, 255, 255, 0.14);
  --q-text: #f5f5f7;
  --q-muted: #86868b;
  --q-dim: #56565c;
  /* Light surfaces ("brand light": hero, iPhone moments) */
  --q-light-bg: #f2f0eb;
  --q-paper: #f6f3ec;
  --q-ink: #1d1c1a;
  /* Accents: the product is monochrome; blue only for links/focus */
  --q-blue: #2f7bff;
  --q-blue-h: #4b8dff;
  --q-link-light: #0066cc;
  --q-ann: #f5a524;
  --q-c-capture: #d6d6dc;
  --q-c-record: #d6d6dc;
  --q-c-write: #d6d6dc;
  --q-c-dict: #d6d6dc;
  --q-c-collect: #d6d6dc;
  --q-c-ask: #d6d6dc;
  /* Motion */
  --q-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --q-ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --q-ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  /* Type */
  --q-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", ui-sans-serif, system-ui, sans-serif;
  --q-serif: "Instrument Serif", ui-serif, Georgia, serif;
  --q-mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, monospace;
  /* Layout */
  --q-wrap: 1080px;
  --q-gutter: 24px;
  /* Space a page leaves above its first content for the fixed header */
  --q-header-space: 84px;
}
@media (max-width: 720px) {
  :root {
    --q-gutter: 16px;
    --q-header-space: 72px;
  }
}

/* ---------- Right-to-left ----------
   Page CSS uses logical properties (inset-inline, margin-inline, text-align:
   start), so an Arabic page mirrors by itself. Two helpers:
   - .q-dir on an icon that points along the reading direction (chevrons,
     arrows, the ↗ external-link glyph) mirrors it on a right-to-left page.
     :dir() follows the nearest dir attribute, so an icon inside a dir="ltr"
     mockup keeps pointing the English way.
   - Mockups of the English product UI (phone, Mac desktop, cards, keycaps)
     carry dir="ltr" in the markup and keep their physical layout inside. */
.q-dir:dir(rtl) {
  scale: -1 1;
}

/* ---------- Header ---------- */
.q-header {
  position: fixed;
  top: 12px;
  inset-inline: 0;
  z-index: 100;
  padding: 0 16px;
  font-family: var(--q-sans);
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  pointer-events: none;
}
.q-header *,
.q-header *::before,
.q-header *::after {
  box-sizing: border-box;
}
/* Zero specificity, so component classes below set their own colours. */
:where(.q-header) a {
  color: inherit;
  text-decoration: none;
}
.q-header svg {
  display: block;
}
.q-header :focus-visible {
  outline: 2px solid var(--q-blue);
  outline-offset: 3px;
  border-radius: 8px;
}
.q-header-in {
  pointer-events: auto;
  position: relative;
  max-width: var(--q-wrap);
  margin: 0 auto;
  height: 60px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 10px 0 14px;
  border-radius: 20px;
  color: var(--q-text);
  background: rgba(18, 18, 20, 0.72);
  -webkit-backdrop-filter: saturate(1.6) blur(20px);
  backdrop-filter: saturate(1.6) blur(20px);
  box-shadow: inset 0 0 0 1px var(--q-line), 0 20px 40px -20px rgba(0, 0, 0, 0.8);
  transition: height 300ms var(--q-ease-out), max-width 300ms var(--q-ease-out), background-color 500ms ease, box-shadow 500ms ease, color 500ms ease;
}
.q-header[data-tone="light"] .q-header-in {
  color: #111;
  background: rgba(252, 251, 248, 0.78);
  -webkit-backdrop-filter: saturate(1.8) blur(24px);
  backdrop-filter: saturate(1.8) blur(24px);
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px -18px rgba(0, 0, 0, 0.18);
}
@media (min-width: 901px) {
  .q-header.is-scrolled .q-header-in {
    height: 52px;
    max-width: 880px;
  }
}

.q-logo {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.03em;
}
.q-logo img {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.12), 0 2px 6px -2px rgba(0, 0, 0, 0.25);
}

/* Centre links: a quiet pill on wide screens, a sheet on narrow ones */
.q-links {
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 13px;
}
.q-header[data-tone="light"] .q-links {
  background: rgba(0, 0, 0, 0.035);
}
.q-links > a,
.q-feat > summary {
  height: 32px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--q-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}
.q-header[data-tone="light"] .q-links > a,
.q-header[data-tone="light"] .q-feat > summary {
  color: #6e6e73;
}
.q-links > a[aria-current] {
  color: var(--q-text);
  background: rgba(255, 255, 255, 0.08);
}
.q-header[data-tone="light"] .q-links > a[aria-current] {
  color: #111;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
}
@media (hover: hover) and (pointer: fine) {
  .q-links > a:hover,
  .q-feat > summary:hover {
    color: var(--q-text);
    background: rgba(255, 255, 255, 0.05);
  }
  .q-header[data-tone="light"] .q-links > a:hover,
  .q-header[data-tone="light"] .q-feat > summary:hover {
    color: #111;
    background: rgba(0, 0, 0, 0.05);
  }
}
.q-links > a svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}
.q-links .q-only-sheet {
  display: none;
}

/* Features disclosure */
.q-feat {
  position: relative;
}
.q-feat > summary {
  list-style: none;
}
.q-feat > summary::-webkit-details-marker {
  display: none;
}
.q-feat > summary svg {
  width: 14px;
  height: 14px;
  transition: transform 200ms var(--q-ease-out);
}
.q-feat[open] > summary {
  color: inherit;
}
.q-feat[open] > summary svg {
  transform: rotate(180deg);
}
.q-feat-panel {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  width: min(640px, calc(100vw - 32px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px;
  border-radius: 18px;
  color: var(--q-text);
  background: #161618;
  box-shadow: inset 0 0 0 1px var(--q-line-2), 0 24px 60px -20px rgba(0, 0, 0, 0.7);
}
.q-feat[open] .q-feat-panel {
  animation: q-pop 180ms var(--q-ease-out) both;
}
@keyframes q-pop {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-4px) scale(0.98);
  }
}
.q-header[data-tone="light"] .q-feat-panel {
  color: #111;
  background: #fcfbf8;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.1), 0 24px 60px -24px rgba(0, 0, 0, 0.3);
}
.q-feat-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.q-feat-label {
  margin: 6px 10px 6px;
  font: 500 11px/1.2 var(--q-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--q-muted);
}
.q-feat-link {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 8px 10px;
  border-radius: 11px;
  transition: background-color 150ms ease;
}
.q-feat-ic {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.q-header[data-tone="light"] .q-feat-ic {
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.q-feat-ic svg {
  width: 16px;
  height: 16px;
}
.q-feat-link b {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}
.q-feat-link small {
  display: block;
  margin-top: 1px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--q-muted);
}
.q-header[data-tone="light"] .q-feat-link small {
  color: #6e6e73;
}
.q-feat-link:focus-visible {
  outline-offset: -2px;
}
@media (hover: hover) and (pointer: fine) {
  .q-feat-link:hover {
    background: rgba(255, 255, 255, 0.06);
  }
  .q-header[data-tone="light"] .q-feat-link:hover {
    background: rgba(0, 0, 0, 0.045);
  }
}

/* Right side */
.q-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 6px;
}
.q-login {
  padding: 0 10px;
  font-size: 14px;
  color: var(--q-muted);
}
.q-header[data-tone="light"] .q-login {
  color: #6e6e73;
}
@media (hover: hover) and (pointer: fine) {
  .q-login:hover {
    color: inherit;
  }
}
.q-sep {
  width: 1px;
  height: 18px;
  margin: 0 6px 0 2px;
  background: var(--q-line);
}
.q-header[data-tone="light"] .q-sep {
  background: rgba(0, 0, 0, 0.1);
}
.q-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  background: #f5f5f7;
  color: #0b0b0c;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.3);
  transition: transform 160ms var(--q-ease-out), background-color 200ms ease;
}
.q-cta svg {
  width: 16px;
  height: 16px;
}
.q-cta:active {
  transform: scale(0.97);
}
.q-header[data-tone="light"] .q-cta {
  background: #111;
  color: #fff;
  box-shadow: none;
}
@media (hover: hover) and (pointer: fine) {
  .q-cta:hover {
    background: #fff;
  }
  .q-header[data-tone="light"] .q-cta:hover {
    background: #000;
  }
}
.q-menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 11px;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.q-menu-btn svg {
  width: 20px;
  height: 20px;
}
.q-menu-btn .q-menu-close,
.q-header.is-open .q-menu-btn .q-menu-open {
  display: none;
}
.q-header.is-open .q-menu-btn .q-menu-close {
  display: block;
}

/* Narrow screens: links fold into a sheet under the bar */
@media (max-width: 900px) {
  .q-header-in {
    grid-template-columns: 1fr auto;
    padding: 0 6px 0 12px;
  }
  .q-login,
  .q-sep {
    display: none;
  }
  .q-menu-btn {
    display: grid;
  }
  .q-links {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    max-height: calc(100dvh - 100px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px;
    border-radius: 18px;
    color: var(--q-text);
    background: #161618;
    box-shadow: inset 0 0 0 1px var(--q-line-2), 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  }
  .q-header[data-tone="light"] .q-links {
    color: #111;
    background: #fcfbf8;
    box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.1), 0 24px 60px -24px rgba(0, 0, 0, 0.3);
  }
  .q-header.is-open .q-links {
    display: flex;
    animation: q-sheet 220ms var(--q-ease-out) both;
  }
  .q-links > a,
  .q-feat > summary {
    height: 46px;
    padding: 0 12px;
    font-size: 17px;
    justify-content: space-between;
  }
  .q-feat > summary {
    display: flex;
  }
  .q-links .q-only-sheet {
    display: inline-flex;
  }
  .q-feat-panel,
  .q-feat[open] .q-feat-panel {
    position: static;
    width: auto;
    transform: none;
    animation: none;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 2px 0 8px;
    background: none;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .q-header[data-tone="light"] .q-feat-panel {
    background: none;
    box-shadow: none;
  }
}
@media (max-width: 380px) {
  .q-logo span {
    display: none;
  }
}
@keyframes q-sheet {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

/* ---------- Footer ---------- */
.q-footer {
  background: var(--q-band);
  color: var(--q-muted);
  padding: 28px 0 24px;
  font-family: var(--q-sans);
  font-size: 12px;
  line-height: 1.47;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}
.q-footer * {
  box-sizing: border-box;
}
:where(.q-footer) a {
  color: inherit;
  text-decoration: none;
}
.q-footer svg {
  display: block;
}
.q-footer :focus-visible {
  outline: 2px solid var(--q-blue);
  outline-offset: 3px;
  border-radius: 6px;
}
.q-footer-in {
  max-width: var(--q-wrap);
  margin: 0 auto;
  padding: 0 var(--q-gutter);
}
.q-footer-top {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 28px;
  padding: 22px 0 26px;
  border-bottom: 1px solid #3a3a3d;
}
.q-footer-brand .q-logo {
  font-size: 16px;
  color: var(--q-text);
}
.q-footer-brand .q-logo img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}
.q-footer-brand p {
  margin: 10px 0 0;
  line-height: 1.5;
}
.q-footer-library {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  color: var(--q-blue-h);
}
.q-footer-library svg {
  width: 13px;
  height: 13px;
}
.q-footer h3 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: #e8e8ed;
}
.q-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.q-footer ul a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.q-footer ul svg {
  width: 12px;
  height: 12px;
  opacity: 0.7;
}
@media (hover: hover) and (pointer: fine) {
  .q-footer ul a:hover,
  .q-footer-bot nav a:hover {
    color: var(--q-text);
    text-decoration: underline;
  }
}
.q-footer-bot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding-top: 16px;
}
.q-footer-bot nav {
  display: flex;
  gap: 14px;
}
.q-footer-bot nav a + a {
  border-inline-start: 1px solid #48484c;
  padding-inline-start: 14px;
}
/* Language menu (footer): only rendered when more than one language is built.
   A <details> popover with the shared dropdown recipe; it opens upwards because
   it sits at the bottom of the page. */
.q-lang {
  position: relative;
}
.q-lang > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px #3a3a3d;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.q-lang > summary::-webkit-details-marker {
  display: none;
}
.q-lang > summary svg {
  width: 14px;
  height: 14px;
}
.q-lang .q-lang-caret {
  transition: transform 200ms var(--q-ease-out);
}
.q-lang[open] .q-lang-caret {
  transform: rotate(180deg);
}
.q-lang-menu {
  position: absolute;
  inset-inline-end: 0;
  bottom: calc(100% + 8px);
  z-index: 5;
  display: grid;
  min-width: 200px;
  max-height: min(360px, 60vh);
  overflow-y: auto;
  padding: 4px;
  border-radius: 12px;
  background: #161618;
  box-shadow: inset 0 0 0 1px var(--q-line-2), 0 12px 30px #00000026;
}
.q-lang[open] .q-lang-menu {
  animation: q-lang-pop 160ms var(--q-ease-out) both;
}
@keyframes q-lang-pop {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
  }
}
.q-lang-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--q-muted);
  text-decoration: none;
}
.q-lang-menu a[aria-current] {
  color: var(--q-text);
}
.q-lang-tick {
  width: 14px;
  height: 14px;
  visibility: hidden;
}
.q-lang-menu a[aria-current] .q-lang-tick {
  visibility: visible;
}
@media (hover: hover) and (pointer: fine) {
  .q-lang-menu a:hover {
    color: var(--q-text);
    background: var(--q-card);
  }
}
@media (max-width: 900px) {
  .q-footer-top {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .q-footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 24px 16px;
  }
  .q-footer-brand {
    grid-column: 1 / -1;
  }
  .q-footer ul {
    gap: 0;
  }
  /* Comfortable touch targets in the stacked footer */
  .q-footer ul a {
    min-height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .q-header-in,
  .q-feat > summary svg,
  .q-cta {
    transition: none;
  }
  .q-feat[open] .q-feat-panel,
  .q-header.is-open .q-links,
  .q-lang[open] .q-lang-menu {
    animation: none;
  }
  .q-lang .q-lang-caret {
    transition: none;
  }
}

/* Device-adaptive offers (home page). An inline script in the page's <head> sets
   <html data-device="ios"> on iPhone / iPad; both variants are always in the HTML
   (same markup for every visitor and crawler), only one is shown. */
html:not([data-device="ios"]) .q-ios-only,
html[data-device="ios"] .q-mac-only {
  display: none !important;
}
