/* Sarfaroz Oripov portfolio. Paper, ink and one signal colour. */
:root {
  --paper: #F2F0EB;
  --paper-2: #E9E6DE;
  --ink: #111111;
  --muted: #6B6862;
  --line: #D8D4CB;
  --line-2: #BDB7AB;
  --signal: #FF4F00;
  --on-signal: #111111;
  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --mono: "Martian Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --pad: clamp(16px, 3.2vw, 44px);
  --strip: 44px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
:root[data-theme="night"] {
  --paper: #0F0F0E;
  --paper-2: #181816;
  --ink: #ECE9E2;
  --muted: #9C978D;
  --line: #2B2A27;
  --line-2: #45423D;
  --signal: #FFB000;
  --on-signal: #111111;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--strip) + 8px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  background: var(--paper) url("../img/grain.png") repeat;
  color: var(--ink);
  font: 400 18px/1.55 var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
:root[data-theme="night"] body { background-image: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
kbd { font: inherit; }
::selection { background: var(--signal); color: var(--on-signal); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

.wrap { padding-inline: var(--pad); }
.mono { font-family: var(--mono); font-size: 11.5px; line-height: 1.55; letter-spacing: .02em; text-transform: uppercase; font-weight: 400; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 99; background: var(--signal); color: var(--on-signal); padding: 10px 14px; font: 500 12px var(--mono); }
.skip:focus { left: 8px; }
@media (max-width: 760px) { .hide-sm { display: none !important; } }
@media (max-width: 1100px) { .hide-md { display: none !important; } }

/* Status strip */
.strip {
  position: sticky; top: 0; z-index: 30; height: var(--strip);
  display: flex; align-items: stretch;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ink);
  font: 400 11px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase;
}
.strip > * { display: flex; align-items: center; gap: 8px; padding: 0 16px; border-right: 1px solid var(--line); white-space: nowrap; text-decoration: none; }
.strip > *:last-child { border-right: 0; }
.strip .grow { flex: 1; }
.strip a:hover, .s-btn:hover { background: var(--ink); color: var(--paper); }
.mark { display: grid; place-items: center; width: 24px; height: 24px; background: var(--signal); color: var(--on-signal); font: 400 13px/1 var(--serif); letter-spacing: 0; }
.s-btn { min-width: 44px; justify-content: center; }
.s-btn kbd { padding: 3px 5px; border: 1px solid currentColor; }
@media (max-width: 760px) { .strip > * { padding: 0 12px; } }

.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); }
@media (prefers-reduced-motion: no-preference) {
  .dot { animation: ping 1.6s var(--ease) 3; }
  @keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--signal) 55%, transparent); } 100% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--signal) 0%, transparent); } }
}

/* Hero */
.hero { border-bottom: 1px solid var(--ink); }
.hero-top { display: flex; justify-content: space-between; gap: 16px; padding-block: 14px; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; gap: 36px; padding-block: clamp(32px, 5vw, 64px) clamp(32px, 4.5vw, 56px); }
.hero-head { min-width: 0; }
@media (min-width: 1080px) { .hero-grid { grid-template-columns: minmax(0, 7fr) minmax(360px, 5fr); column-gap: 64px; row-gap: 44px; align-items: start; } .hero-head { grid-column: 1 / -1; } }
.name { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; font: 500 13px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
h1 { font-weight: 300; font-size: clamp(46px, 8vw, 128px); line-height: .95; letter-spacing: -.035em; max-width: 15ch; text-wrap: balance; }
h1 em, h2 em { font-style: italic; text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: .06em; text-underline-offset: .1em; }
.lede { max-width: 44ch; font-size: clamp(19px, 1.5vw, 22px); line-height: 1.45; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.cta-note { margin-top: 16px; }

.btn {
  display: inline-flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 22px;
  font: 500 12px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; text-decoration: none;
  border: 1px solid var(--ink); transition: background-color .2s, color .2s, border-color .2s, transform .25s var(--ease);
  will-change: transform;
}
.btn-signal { background: var(--signal); border-color: var(--signal); color: var(--on-signal); }
.btn-signal:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-line:hover { background: var(--ink); color: var(--paper); }

/* Build log */
.log { border: 1px solid var(--ink); background: var(--paper); font: 400 11.5px/1.6 var(--mono); box-shadow: 6px 6px 0 var(--ink); }
.log-head { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--ink); }
.log-body { list-style: none; padding: 12px 14px; min-height: 164px; }
.log-body li { display: grid; grid-template-columns: auto 76px 1fr; gap: 10px; padding: 2px 0; }
.log-body time { color: var(--muted); }
.log-body b { font-weight: 500; }
.log-body li.typing span::after { content: ""; display: inline-block; width: .6em; height: 1.05em; margin-left: 2px; vertical-align: -2px; background: var(--ink); }
.js .log-body li.pending { visibility: hidden; }
.log-foot { display: flex; border-top: 1px solid var(--line); }
.log-foot button { flex: 1; padding: 10px; text-transform: uppercase; letter-spacing: .06em; border-right: 1px solid var(--line); }
.log-foot button:last-child { border-right: 0; }
.log-foot button:hover { background: var(--ink); color: var(--paper); }
@media (max-width: 760px) { .log-body li { grid-template-columns: 64px 1fr; } .log-body time { display: none; } }

/* Proof strip */
.proof { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); overflow-x: auto; border-top: 1px solid var(--line); scrollbar-width: none; scroll-snap-type: x mandatory; }
.proof::-webkit-scrollbar { display: none; }
.proof a { display: block; padding: 14px; border-right: 1px solid var(--line); text-decoration: none; scroll-snap-align: start; }
.proof a:last-child { border-right: 0; }
.proof img { aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border: 1px solid var(--line); transition: transform .35s var(--ease); }
.proof a:hover img { transform: translateY(-4px); }
.proof figcaption { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }

/* Sections */
.sec { border-bottom: 1px solid var(--ink); }
.sec-head { display: grid; grid-template-columns: 44px 1fr auto; gap: 16px; align-items: baseline; padding-block: 26px 22px; border-bottom: 1px solid var(--line); }
h2 { font-weight: 300; font-size: clamp(36px, 5vw, 76px); line-height: 1; letter-spacing: -.03em; }
h3 { font-weight: 400; }

/* Index table */
.index { position: relative; }
.row {
  display: grid; grid-template-columns: 44px minmax(0, 2.1fr) minmax(0, 3fr) minmax(0, 2.4fr) minmax(0, 2.2fr) minmax(0, 1.7fr);
  gap: 20px; align-items: center; padding: 20px var(--pad); border-bottom: 1px solid var(--line);
  text-decoration: none; transition: background-color .16s, color .16s;
}
.row-head { padding-block: 12px; }
.row-group { padding-block: 14px; background: var(--paper-2); }
a.row:hover, a.row:focus-visible { background: var(--ink); color: var(--paper); outline: none; }
a.row:hover .muted, a.row:hover .mono { color: inherit; }
.p-name { font-size: clamp(24px, 2.3vw, 34px); line-height: 1.05; letter-spacing: -.02em; }
.p-what { font-size: 17px; line-height: 1.35; }
.c-link { justify-self: end; text-align: right; }
.row-thumb { display: none; }
@media (max-width: 960px) {
  .row { grid-template-columns: 34px 1fr; gap: 6px 14px; padding-block: 18px; }
  .row-head { display: none; }
  .row .p-what { grid-column: 2; }
  .row .c-stack, .row .c-result { display: none; }
  .row .c-link { grid-column: 2; justify-self: start; text-align: left; }
  .row-thumb { display: block; grid-column: 2; margin-top: 8px; border: 1px solid var(--line); aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
}
.preview {
  position: fixed; left: 0; top: 0; z-index: 40; width: 340px; pointer-events: none;
  border: 1px solid var(--ink); background: var(--paper); box-shadow: 8px 8px 0 var(--ink);
  opacity: 0; transform: translate3d(-999px, -999px, 0); scale: .92; transition: opacity .18s, scale .22s var(--ease);
}
.preview.on { opacity: 1; scale: 1; }
.preview img { aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
@media (hover: none), (pointer: coarse), (max-width: 960px) { .preview { display: none; } }

/* Case notes */
.case { display: grid; gap: 40px; padding-block: clamp(44px, 7vw, 96px); border-bottom: 1px solid var(--line); }
.case:last-child { border-bottom: 0; }
@media (min-width: 1080px) { .case { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: start; } }
.case h3 { margin-top: 12px; font-size: clamp(32px, 3.4vw, 54px); line-height: 1.03; letter-spacing: -.025em; text-wrap: balance; }
.outcome { margin-top: 18px; font-size: 20px; line-height: 1.5; max-width: 42ch; }
.spec { margin-top: 28px; border-top: 1px solid var(--ink); }
.spec div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.spec dt { font: 400 11px/1.9 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.spec dd { font-size: 17px; }
.notes { list-style: none; margin-top: 24px; display: grid; gap: 10px; font-size: 17px; }
.notes li { position: relative; padding-left: 26px; }
.notes li::before { content: "→"; position: absolute; left: 0; font-family: var(--mono); font-size: 13px; top: .2em; color: var(--muted); }
.case-visual { position: relative; }

/* Hunk call demo (keeps Hunk's own dark look) */
.call { --c-bg: #0d100f; --c-ink: #e9efe9; --c-mut: #8a968f; --c-green: #46c88b; background: var(--c-bg); color: var(--c-ink); border: 1px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); padding: 22px; }
.call-head { display: flex; justify-content: space-between; gap: 12px; color: var(--c-mut); }
.call-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--c-green); }
.wave { display: flex; align-items: center; gap: 4px; height: 56px; margin: 18px 0 14px; }
.wave i { flex: 1; height: 100%; background: var(--c-green); border-radius: 2px; transform: scaleY(var(--h, .3)); transform-origin: center; }
.wave i:nth-child(4n+1) { --h: .22; } .wave i:nth-child(4n+2) { --h: .55; } .wave i:nth-child(4n+3) { --h: .38; } .wave i:nth-child(6n) { --h: .7; } .wave i:nth-child(7n) { --h: .16; }
.call.live .wave i { animation: wave .9s ease-in-out infinite alternate; }
.wave i:nth-child(3n) { animation-delay: -.3s; } .wave i:nth-child(3n+1) { animation-delay: -.6s; } .wave i:nth-child(4n) { animation-duration: .7s; } .wave i:nth-child(5n) { animation-duration: 1.1s; }
@keyframes wave { from { transform: scaleY(.12); } to { transform: scaleY(1); } }
.call-lines { list-style: none; display: grid; gap: 10px; font: 400 16px/1.45 var(--serif); }
.call-lines li { max-width: 86%; padding: 12px 14px; border: 1px solid #2a312d; background: #141917; }
.call-lines li.from-ai { justify-self: end; background: #12261c; border-color: #1f4532; }
.call-lines b { display: block; margin-bottom: 4px; font-size: 10px; color: var(--c-mut); }
.call-lines .call-done { justify-self: stretch; max-width: none; text-align: center; color: #0d100f; background: var(--c-green); border-color: var(--c-green); }
.js .call-lines li.pending { opacity: 0; transform: translateY(8px); }
.call-lines li { transition: opacity .35s var(--ease), transform .35s var(--ease); }
.call-replay { margin-top: 16px; padding: 8px 12px; border: 1px solid #2a312d; color: var(--c-mut); }
.call-replay:hover { color: var(--c-ink); border-color: var(--c-ink); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--ink); background: var(--paper); }
.stats div { padding: 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats div:nth-child(2n) { border-right: 0; }
.stats div:nth-child(n+3) { border-bottom: 0; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } .stats div { border-bottom: 0; } .stats div:nth-child(2n) { border-right: 1px solid var(--line); } .stats div:last-child { border-right: 0; } }
.stats b { display: block; font: 300 clamp(34px, 3.4vw, 54px)/1 var(--serif); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stats span { display: block; margin-top: 8px; }
.shot { margin-top: 20px; border: 1px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); }

/* Prices */
.prices { list-style: none; }
.price { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 16px; align-items: baseline; padding-block: 22px; border-bottom: 1px solid var(--line); }
.price h3 { font-size: clamp(23px, 2.2vw, 32px); letter-spacing: -.015em; }
.leader { height: 1px; border-bottom: 1px dotted var(--line-2); transform: translateY(-5px); }
.val { white-space: nowrap; font-size: 12.5px; }
.price p { grid-column: 1 / -1; max-width: 62ch; color: var(--muted); font-size: 17px; }
.price-note { padding-block: 20px 26px; }
@media (max-width: 640px) { .price { grid-template-columns: 1fr; } .leader { display: none; } .val { white-space: normal; } }

/* Steps */
.steps { list-style: none; display: grid; gap: 0; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.steps li { padding: 26px 24px 30px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .steps li { border-bottom: 0; border-right: 1px solid var(--line); padding: 30px 28px 36px; } .steps li:first-child { padding-left: 0; } .steps li:last-child { border-right: 0; } }
.steps h3 { margin: 14px 0 8px; font-size: 25px; letter-spacing: -.015em; }
.steps p { color: var(--muted); font-size: 17px; }

/* About */
.about { display: grid; gap: 32px; padding-block: clamp(36px, 5vw, 64px); }
@media (min-width: 1080px) { .about { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; } }
.about-text p { font-size: clamp(21px, 1.9vw, 27px); line-height: 1.42; max-width: 40ch; }
.about-text p + p { margin-top: 18px; }
.about-facts { margin-top: 0; }

/* Contact */
.contact { padding-block: clamp(56px, 9vw, 130px); }
h2.big { margin-top: 18px; font-size: clamp(54px, 10vw, 168px); line-height: .9; letter-spacing: -.04em; }
.contact-lede { margin-top: 26px; max-width: 46ch; font-size: clamp(19px, 1.6vw, 23px); }

/* Footer */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding-block: 22px 32px; }

/* Command menu */
.cmdk { margin: 12vh auto auto; padding: 0; width: min(640px, calc(100vw - 32px)); border: 1px solid var(--ink); background: var(--paper); color: var(--ink); box-shadow: 10px 10px 0 var(--ink); }
.cmdk::backdrop { background: color-mix(in srgb, #111 35%, transparent); }
.cmdk input { width: 100%; padding: 18px; border: 0; border-bottom: 1px solid var(--ink); background: transparent; color: var(--ink); font: 400 14px var(--mono); outline: none; }
.cmdk ul { list-style: none; max-height: 52vh; overflow: auto; padding: 6px 0; }
.cmdk li { display: flex; justify-content: space-between; gap: 16px; padding: 11px 18px; font: 400 12px var(--mono); text-transform: uppercase; letter-spacing: .04em; cursor: pointer; }
.cmdk li[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.cmdk li .k { color: var(--muted); }
.cmdk li[aria-selected="true"] .k { color: inherit; opacity: .7; }
.cmdk-hint { display: flex; justify-content: space-between; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 10.5px; }
@media (max-width: 560px) { .cmdk-hint span:last-child { display: none; } }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 70; padding: 12px 16px; background: var(--ink); color: var(--paper); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s var(--ease); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Reveal on scroll (only when JS runs and motion is welcome) */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
  .js [data-reveal].in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .call.live .wave i { animation: none; transform: scaleY(.5); }
  .proof img, .btn { transition: none; }
}
