/* ==========================================================
   bkhalid.dev: landing page for 1DManager, FilmCam and Billit.
   Loads after base.css (shared tokens and components).
   ========================================================== */

:root { --orange: #e5591f; --amber: #f2a33a; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: grid; align-items: center; padding-block: 120px 96px; overflow: hidden; isolation: isolate; }
.hero__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero__grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px; background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 65% 60% at 62% 42%, #000 10%, transparent 72%);
  mask-image: radial-gradient(ellipse 65% 60% at 62% 42%, #000 10%, transparent 72%);
}
.hero__aura {
  position: absolute; width: 64vmax; height: 64vmax; right: -18vmax; top: -22vmax; border-radius: 50%;
  background: conic-gradient(from 90deg, rgba(229, 89, 31, .34), rgba(242, 163, 58, .24), rgba(120, 170, 150, .2), rgba(110, 130, 255, .22), rgba(229, 89, 31, .34));
  filter: blur(90px); opacity: .55; animation: spin 40s linear infinite;
}
@keyframes spin { to { transform: rotate(1turn); } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero__aura { opacity: .3; } }

.hero__inner { display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 48px; }
.hero__copy { display: grid; gap: 28px; justify-items: start; }
.hero__copy .h-display { max-width: 14ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }

/* three app icons, floating with a little parallax (base.js sets --px/--py/--rx/--ry) */
.stack {
  position: relative; width: min(470px, 100%); aspect-ratio: 1; justify-self: end;
  transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d; transition: transform .8s var(--ease);
}
.tile {
  --z: 1;
  position: absolute; display: block; width: 46%;
  rotate: var(--rot, 0deg);
  translate: calc(var(--px, 0) * var(--z) * 36px) calc(var(--py, 0) * var(--z) * 36px);
  transition: translate .8s var(--ease), scale .6s var(--ease), opacity .9s var(--ease), filter .9s var(--ease);
}
.js .tile { opacity: 0; scale: .7; filter: blur(10px); }
.loaded .tile { opacity: 1; scale: 1; filter: none; transition-delay: calc(var(--i) * 140ms + 450ms), calc(var(--i) * 140ms + 450ms), calc(var(--i) * 140ms + 450ms), calc(var(--i) * 140ms + 450ms); }
.loaded .tile:hover { scale: 1.05; transition-delay: 0s; }
.tile img {
  width: 100%; border-radius: 23%;
  box-shadow: 0 0 0 1px var(--line), 0 30px 60px -24px rgba(17, 17, 19, .45), 0 10px 20px -12px rgba(17, 17, 19, .25);
  animation: float 7s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -2.3s);
}
@keyframes float { from { transform: translateY(-10px); } to { transform: translateY(10px); } }
.tile--1dm { --rot: -8deg; --z: 1.4; left: 2%; top: 30%; z-index: 2; }
.tile--fc { --rot: 7deg; --z: .7; left: 46%; top: 4%; z-index: 1; width: 42%; }
.tile--bi { --rot: -2deg; --z: 1.1; left: 50%; top: 50%; z-index: 3; width: 40%; }
.tile__label {
  position: absolute; left: 50%; bottom: -14px; translate: -50% 6px;
  padding: 6px 12px; border-radius: 999px; background: var(--ink); color: var(--bg);
  font: 500 12px/1 var(--mono); letter-spacing: .04em; white-space: nowrap;
  opacity: 0; transition: opacity .3s, translate .4s var(--ease); pointer-events: none;
}
.tile:hover .tile__label, .tile:focus-visible .tile__label { opacity: 1; translate: -50% 0; }

.scrollcue { position: absolute; left: 50%; bottom: 28px; translate: -50% 0; width: 26px; height: 40px; border-radius: 14px; border: 1.5px solid var(--line-2); }
.scrollcue span { position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px; border-radius: 3px; background: var(--muted); animation: cue 2s var(--ease) infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(-4px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- apps bento ---------- */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.app { display: grid; grid-template-rows: auto 1fr; color: inherit; }
.app:hover { translate: 0 -4px; box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.app--1dm { grid-column: span 7; }
.app--fc { grid-column: span 5; }
.app--bi { grid-column: span 12; grid-template-columns: 1fr 1fr; grid-template-rows: none; }

.app__body { position: relative; z-index: 2; display: grid; gap: 16px; align-content: start; padding: clamp(24px, 3vw, 36px); }
.app__id { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.app__id img { width: 52px; height: 52px; border-radius: 14px; box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.app__id > span:not(.app__go) { display: grid; gap: 2px; }
.app__id b { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.app__id small { font: 400 12.5px/1.3 var(--mono); color: var(--muted); }
.app__go {
  margin-left: auto; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line-2); transition: background-color .4s, color .4s, border-color .4s, rotate .5s var(--ease);
}
.app__go .ico { width: 18px; height: 18px; }
.app:hover .app__go { background: var(--ink); color: var(--bg); border-color: var(--ink); rotate: 45deg; }
.app__desc { color: var(--ink-2); max-width: 46ch; }
.app__url { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 6px; transition: color .3s; }
.app__url .ico { width: 15px; height: 15px; transition: transform .4s var(--ease); }
.app:hover .app__url { color: var(--ink); }
.app:hover .app__url .ico { transform: translateX(3px); }
.app__media { position: relative; min-height: 300px; }

/* 1DManager: phone peeking up from the bottom, two floating reminders */
.app--1dm { background: radial-gradient(120% 70% at 50% 120%, color-mix(in srgb, var(--orange) 16%, transparent), transparent 60%), var(--surface); }
.mini-phone {
  position: absolute; left: 50%; top: 24px; width: 236px; translate: -50% 0;
  padding: 8px; border-radius: 38px; background: #0d0d0f;
  box-shadow: inset 0 0 0 1.5px #2c2c30, var(--shadow-lg);
  transition: translate .8s var(--ease), rotate .8s var(--ease);
}
.mini-phone img { width: 100%; aspect-ratio: 1 / 2; object-fit: cover; object-position: top; border-radius: 30px; }
.app:hover .mini-phone { translate: -50% -14px; }
.note {
  position: absolute; z-index: 1; display: flex; align-items: center; gap: 10px;
  padding: 9px 14px 9px 9px; border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13px; line-height: 1.25;
  animation: bob 6s ease-in-out infinite alternate;
}
.note i { width: 30px; height: 30px; border-radius: 10px; background: var(--c); position: relative; }
.note i::after { content: ""; position: absolute; inset: 9px; border-radius: 3px; border: 2px solid #fff; border-top-width: 5px; }
.note span { display: grid; }
.note b { font-weight: 600; }
.note small { color: var(--muted); font-size: 12px; }
.note--a { --c: #e5484d; left: 5%; top: 64px; }
.note--b { --c: var(--orange); right: 5%; top: 168px; animation-delay: -3s; }
@keyframes bob { from { transform: translateY(-6px); } to { transform: translateY(6px); } }

/* FilmCam: always dark, with a warm light leak */
.app--fc {
  --surface: #0e0e10; --ink: #f3f3f1; --ink-2: #c4c4c8; --muted: #8b8b93; --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .16); --glow: rgba(242, 163, 58, .13); --bg: #0e0e10;
  background: radial-gradient(70% 50% at 100% 0%, rgba(242, 120, 40, .22), transparent 70%), radial-gradient(60% 40% at 0% 100%, rgba(242, 163, 58, .1), transparent 70%), #0e0e10;
  color: var(--ink);
}
.viewfinder {
  position: absolute; left: 50%; top: 24px; width: 236px; translate: -50% 0;
  padding: 8px; border-radius: 38px; background: #000;
  box-shadow: inset 0 0 0 1.5px #2c2c30, 0 40px 80px -30px rgba(0, 0, 0, .9);
  transition: translate .8s var(--ease);
}
.viewfinder img { width: 100%; aspect-ratio: 1 / 2; object-fit: cover; object-position: top; border-radius: 30px; }
.app:hover .viewfinder { translate: -50% -14px; }
.swatches { position: absolute; right: 7%; top: 70px; display: grid; gap: 12px; z-index: 1; }
.swatches i {
  width: 44px; height: 44px; border-radius: 50%;
  background: conic-gradient(var(--a) 0 25%, var(--b) 0 50%, var(--c) 0 75%, var(--d) 0);
  box-shadow: 0 0 0 2px #0e0e10, 0 0 0 3.5px rgba(255, 255, 255, .18), 0 10px 20px -8px #000;
  transition: rotate .8s var(--ease), translate .6s var(--ease);
}
.swatches i:first-child { box-shadow: 0 0 0 2px #0e0e10, 0 0 0 3.5px var(--amber), 0 10px 20px -8px #000; }
.app:hover .swatches i { rotate: 90deg; }
.app:hover .swatches i:nth-child(2) { transition-delay: 60ms; }
.app:hover .swatches i:nth-child(3) { transition-delay: 120ms; }
.app:hover .swatches i:nth-child(4) { transition-delay: 180ms; }

/* Billit: warm paper, an invoice sketch and a little bar chart */
.app--bi { background: #edebe4; --surface-2: #f8f7f3; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .app--bi { background: #18181a; --surface-2: #222225; } }
.app--bi .app__media { min-height: 340px; }
.invoice {
  position: absolute; left: 12%; top: 40px; width: 250px; padding: 22px; border-radius: 20px;
  background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  rotate: -4deg; display: grid; gap: 14px; transition: rotate .8s var(--ease), translate .8s var(--ease);
}
.app:hover .invoice { rotate: -1deg; translate: 0 -8px; }
.invoice__head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 1px dashed var(--line-2); }
.invoice__head b { width: 56px; height: 14px; border-radius: 4px; background: var(--ink); opacity: .85; }
.invoice__head i { width: 34px; height: 10px; border-radius: 4px; background: var(--line-2); }
.invoice__row, .invoice__total { display: flex; justify-content: space-between; gap: 12px; }
.invoice__row span, .invoice__row em, .invoice__total span, .invoice__total em { height: 8px; border-radius: 4px; background: var(--line-2); transform-origin: left; }
.invoice__row span { width: 58%; }
.invoice__row:nth-child(3) span { width: 44%; }
.invoice__row:nth-child(4) span { width: 66%; }
.invoice__row:nth-child(5) span { width: 38%; }
.invoice__row em { width: 18%; transform-origin: right; }
.invoice__total { padding-top: 12px; border-top: 1px dashed var(--line-2); }
.invoice__total span { width: 30%; background: var(--muted); }
.invoice__total em { width: 30%; height: 12px; background: #22a06b; transform-origin: right; }
.js .app--bi .invoice__row > *, .js .app--bi .invoice__total > * { transform: scaleX(0); transition: transform 1s var(--ease); }
.js .app--bi.in .invoice__row > *, .js .app--bi.in .invoice__total > * { transform: none; }
.app--bi.in .invoice__row:nth-child(2) > * { transition-delay: .5s; }
.app--bi.in .invoice__row:nth-child(3) > * { transition-delay: .6s; }
.app--bi.in .invoice__row:nth-child(4) > * { transition-delay: .7s; }
.app--bi.in .invoice__row:nth-child(5) > * { transition-delay: .8s; }
.app--bi.in .invoice__total > * { transition-delay: 1s; }
.bars {
  position: absolute; right: 12%; bottom: 44px; width: 190px; height: 150px; padding: 18px;
  display: flex; align-items: flex-end; gap: 10px; border-radius: 20px;
  background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow);
  rotate: 3deg; transition: rotate .8s var(--ease), translate .8s var(--ease);
}
.app:hover .bars { rotate: 0deg; translate: 0 -6px; }
.bars i { flex: 1; height: var(--h); border-radius: 5px 5px 2px 2px; background: var(--ink); opacity: .14; transform-origin: bottom; }
.bars i:last-child { opacity: 1; background: #22a06b; }
.js .app--bi .bars i { transform: scaleY(0); transition: transform 1.1s var(--ease); }
.js .app--bi.in .bars i { transform: none; }
.app--bi.in .bars i:nth-child(1) { transition-delay: .6s; }
.app--bi.in .bars i:nth-child(2) { transition-delay: .68s; }
.app--bi.in .bars i:nth-child(3) { transition-delay: .76s; }
.app--bi.in .bars i:nth-child(4) { transition-delay: .84s; }
.app--bi.in .bars i:nth-child(5) { transition-delay: .92s; }
.app--bi.in .bars i:nth-child(6) { transition-delay: 1s; }

/* ---------- principles ---------- */
.principles { padding-bottom: clamp(64px, 9vw, 110px); }
.rules { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px 28px; counter-reset: r; }
.rule-item { position: relative; display: grid; gap: 10px; align-content: start; padding-top: 26px; border-top: 1px solid var(--line); }
.rule-item::before { content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 1.4s var(--ease); transition-delay: calc(var(--d, 0) * 90ms + 200ms); }
.rule-item.in::before { transform: none; }
.rule-item__n { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.rule-item h3 { font-size: 22px; letter-spacing: -.03em; }
.rule-item p { color: var(--muted); }
.rules__note { margin-top: 48px; font: 400 13px/1.5 var(--mono); color: var(--muted); }

/* ---------- marquee strip ---------- */
.strip { border-block: 1px solid var(--line); padding-block: 26px; }
.strip span { font-size: clamp(26px, 3.6vw, 44px); font-weight: 500; letter-spacing: -.04em; white-space: nowrap; }
.strip i { width: 10px; height: 10px; flex: none; border-radius: 50%; border: 1.5px solid var(--muted); }

/* ---------- contact ---------- */
.contact__grid { display: grid; grid-template-columns: .95fr 1.05fr; gap: clamp(40px, 6vw, 88px); align-items: start; }
.contact__intro { display: grid; gap: 20px; position: sticky; top: 120px; }
.contact__intro .head { margin-bottom: 12px; }
.wa { display: flex; align-items: center; gap: 16px; padding: 16px 20px 16px 16px; border-radius: var(--r); transition: translate .5s var(--ease), border-color .4s, box-shadow .5s; }
.wa:hover { translate: 0 -2px; border-color: var(--line-2); box-shadow: var(--shadow); }
.wa__ico { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: #25d366; color: #fff; flex: none; }
.wa__ico .ico { width: 24px; height: 24px; }
.wa > span:nth-child(2) { display: grid; }
.wa small { font-size: 13px; color: var(--muted); }
.wa b { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.wa__go { margin-left: auto; color: var(--muted); transition: transform .4s var(--ease), color .3s; }
.wa:hover .wa__go { transform: translate(2px, -2px); color: var(--ink); }
.contact__review { font-size: 14px; color: var(--muted); }
.contact__review a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.contact__review a:hover { text-decoration-color: currentColor; }

/* ---------- feedback form ---------- */
.form { display: grid; gap: 24px; padding: clamp(22px, 3.4vw, 36px); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.form__label { display: block; margin-bottom: 10px; padding: 0; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.apps-pick__row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pick {
  position: relative; display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line-2); cursor: pointer;
  transition: border-color .3s, background-color .3s, box-shadow .3s, transform .3s var(--ease);
}
.pick:hover { background: var(--surface-2); }
.pick:active { transform: scale(.98); }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick img { width: 28px; height: 28px; border-radius: 8px; flex: none; }
.pick span { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--surface-2); }
.pick:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }

.rate__row { display: flex; align-items: center; gap: 16px; min-height: 36px; }
.stars { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.stars input { position: absolute; opacity: 0; pointer-events: none; }
.stars label { display: grid; place-items: center; width: 36px; height: 36px; cursor: pointer; color: var(--line-2); transition: color .2s, transform .3s var(--ease); }
.stars label .ico { width: 26px; height: 26px; }
.stars label:hover { transform: scale(1.15); }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: #f2a33a; }
.stars input:focus-visible + label { outline: 2px solid var(--ink); border-radius: 8px; }
.rate__word { font-size: 13px; color: var(--muted); }

.field input, .field textarea {
  display: block; width: 100%; padding: 13px 15px; border-radius: 14px;
  border: 1px solid var(--line-2); background: var(--bg); color: var(--ink);
  transition: border-color .3s, box-shadow .3s; resize: vertical;
}
.field textarea { min-height: 130px; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: .7; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--line); }
.field.error input, .field.error textarea { border-color: #e5484d; box-shadow: 0 0 0 4px rgba(229, 72, 77, .12); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hp { display: none !important; }
.captcha { min-height: 78px; display: flex; align-items: center; border-radius: 12px; }
.captcha.error { box-shadow: 0 0 0 2px #e5484d; }
.captcha__msg { font: 400 12.5px/1.5 var(--mono); color: var(--muted); }
.form .btn--primary.loading { opacity: .7; pointer-events: none; }
.form .btn--primary.sent { background: #16a34a; color: #fff; }
.form__note { min-height: 1.4em; font-size: 14px; color: #16a34a; margin-top: -8px; }
.form__note:empty { display: none; }
.form__note.err { color: #e5484d; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .app--1dm, .app--fc { grid-column: span 12; }
  .app--bi { grid-template-columns: 1fr; }
  .rules { grid-template-columns: repeat(2, 1fr); }
  .contact__grid { grid-template-columns: 1fr; }
  .contact__intro { position: static; }
}
@media (max-width: 820px) {
  .hero { min-height: auto; padding-top: 112px; }
  .hero__inner { grid-template-columns: 1fr; gap: 24px; }
  .stack { justify-self: center; width: min(360px, 88%); margin-top: 8px; }
  .scrollcue { display: none; }
}
@media (max-width: 560px) {
  .rules { grid-template-columns: 1fr; gap: 28px; }
  .field-row { grid-template-columns: 1fr; }
  .apps-pick__row { grid-template-columns: 1fr; }
  .note { font-size: 12px; }
  .note--a { left: 4%; top: 40px; }
  .note--b { right: 4%; top: 150px; }
  .swatches { right: 5%; }
  .swatches i { width: 36px; height: 36px; }
  .invoice { left: 6%; width: 210px; }
  .bars { right: 6%; width: 150px; height: 124px; }
}

@media (prefers-reduced-motion: reduce) {
  .js .tile { opacity: 1; scale: 1; filter: none; }
  .hero__aura, .tile img, .note { animation: none; }
  .js .app--bi .invoice__row > *, .js .app--bi .invoice__total > *, .js .app--bi .bars i { transform: none; }
}
