/* Zakiy — Classic view. Concept «Nuqta»: everything measured by the pen's rhombic dot. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("fonts/literata.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}

:root {
  --paper: #F2F3EE;
  --card: #FFFFFF;
  --ink: #0F1736;
  --ink-2: #4A526E;
  --lajvard: #2341B0;
  --rule: #C9CDD9;
  --guide: #AEB6D3;
  --sel: #D6DDF7;

  --sans: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
  --serif: "Literata", ui-serif, Georgia, serif;

  --gut: clamp(16px, 4vw, 56px);
  --max: 1360px;
  --u: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0A0F26;
    --card: #121938;
    --ink: #E9ECF6;
    --ink-2: #A6ADC8;
    --lajvard: #93A7FF;
    --rule: #2F3963;
    --guide: #3A4677;
    --sel: #26326A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0A0F26;
  --card: #121938;
  --ink: #E9ECF6;
  --ink-2: #A6ADC8;
  --lajvard: #93A7FF;
  --rule: #2F3963;
  --guide: #3A4677;
  --sel: #26326A;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 18px/1.6 var(--serif);
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--sel); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--sans); margin: 0; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 2px solid var(--lajvard); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: var(--gut); top: -100px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 12px 16px;
  font: 600 16px/1 var(--sans); text-decoration: none;
}
.skip:focus { top: 12px; }

.ico { width: 1em; height: 1em; flex: none; }

/* ---------- Wordmark ---------- */
.wordmark { display: block; overflow: visible; }
.wm-glyphs { fill: var(--ink); }
.wm-nuqta { fill: var(--lajvard); }
.wm-guide { stroke: var(--guide); stroke-width: 6; stroke-dasharray: 2 34; stroke-linecap: square; vector-effect: none; }
.wm-guide-x, .wm-guide-base { stroke: var(--ink-2); stroke-dasharray: 2 26; stroke-width: 8; }
.wm-dot { fill: none; stroke: var(--lajvard); stroke-width: 22; }

/* ---------- Top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px var(--gut);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.top-mark { display: inline-flex; align-items: center; min-height: 44px; }
.wm-small { height: 26px; width: auto; }
.top-nav { display: flex; align-items: center; gap: 4px; font: 500 16px/1 var(--sans); }
.top-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  text-decoration: none; color: var(--ink-2);
}
.top-nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.theme {
  display: inline-grid; place-items: center; width: 44px; height: 44px; margin-left: 4px;
  background: none; border: 0; color: var(--ink); cursor: pointer; border-radius: 0;
}
.theme svg { width: 20px; height: 20px; }
.theme-half { fill: currentColor; }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(40px, 9vh, 120px) var(--gut) clamp(56px, 10vh, 128px);
}
.hero-mark { margin-left: calc(-1 * clamp(0px, 1vw, 12px)); }
.wm-hero { width: 100%; height: auto; }
.hero-copy {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 32px 64px;
  align-items: end; margin-top: clamp(32px, 6vh, 72px);
}
.lead { font-size: clamp(30px, 3.6vw, 54px); font-weight: 600; line-height: 1.08; letter-spacing: -0.025em; max-width: 19ch; text-wrap: balance; }
.hero-side { display: grid; gap: 24px; justify-items: start; }
.sub { color: var(--ink-2); font-size: 18px; max-width: 38ch; }
.to-work {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px 0 22px;
  font: 600 16px/1 var(--sans); text-decoration: none;
  color: var(--paper); background: var(--ink);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
  padding-right: 30px;
}
.to-work:hover { background: var(--lajvard); color: var(--paper); }

/* One orchestrated moment: the scribe rules the guides, measures with two dots, then sets the i-dot. */
@media (prefers-reduced-motion: no-preference) {
  .wm-hero .wm-guide { transform-box: fill-box; transform-origin: left center; animation: rule 700ms cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 90ms); }
  .wm-hero .wm-dot { transform-box: fill-box; transform-origin: center; animation: stamp 420ms cubic-bezier(.3,1.4,.5,1) both; animation-delay: calc(650ms + var(--i) * 220ms); }
  .wm-hero .wm-nuqta { transform-box: fill-box; transform-origin: center; animation: stamp 520ms cubic-bezier(.3,1.5,.5,1) both, bleed 900ms ease-out both; animation-delay: 1180ms; }
  .nuqta-stack path { transform-box: fill-box; transform-origin: center; }
  .nuqta-stack.in path { animation: stamp 420ms cubic-bezier(.3,1.4,.5,1) both; animation-delay: calc(var(--i) * 140ms); }
}
@keyframes rule { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes stamp { 0% { transform: scale(0) rotate(-45deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes bleed { 0% { filter: blur(18px); } 100% { filter: blur(0); } }

/* ---------- Nuqta note ---------- */
.nuqta {
  max-width: var(--max); margin: 0 auto; padding: clamp(56px, 10vh, 120px) var(--gut);
  display: grid; grid-template-columns: minmax(120px, 3fr) minmax(0, 7fr); gap: 32px clamp(32px, 6vw, 96px);
  align-items: center;
}
.nuqta-stack { width: 100%; max-width: 200px; justify-self: center; }
.nuqta-stack path { fill: var(--lajvard); }
.nuqta-stack path:nth-child(odd) { fill: none; stroke: var(--lajvard); stroke-width: 6; }
.nuqta-stack line { stroke: var(--ink-2); stroke-width: 2; }
.nuqta-copy { display: grid; gap: 20px; max-width: 62ch; }
.nuqta-copy h2 { font-size: clamp(28px, 3vw, 44px); margin-bottom: 8px; }
.nuqta-copy p { font-size: clamp(18px, 1.5vw, 21px); }
.nuqta-copy .note { font-size: 16px; color: var(--ink-2); }

/* ---------- Works ---------- */
.works {
  max-width: var(--max); margin: 0 auto; padding: clamp(56px, 10vh, 120px) var(--gut) 160px;
  display: grid; grid-template-columns: minmax(220px, 3fr) minmax(0, 9fr); gap: 0 clamp(32px, 5vw, 80px);
  align-items: start;
}
.fihrist { position: sticky; top: 96px; display: grid; gap: 16px; }
.fihrist h2 { font-size: clamp(28px, 3vw, 44px); }
.works-intro { color: var(--ink-2); font-size: 16px; }
.fihrist-list { display: grid; gap: 2px; margin-top: 16px; font: 500 17px/1.2 var(--sans); }
.fihrist-list a {
  display: flex; align-items: center; gap: 12px; min-height: 40px;
  color: var(--ink-2); text-decoration: none;
}
.fihrist-list a:hover, .fihrist-list a[aria-current="true"] { color: var(--ink); }
.mark {
  width: 11px; height: 11px; flex: none; transform: rotate(45deg) scale(.82);
  border: 1.5px solid currentColor; transition: background-color .2s, border-color .2s, transform .2s;
}
.fihrist-list a[aria-current="true"] .mark { background: var(--lajvard); border-color: var(--lajvard); transform: rotate(45deg) scale(1); }
.fihrist-sub { display: grid; padding-left: 23px; margin: 0 0 6px; font-size: 15px; }
.fihrist-sub a { min-height: 32px; }

.works-list { display: grid; gap: clamp(120px, 18vh, 200px); }
.work { display: grid; gap: clamp(28px, 4vh, 40px); }
.work-head { display: grid; gap: 14px; justify-items: start; max-width: 60ch; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; font: 500 14px/1 var(--sans); color: var(--ink-2); }
.tags li { padding: 7px 10px 6px; border: 1px solid var(--rule); }
.work-name { font-size: clamp(40px, 5.4vw, 80px); letter-spacing: -0.035em; line-height: 1; }
.work-text { font-size: clamp(18px, 1.5vw, 21px); max-width: 52ch; }
.work-link {
  position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  font: 600 16px/1 var(--sans); color: var(--lajvard); text-decoration: none;
  border-bottom: 1.5px solid currentColor;
}
.work-link-label { color: var(--ink); }
.work-host { font-weight: 500; }
.work-link:hover .work-link-label { color: var(--lajvard); }

/* Screenshot frame: ruled like a manuscript page, nuqta at the four corners. */
.frame { position: relative; margin: 0 6% 0 0; }
.frame picture, .frame > picture img { display: block; }
.frame picture img { width: 100%; border: 1px solid var(--rule); background: var(--card); }
.corner {
  position: absolute; width: 12px; height: 12px; background: var(--lajvard);
  transform: translate(-50%, -50%) rotate(45deg); z-index: 2;
}
.c1 { left: 0; top: 0; }
.c2 { left: 100%; top: 0; }
.c3 { left: 0; top: 100%; }
.c4 { left: 100%; top: 100%; }
.phone {
  position: absolute; right: -6%; bottom: -10%; width: 21%; z-index: 3;
  border: 1px solid var(--ink); border-radius: 22px; overflow: hidden; background: var(--card);
  box-shadow: 0 0 0 6px var(--paper);
}
.phone img { width: 100%; }

/* Vorislar apps */
.apps { display: grid; gap: 20px; margin-top: clamp(40px, 8vh, 72px); }
.apps-title { font-size: 22px; letter-spacing: -0.01em; }
.apps-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px 20px; }
.app { display: grid; gap: 10px; align-content: start; }
.app-link { position: relative; display: grid; gap: 6px; text-decoration: none; }
.app-shot { display: block; border: 1px solid var(--rule); border-radius: 16px; overflow: hidden; background: var(--card); margin-bottom: 8px; }
.app-shot img { width: 100%; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.app-link:hover .app-shot img { transform: scale(1.03); }
.app-name { font: 700 20px/1.1 var(--sans); }
.app-host { font: 500 14px/1.3 var(--sans); color: var(--lajvard); overflow-wrap: anywhere; }
.app-link:hover .app-name { text-decoration: underline; text-underline-offset: 4px; }
.app-text { font-size: 15px; line-height: 1.5; color: var(--ink-2); }

/* ---------- Footer ---------- */
.foot {
  max-width: var(--max); margin: 0 auto; padding: 80px var(--gut) 48px;
  border-top: 1px solid var(--rule);
  display: grid; gap: 40px;
}
.wm-foot { width: min(560px, 70vw); height: auto; }
.wm-foot .wm-glyphs { fill: var(--ink); }
.foot-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px 40px; align-items: end; }
.foot-row p:first-child { font-size: 20px; }
.foot-small { font: 400 15px/1.5 var(--sans); color: var(--ink-2); }
.foot-small a { display: inline-flex; align-items: center; min-height: 44px; margin-left: 12px; color: var(--ink); }

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  .works { grid-template-columns: 1fr; }
  .fihrist { position: static; }
  .fihrist nav { display: none; }
  .works-list { margin-top: 64px; }
  .apps-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Phone ---------- */
@media (max-width: 720px) {
  body { font-size: 17px; }
  .top { padding: 6px 16px; }
  .top-nav a[href="#nuqta"] { display: none; }
  .top-nav a { padding: 0 8px; }
  .wm-small { height: 22px; }
  .hero { padding: 32px 16px 56px; }
  .hero-copy { grid-template-columns: 1fr; margin-top: 28px; }
  .lead { font-size: 30px; }
  .nuqta { grid-template-columns: 1fr; padding: 48px 16px; }
  .nuqta-stack { max-width: 64px; justify-self: start; }
  .works { padding: 48px 16px 96px; }
  .works-list { gap: 96px; margin-top: 48px; }
  .work-name { font-size: 44px; }
  .frame { margin: 0 auto; width: min(78%, 300px); }
  .frame picture img { border-radius: 22px; border-color: var(--ink); }
  .corner, .phone { display: none; }
  .apps-list {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 62%;
    overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px;
    margin: 0 -16px; padding-left: 16px; padding-right: 16px; scroll-padding-left: 16px;
  }
  .app { scroll-snap-align: start; }
  .foot { padding: 56px 16px 32px; }
  .foot-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .top, .fihrist nav, .phone, .corner { display: none; }
  body { background: #fff; color: #000; }
}

/* logo A (four nuqta + z) — header and footer */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--lajvard); }
.brand .logo-a { width: 40px; height: 40px; flex: none; }
.top-mark, .top-mark:hover { text-decoration: none; }
.brand-name { font-family: var(--sans); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; color: var(--ink); }
.brand-foot .logo-a { width: 72px; height: 72px; }
.brand-foot .brand-name { font-size: 40px; }
@media (max-width: 600px) { .brand .logo-a { width: 30px; height: 30px; } .brand-name { font-size: 20px; } }

/* the «zakiy» next to logo A keeps the rhombus nuqta i-dot (owner 11-10 msg 7930) */
.brand .brand-wm { height: 26px; width: auto; }
.brand .brand-wm .wm-glyphs { fill: var(--ink); }
.brand .brand-wm .wm-nuqta { fill: var(--lajvard); }
.brand-foot .brand-wm { height: 52px; }
@media (max-width: 600px) { .brand .brand-wm { height: 22px; } }
