/* Swiss style (chosen 06.11): one font (Onest), strict grid, black lines, square corners, red used sparingly.
   The old look is kept in style.before-swiss.css. */
:root {
  --paper: #fafaf8;
  --paper-2: #f0f0ed;
  --ink: #0b0b0b;
  --muted: #5a5a57;
  --line: #d6d6d1;
  --accent: #e30613;
  --accent-deep: #b8040f;
  --focus: #e30613;
  --on-ink-muted: #9c9c97;

  --f-display: "Onest", system-ui, sans-serif;
  --f-text: "Onest", system-ui, sans-serif;
  --f-mono: "Onest", system-ui, sans-serif;

  --fs-section: clamp(2.5rem, 6.4vw, 5.5rem);
  --fs-job: clamp(1.3rem, 2.4vw, 1.75rem);
  --fs-body: clamp(1rem, 1.1vw, 1.125rem);
  --fs-label: .8125rem;

  --gutter: 16px;
  --pad: 16px;
  --gap-section: 64px;
  --nav-h: 64px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  /* two of twelve columns, measured inside .wrap */
  --indent: 0px;
}
@media (min-width: 768px) {
  :root { --gutter: 20px; --pad: 40px; --gap-section: 112px; }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
html { scroll-padding-top: var(--nav-h); }
body {
  background: var(--paper); color: var(--ink);
  font-family: var(--f-text); font-size: var(--fs-body); line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, canvas { display: block; }
a { color: inherit; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.wrap { max-width: 1320px; margin: 0 auto; padding: 0 var(--pad); }
.label { font-weight: 700; font-size: var(--fs-label); line-height: 1.3; letter-spacing: 0; }
.muted { color: var(--muted); }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 14px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- buttons: flat blocks, no pills ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 20px;
  font-weight: 700; font-size: 16px; text-decoration: none; white-space: nowrap;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn-ghost-light { border: 2px solid currentColor; color: var(--paper); }
.btn-ghost-light:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn-ghost-light:hover .arrow { transform: translateY(3px); }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; padding: 0 var(--pad);
  transition: background-color .3s var(--ease), box-shadow .3s var(--ease);
}
.nav.scrolled { background: color-mix(in srgb, var(--paper) 94%, transparent); box-shadow: 0 1px 0 var(--ink); }
.nav.on-ink { background: color-mix(in srgb, var(--ink) 94%, transparent); box-shadow: 0 1px 0 #333; color: var(--paper); }
.mark { font-weight: 800; font-size: 22px; letter-spacing: -.06em; text-decoration: none; line-height: 1; padding: 8px 0; }
.nav-right { display: flex; align-items: center; gap: 16px; }
.lang { display: flex; gap: 2px; }
.lang button { font-weight: 700; font-size: 14px; min-width: 36px; min-height: 40px; color: var(--muted); transition: color .2s; position: relative; }
.lang button:hover { color: currentColor; }
.lang button[aria-pressed="true"] { color: inherit; }
.lang button[aria-pressed="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 8px; height: 2px; background: var(--accent); }
.nav.on-ink .lang button { color: var(--on-ink-muted); }
.nav.on-ink .lang button[aria-pressed="true"] { color: var(--paper); }
.nav.on-ink .btn-primary { background: var(--paper); color: var(--ink); }
.nav.on-ink .btn-primary:hover { background: var(--accent); color: var(--paper); }

/* ---------- hero ---------- */
.hero-wrap { height: 220svh; position: relative; }
.hero-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; transform-origin: 50% 30%; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; }
.no-gl #gl { display: none; }
.no-gl .hero-stage { background: url("assets/me.png") 50% 30% / auto 115% no-repeat; }
main:focus { outline: none; }
/* first screen: only the animation + a small hint; the name rises in on scroll (main.js) */
.hero-hint { position: absolute; left: 0; right: 0; bottom: 64px; text-align: center; color: var(--muted); pointer-events: none; }
.scroll-cue { position: absolute; left: 50%; bottom: 24px; width: 2px; height: 28px; background: var(--line); overflow: hidden; transform: translateX(-50%); }
.scroll-cue span { position: absolute; left: 0; top: -100%; width: 2px; height: 100%; background: var(--ink); animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { to { top: 100%; } }
.hero-text {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end;
  gap: 20px; text-align: left; padding: 0 var(--pad) clamp(40px, 8svh, 96px); pointer-events: none;
}
.hero-name {
  /* "Тургунбоев" is about 5.6em wide in Onest 800, so 15vw stays inside the screen */
  font-weight: 800; font-size: clamp(2.8rem, 15vw, 13rem); max-width: 100%;
  line-height: .86; letter-spacing: -.06em;
}
.hero-role { font-weight: 600; font-size: clamp(1rem, 1.6vw, 1.35rem); border-top: 2px solid var(--ink); padding-top: 12px; width: min(560px, 100%); }
.hero-static .hero-hint, .hero-static .scroll-cue { display: none; }
.hero-static #gl { opacity: .18; }

/* ---------- sections ---------- */
.section { padding: 20px 0 var(--gap-section); border-top: 4px solid var(--ink); }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; margin-bottom: 40px; }
.sec-num { color: var(--ink); font-size: 1rem; }
.sec-title { font-weight: 800; font-size: var(--fs-section); line-height: .95; letter-spacing: -.05em; }
.sub-title { font-weight: 800; font-size: clamp(1.5rem, 2.8vw, 2.25rem); letter-spacing: -.04em; line-height: 1; margin-bottom: 20px; }
.job-title { font-weight: 800; font-size: var(--fs-job); line-height: 1.1; letter-spacing: -.03em; }
.sec-hint { color: var(--muted); font-weight: 500; flex-basis: 100%; }
@media (min-width: 960px) {
  :root { --indent: calc((100% + var(--gutter)) / 6); }
  .sec-head { display: grid; grid-template-columns: calc(var(--indent) - var(--gutter)) 1fr auto; column-gap: var(--gutter); margin-bottom: 56px; }
  .sec-hint { flex-basis: auto; text-align: right; max-width: 28ch; }
  /* content starts at column 3 of 12 */
  #about .wrap > :not(.sec-head), #experience .jobs, #skills .skill-grid,
  .contact .wrap > :not(.sec-head), .case:not(.has-media) { margin-left: var(--indent); }
}

/* reveal on scroll (added by main.js) */
.rv { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.rv.in { opacity: 1; transform: none; }

/* ---------- about ---------- */
.grid { display: grid; grid-template-columns: 1fr; gap: 48px; }
.about .grid > .sec-head { margin-bottom: 0; }
.about-lead { font-weight: 600; font-size: clamp(1.5rem, 3.2vw, 2.6rem); line-height: 1.12; letter-spacing: -.03em; max-width: 26ch; }
.about-blocks { display: grid; gap: 0 var(--gutter); }
.about-block { border-top: 1px solid var(--ink); padding: 14px 0 28px; display: grid; gap: 6px; align-content: start; }
.about-block .label { color: var(--accent); }
.about-block-t { font-weight: 800; font-size: 1.3rem; letter-spacing: -.03em; line-height: 1.1; }
.about-block-d { color: var(--muted); max-width: 52ch; hyphens: auto; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 28px var(--gutter); }
.fact { border-top: 1px solid var(--ink); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.fact-n { font-weight: 800; font-size: clamp(2.8rem, 4.8vw, 4.6rem); line-height: .9; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.fact:nth-child(2) .fact-n { color: var(--accent); }
.fact-pre { font-size: 14px; font-weight: 600; color: var(--muted); margin-right: 6px; letter-spacing: 0; vertical-align: middle; }
.fact-label { font-weight: 500; font-size: 15px; line-height: 1.3; max-width: 18ch; }
@media (min-width: 768px) {
  .about-blocks { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1100px) {
  .about-blocks { grid-template-columns: repeat(4, 1fr); }
  .facts { grid-template-columns: repeat(5, 1fr); }
}

/* ---------- experience: one line per job, the details open on hover / tap ---------- */
.jobs { border-bottom: 1px solid var(--ink); }
.job { position: relative; border-top: 1px solid var(--ink); }
.job::before { content: ""; position: absolute; left: 0; top: -1px; height: 3px; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.job.open::before { transform: scaleX(1); }
.job-head {
  width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: center;
  text-align: left; padding: 20px 0; min-height: 72px;
}
.job-date { color: var(--muted); grid-column: 1 / -1; font-weight: 600; }
.job-who { display: grid; gap: 4px; }
.job-company { color: var(--muted); font-size: 15px; }
.job-company b { color: var(--ink); font-weight: 700; }
.job.open .job-title { color: var(--accent); }
.job-title { transition: color .3s var(--ease); }
.job-teaser { display: none; }
.job .plus { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 2px solid currentColor; font-size: 18px; font-weight: 700; line-height: 1; transition: transform .4s var(--ease), background-color .3s, color .3s; }
.job.open .plus { transform: rotate(45deg); background: var(--ink); color: var(--paper); border-color: var(--ink); }
/* height animation without measuring: 0fr -> 1fr */
.job-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .55s var(--ease); }
.job.open .job-body { grid-template-rows: 1fr; }
.job-inner { overflow: hidden; }
.job-note { color: var(--muted); font-size: 14px; }
.points { display: grid; gap: 10px; padding: 4px 0 28px; max-width: 68ch; hyphens: auto; }
.points li { position: relative; padding-left: 22px; opacity: 0; transform: translateY(8px); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.job.open .points li { opacity: 1; transform: none; }
.job.open .points li:nth-child(2) { transition-delay: .05s; }
.job.open .points li:nth-child(3) { transition-delay: .1s; }
.job.open .points li:nth-child(4) { transition-delay: .15s; }
.job.open .points li:nth-child(5) { transition-delay: .2s; }
.job.open .points li:nth-child(6) { transition-delay: .25s; }
.points li::before { content: "-"; position: absolute; left: 0; top: 0; font-weight: 700; color: var(--accent); }
.toggle { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 8px; font-weight: 700; font-size: 14px; }
.toggle:hover { color: var(--accent); }
.toggle .plus { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 2px solid currentColor; line-height: 1; transition: transform .3s var(--ease); }
.toggle[aria-expanded="true"] .plus { transform: rotate(45deg); }
@media (min-width: 960px) {
  .job-head { grid-template-columns: 2fr 5fr 3fr auto; gap: 0 var(--gutter); }
  .job-date { grid-column: auto; }
  .job-teaser { display: flex; flex-wrap: wrap; gap: 2px 12px; justify-content: flex-end; }
  .job-inner { padding-left: calc((100% - 3 * var(--gutter) - 32px) * 2 / 10 + var(--gutter)); }
}

/* ---------- chips: plain bold words, no pills ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: auto; padding-top: 4px; }
.chip { font-weight: 700; font-size: 13px; line-height: 1.3; }
.job-teaser .chip { color: var(--muted); font-weight: 600; }

/* ---------- cases ---------- */
.case-grid { display: grid; gap: 72px; }
.case-client { color: var(--accent); }
.case-title { font-weight: 800; font-size: clamp(1.7rem, 3vw, 2.6rem); line-height: 1; letter-spacing: -.045em; }
.case-rows { display: grid; gap: 14px; }
.case-row { display: grid; gap: 2px; }
.case-row .label { color: var(--ink); }
.case-back { position: relative; padding-top: 14px; }
.case-back::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); }
.case-body { display: flex; flex-direction: column; gap: 16px; border-top: 1px solid var(--ink); padding-top: 14px; }
.case.has-media .case-body { margin-top: 20px; }
/* photos keep their real shape, nothing cropped */
.case-photos { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 4px; align-items: center; }
.case-photos img { width: 100%; height: auto; max-height: min(80svh, 720px); object-fit: contain; object-position: left center; }
/* old Ucell dots visual (not used now) */
.case-dots { background: var(--ink); color: var(--paper); padding: 24px; display: grid; gap: 16px; align-content: center; }
.dots { display: grid; grid-template-columns: repeat(40, 1fr); gap: 3px; }
.dots i { aspect-ratio: 1; border-radius: 50%; background: #3a3a3f; }
.case.in .dots i { background: var(--accent); }
@media (min-width: 960px) {
  /* photo on 7 columns, text on the last 4, sides swap every other case */
  .case.has-media { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); column-gap: calc((100% + var(--gutter)) / 12 + var(--gutter)); align-items: start; }
  .case.has-media:nth-child(even) { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); }
  .case.has-media:nth-child(even) > :first-child { order: 2; }
  .case.has-media:nth-child(even) .case-photos img { object-position: right center; }
  .case.has-media .case-body { margin-top: 0; }
  .case:not(.has-media) .case-body { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--gutter); }
  .case:not(.has-media) .case-client, .case:not(.has-media) .case-title { grid-column: 1 / -1; }
  .case:not(.has-media) .case-rows { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; column-gap: var(--gutter); }
  .case:not(.has-media) .case-back { padding-top: 0; }
  .case:not(.has-media) .case-back::before { display: none; }
}

/* ---------- skills ---------- */
.skill-grid { display: grid; gap: 32px var(--gutter); }
.skill-group h3 { font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em; margin-bottom: 12px; padding-top: 12px; border-top: 1px solid var(--ink); }
.skill-group .chips { flex-direction: column; gap: 6px; }
.skill-group .chip { font-weight: 500; font-size: 15px; }
@media (min-width: 768px) { .skill-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .skill-grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- education + community ---------- */
.edu-grid { display: grid; gap: 56px; }
.edu-card { border-top: 1px solid var(--ink); padding-top: 14px; display: grid; gap: 8px; max-width: 46ch; }
.edu-card .label { color: var(--accent); }
.edu-card-2 { margin-top: 32px; }
.events-more li { padding: 6px 0; }
.comm { border-top: 1px solid var(--ink); padding: 14px 0 22px; }
.comm-name { font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; margin-bottom: 4px; }
.events li { padding: 5px 0; display: flex; gap: 10px; }
.events li::before { content: "-"; color: var(--accent); font-weight: 700; }
.events li.more { color: var(--muted); }
@media (min-width: 960px) {
  .edu-grid { grid-template-columns: 1fr 1fr; gap: var(--gutter) calc(var(--gutter) * 3); }
  .edu .sec-head { display: flex; }
  .edu-grid > div:last-child { padding-top: calc(var(--fs-section) * .95 + 56px); }
}

/* ---------- contact (black band) ---------- */
.contact { padding: 20px 0 var(--gap-section); border-top: 4px solid var(--ink); background: var(--paper); color: var(--ink); transition: background-color .6s var(--ease), color .6s var(--ease); }
.contact.dark { background: var(--ink); color: var(--paper); }
.contact :focus-visible { outline-color: var(--accent); }
.contact .sec-num { color: inherit; }
.contact-lead { color: var(--on-ink-muted); max-width: 52ch; margin: -16px 0 32px; font-weight: 500; }
.contact:not(.dark) .contact-lead { color: var(--muted); }
.contact-list { border-bottom: 1px solid #3a3a3a; margin-bottom: 40px; }
.contact-list li { border-top: 1px solid #3a3a3a; }
.contact-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; padding: 16px 0;
  text-decoration: none; transition: color .25s var(--ease), padding-left .3s var(--ease);
}
.contact-row .label { color: var(--on-ink-muted); width: 92px; flex: none; }
.contact-val { font-weight: 800; font-size: clamp(1.15rem, 3.4vw, 2.6rem); letter-spacing: -.04em; overflow-wrap: anywhere; flex: 1; }
.contact-row .arrow { font-size: 1.4rem; transition: transform .3s var(--ease); }
a.contact-row:hover { color: var(--accent); padding-left: 8px; }
a.contact-row:hover .arrow { transform: translate(4px, -4px); }
.contact-row.soon .contact-val { color: var(--on-ink-muted); }
.contact:not(.dark) .contact-row .label,
.contact:not(.dark) .contact-row.soon .contact-val { color: var(--muted); }
.contact:not(.dark) .contact-list, .contact:not(.dark) .contact-list li { border-color: var(--ink); }
.contact:not(.dark) .btn-ghost-light { color: var(--ink); }
.contact.dark .contact-list, .contact.dark .contact-list li { border-color: #3a3a3a; }

/* ---------- footer ---------- */
.footer { background: var(--ink); color: var(--on-ink-muted); padding: 28px 0 32px; border-top: 1px solid #2a2a2a; font-size: 14px; font-weight: 500; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.footer a { color: var(--paper); text-underline-offset: 4px; }
.footer :focus-visible { outline-color: var(--paper); }

/* ---------- ?tune panel ---------- */
.tune {
  position: fixed; right: 16px; bottom: 16px; z-index: 200; width: min(320px, calc(100vw - 32px));
  background: #fff; color: var(--ink); border: 2px solid var(--ink); padding: 16px;
  font-size: 14px; display: grid; gap: 10px;
}
.tune-title { font-weight: 800; font-size: 16px; }
.tune-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; }
.tune-row output { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tune-row input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
.tune-check { display: flex; gap: 8px; align-items: center; }
.tune-btns { display: flex; gap: 8px; }
.tune-btns button { flex: 1; min-height: 40px; border: 2px solid var(--ink); font-weight: 700; }
.tune-btns [data-copy] { background: var(--ink); color: #fff; }
.tune-note { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .rv { opacity: 1; transform: none; }
}
