/* ─── Variables ──────────────────────────────────────────────────────────── */
:root {
  --bg:      #0C0C0B;
  --fg:      #EDE8DF;
  --dim:     rgba(237,232,223,.4);
  --line:    rgba(237,232,223,.1);
  --card-bg: #161615;
  --font:    'Plus Jakarta Sans', system-ui, sans-serif;
  --nav-h:   56px;
  --ease:    cubic-bezier(.25,.46,.45,.94);
  --ease-out: cubic-bezier(.16,1,.3,1);
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
  -webkit-font-smoothing: antialiased;
}
body.is-loading { overflow: hidden; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }
button { font-family: var(--font); cursor: none; }

/* ─── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }

/* ─── Cursor ─────────────────────────────────────────────────────────────── */
.cursor {
  position: fixed;
  width: 8px; height: 8px;
  background: var(--fg);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9000;
  transform: translate(-50%, -50%);
  transition: width .2s var(--ease), height .2s var(--ease), opacity .2s;
  mix-blend-mode: difference;
}
body.cur-big .cursor { width: 36px; height: 36px; }

/* ─── Preloader ──────────────────────────────────────────────────────────── */
.preloader {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 8000;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .7s var(--ease), visibility .7s;
}
.preloader.out { opacity: 0; visibility: hidden; }
.preloader span {
  font-size: clamp(28px, 6vw, 72px);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--fg);
  opacity: 0;
  animation: fade-up .6s var(--ease-out) .2s forwards;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Nav ────────────────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  padding: 0 36px;
  display: flex; align-items: center; justify-content: space-between;
  z-index: 700;
  transition: border-bottom .3s;
}
.nav.solid {
  border-bottom: 1px solid var(--line);
  background: rgba(12,12,11,.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.nav-logo {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .06em;
}
.nav-links {
  display: flex; gap: 26px; align-items: center;
}
.nav-links a {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
  transition: color .2s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--fg); }

.nav-burger {
  display: none;
  flex-direction: column; gap: 5px;
  background: none; border: none; padding: 6px;
}
.nav-burger span {
  display: block; width: 20px; height: 1.5px;
  background: var(--fg);
  transition: transform .3s var(--ease), opacity .3s;
}
.nav-burger.open span:nth-child(1) { transform: rotate(45deg) translate(4.5px, 4.5px); }
.nav-burger.open span:nth-child(2) { opacity: 0; }

/* ─── Mobile Nav ─────────────────────────────────────────────────────────── */
.mobile-nav {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 600;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity .35s var(--ease), visibility .35s;
}
.mobile-nav.open { opacity: 1; visibility: visible; }
.mobile-nav li { overflow: hidden; }
.mobile-nav a {
  display: block;
  font-size: clamp(28px, 6vw, 52px);
  font-weight: 800;
  letter-spacing: -.02em;
  padding: 5px 0;
  opacity: 0; transform: translateY(18px);
  transition: opacity .35s var(--ease), transform .35s var(--ease), color .2s;
  color: var(--dim);
}
.mobile-nav a:hover { color: var(--fg); }
.mobile-nav.open a { opacity: 1; transform: translateY(0); }
.mobile-nav li:nth-child(1)  a { transition-delay: .03s }
.mobile-nav li:nth-child(2)  a { transition-delay: .06s }
.mobile-nav li:nth-child(3)  a { transition-delay: .09s }
.mobile-nav li:nth-child(4)  a { transition-delay: .12s }
.mobile-nav li:nth-child(5)  a { transition-delay: .15s }
.mobile-nav li:nth-child(6)  a { transition-delay: .18s }
.mobile-nav li:nth-child(7)  a { transition-delay: .21s }
.mobile-nav li:nth-child(8)  a { transition-delay: .24s }
.mobile-nav li:nth-child(9)  a { transition-delay: .27s }

/* ─── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  padding: var(--nav-h) 36px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.hero-name {
  font-size: clamp(72px, 14.5vw, 200px);
  font-weight: 800;
  line-height: .9;
  letter-spacing: -.03em;
  margin-top: 40px;
}
.hero-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  margin-top: 32px;
}
.hero-role {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
}
.hero-year {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--dim);
}

/* ─── Section ────────────────────────────────────────────────────────────── */
.section {
  padding: 100px 36px;
  border-top: 1px solid var(--line);
  transition: padding .5s var(--ease-out);
}
.section.collapsed {
  padding: 36px 36px;
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 48px;
  cursor: pointer;
  user-select: none;
  transition: margin-bottom .5s var(--ease-out);
}
.section.collapsed .section-head {
  margin-bottom: 0;
  align-items: center;
}
.section-head:hover .section-title { opacity: .7; }
.section.collapsed .section-title { font-size: clamp(20px, 2.2vw, 32px); }
.section-toggle {
  margin-left: auto;
  flex-shrink: 0;
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--fg);
  transition: border-color .3s var(--ease), transform .4s var(--ease-out);
  align-self: center;
}
.section-head:hover .section-toggle { border-color: rgba(237,232,223,.3); }
.section-toggle svg {
  transition: transform .4s var(--ease-out);
  transform: rotate(45deg);
}
.section.collapsed .section-toggle svg { transform: rotate(0deg); }
.section-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows .5s var(--ease-out);
  overflow: hidden;
}
.section.collapsed .section-body {
  grid-template-rows: 0fr;
}
.section-body-inner { min-height: 0; }
.section-num {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--dim);
  flex-shrink: 0;
}
.section-title {
  font-size: clamp(36px, 5.5vw, 76px);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1;
  transition: font-size .5s var(--ease-out);
}

/* ─── Grid ───────────────────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(280px, 20vw, 480px), 1fr));
  gap: 16px;
  align-items: start;
  grid-auto-rows: 1px;
}

/* ─── Card ───────────────────────────────────────────────────────────────── */
.card {
  position: relative;
  overflow: hidden;
  background: var(--card-bg);
  border-radius: 2px;
  aspect-ratio: 4 / 3;
  cursor: none;
}
.card.tall { aspect-ratio: 3 / 4; }
.card.wide { grid-column: span 2; aspect-ratio: 16 / 9; }
.card.full { grid-column: span 3; aspect-ratio: 21 / 9; }

.card img,
.card video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1);
  transition: transform .7s var(--ease-out), filter .6s var(--ease);
}
.card:hover img,
.card:hover video {
  transform: scale(1.04);
  filter: grayscale(0);
}

.card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(12,12,11,.85) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .32s var(--ease);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 22px;
}
.card:hover .card-overlay { opacity: 1; }

.card-cat {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(237,232,223,.5);
  margin-bottom: 6px;
}
.card-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.card-subtitle {
  display: block;
  font-size: 9px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(237,232,223,.5); margin-top: 2px;
}
.card-year {
  font-size: 10px;
  font-weight: 400;
  color: rgba(237,232,223,.45);
  margin-top: 4px;
}

/* Empty state */
.grid-empty {
  grid-column: 1 / -1;
  height: 140px;
  border: 1px dashed var(--line);
  border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
}
.grid-empty span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ─── Reveal ─────────────────────────────────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: none; }

/* ─── About ──────────────────────────────────────────────────────────────── */
.about-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 72px;
  align-items: start;
}
.about-portrait {
  position: sticky;
  top: calc(var(--nav-h) + 20px);
}
.portrait-placeholder {
  aspect-ratio: 3 / 4;
  background: var(--card-bg);
  border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
}
.portrait-placeholder span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
}
.about-portrait img { aspect-ratio: 3 / 4; object-fit: cover; border-radius: 2px; }
.about-bio {
  font-size: 17px;
  font-weight: 400;
  line-height: 1.8;
  color: var(--fg);
  max-width: 560px;
}
.about-bio + .about-bio { margin-top: 18px; }
.about-skills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 52px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.about-skills h4 {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 14px;
}
.about-skills li {
  font-size: 13.5px;
  font-weight: 400;
  line-height: 2.1;
}

/* ─── Contact ────────────────────────────────────────────────────────────── */
.contact-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}
.contact-line {
  font-size: clamp(22px, 2.8vw, 36px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.3;
}
.contact-email {
  display: block;
  font-size: 14px;
  font-weight: 400;
  margin-top: 44px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  transition: color .2s;
}
.contact-email:hover { color: var(--dim); }
.contact-socials {
  display: flex; gap: 20px;
  margin-top: 16px;
}
.contact-socials a {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
  transition: color .2s;
}
.contact-socials a:hover { color: var(--fg); }

.contact-form { display: flex; flex-direction: column; gap: 20px; }
.field input,
.field select,
.field textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  color: var(--fg);
  outline: none;
  -webkit-appearance: none;
  border-radius: 0;
  transition: border-color .25s;
  cursor: none;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--dim); }
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--fg); }
.field textarea { resize: none; }
.field select option { background: var(--bg); color: var(--fg); }
.field-select { position: relative; }

.form-btn {
  align-self: flex-start;
  background: var(--fg); color: var(--bg);
  border: none;
  padding: 13px 28px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: opacity .2s;
  margin-top: 4px;
}
.form-btn:hover { opacity: .85; }

.form-ok {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dim);
  display: none;
}
.form-ok.show { display: block; }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  padding: 24px 36px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.footer span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0;
  z-index: 1500;
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
  opacity: 0; visibility: hidden;
  transition: opacity .35s var(--ease), visibility .35s;
}
.modal.open { opacity: 1; visibility: visible; }

.modal-bg {
  position: absolute; inset: 0;
  background: rgba(12,12,11,.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.modal-panel {
  position: relative; z-index: 1;
  background: #141413;
  width: 100%; max-width: 1760px;
  max-height: 92vh;
  border-radius: 6px;
  display: grid;
  grid-template-columns: 1fr 420px;
  align-items: stretch;
  overflow: hidden;
  transform: translateY(18px) scale(.97);
  transition: transform .4s var(--ease-out), opacity .35s var(--ease);
}
.modal.open .modal-panel { transform: none; }

.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px;
  background: rgba(237,232,223,.1); color: var(--fg);
  border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  transition: background .2s, transform .25s;
}
.modal-close:hover { background: rgba(237,232,223,.18); transform: rotate(90deg); }

.modal-media {
  overflow: hidden;
  background: #0a0a09;
}
.modal-media img   { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-media video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ─── Gallery (sub-projects) ─────────────────────────────────────────────── */
.modal-gallery {
  display: flex; flex-direction: column;
  height: 100%;
}
.gallery-main {
  flex: 1; min-height: 0;
  width: 100%; height: 100%; object-fit: cover;
  background: #000; display: block;
}
.gallery-tabs {
  display: flex;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.gallery-tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  padding: 10px 6px;
  background: none; border: none;
  border-right: 1px solid var(--line);
  color: var(--dim);
  cursor: none;
  transition: background .2s, color .2s;
}
.gallery-tab:last-child { border-right: none; }
.gallery-tab:hover, .gallery-tab.active { background: rgba(237,232,223,.05); color: var(--fg); }
.gallery-tab-num {
  font-size: 9px; font-weight: 700; letter-spacing: .1em;
}
.gallery-tab-title {
  font-size: 8px; font-weight: 500; letter-spacing: .06em;
  text-transform: uppercase; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 80px;
}

.modal-media-empty {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.modal-media-empty span {
  font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--dim);
}

.modal-info {
  padding: clamp(28px, 3vw, 52px) clamp(24px, 2.5vw, 44px);
  overflow-y: auto;
  display: flex; flex-direction: column; gap: clamp(14px, 1.4vw, 22px);
  border-left: 1px solid var(--line);
  height: 100%;
}
.modal-cat {
  font-size: clamp(9px, 0.75vw, 12px); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--dim);
}
.modal-title {
  font-size: clamp(24px, 2.4vw, 44px);
  font-weight: 800; letter-spacing: -.02em; line-height: 1.08;
}
.modal-subtitle {
  display: block;
  font-size: clamp(11px, 0.85vw, 14px); font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: var(--dim); margin-top: 2px;
}
.modal-year { font-size: clamp(10px, 0.8vw, 13px); font-weight: 400; color: var(--dim); }
.modal-desc { font-size: clamp(14px, 1.1vw, 18px); font-weight: 400; line-height: 1.8; color: rgba(237,232,223,.75); }
.modal-desc.hidden { display: none; }
.modal-tags { display: flex; flex-wrap: wrap; gap: clamp(5px, 0.5vw, 8px); }
.modal-tags.hidden { display: none; }
.modal-tag {
  font-size: clamp(9px, 0.7vw, 11px); font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  border: 1px solid var(--line); padding: clamp(3px, 0.3vw, 5px) clamp(8px, 0.7vw, 12px); border-radius: 2px; color: var(--dim);
}
.modal-meta {
  padding-top: clamp(14px, 1.4vw, 22px);
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: clamp(6px, 0.6vw, 10px);
}
.modal-meta.hidden { display: none; }
.modal-meta-label {
  font-size: clamp(9px, 0.7vw, 11px); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--dim);
}
.modal-meta-value {
  font-size: clamp(13px, 1vw, 17px); font-weight: 400;
}
.modal-meta-pills { display: flex; flex-wrap: wrap; gap: clamp(4px, 0.4vw, 7px); }
.modal-meta-pill {
  font-size: clamp(9px, 0.7vw, 11px); font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid var(--line); padding: clamp(3px, 0.3vw, 5px) clamp(8px, 0.7vw, 12px); border-radius: 2px; color: var(--dim);
}
.modal-links {
  margin-top: auto;
  padding-top: clamp(18px, 1.8vw, 28px);
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: clamp(7px, 0.7vw, 11px);
}
.modal-links.hidden { display: none; }
.modal-link-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: clamp(10px, 0.8vw, 12px); font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--line);
  padding: clamp(8px, 0.8vw, 12px) clamp(14px, 1.3vw, 20px);
  border-radius: 2px;
  color: var(--dim);
  transition: color .2s, border-color .2s;
}
.modal-link-btn:hover { color: var(--fg); border-color: var(--fg); }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 12px 12px 0 0;
  }
  .modal-media { width: 100%; }
  .modal-info  { border-left: none; border-top: 1px solid var(--line); }
}
@media (max-width: 720px) {
  .nav { padding: 0 20px; }
  .hero { padding: var(--nav-h) 20px 24px; }
  .section { padding: 72px 20px; }
  .about-body { grid-template-columns: 1fr; }
  .about-portrait { position: static; max-width: 220px; }
  .about-skills { grid-template-columns: 1fr 1fr; }
  .contact-body { grid-template-columns: 1fr; gap: 48px; }
  .footer { flex-direction: column; gap: 6px; text-align: center; padding: 20px; }
}
@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .card.wide, .card.full { grid-column: span 2; }
  .about-skills { grid-template-columns: 1fr; }
  .modal-info { padding: 22px 18px; gap: 12px; }
  .modal-title { font-size: 22px; }
  .modal-desc  { font-size: 14px; }
}
@media (pointer: coarse) {
  body   { cursor: auto; }
  button { cursor: pointer; }
  .card, .field input, .modal-tab { cursor: pointer; }
  .cursor { display: none; }
}
