/* ==========================================================
   Shared base for bkhalid.dev, 1dm.bkhalid.dev and filmcam.bkhalid.dev
   Source of truth: shared/base.css. After editing, run
   deploy/sync-shared.sh to copy it into each site's css/ folder.
   Each site's css/site.css sets its accent and its own sections.
   ========================================================== */

/* ---------- tokens ---------- */
:root {
  --bg: #f7f6f3;
  --bg-2: #efede8;
  --surface: #ffffff;
  --surface-2: #f3f2ee;
  --ink: #111113;
  --ink-2: #3c3c42;
  --muted: #74747b;
  --line: rgba(17, 17, 19, .08);
  --line-2: rgba(17, 17, 19, .15);
  --accent: #111113;
  --accent-ink: #ffffff;
  --glow: rgba(17, 17, 19, .07);
  --nav-bg: rgba(247, 246, 243, .74);
  --shadow-sm: 0 1px 2px rgba(17, 17, 19, .06);
  --shadow: 0 1px 2px rgba(17, 17, 19, .04), 0 16px 36px -18px rgba(17, 17, 19, .2);
  --shadow-lg: 0 2px 6px rgba(17, 17, 19, .04), 0 48px 90px -36px rgba(17, 17, 19, .34);

  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 32px);

  color-scheme: light dark;
  interpolate-size: allow-keywords;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0c;
    --bg-2: #121214;
    --surface: #141416;
    --surface-2: #1b1b1e;
    --ink: #f3f3f1;
    --ink-2: #c4c4c8;
    --muted: #8b8b93;
    --line: rgba(255, 255, 255, .08);
    --line-2: rgba(255, 255, 255, .16);
    --accent: #f3f3f1;
    --accent-ink: #0b0b0c;
    --glow: rgba(255, 255, 255, .07);
    --nav-bg: rgba(11, 11, 12, .7);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 36px -18px rgba(0, 0, 0, .7);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .3), 0 48px 90px -36px rgba(0, 0, 0, .9);
  }
}
:root[data-theme="dark"] {
  --bg: #0b0b0c;
  --bg-2: #121214;
  --surface: #141416;
  --surface-2: #1b1b1e;
  --ink: #f3f3f1;
  --ink-2: #c4c4c8;
  --muted: #8b8b93;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .16);
  --accent: #f3f3f1;
  --accent-ink: #0b0b0c;
  --glow: rgba(255, 255, 255, .07);
  --nav-bg: rgba(11, 11, 12, .7);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 36px -18px rgba(0, 0, 0, .7);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .3), 0 48px 90px -36px rgba(0, 0, 0, .9);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.03em; line-height: 1.05; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--bg); transition: top .2s; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { --wrap: 760px; }
.ico { width: 20px; height: 20px; flex: none; }

/* ---------- type ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.h-display { font-size: clamp(46px, 8.6vw, 112px); letter-spacing: -.055em; line-height: .94; }
.h-section { font-size: clamp(34px, 5.6vw, 68px); letter-spacing: -.05em; line-height: .98; }
.h-card { font-size: clamp(22px, 2.4vw, 28px); letter-spacing: -.035em; line-height: 1.1; }
.lead { font-size: clamp(17px, 1.55vw, 20px); line-height: 1.55; color: var(--ink-2); max-width: 58ch; }
.dim { color: var(--muted); }
.mono { font-family: var(--mono); }

.section { position: relative; padding-block: clamp(80px, 12vw, 150px); }
.section--tight { padding-block: clamp(56px, 8vw, 96px); }
.head { display: grid; gap: 20px; max-width: 780px; margin-bottom: clamp(40px, 6vw, 72px); }
.head--center { margin-inline: auto; text-align: center; justify-items: center; }
.head .lead { margin-inline: inherit; }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- nav ---------- */
.nav { position: fixed; inset: 12px 0 auto; z-index: 60; display: flex; justify-content: center; padding-inline: 12px; pointer-events: none; }
.nav__bar {
  position: relative; pointer-events: auto;
  display: flex; align-items: center; gap: 6px;
  width: 100%; max-width: var(--wrap);
  padding: 8px 8px 8px 16px; border-radius: 999px;
  border: 1px solid transparent;
  transition: max-width .7s var(--ease), background-color .4s, border-color .4s, box-shadow .4s, padding .4s var(--ease);
}
.nav.is-scrolled .nav__bar {
  max-width: 920px;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.nav__brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.02em; font-size: 16px; margin-right: auto; }
.nav__brand img { width: 30px; height: 30px; border-radius: 9px; box-shadow: 0 0 0 1px var(--line); }
.nav__brand b { color: var(--accent); font-weight: inherit; }
.nav__links { display: flex; align-items: center; gap: 2px; }
.nav__links a:not(.btn) { padding: 8px 14px; border-radius: 999px; font-size: 14.5px; color: var(--ink-2); transition: background-color .25s, color .25s; }
.nav__links a:not(.btn):hover { background: var(--line); color: var(--ink); }
.nav__links .btn { margin-left: 6px; }
.nav__burger { display: none; width: 40px; height: 40px; border-radius: 50%; place-items: center; }
.nav__burger span { display: block; width: 18px; height: 1.5px; background: currentColor; border-radius: 2px; transition: transform .4s var(--ease); }
.nav__burger span + span { margin-top: 5px; }
.menu-open .nav__burger span:first-child { transform: translateY(3.25px) rotate(45deg); }
.menu-open .nav__burger span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

@media (max-width: 820px) {
  .nav__burger { display: grid; align-content: center; justify-items: center; }
  .nav__bar { background: var(--nav-bg); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px); border-color: var(--line); }
  .nav__links {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 8px; border-radius: 22px;
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
    opacity: 0; transform: translateY(-8px) scale(.98); transform-origin: top center;
    pointer-events: none; visibility: hidden;
    transition: opacity .3s var(--ease), transform .4s var(--ease), visibility 0s .4s;
  }
  .menu-open .nav__links { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .3s var(--ease), transform .4s var(--ease); }
  .nav__links a:not(.btn) { padding: 13px 16px; font-size: 16px; border-radius: 14px; }
  .nav__links .btn { margin: 6px 0 0; }
}

/* ---------- buttons ---------- */
.btn {
  --h: 50px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 24px; border-radius: 999px;
  font: 500 15px/1 var(--font); letter-spacing: -.01em; white-space: nowrap;
  border: 1px solid transparent; overflow: hidden; isolation: isolate;
  transition: transform .4s var(--ease), background-color .3s, border-color .3s, box-shadow .4s var(--ease), color .3s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn .ico { width: 18px; height: 18px; transition: transform .4s var(--ease); }
.btn:hover .ico--go { transform: translateX(3px); }
.btn:hover .ico--out { transform: translate(2px, -2px); }
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--ink) 70%, transparent); }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn--ghost { border-color: var(--line-2); color: var(--ink); background: color-mix(in srgb, var(--surface) 40%, transparent); }
.btn--ghost:hover { background: var(--line); }
.btn--sm { --h: 38px; padding: 0 16px; font-size: 14px; }
.btn--block { width: 100%; }
/* a light sweep across solid buttons on hover */
.btn--primary::after, .btn--accent::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .9s var(--ease);
}
.btn--primary:hover::after, .btn--accent:hover::after { transform: translateX(120%); }

/* store button: two-line label */
.btn--store { --h: 58px; padding: 0 24px 0 18px; gap: 12px; }
.btn--store .ico { width: 24px; height: 24px; }
.btn--store span { display: grid; text-align: left; font-size: 17px; font-weight: 600; line-height: 1.05; letter-spacing: -.02em; }
.btn--store small { font: 500 11px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; opacity: .7; }
.btn[aria-disabled="true"] { cursor: default; opacity: .72; }
.btn[aria-disabled="true"]:hover { transform: none; box-shadow: none; }
.btn[aria-disabled="true"]::after { display: none; }

/* ---------- chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line-2);
  font: 500 12.5px/1 var(--font); color: var(--ink-2); white-space: nowrap;
}
.chip .ico { width: 14px; height: 14px; }
.chip--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--accent)); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- surfaces ---------- */
.card {
  position: relative; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  overflow: hidden; isolation: isolate;
}
/* pointer spotlight: base.js sets --mx / --my on .spot elements */
.spot::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--glow), transparent 60%);
  opacity: 0; transition: opacity .5s;
}
.spot:hover::before { opacity: 1; }

/* ---------- motion: entrance and reveal ---------- */
.js .intro { opacity: 0; transform: translateY(18px); filter: blur(6px); }
.loaded .intro { opacity: 1; transform: none; filter: none; transition: opacity 1.1s var(--ease), transform 1.1s var(--ease), filter 1.1s var(--ease); transition-delay: calc(var(--i, 0) * 110ms + 250ms); }

/* hover effects on revealed elements use `translate` (not transform), so they
   animate right away instead of waiting for the reveal's stagger delay */
.js .reveal {
  --rd: calc(var(--d, 0) * 90ms);
  opacity: 0; transform: translateY(28px); filter: blur(8px);
  transition: opacity 1.1s var(--ease) var(--rd), transform 1.1s var(--ease) var(--rd), filter 1.1s var(--ease) var(--rd),
    translate .6s var(--ease), box-shadow .6s var(--ease), border-color .4s, background-color .4s;
}
.js .reveal.in { opacity: 1; transform: none; filter: none; }

/* headline words slide up from a mask (base.js wraps them) */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .12em; margin-bottom: -.12em; }
.w > span { display: inline-block; transform: translateY(105%); }
.loaded .w > span { transform: none; transition: transform 1.2s var(--ease); transition-delay: calc(var(--w, 0) * 55ms + 100ms); }
.no-split .w > span, html:not(.js) .w > span { transform: none; }

/* ---------- marquee ---------- */
.marquee { display: flex; overflow: hidden; user-select: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee__track { display: flex; flex: none; align-items: center; gap: 28px; padding-right: 28px; animation: marquee 38s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-100%); } }

/* ---------- phone mockup ---------- */
.phone {
  --pw: min(300px, 70vw);
  position: relative; width: var(--pw); padding: calc(var(--pw) * .033);
  border-radius: calc(var(--pw) * .15); background: #0d0d0f;
  box-shadow: inset 0 0 0 1.5px #2a2a2e, inset 0 0 0 5px #0d0d0f, inset 0 0 0 6px #3a3a3f, var(--shadow-lg);
}
.phone__screen { position: relative; aspect-ratio: 1 / 2; border-radius: calc(var(--pw) * .12); overflow: hidden; background: #000; }
.phone__screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.phone__screen .shot { opacity: 0; transform: scale(1.03); transition: opacity 1s var(--ease), transform 1.6s var(--ease); }
.phone__screen .shot.is-on { opacity: 1; transform: none; }

/* ---------- gallery (horizontal) ---------- */
.gallery {
  display: flex; gap: clamp(14px, 2vw, 24px);
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 8px max(var(--gutter), calc((100vw - var(--wrap)) / 2)) 28px;
  scroll-padding-inline: max(var(--gutter), calc((100vw - var(--wrap)) / 2));
  cursor: grab;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery.is-drag { cursor: grabbing; scroll-snap-type: none; }
.gallery.is-drag img { pointer-events: none; }
.frame { flex: none; width: clamp(200px, 23vw, 252px); margin: 0; scroll-snap-align: start; }
.frame img { width: 100%; aspect-ratio: 1 / 2; object-fit: cover; border-radius: 26px; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--surface-2); transition: transform .6s var(--ease); user-select: none; -webkit-user-drag: none; }
.frame:hover img { transform: translateY(-6px); }
.frame figcaption { margin-top: 14px; font-size: 14px; color: var(--muted); }
.gallery__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.gallery__btns { display: flex; gap: 8px; }
.gbtn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); transition: background-color .3s, transform .3s var(--ease), opacity .3s; }
.gbtn:hover { background: var(--line); }
.gbtn:active { transform: scale(.94); }
.gbtn:disabled { opacity: .35; cursor: default; }
.gbtn .ico { width: 18px; height: 18px; }
.gprog { flex: 1; max-width: 220px; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.gprog i { display: block; height: 100%; width: var(--w, 20%); background: var(--ink); border-radius: 2px; transform: translateX(var(--x, 0%)); transition: transform .2s linear; }

/* ---------- FAQ ---------- */
.qa { border-top: 1px solid var(--line); }
.qa details { border-bottom: 1px solid var(--line); }
.qa summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 0; cursor: pointer; list-style: none; font-size: clamp(17px, 1.6vw, 19px); font-weight: 500; letter-spacing: -.015em; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: ""; flex: none; width: 14px; height: 14px; background: linear-gradient(currentColor 0 0) center / 100% 1.5px no-repeat, linear-gradient(currentColor 0 0) center / 1.5px 100% no-repeat; transition: transform .5s var(--ease); color: var(--muted); }
.qa details[open] summary::after { transform: rotate(135deg); }
.qa details::details-content { block-size: 0; overflow: hidden; transition: block-size .5s var(--ease), content-visibility .5s allow-discrete; }
.qa details[open]::details-content { block-size: auto; }
.qa details p { padding: 0 40px 26px 0; color: var(--ink-2); max-width: 64ch; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: 40px calc(40px + env(safe-area-inset-bottom)); font-size: 14px; color: var(--muted); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.footer a:hover { color: var(--ink); }
.footer .nav__brand { color: var(--ink); margin: 0; }

/* ---------- document pages (privacy policies) ---------- */
.doc { padding-block: 140px 100px; }
.doc h1 { font-size: clamp(36px, 6vw, 56px); letter-spacing: -.05em; margin-bottom: 20px; }
.doc h2 { font-size: 22px; letter-spacing: -.025em; margin: 44px 0 12px; }
.doc p, .doc li { color: var(--ink-2); }
.doc p + p { margin-top: 14px; }
.doc ul { list-style: disc; padding-left: 22px; margin-top: 12px; display: grid; gap: 10px; }
.doc a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; transition: text-decoration-color .2s; }
.doc a:hover { text-decoration-color: currentColor; }
.doc strong { color: var(--ink); font-weight: 600; }
.doc code { font: 14px var(--mono); background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.doc__meta { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-size: 15px; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .js .intro, .js .reveal { opacity: 1; transform: none; filter: none; }
  .w > span { transform: none; }
  .marquee__track { animation: none; }
}
