/* ===== English font: Origin (Text for body/UI, Display for headlines) ===== */
@font-face { font-family: 'Origin'; src: url('assets/fonts/Origin-BoldText.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Origin'; src: url('assets/fonts/Origin-ExtraBoldText.woff2') format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Origin'; src: url('assets/fonts/Origin-BlackText.woff2') format('woff2'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'Origin Display'; src: url('assets/fonts/Origin-ExtraLightDisplay.woff2') format('woff2'); font-weight: 200; font-display: swap; }
@font-face { font-family: 'Origin Display'; src: url('assets/fonts/Origin-BoldDisplay.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Origin Display'; src: url('assets/fonts/Origin-ExtraBoldDisplay.woff2') format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Origin Display'; src: url('assets/fonts/Origin-BlackDisplay.woff2') format('woff2'); font-weight: 900; font-display: swap; }

/* ===== Georgian font: Mersad (variable, weights 100-900) ===== */
@font-face { font-family: 'Mersad'; src: url('assets/fonts/Mersad-Variable.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
/* FiraGO is only a fallback for symbols Mersad/Origin lack (arrows, №) */
@font-face { font-family: 'FiraGO'; src: url('assets/fonts/FiraGO-Regular.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

/* ===== Theme tokens ===== */
:root, [data-theme="dark"] {
  --bg: #0a0b0d;
  --surface: #141518;
  --surface-2: #1b1c20;
  --line: rgba(255,255,255,.10);
  --text: #eeeeec;
  --muted: #9b9ba1;
  --btn-bg: #eeeeec;
  --btn-text: #0a0b0d;
  --chip: #1a1b1f;
  --cur-fill: rgba(255,255,255,.22);
  --cur-line: rgba(255,255,255,.30);
  --ph-a: #1a1c21; --ph-b: #101114;
  --shadow: 0 50px 100px -30px rgba(0,0,0,.95), 0 22px 46px -20px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.07);
}
[data-theme="light"] {
  --bg: #f4f3f0;
  --surface: #ffffff;
  --surface-2: #ecebe7;
  --line: rgba(0,0,0,.10);
  --text: #111113;
  --muted: #6c6c72;
  --btn-bg: #111113;
  --btn-text: #f4f3f0;
  --chip: #ebeae6;
  --cur-fill: rgba(0,0,0,.16);
  --cur-line: rgba(0,0,0,.24);
  --ph-a: #e4e3df; --ph-b: #d9d8d3;
  --shadow: 0 50px 90px -34px rgba(20,20,30,.32), 0 20px 40px -22px rgba(20,20,30,.22), 0 2px 6px rgba(20,20,30,.06);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: 'Origin', 'Mersad', 'FiraGO', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background .5s ease, color .5s ease;
}
[data-theme="light"] body { background: linear-gradient(to bottom, #fff 0%, #f1f0ed 55%, #e5e4e0 100%); }
html[lang="ka"] body { letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
img { display: block; max-width: 100%; }
::selection { background: var(--text); color: var(--bg); }

/* custom cursor only for mouse devices */
@media (hover: hover) and (pointer: fine) {
  html.has-cursor, html.has-cursor * { cursor: none !important; }
}

/* ===== Cursor ===== */
#cursor {
  position: fixed; left: 0; top: 0; z-index: 9999;
  pointer-events: none; opacity: 0;
  transition: opacity .3s ease;
  will-change: transform;
}
#cursor.on { opacity: 1; }
#cursor i {
  position: absolute; left: -22px; top: -22px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--cur-fill);
  border: 1px solid var(--cur-line);
  -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px);
  transition: transform .45s cubic-bezier(.2,.8,.2,1), background .3s ease, border-color .3s ease;
}
#cursor.down i { transform: scale(.72); transition-duration: .15s; }
#cursor.hover { mix-blend-mode: difference; }
#cursor.hover i { transform: scale(2.1); background: #fff; border-color: #fff; }
#cursor.hover.down i { transform: scale(1.6); }

/* ===== Nav ===== */
.nav-wrap { position: fixed; top: 14px; left: 0; right: 0; z-index: 100; display: flex; justify-content: center; pointer-events: none; }
.nav {
  position: relative;
  pointer-events: auto;
  display: flex; align-items: center; gap: 4px;
  padding: 6px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
}
.nav::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 7px;
  bottom: 7px;
  left: 0;
  width: var(--pill-width, 0);
  border-radius: 999px;
  background: var(--surface-2);
  transform: translateX(var(--pill-x, 0));
}
.nav.pill-ready::before { transition: transform .45s ease-in-out, width .45s ease-in-out; }
.nav a, .nav-btn {
  position: relative;
  z-index: 1;
  padding: 8px 14px; border-radius: 999px; color: var(--muted);
  transition: background .3s, color .3s; display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap;
}
.nav a:hover, .nav-btn:hover { color: var(--text); }
.nav a.active { color: var(--text); }
.nav .nav-logo { padding: 7px 12px 7px 10px; }
.nav-logo img { height: 18px; width: auto; }
.logo-l { display: none; }
[data-theme="light"] .logo-d { display: none; }
[data-theme="light"] .logo-l { display: block; }
.nav-btn { padding: 9px 12px; font-size: 12px; font-weight: 600; letter-spacing: .04em; min-width: 38px; }

/* ===== Layout ===== */
#view { min-height: 100vh; padding: 0 clamp(16px, 2.6vw, 40px); transition: opacity .35s ease, filter .35s ease; }
#view.leaving { opacity: 0; filter: blur(10px); }
.wrap { max-width: 1240px; margin: 0 auto; }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; line-height: 1.05; text-transform: uppercase; }
html[lang="ka"] h1, html[lang="ka"] h2, html[lang="ka"] h3 { letter-spacing: -.015em; line-height: 1.15; }
p { margin: 0; }

/* ===== Reveal (blur → sharp) ===== */
.rv { opacity: 0; filter: blur(14px); transform: translateY(30px);
  transition: opacity 1.3s cubic-bezier(.2,.7,.2,1) var(--d,0s), filter 1.3s cubic-bezier(.2,.7,.2,1) var(--d,0s), transform 1.3s cubic-bezier(.2,.7,.2,1) var(--d,0s); }
.rv.in { opacity: 1; filter: blur(0); transform: none; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 19px; border-radius: 999px; font-size: 13px; font-weight: 500; border: 1px solid var(--text); transition: background .3s, color .3s; }
.btn.primary { background: var(--btn-bg); color: var(--btn-text); }
.btn.ghost { color: var(--text); }
.chip { display: inline-block; padding: 8px 14px; border-radius: 999px; background: var(--chip); font-size: 13px; font-weight: 500; }
.chip.outline { background: none; border: 1px solid var(--line); font-weight: 400; }
.label { font-family: inherit; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ===== Home: title page ===== */
.title-page { min-height: 100svh; max-width: 1680px; margin: 0 auto; padding: 88px 0 5vh; display: flex; flex-direction: column; }
.tp-meta { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; font-size: 13px; line-height: 1.55; color: var(--muted); margin-bottom: clamp(28px, 5vh, 60px); }
.tp-meta > div:nth-child(2) { text-align: left; }
.tp-meta > div:nth-child(3) { justify-self: end; }
.tp-word { margin: 0; font-weight: 200; text-transform: none !important; letter-spacing: -.005em; line-height: 1; white-space: nowrap; font-size: 18vw; overflow: hidden; padding-bottom: .16em; margin-bottom: -.16em; }
.tp-word > span { display: inline-block; }
.tp-word .ch { display: inline-block; transform: translateY(110%); animation: rise 1.2s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: calc(var(--i) * 70ms + .15s); }
@keyframes rise { to { transform: none; } }
.tp-foot { margin-top: auto; padding-top: 10vh; text-align: center; }
.tp-name { font-size: clamp(18px, 1.7vw, 24px); font-weight: 500; }
.tp-small { margin-top: 26px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.tp-small b { color: var(--text); font-weight: 500; }

/* ===== Home: intro (name / contacts / text) ===== */
.intro { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 5vw, 80px); padding: 10vh 0 6vh; align-items: start; }
.intro .pre { font-size: clamp(24px, 2.8vw, 38px); font-weight: 300; line-height: 1.2; text-transform: uppercase; }
.intro-name { font-size: clamp(30px, 4.2vw, 58px); font-weight: 200; line-height: 1.08; margin-top: clamp(24px, 4vw, 52px); }
.intro h3 { font-size: 16px; font-weight: 600; letter-spacing: .01em; margin: 0 0 16px; }
.kv { display: flex; align-items: baseline; gap: 18px; margin-bottom: 14px; font-size: 14px; flex-wrap: wrap; }
.kv b { font-size: 16px; font-weight: 600; min-width: 62px; }
.intro .edu { margin-top: 38px; }
.erow { display: grid; grid-template-columns: 112px 1fr; gap: 14px; padding: 7px 0; font-size: 14px; }
.erow span:first-child { color: var(--muted); }
.intro-text .tag { font-size: 15px; font-weight: 500; margin-bottom: 14px; }
.intro-text .sub { color: var(--muted); font-size: 14px; max-width: 46ch; margin-bottom: 24px; }
.intro-text .row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== Home: selected work ===== */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 4vh 0 28px; }
.sec-head h2 { font-size: clamp(28px, 3.3vw, 42px); }
.arrows { display: flex; gap: 8px; }
.arrow { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--text); display: grid; place-items: center; font-size: 17px; transition: opacity .3s, background .3s; }
.arrow[disabled] { opacity: .3; border-color: var(--line); }
.track { display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-right: calc(50% - 50vw); padding-right: calc(50vw - 50%); scroll-behavior: smooth; }
.track::-webkit-scrollbar { display: none; }
@media (min-width: 901px) and (hover: hover) and (pointer: fine) { .track { cursor: grab; } }
.track img { -webkit-user-drag: none; user-select: none; }
.track.dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; user-select: none; }
.track.dragging .card { pointer-events: none; }
.card { flex: 0 0 min(36vw, 480px); scroll-snap-align: start; display: block; }
.card-media { aspect-ratio: 4/3; border-radius: 22px; overflow: hidden; background: var(--surface); position: relative; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s cubic-bezier(.2,.7,.2,1); }
.card-media.full-cover { background: var(--cover-background, #e8dfd2); }
.card:hover .card-media img, .card:hover .ph { transform: scale(1.035); }
.card:hover .card-media.full-cover img { transform: none; }
.card-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: 14px; }
.card-meta b { font-weight: 600; text-transform: uppercase; }
.card-meta span { color: var(--muted); font-size: 13px; }
.progress { height: 1px; background: var(--line); margin-top: 38px; position: relative; }
.progress i { position: absolute; left: 0; top: 0; height: 1px; background: var(--text); width: 20%; transition: width .2s linear, transform .2s linear; }

/* placeholders until real images are added */
.ph { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, var(--ph-a), var(--ph-b)); color: var(--muted); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; transition: transform 1.1s cubic-bezier(.2,.7,.2,1); }

/* ===== About ===== */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; padding: 96px 0 70px; align-items: start; }
.about-l .photo { border-radius: 24px; overflow: hidden; aspect-ratio: 1/1.05; background: var(--surface); }
.about-l .photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.about-l .bio { margin-top: 34px; font-size: clamp(15px, 1.2vw, 17px); line-height: 1.55; max-width: 56ch; }
.about-l .bio p + p { margin-top: 18px; }
.about-l .links { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 8px; }
.resume { position: sticky; top: 76px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: clamp(22px, 2.4vw, 36px); box-shadow: var(--shadow); }
.resume h2 { font-size: 21px; padding-bottom: 22px; border-bottom: 1px solid var(--line); margin-bottom: 8px; letter-spacing: -.02em; }
.resume h3 { font-size: 17px; letter-spacing: -.01em; margin: 32px 0 14px; }
.item { display: flex; justify-content: space-between; gap: 18px; padding: 10px 0; }
.item b { font-weight: 500; display: block; }
.item small { color: var(--muted); font-size: 13px; display: block; }
.item time { color: var(--muted); font-size: 14px; white-space: nowrap; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.cert { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 15px; transition: opacity .3s; }
.cert:first-of-type { border-top: 0; }
.cert > span:last-child { color: var(--muted); flex: none; }
.cert-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cert-name .ico { width: 24px; height: 24px; }
.cert:hover { opacity: .65; }
.resume .dl { margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--line); }

/* ===== Project page ===== */
.proj { padding: 96px 0 40px; }
.back { font-size: 13px; color: var(--muted); display: inline-block; margin-bottom: 22px; }
.back:hover { color: var(--text); }
.proj-cover { border-radius: 22px; overflow: hidden; aspect-ratio: 16/8; background: var(--surface); }
.proj-cover img, .proj-cover .ph { width: 100%; height: 100%; object-fit: cover; }
.proj-cover.full-cover { aspect-ratio: auto; }
.proj-cover.full-cover img { height: auto; }
.proj-top { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; margin: 36px 0 46px; align-items: start; }
.proj-top h1 { font-size: clamp(26px, 3.2vw, 42px); }
.proj-top .desc { color: var(--muted); max-width: 62ch; margin-top: 22px; }
.proj-top .desc p + p { margin-top: 14px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 30px; font-size: 14px; }
.facts .label { display: block; margin-bottom: 4px; }
.gallery { display: grid; gap: 18px; }
.gallery .g { border-radius: 22px; overflow: hidden; background: var(--surface); }
.gallery .g img { width: 100%; height: auto; }
.gallery .g.ph-wrap { aspect-ratio: 16/9; }
.brandbook { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.pn { display: flex; justify-content: space-between; gap: 20px; padding: 60px 0 10px; font-size: 15px; }
.pn a { transition: opacity .3s; } .pn a:hover { opacity: .6; }

/* ===== Footer ===== */
footer { padding: 0 clamp(16px, 2.6vw, 40px); border-top: 1px solid var(--line); margin-top: 12vh; }
.f-top { padding: 9vh 0 0; }
.f-mail { font-size: clamp(20px, 2.4vw, 36px); font-weight: 600; letter-spacing: -.04em; line-height: 1; word-break: break-word; display: inline-block; }
.f-row { display: flex; align-items: center; gap: 14px; margin-top: 30px; color: var(--muted); font-size: 15px; flex-wrap: wrap; }
.soc { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--text); transition: background .3s; }
.soc:hover { background: var(--surface-2); }
.f-cols { display: grid; grid-template-columns: 1fr 1.2fr 1.2fr; gap: 30px; border-top: 1px solid var(--line); margin-top: 9vh; padding: 40px 0; font-size: 15px; }
.f-cols .label { display: block; text-transform: none; letter-spacing: .02em; font-family: inherit; font-size: 13px; margin-bottom: 14px; }
.f-cols a { display: block; padding: 4px 0; transition: opacity .3s; } .f-cols a:hover { opacity: .6; }
.copy { color: var(--muted); font-size: 13px; padding: 0 0 34px; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .intro { grid-template-columns: 1fr; gap: 34px; padding-top: 6vh; }
  .tp-meta { grid-template-columns: 1fr 1fr; }
  .tp-meta > div:nth-child(2) { display: none; }
  .card { flex-basis: 82vw; }
  .about { grid-template-columns: 1fr; padding-top: 96px; }
  .resume { position: static; }
  .proj-top { grid-template-columns: 1fr; gap: 28px; }
  .f-cols { grid-template-columns: 1fr 1fr; }
  .nav a { padding: 9px 11px; }
}
@media (max-width: 520px) {
  .nav-wrap { padding: 0 8px; }
  .nav { gap: 0; padding: 4px; max-width: 100%; font-size: 11px; }
  .nav a, .nav-btn { padding: 8px 9px; }
  .nav .nav-logo { padding: 7px 8px; }
  .nav-btn { min-width: 0; padding: 8px 9px; }
  html[lang="ka"] .nav a { font-size: 10.5px; letter-spacing: 0; }
  .f-cols { grid-template-columns: 1fr; }
  .item { flex-direction: column; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .rv { transition: none; opacity: 1; filter: none; transform: none; }
  .tp-word .ch { animation: none; transform: none; }
  .depth { transform: none !important; opacity: 1 !important; filter: none !important; }
  .nav.pill-ready::before { transition: none; }
}

/* ===== Depth reveal: panels rise out of the background as you scroll ===== */
.depth {
  --p: 1;
  transform-origin: 50% 100%;
  transform: perspective(1400px) translate3d(0, calc((1 - var(--p)) * 80px), calc((1 - var(--p)) * -280px)) rotateX(calc((1 - var(--p)) * 10deg));
  opacity: calc(.1 + var(--p) * .9);
  filter: blur(calc((1 - var(--p)) * 10px));
  will-change: transform, opacity, filter;
}

/* ===== Georgian: Mersad + Mtavruli capitals (converted in JavaScript) ===== */
html[lang="ka"] body { font-family: 'Origin', 'Mersad', 'FiraGO', system-ui, sans-serif; text-transform: none; letter-spacing: .02em; }
/* Mersad's case feature also selects its Georgian capital forms. */
html :lang(ka) { font-feature-settings: "case" 1; }
html[lang="ka"] .f-mail, html[lang="ka"] .f-row a[href^="tel"] { text-transform: none; letter-spacing: 0; }
html[lang="ka"] h1, html[lang="ka"] h2, html[lang="ka"] h3 { letter-spacing: -.005em; line-height: 1.2; }

html[lang="ka"] .chip, html[lang="ka"] .btn, html[lang="ka"] .nav a { font-size: 12px; }
html[lang="ka"] .sec-head h2 { font-size: clamp(24px, 2.6vw, 34px); }
html[lang="ka"] .proj-top h1 { font-size: clamp(22px, 2.4vw, 32px); }

html[lang="ka"] .item b { font-weight: 600; }
html[lang="ka"] [lang="en"] { text-transform: none; letter-spacing: 0; }   /* keep Latin brand/tool names as written */

html[lang="ka"] .kv a, html[lang="ka"] .tp-small b { text-transform: none; }

/* headlines use the Display cut of Origin */
h1, h2, h3, .tp-word, .intro-name, .pre, .card-meta b, .f-mail { font-family: 'Origin Display', 'Origin', 'Mersad', 'FiraGO', sans-serif; }

html[lang="ka"] .f-cols .label { text-transform: uppercase; }

/* social icons */
.ico { width: 1.15em; height: 1.15em; flex: none; display: block; }
.soc .ico { width: 20px; height: 20px; }
.chip.outline { display: inline-flex; align-items: center; gap: 8px; }
.chip.outline .ico { width: 16px; height: 16px; }
