/* Kaiven Studios — studio homepage. Brand LOCKED v1: Paper/Ink, Kaiven Blue = focus only, Fraunces / Geist / Geist Mono / IBM Plex Sans Arabic.
   Motion: focus pull (blur 10 -> 0, scale 1.08 -> 1, 700ms, ease .2,.7,.2,1), frame corners, cuts. Never bounce or spin. */
:root {
  --paper: #F1F0EC; --ink: #0E0E12; --fog: #DCDBD5; --graphite: #5B5B64; --blue: #2B2AE6; --blue-l: #8F8DFF;
  --display: "Fraunces", Georgia, serif; --body: "Geist", system-ui, sans-serif; --mono: "Geist Mono", ui-monospace, monospace; --ar: "IBM Plex Sans Arabic", Tahoma, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--body); overflow-x: hidden; }
body.loading { overflow: hidden; }
html[lang="ar"] body, html[lang="ar"] button { font-family: var(--ar); }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.wrap { width: min(1240px, 100% - 44px); margin-inline: auto; }
.mono { font-family: var(--mono); font-weight: 500; letter-spacing: .16em; text-transform: uppercase; font-size: 12px; }
html[lang="ar"] .mono:not(.keep) { font-family: var(--ar); letter-spacing: 0; text-transform: none; font-size: 14px; }
.label { color: var(--graphite); margin-bottom: 24px; }
h1, h2, h3, .big { font-family: var(--display); font-weight: 340; font-variation-settings: "SOFT" 100, "opsz" 144; letter-spacing: -.028em; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] .big { font-family: var(--ar); font-weight: 500; letter-spacing: 0; }
html[lang="ar"] em { font-style: normal; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }

/* frame corners (shared) */
.c { position: absolute; width: 26px; height: 26px; border: 0 solid currentColor; pointer-events: none; }
.c.tl { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; }
.c.tr { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; }
.c.bl { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; }
.c.br { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; }
.sq { position: absolute; width: 8px; height: 8px; background: var(--blue); }

/* loader */
.loader { position: fixed; inset: 0; z-index: 100; background: var(--ink); color: var(--paper); display: grid; place-items: center; }
.lf { position: relative; width: 120px; height: 80px; transition: width .7s var(--ease), height .7s var(--ease); }
.lf .sq { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.lcount { position: absolute; left: 50%; bottom: 12vh; transform: translateX(-50%); color: #9a9aa3; }
.lcount b { color: var(--paper); font-weight: 500; }
.loader.done .lf { width: calc(100vw - 48px); height: calc(100svh - 48px); }
.loader.gone { opacity: 0; visibility: hidden; transition: opacity .5s .1s, visibility 0s .6s; }

/* cursor viewfinder (fine pointers only) */
.cursor { position: fixed; z-index: 90; left: 0; top: 0; width: 44px; height: 44px; color: var(--blue); pointer-events: none; opacity: 0; transition: width .35s var(--ease), height .35s var(--ease), opacity .3s; }
.cursor .c { width: 10px; height: 10px; border-width: 0; }
.cursor .c.tl { border-top-width: 1.5px; border-left-width: 1.5px; } .cursor .c.tr { border-top-width: 1.5px; border-right-width: 1.5px; }
.cursor .c.bl { border-bottom-width: 1.5px; border-left-width: 1.5px; } .cursor .c.br { border-bottom-width: 1.5px; border-right-width: 1.5px; }
.cursor .sq { width: 4px; height: 4px; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.cursor.on { opacity: 1; }
.cursor.big { width: 78px; height: 78px; }
.cursor.light { color: var(--blue-l); }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* nav */
.nav { position: fixed; z-index: 50; inset: 0 0 auto; height: 76px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--paper); transition: color .3s, background .3s; }
.nav.on-paper { color: var(--ink); background: rgba(241, 240, 236, .86); backdrop-filter: blur(10px); }
.brand { position: relative; width: 112px; height: 54px; }
.brand .wm { position: absolute; inset: 0; width: 112px; height: auto; transition: opacity .3s; }
.brand .ink { opacity: 0; } .nav.on-paper .brand .ink { opacity: 1; } .nav.on-paper .brand .paper { opacity: 0; }
.links { display: flex; gap: 30px; font-size: 14px; }
.links a { text-decoration: none; opacity: .72; transition: opacity .2s; }
.links a:hover { opacity: 1; }
.nav-r { display: flex; align-items: center; gap: 10px; }
.lang { min-height: 40px; padding: 0 15px; border: 1px solid currentColor; border-radius: 99px; font: 500 14px/1 var(--ar); opacity: .8; }
html[lang="ar"] .lang { font: 500 13px/1 var(--body); }
.pill { display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 99px; background: var(--paper); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; transition: background .2s, color .2s; }
.nav.on-paper .pill { background: var(--ink); color: var(--paper); }

/* 1. hero */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 560px; background: var(--ink); color: var(--paper); overflow: hidden; display: grid; place-items: center; }
.grain { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .07; pointer-events: none; mix-blend-mode: screen; }
.hero::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(90% 80% at 50% 50%, transparent 50%, rgba(0, 0, 0, .55)); }
.vf { position: absolute; inset: 24px; color: rgba(241, 240, 236, .9); }
.vf .c { width: 40px; height: 40px; }
.hud .h { position: absolute; z-index: 2; color: #a7a7b0; font-size: 11px; }
.hud .tl { top: 46px; left: 50px; } .hud .tr { top: 46px; right: 50px; } .hud .bl { bottom: 44px; left: 50px; } .hud .br { bottom: 44px; right: 50px; }
.hud b { color: var(--paper); font-weight: 500; margin-inline-start: 8px; font-variant-numeric: tabular-nums; }
.rec { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--blue-l); margin-inline-end: 8px; vertical-align: 0; animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-in { position: relative; z-index: 2; text-align: center; padding: 0 24px; }
.rack { font-size: clamp(56px, 10.6vw, 170px); line-height: .9; }
.rack .w { display: inline-block; will-change: filter, transform; transition: filter .25s linear; }
.rack em { font-style: italic; color: var(--blue-l); }
html[lang="ar"] .rack { font-size: clamp(48px, 8.4vw, 130px); line-height: 1.15; }
.for { margin-top: 30px; font-size: clamp(17px, 1.6vw, 22px); color: #c4c4cc; }
.cut { color: var(--paper); font-family: var(--display); font-style: italic; font-variation-settings: "SOFT" 100, "opsz" 144; font-size: 1.2em; }
html[lang="ar"] .cut { font-family: var(--ar); font-style: normal; font-weight: 600; }
.scroll { position: absolute; z-index: 2; left: 50%; bottom: 40px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; color: #a7a7b0; text-decoration: none; font-size: 11px; }
.scroll i { width: 1px; height: 34px; background: linear-gradient(var(--blue-l), transparent); animation: drip 1.8s infinite; }
@keyframes drip { from { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } to { transform: scaleY(0); transform-origin: bottom; } }

/* 2. idea */
.idea { position: relative; height: 230vh; background: var(--paper); }
.idea-pin { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; flex-direction: column; justify-content: center; width: min(1240px, 100% - 44px); margin-inline: auto; }
.big { font-size: clamp(36px, 5.6vw, 92px); line-height: 1.04; max-width: 17ch; }
.big .w { display: inline-block; color: var(--fog); filter: blur(6px); transition: color .5s var(--ease), filter .5s var(--ease); }
.big .w.in { color: var(--ink); filter: none; }
.big em .w.in, .big .w.in em { color: var(--blue); }
.big em { font-style: italic; }
html[lang="ar"] .big { font-size: clamp(32px, 4.8vw, 74px); line-height: 1.35; max-width: 20ch; }

/* 3. work reel */
.work { position: relative; background: var(--ink); color: var(--paper); }
.reel { position: relative; height: 100vh; height: 100svh; overflow: hidden; }
.track { position: absolute; top: 0; left: 0; height: 100%; display: flex; will-change: transform; }

.panel { position: relative; flex: none; width: 100vw; height: 100%; display: flex; align-items: center; }
.panel.intro { flex-direction: column; align-items: flex-start; justify-content: center; padding: 0 max(28px, 8vw); }
.work .label { color: #8d8d96; }
.panel.intro h2 { font-size: clamp(52px, 8.6vw, 140px); line-height: .92; }
.panel.intro h2 em { font-style: italic; color: var(--blue-l); }
.panel.intro .lede { margin-top: 28px; color: #b9b9c1; max-width: 40ch; font-size: 19px; }
.proj { gap: clamp(30px, 4vw, 70px); padding: 90px max(28px, 6vw) 70px; }
.devices { position: relative; flex: 1.55; min-width: 0; }
.laptop .scr { position: relative; aspect-ratio: 16 / 10; border-radius: 10px 10px 0 0; overflow: hidden; background: #000; border: 9px solid #1a1a20; border-bottom-width: 12px; }
.laptop video { width: 100%; height: 100%; object-fit: cover; }
.laptop .base { height: 14px; margin: 0 -6%; border-radius: 0 0 14px 14px; background: linear-gradient(#2a2a31, #15151a); }
.phone { position: absolute; right: -2%; bottom: -6%; width: 21%; aspect-ratio: 390 / 844; border-radius: 26px; border: 6px solid #1a1a20; overflow: hidden; background: #000; box-shadow: 0 30px 60px rgba(0, 0, 0, .6); }
.phone video, .phone img { width: 100%; height: 100%; object-fit: cover; }
.pinfo { flex: 1; min-width: 0; max-width: 420px; }
.idx { color: #8d8d96; }
.pinfo h3 { font-size: clamp(48px, 5.6vw, 92px); line-height: .95; margin: 14px 0 0; }
.type { color: var(--blue-l); margin: 16px 0 18px; }
.desc { color: #c4c4cc; }
.open { display: inline-flex; align-items: center; min-height: 48px; margin-top: 26px; padding: 0 24px; border: 1px solid rgba(241, 240, 236, .35); border-radius: 99px; text-decoration: none; font-size: 15px; transition: background .2s, color .2s, border-color .2s; }
.open:hover, .open:focus-visible { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.lock { position: absolute; z-index: 3; left: 0; top: 0; color: var(--paper); pointer-events: none; will-change: transform, width, height; }
.lock .c { width: 30px; height: 30px; }
.reel-bar { position: absolute; z-index: 3; left: max(28px, 6vw); right: max(28px, 6vw); bottom: 28px; display: flex; align-items: center; gap: 16px; color: #8d8d96; font-size: 11px; }
.reel-bar i { flex: 1; height: 1px; background: rgba(241, 240, 236, .18); position: relative; }
.reel-bar b { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--paper); }
html[dir="rtl"] .reel-bar b { left: auto; right: 0; }

/* 4. services */
.services { position: relative; padding: clamp(100px, 12vw, 170px) 0; background: var(--paper); }
.rows { list-style: none; border-top: 1px solid var(--fog); }
.rows li { border-bottom: 1px solid var(--fog); }
.row { position: relative; display: grid; grid-template-columns: 80px 1fr minmax(0, 360px) 40px; align-items: center; gap: 24px; padding: 30px 0; color: var(--ink); text-decoration: none;
  /* full-bleed hover band: a solid shadow clipped to the row's height (renders correctly in Safari) */
  box-shadow: 0 0 0 100vmax transparent; clip-path: inset(0 -100vmax); transition: background-color .35s var(--ease), box-shadow .35s var(--ease), color .25s; }
.row h3 { font-size: clamp(48px, 7.6vw, 124px); line-height: .95; transition: transform .45s var(--ease); }
.row p { color: var(--graphite); font-size: 16px; transition: color .25s; }
.row .n { color: var(--graphite); }
.row .arr { font-size: 28px; justify-self: end; transition: transform .35s var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .row:hover, .row:focus-visible { background: var(--ink); box-shadow: 0 0 0 100vmax var(--ink); color: var(--paper); }
  .row:hover h3, .row:focus-visible h3 { transform: translateX(28px); font-style: italic; }
  html[dir="rtl"] .row:hover h3, html[dir="rtl"] .row:focus-visible h3 { transform: translateX(-28px); }
  .row:hover p, .row:focus-visible p, .row:hover .n, .row:focus-visible .n { color: #b9b9c1; }
  .row:hover .arr { transform: translateX(8px); }
}
html[dir="rtl"] .row .arr { transform: scaleX(-1); }
.services { overflow: hidden; }
.peek { position: fixed; z-index: 40; left: 0; top: 0; width: 280px; aspect-ratio: 4 / 3; pointer-events: none; opacity: 0; transform: translate(-50%, -50%) scale(.9); filter: blur(10px); transition: opacity .35s var(--ease), filter .35s var(--ease); border-radius: 8px; overflow: hidden; box-shadow: 0 30px 60px rgba(0, 0, 0, .45); }
.peek.on { opacity: 1; filter: none; }
.pv { position: absolute; inset: 0; opacity: 0; transition: opacity .2s; background: var(--paper); }
.pv.on { opacity: 1; }
.pv video { width: 100%; height: 100%; object-fit: cover; }
.pv[data-k="social"] { background: #000; }
.pv[data-k="social"] video { object-fit: contain; }
.nfc { position: absolute; inset: 14% 18%; border-radius: 14px; background: var(--ink); color: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 10px; }
.nfc img { width: 34px; filter: invert(1); }
.nfc b { font: 400 22px/1 var(--display); font-variation-settings: "SOFT" 100, "opsz" 144; }
.nfc span { font-size: 11px; color: #b9b9c1; }
.wave { position: absolute; right: 12px; top: 12px; width: 18px; height: 18px; border: 2px solid var(--blue-l); border-left-color: transparent; border-bottom-color: transparent; border-radius: 50%; }
.idn { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; place-items: center; padding: 20px; }
.idn img { width: 70px; }
.idn b { font: 400 64px/1 var(--display); font-variation-settings: "SOFT" 100, "opsz" 144; }
.sw { display: grid; grid-template-columns: repeat(2, 30px); gap: 6px; grid-row: span 2; }
.sw i { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--fog); }

/* 5. process */
.process { position: relative; background: var(--paper); padding: 0 0 clamp(80px, 10vw, 140px); }
.pgrid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(30px, 6vw, 100px); }
.phone-pin { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; place-items: center; }
.phone.big { position: relative; right: auto; bottom: auto; width: min(320px, 70vw); border-width: 10px; border-radius: 42px; box-shadow: 0 40px 80px rgba(14, 14, 18, .25); background: var(--paper); }
.ps { position: absolute; inset: 0; opacity: 0; filter: blur(10px); transform: scale(1.08); transition: opacity .7s var(--ease), filter .7s var(--ease), transform .7s var(--ease); }
.ps.on { opacity: 1; filter: none; transform: none; }
.ps video { width: 100%; height: 100%; object-fit: cover; }
.s0 { background: #ECE9E2; display: flex; flex-direction: column; }
.chat-top { display: flex; align-items: center; gap: 10px; padding: 16px 14px 12px; background: var(--paper); border-bottom: 1px solid var(--fog); font-size: 11px; color: var(--ink); }
.chat-top img { width: 26px; height: 26px; border-radius: 50%; background: var(--paper); border: 1px solid var(--fog); padding: 3px; }
.chat { padding: 16px 12px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; line-height: 1.4; }
.bub { max-width: 82%; padding: 9px 12px; border-radius: 14px; background: #fff; box-shadow: 0 1px 0 rgba(0, 0, 0, .05); }
.bub.in { align-self: flex-start; border-start-start-radius: 4px; }
.bub.out { align-self: flex-end; background: var(--ink); color: var(--paper); border-start-end-radius: 4px; }
.bub.card { padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.bub.card img { width: 100%; height: 150px; object-fit: cover; border-radius: 9px; }
.bub.card b { font-size: 12px; padding: 2px 4px 0; }
.bub.card span { font-size: 11px; color: var(--graphite); padding: 0 4px 4px; }
.s2 { background: #000; }
.bar { position: absolute; z-index: 2; left: 10px; right: 10px; top: 10px; height: 30px; border-radius: 10px; background: rgba(241, 240, 236, .94); color: var(--ink); display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 11px; text-transform: none; letter-spacing: .02em; }
.lockic { width: 8px; height: 9px; border: 1.5px solid var(--ink); border-radius: 2px; position: relative; }
.lockic::before { content: ''; position: absolute; left: 0; top: -6px; width: 5px; height: 5px; border: 1.5px solid var(--ink); border-bottom: 0; border-radius: 4px 4px 0 0; }
.live { position: absolute; z-index: 2; left: 50%; bottom: 22px; transform: translateX(-50%); padding: 8px 16px; border-radius: 99px; background: var(--blue); color: #fff; font-size: 11px; }
.ptitle { padding-top: clamp(100px, 12vw, 170px); }
.ptitle h2 { font-size: clamp(44px, 6.4vw, 104px); line-height: .95; }
.ptitle h2 em { font-style: italic; color: var(--blue); }
.steps { padding: 26vh 0 20vh; }
.step { min-height: 60vh; opacity: .25; filter: blur(4px); transition: opacity .6s var(--ease), filter .6s var(--ease); }
.step.on { opacity: 1; filter: none; }
.step h3 { font-size: clamp(34px, 3.6vw, 54px); margin: 14px 0; }
.step p { color: var(--graphite); max-width: 36ch; font-size: 18px; }
.step .n { color: var(--graphite); }

/* 6. close */
.close { position: relative; background: var(--ink); color: var(--paper); padding: clamp(90px, 10vw, 140px) 0 clamp(100px, 12vw, 160px); overflow: hidden; }
.marquee { display: grid; gap: 4px; margin-bottom: clamp(70px, 9vw, 130px); }
.mq { display: flex; width: max-content; white-space: nowrap; will-change: transform; }
.mq span { font: 330 clamp(54px, 9vw, 150px)/1.05 var(--display); font-variation-settings: "SOFT" 100, "opsz" 144; letter-spacing: -.03em; padding-inline-end: .3em; }
.mq em { font-style: italic; color: var(--blue-l); }
.mq.r2 span { font: 500 clamp(14px, 1.4vw, 20px)/2.4 var(--mono); letter-spacing: .3em; text-transform: uppercase; color: #8d8d96; }
.cta { text-align: center; }
.cta .label { color: #8d8d96; }
.cta h2 { font-size: clamp(38px, 5.4vw, 86px); line-height: 1; max-width: 18ch; margin-inline: auto; }
.cta h2 em { font-style: italic; color: var(--blue-l); }
.go { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 64px; margin-top: 48px; padding: 0 40px; background: var(--blue); color: #fff; text-decoration: none; font-weight: 500; font-size: 17px; transition: background .25s; }
.go .c { color: var(--paper); width: 14px; height: 14px; transition: transform .35s var(--ease); }
.go .c.tl { transform: translate(-12px, -12px); } .go .c.tr { transform: translate(12px, -12px); } .go .c.bl { transform: translate(-12px, 12px); } .go .c.br { transform: translate(12px, 12px); }
.go:hover .c, .go:focus-visible .c { transform: none; }
.go:hover, .go:focus-visible { background: #1f1ec4; }
.ways { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 34px; margin-top: 46px; }
.ways a { text-decoration: none; color: #b9b9c1; text-transform: none; letter-spacing: .04em; font-size: 13px; min-height: 44px; display: inline-flex; align-items: center; }
.ways a:hover { color: var(--paper); }

.foot { background: var(--ink); color: var(--paper); border-top: 1px solid rgba(241, 240, 236, .1); padding: 34px 0; }
.frow { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.foot img { width: 100px; height: auto; }
.foot .ar { font: 500 17px/1.4 var(--ar); color: var(--blue-l); }
.foot .small { color: #8d8d96; font-size: 11px; }
.foot .small a { text-decoration: none; }

@media (max-width: 900px) {
  .links { display: none; }
  .nav { padding: 0 16px; height: 66px; }
  .brand, .brand .wm { width: 96px; }
  .pill { display: none; }
  .hud .tr, .hud .br { display: none; }
  .hud .tl { left: 34px; top: 86px; } .hud .bl { display: none; }
  .scroll { bottom: 34px; }
  .vf { inset: 16px; } .vf .c { width: 28px; height: 28px; }
  .proj { flex-direction: column; justify-content: center; gap: 26px; padding: 80px 22px 70px; }
  .devices { flex: none; width: 100%; max-width: 520px; }
  .phone { width: 26%; }
  .pinfo { max-width: none; }
  .pinfo h3 { font-size: 46px; margin-top: 8px; }
  .type { margin: 10px 0 10px; }
  .desc { font-size: 15px; }
  .open { margin-top: 16px; }
  .row { grid-template-columns: 1fr auto; gap: 6px 16px; padding: 24px 0; }
  .row .n { grid-column: 1 / -1; }
  .row h3 { font-size: 52px; }
  .row p { grid-column: 1; font-size: 15px; }
  .row .arr { grid-row: 2; grid-column: 2; }
  .peek { display: none; }
  .pgrid { grid-template-columns: 1fr; }
  .phone-pin { height: 74svh; top: 66px; z-index: 0; }
  .phone.big { width: min(250px, 62vw); }
  .steps { position: relative; z-index: 1; padding: 0 0 10vh; }
  .ptitle { padding-bottom: 6vh; }
  .step { min-height: auto; padding: 26px 22px; margin-bottom: 40vh; background: rgba(241, 240, 236, .94); border: 1px solid var(--fog); border-radius: 8px; backdrop-filter: blur(8px); }
}
@media (prefers-reduced-motion: reduce) {
  .rec, .scroll i { animation: none; }
  .rack .w, .big .w, .ps, .step, .peek { transition: none; filter: none; }
  .big .w { color: var(--ink); }
}
