:root {
  color-scheme: light dark;
  --bg: #FBFBFB;
  --text: #171717;
  --muted: #6C6667;
  --accent: #9D5C8F;
  --comp: #7FA7CC;
  --card: #F3F0F0;
  --border: #E8E3E4;
  --thumb: #F3E3EF;
  --photo-bg: #F7EFF5;
  --btn-text: #FBFBFB;
  --accent-text: #9D5C8F;
  --comp-text: #3F6C9E;
  --thumb-comp: #E7EEF5;
  --tape: rgba(190, 178, 166, 0.5);
  --tape-edge: rgba(160, 148, 136, 0.35);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171717;
    --text: #FBFBFB;
    --muted: #9B9596;
    --accent: #BF7FB0;
    --comp: #8FB8DD;
    --card: #201D1E;
    --border: #2C292A;
    --thumb: #291F27;
    --photo-bg: #20181E;
    --btn-text: #171717;
    --accent-text: #BF7FB0;
    --comp-text: #8FB8DD;
    --thumb-comp: #1D242C;
    --tape: rgba(251, 251, 251, 0.16);
    --tape-edge: rgba(251, 251, 251, 0.28);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 2000;
  background: var(--accent-text); color: var(--btn-text);
  padding: 10px 18px; border-radius: 0 0 8px 0; font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 0; }
.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;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
.container { max-width: 1448px; margin: 0 auto; padding: 0 120px; }

/* ---------- NAV ---------- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 34px;
}
.nav__logo { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); text-decoration: none; }
.nav__links { display: flex; align-items: center; gap: 36px; list-style: none; }
.nav__links a { font-size: 15px; font-weight: 500; color: var(--muted); text-decoration: none; transition: color 0.2s; }
.nav__links a:hover { color: var(--comp-text); }
.nav__dot {
  width: 18px; height: 18px; border: 1.5px solid var(--text); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.nav__dot::after { content: ""; width: 7px; height: 7px; background: var(--text); border-radius: 50%; }

/* ---------- HERO ---------- */
.hero {
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: 60px; padding: 90px 0 40px;
}
.hero__caption {
  color: var(--accent-text); font-size: 14px; font-weight: 600;
  letter-spacing: 0.35em; text-transform: uppercase;
}
.hero__name {
  font-size: clamp(56px, 6.5vw, 92px); font-weight: 700;
  letter-spacing: -0.03em; line-height: 1.0; margin: 20px 0 24px;
}
.hero__subtitle { font-size: 26px; font-weight: 500; }
.hero__subtitle span { color: var(--muted); font-weight: 400; }
.hero__tagline { color: var(--muted); margin-top: 12px; }
.hero__buttons { display: flex; gap: 16px; margin-top: 40px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 54px; padding: 0 34px; border-radius: 27px;
  font-size: 16px; font-weight: 600; text-decoration: none;
  transition: transform 0.2s, opacity 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--accent-text); color: var(--btn-text); }
.btn--secondary { border: 1.5px solid var(--border); color: var(--text); }

.hero__photo {
  position: relative; width: min(530px, 38vw); aspect-ratio: 1;
  border-radius: 28px; background: var(--photo-bg); overflow: visible;
}
.hero__photo img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 28px; display: block;
}
.hero__photo::before, .hero__photo::after {
  content: ""; position: absolute; width: 100px; height: 44px;
  background: var(--tape); border: 1px solid var(--tape-edge);
  transform: rotate(45deg); z-index: 2;
  clip-path: polygon(0 0, 96% 0, 100% 25%, 96% 50%, 100% 75%, 96% 100%, 0 100%, 4% 75%, 0 50%, 4% 25%);
}
.hero__photo::before { top: -22px; left: calc(100% - 65px); }
.hero__photo::after { top: calc(100% - 22px); left: -35px; }

.scroll-hint { padding: 60px 0; }


/* ---------- SECTIONS ---------- */
section { padding: 90px 0 30px; }
.section-label {
  color: var(--accent-text); font-size: 14px; font-weight: 600;
  letter-spacing: 0.3em; text-transform: uppercase;
}
h2 { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin-top: 22px; }

/* ---------- ABOUT ---------- */
.about__grid {
  display: grid; grid-template-columns: 1fr 1fr; column-gap: 80px;
  grid-template-areas: "head bio" "skills bio"; grid-template-rows: auto 1fr;
  align-items: start;
}
.about__head { grid-area: head; }
.about__intro { color: var(--muted); margin-top: 24px; }
.about__grid .skills { grid-area: skills; align-self: start; }
.about__bio { grid-area: bio; }
.about__bio p { color: var(--muted); margin-bottom: 24px; }
.about__bio a { color: var(--comp-text); text-decoration: none; border-bottom: 1px solid var(--comp-text); }
.skills { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.skills li {
  list-style: none; padding: 8px 18px; border-radius: 20px;
  background: var(--card); border: 1px solid var(--border);
  font-size: 15px; font-weight: 500;
}

/* ---------- WORK ---------- */
.work__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 48px; }
.work-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; padding: 20px; text-decoration: none; color: var(--text);
  transition: transform 0.2s;
}
.work-card:hover { transform: translateY(-4px); }
.work-card__thumb { height: 180px; border-radius: 12px; background: var(--thumb); position: relative; }
.work-card__thumb::after {
  content: ""; position: absolute; right: 24px; bottom: 18px; width: 30px; height: 20px;
  background:
    conic-gradient(var(--accent) 0 0) 0 0 / 10px 10px no-repeat,
    conic-gradient(var(--accent) 0 0) 20px 0 / 10px 10px no-repeat,
    conic-gradient(var(--accent) 0 0) 10px 10px / 10px 10px no-repeat;
}
.work-card__thumb--img { background-color: var(--thumb-comp); }
.work-card__thumb--img::after { content: none; }
.work-card__row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 22px; }
.work-card__title { font-size: 20px; font-weight: 600; }
.work-card__arrow { color: var(--comp-text); font-size: 22px; }
.work-card__tag { font-size: 14px; color: var(--muted); letter-spacing: 0.05em; margin-top: 6px; }

/* ---------- PERSONAL ---------- */
.personal__grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 80px; align-items: start; }
.personal__text p { color: var(--muted); margin-top: 24px; }
.personal-photos {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 14px; margin-top: 48px;
}
.personal-photos img {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block;
  border-radius: 14px; border: 1px solid var(--border); background: var(--card);
}
.personal-photos img:nth-child(even) { transform: rotate(1.2deg); }
.personal-photos img:nth-child(odd) { transform: rotate(-1.2deg); }

/* ---------- CONTACT ---------- */
.contact h2 { font-size: 56px; }
.contact__row { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 24px; }
.contact__email {
  display: inline-block; margin-top: 20px; font-size: 24px; font-weight: 500;
  color: var(--accent-text); text-decoration: none; border-bottom: 1.5px solid var(--accent-text);
  padding-bottom: 4px;
}
.contact__socials { display: flex; gap: 28px; }
.contact__socials a { color: var(--text); font-weight: 500; text-decoration: none; }
.contact__socials a:hover { color: var(--comp-text); }

/* ---------- FOOTER ---------- */
footer { margin-top: 110px; border-top: 1px solid var(--border); padding: 30px 0 40px; }
.footer__row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
footer p { font-size: 14px; color: var(--muted); }

/* ---------- PROJECT OVERLAY ---------- */
.project-overlay { position: fixed; inset: 0; z-index: 1000; visibility: hidden; transition: visibility 0s 0.45s; }
.project-overlay.is-open { visibility: visible; transition-delay: 0s; }
.project-overlay__backdrop {
  position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity 0.35s ease;
}
.is-open .project-overlay__backdrop { opacity: 1; }
.project-panel {
  position: absolute; left: 0; right: 0; bottom: 0; top: 40px;
  background: var(--bg); border-radius: 24px 24px 0 0;
  transform: translateY(100%); transition: transform 0.45s cubic-bezier(0.32, 0.72, 0.24, 1);
  overflow-y: auto; overscroll-behavior: contain;
}
.is-open .project-panel { transform: translateY(0); }
.project-panel__bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; justify-content: flex-end; padding: 20px 28px 0;
}
.project-panel__close {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font-size: 18px; line-height: 1; cursor: pointer; transition: transform 0.2s, color 0.2s;
}
.project-panel__close:hover { transform: rotate(90deg); color: var(--comp-text); }
.project-panel__content { max-width: 860px; margin: 0 auto; padding: 16px 24px 90px; }
.project-panel__title { font-size: clamp(34px, 4vw, 48px); font-weight: 700; letter-spacing: -0.02em; }
.project-tags { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; padding: 0; }
.project-tags li {
  list-style: none; padding: 6px 16px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--border);
  font-size: 14px; font-weight: 500;
}
.project-panel__perex { font-size: 22px; line-height: 1.55; margin-top: 34px; }
.project-panel__body > p { color: var(--muted); margin-top: 26px; }
.project-panel__img {
  height: min(420px, 46vw); border-radius: 16px; background: var(--thumb);
  position: relative; margin: 44px 0 18px;
}
.project-panel__img::after {
  content: ""; position: absolute; right: 32px; bottom: 26px; width: 30px; height: 20px;
  background:
    conic-gradient(var(--accent) 0 0) 0 0 / 10px 10px no-repeat,
    conic-gradient(var(--accent) 0 0) 20px 0 / 10px 10px no-repeat,
    conic-gradient(var(--accent) 0 0) 10px 10px / 10px 10px no-repeat;
}
.project-screens {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin: 44px 0 18px; padding: 0;
}
.project-screens--wide { grid-template-columns: 1fr; }
.project-screens figure { margin: 0; }
.project-screens img {
  width: 100%; height: auto; display: block;
  border-radius: 16px; border: 1px solid var(--border); background: var(--thumb);
}
.project-screens figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; text-align: center; }
body.modal-open { overflow: hidden; }

.work-card--disabled { cursor: default; }
.work-card--disabled:hover { transform: none; }
.work-card__badge {
  position: absolute; top: 12px; left: 12px;
  padding: 4px 12px; border-radius: 12px;
  background: var(--accent-text); color: var(--btn-text);
  font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
}

/* ---------- CURSOR INVERT EFFECT ---------- */
.invert-host { position: relative; }
.invert-copy {
  position: absolute; inset: 0; pointer-events: none;
  z-index: 1;
  -webkit-mask-image: radial-gradient(circle 40px at var(--mx, -100px) var(--my, -100px), #000 35%, transparent 100%);
  mask-image: radial-gradient(circle 40px at var(--mx, -100px) var(--my, -100px), #000 35%, transparent 100%);
}
.invert-copy, .invert-copy * { color: var(--comp-text) !important; }
.invert-copy--flex { display: inline-flex; align-items: center; justify-content: center; }
@media (hover: none) { .invert-copy { display: none; } }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1100px) {
  .container { padding: 0 48px; }
  .hero { grid-template-columns: 1fr; }
  .hero__photo { width: min(440px, 80vw); order: 2; }
  .hero > div:not(.hero__photo) { order: 1; }
  .about__grid { grid-template-columns: 1fr; grid-template-areas: "head" "bio" "skills"; grid-template-rows: none; }
  .personal__grid { grid-template-columns: 1fr; }
  .work__grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .container { padding: 0 24px; }
  .nav__links { gap: 20px; }
  .contact h2 { font-size: 38px; }
}
