:root {
  --bg: #191919;
  --panel: #212121;
  --text: #f2f2f2;
  --muted: #a9a9a9;
  --line: #383838;
  --gap: clamp(8px, 0.8vw, 14px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

a { color: inherit; text-decoration: none; }
a:hover { color: #fff; }
button { font: inherit; }

.site-header {
  width: min(1840px, calc(100% - 48px));
  margin: 0 auto;
  padding: clamp(42px, 6vw, 96px) 0 clamp(34px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
}

.identity {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: clamp(38px, 5vw, 76px);
}

h1 {
  margin: 0;
  font-size: clamp(44px, 6.3vw, 112px);
  line-height: 0.9;
  letter-spacing: -0.055em;
  font-weight: 700;
  text-transform: uppercase;
}

.role {
  margin: 0;
  color: var(--muted);
  font-size: clamp(15px, 1.35vw, 22px);
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1.3fr 1.3fr 0.8fr;
  gap: clamp(28px, 5vw, 96px);
}

.profile-block h2 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-weight: 600;
}

.profile-block p,
.contact-links {
  margin: 0;
  max-width: 650px;
  font-size: clamp(14px, 1vw, 18px);
  line-height: 1.65;
  font-weight: 450;
}

.contact-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.contact-links a {
  border-bottom: 1px solid transparent;
}
.contact-links a:hover { border-bottom-color: currentColor; }

main {
  width: min(1840px, calc(100% - 48px));
  margin: 0 auto;
  padding: var(--gap) 0;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

.render-card {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: var(--panel);
  overflow: hidden;
  cursor: zoom-in;
  display: block;
  width: 100%;
}

.render-card img {
  display: block;
  width: 100%;
  height: auto;
  background: #111;
  transition: transform 220ms ease, opacity 220ms ease;
}

@media (hover:hover) {
  .render-card:hover img {
    transform: scale(1.008);
    opacity: 0.96;
  }
}

.render-card:focus-visible,
.icon-button:focus-visible,
.text-button:focus-visible,
.close-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.site-footer {
  width: min(1840px, calc(100% - 48px));
  margin: 0 auto;
  padding: 42px 0 58px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.site-footer a:hover { color: var(--text); }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  background: rgba(9, 9, 9, 0.985);
  color: #fff;
}

.lightbox.is-open { display: block; }
body.lightbox-open { overflow: hidden; }

.lightbox-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 22px;
  scrollbar-width: thin;
}

.lightbox-stage img {
  display: block;
  max-width: calc(100vw - 44px);
  max-height: calc(100vh - 44px);
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  cursor: zoom-in;
}

.lightbox-stage.is-actual {
  align-items: flex-start;
  justify-content: flex-start;
}

.lightbox-stage.is-actual img {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  margin: auto;
  cursor: zoom-out;
}

.lightbox-controls {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(20,20,20,.72);
  backdrop-filter: blur(12px);
}

.icon-button,
.text-button,
.close-button {
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.icon-button {
  width: 44px;
  height: 40px;
  font-size: 22px;
}

.text-button {
  min-width: 52px;
  height: 40px;
  font-size: 12px;
  letter-spacing: .08em;
}

.close-button {
  position: absolute;
  top: 14px;
  right: 20px;
  width: 48px;
  height: 48px;
  font-size: 36px;
  font-weight: 300;
  line-height: 1;
}

@media (max-width: 900px) {
  .site-header,
  main,
  .site-footer { width: min(100% - 28px, 1840px); }

  .identity {
    display: block;
  }

  .role {
    margin-top: 18px;
    white-space: normal;
  }

  .profile-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .portfolio-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .site-header { padding-top: 34px; }
  h1 { font-size: clamp(42px, 15vw, 68px); }
  .lightbox-stage { padding: 10px; }
  .lightbox-stage img {
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }
  .close-button { top: 6px; right: 7px; }
  .lightbox-controls { bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .render-card img { transition: none; }
}
