:root {
  --bg: #0b0b0d;
  --green: #2f6b3c;
  --green-light: #7cc28a;
  --green-dark: #24542f;
  --white: #f4f4f2;
  --ink: #111;
  --radius: 34px;
  --max: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--white);
  font-family: "Nunito", system-ui, sans-serif;
  font-weight: 800;
  overflow-x: hidden;
  position: relative;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.topbar {
  height: 14px;
  background: var(--green);
  width: 56%;
}
.nav {
  position: absolute;
  top: 0; right: 0;
  width: 44%;
  min-height: 70px;
  background: var(--white);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 24px;
  z-index: 10;
}
.nav a {
  color: #333;
  white-space: nowrap;
  font-style: italic;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: .08em;
  position: relative;
}
.nav a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -4px;
  height: 3px; background: var(--green);
  transform: scaleX(0); transform-origin: left;
  transition: transform .25s ease;
}
.nav a:hover::after { transform: scaleX(1); }

.sky { position: absolute; inset: 0; height: 100vh; min-height: 820px; pointer-events: none; z-index: 0; }
.sky i {
  position: absolute;
  width: var(--s, 7px); height: var(--s, 7px);
  background: var(--white); border-radius: 50%;
  animation: twinkle 4s ease-in-out infinite;
}
.sky i:nth-child(2n) { animation-delay: -1.3s; }
.sky i:nth-child(3n) { animation-delay: -2.6s; }
.sky i.ring { background: none; border: 3px solid var(--white); width: 16px; height: 16px; }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes twinkle { 50% { opacity: .35; transform: scale(.8); } }

.hero {
  position: relative; z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 50px 24px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  gap: 60px;
  align-items: start;
}
.left { position: relative; }

.id { display: flex; align-items: center; gap: 26px; }
.id-text { margin-left: 6px; min-width: 0; }
.avatar {
  position: relative;
  width: 118px; height: 118px;
  border-radius: 50%;
  background: #222;
  flex-shrink: 0;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; z-index: 1; }
.swirl {
  animation: orbit 9s linear infinite;
  position: absolute; inset: -22px;
  width: calc(100% + 44px); height: calc(100% + 44px);
  z-index: 2;
}
.swirl circle { fill: none; stroke: var(--white); stroke-width: 6; stroke-linecap: round; }
.squiggle path, .corner-swirl path {
  fill: none; stroke: var(--white); stroke-width: 7; stroke-linecap: round;
}
.id h1 {
  font-weight: 900;
  font-size: clamp(2.2rem, 3.5vw, 3.1rem);
  line-height: .95;
  letter-spacing: -.01em;
}
.role { font-weight: 800; font-size: 1.15rem; margin-top: 6px; opacity: .95; }

.cta {
  display: inline-block;
  background: var(--green);
  border: 2px solid var(--white);
  outline: 3px solid var(--green);
  color: var(--white);
  font-weight: 800;
  font-size: .85rem;
  padding: 10px 16px;
  letter-spacing: .04em;
  margin-top: 14px;
  white-space: nowrap;
  transition: transform .2s ease, background .2s ease;
}
.cta:hover { transform: translateY(-3px) rotate(-1.5deg); background: var(--green-dark); }

.folder { position: relative; }
.about-title { margin: 60px 0 22px; }
.folder-body {
  position: relative;
  background: var(--green);
  width: 96%;
  padding: 40px 34px 54px;
}
.folder-body p {
  font-style: italic;
  font-weight: 800;
  font-size: 1.12rem;
  line-height: 1.5;
  max-width: 34ch;
}
.folder-dots { position: absolute; right: 22px; bottom: 16px; display: flex; gap: 22px; }
.folder-dots b { width: 15px; height: 15px; background: var(--white); border-radius: 50%; }
.squiggle { position: absolute; right: -40px; bottom: -34px; width: 56px; height: 56px; }

.search {
  margin-top: 74px;
  display: flex; align-items: center; gap: 14px;
  background: var(--white);
  color: #555;
  width: 96%;
  padding: 18px 26px;
  font-style: italic;
  font-weight: 800;
  font-size: 1.15rem;
  transition: transform .2s ease;
}
.search svg { width: 26px; height: 26px; flex-shrink: 0; }
.search .gh path { fill: var(--ink); stroke: none; }
.socials a svg { width: 18px; height: 18px; margin-right: 8px; vertical-align: -3px; }
.socials a svg path { fill: currentColor; }
.socials a .ig * { fill: none; stroke: currentColor; stroke-width: 2.4; }
.socials a .ig .dot { fill: currentColor; stroke: none; }
.search:hover { transform: translateX(6px); }
.search span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.socials {
  margin-top: 22px;
  width: 96%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}
.socials a {
  background: var(--green);
  text-align: center;
  padding: 14px 10px;
  font-weight: 900;
  letter-spacing: .06em;
  font-size: 1rem;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.socials a:hover { background: var(--white); color: var(--green); transform: translateY(-2px); }

.corner-swirl { position: absolute; left: -48px; bottom: -50px; width: 54px; height: 40px; }

.right { display: flex; flex-direction: column; gap: 22px; padding-top: 20px; }
.photo {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 6px solid var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  background: #222;
  transition: transform .3s ease;
}
.photo:nth-child(1) { transform: rotate(1.2deg); }
.photo:nth-child(2) { transform: rotate(-1deg); }
.photo:hover { transform: rotate(0) scale(1.015); }
.overlay {
  position: absolute; inset: 0; z-index: 2;
  border-radius: calc(var(--radius) - 6px);
  display: grid; place-items: center;
  background: rgba(0, 0, 0, .55);
  font-weight: 900; font-style: italic;
  font-size: clamp(1.8rem, 3.4vw, 2.8rem); letter-spacing: .03em;
  opacity: 0;
  transition: opacity .3s ease;
}
.photo:hover .overlay { opacity: 1; }
.photo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border-radius: calc(var(--radius) - 6px);
  object-fit: cover; z-index: 1;
}

.block {
  position: relative; z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 80px 24px 40px;
  scroll-margin-top: 20px;
}
.label {
  display: inline-block;
  background: var(--green);
  padding: 10px 28px 10px 22px;
  font-weight: 900; font-style: italic;
  font-size: 2rem; letter-spacing: .06em;
  margin-bottom: 36px;
  position: relative;
}
#projects { padding-top: 50px; }
.label::after {
  content: ""; position: absolute; right: -26px; top: 50%;
  width: 12px; height: 12px; border-radius: 50%; background: var(--white);
  transform: translateY(-50%);
}

.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 34px 30px; }
.project { display: flex; flex-direction: column; transition: transform .25s ease; }
.project:hover { transform: translateY(-6px); }
.project-tab {
  align-self: flex-start;
  background: var(--white); color: var(--green);
  font-weight: 900; font-style: italic;
  padding: 6px 22px 4px; font-size: 1.1rem;
}
.project-body {
  background: var(--green);
  padding: 26px 28px 24px;
  flex: 1;
  display: flex; flex-direction: column; gap: 12px;
}
.project h3 { font-weight: 900; font-size: 1.6rem; }
.project p { font-weight: 700; font-style: italic; line-height: 1.5; opacity: .97; }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  background: var(--bg); color: var(--white);
  padding: 4px 12px; font-size: .82rem; font-weight: 800;
  border-radius: 999px;
}
.tags.light li { background: var(--white); color: var(--green); }
.links { display: flex; gap: 18px; margin-top: auto; padding-top: 6px; }
.links a { font-style: italic; border-bottom: 2px solid var(--white); }
.links a:hover { color: var(--bg); border-color: var(--bg); }

.project.more-card .project-body {
  background: transparent;
  border: 4px dashed var(--green);
  justify-content: center; align-items: flex-start;
  transition: background .25s ease, border-color .25s ease;
}
.project.more-card:hover .project-body { background: var(--green); border-style: solid; }
.more-card .arrow { display: inline-block; transition: transform .25s ease; }
.more-card:hover .arrow { transform: translateX(8px); }
.more-card .go { font-style: italic; font-weight: 900; border-bottom: 2px solid var(--green-light); }

.subpage .block { padding-top: 110px; min-height: 70vh; }
.back { display: table; font-style: italic; opacity: .75; margin-bottom: 22px; }
.back:hover { opacity: 1; color: var(--green-light); }
.nav a[aria-current="page"]::after { transform: scaleX(1); }
.block-sub { font-style: italic; opacity: .75; margin: -18px 0 30px; }

.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.gcard {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--green);
  border: 0; padding: 0; text-align: left;
  font: inherit; color: inherit; cursor: pointer;
  transition: transform .25s ease;
}
.gcard:hover { transform: translateY(-6px) rotate(-.6deg); }
.gcard:focus-visible { outline: 3px solid var(--white); outline-offset: 4px; }
.gcard-num {
  position: absolute; top: -14px; left: 16px; z-index: 2;
  background: var(--white); color: var(--green);
  font-style: italic; font-weight: 900; font-size: .9rem; padding: 2px 12px;
}
.gcard-cover {
  position: relative; display: grid; place-items: center;
  width: 100%; aspect-ratio: 4 / 3; overflow: hidden;
  border: 5px solid var(--green);
  background:
    radial-gradient(circle at 30% 30%, #8a8a8a 0 2px, transparent 3px) 0 0 / 20px 20px,
    linear-gradient(160deg, #5c5c5c, #262626);
}
.gcard-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.gcard-cover img.tall { object-fit: contain; padding: 14px 0; background: #1a1a1a; }
.gcard-cover.phones { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 14px; background: #1a1a1a; }
.gcard-cover.phones img { position: static; width: auto; height: 100%; max-width: 31%; object-fit: contain; padding: 0; border-radius: 10px; }
.gcard:hover .gcard-cover img { transform: scale(1.04); }
.gcard-body { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px 20px; }
.gcard-title { font-weight: 900; font-size: 1.35rem; }
.gcard-sub { font-style: italic; font-weight: 700; opacity: .85; }
.gcard-go { margin-top: 10px; align-self: flex-start; font-style: italic; font-weight: 900; border-bottom: 2px solid var(--white); }
.ph { color: #ddd; font-style: italic; font-size: .85rem; opacity: .8; padding: 10px; text-align: center; word-break: break-all; }

.viewer {
  margin: auto; padding: 0;
  width: min(940px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  background: var(--bg); color: var(--white);
  border: 5px solid var(--white); border-radius: 26px;
  overflow: auto;
}
.viewer::backdrop { background: rgba(0, 0, 0, .8); }
.viewer[open] { animation: pop .25s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
.v-close {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--white); color: var(--bg); border: 0;
  font: 900 1.1rem "Nunito", sans-serif; cursor: pointer;
}
.v-stage { position: relative; }
.v-frame {
  position: relative; height: min(56vh, 520px); display: grid; place-items: center; overflow: hidden;
  background:
    radial-gradient(circle at 30% 30%, #8a8a8a 0 2px, transparent 3px) 0 0 / 22px 22px,
    linear-gradient(160deg, #5c5c5c, #262626);
}
.v-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.v-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 46px; height: 46px; border: 0;
  background: var(--green); color: var(--white);
  font: 900 1.3rem "Nunito", sans-serif; cursor: pointer;
  transition: background .2s ease;
}
.v-arrow:hover { background: var(--green-dark); }
.v-arrow.prev { left: 14px; }
.v-arrow.next { right: 14px; }
.v-thumbs { display: flex; gap: 10px; padding: 14px 24px 0; overflow-x: auto; }
.v-thumbs button {
  flex: 0 0 84px; height: 60px; padding: 0; overflow: hidden; cursor: pointer;
  border: 3px solid transparent; background: #333; opacity: .55;
  display: grid; place-items: center;
}
.v-thumbs button.on { border-color: var(--green-light); opacity: 1; }
.v-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.v-thumbs .ph { font-size: .6rem; padding: 2px; }
.v-info { padding: 18px 24px 26px; display: flex; flex-direction: column; gap: 10px; }
.v-count { font-style: italic; color: var(--green-light); font-size: .9rem; }
.v-info h3 { font-weight: 900; font-size: 1.7rem; }
.v-info > p:not(.v-count) { font-weight: 700; font-style: italic; line-height: 1.55; opacity: .92; }
.v-info .tags li { background: var(--green); }
.v-links { display: flex; gap: 18px; }
.v-links a { font-style: italic; border-bottom: 2px solid var(--green-light); }

.resume { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; }
.timeline { border-left: 5px solid var(--white); padding-left: 30px; display: flex; flex-direction: column; gap: 34px; }
.entry { position: relative; }
.entry::before {
  content: ""; position: absolute; left: -44px; top: 4px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--green); border: 4px solid var(--white);
}
.when { font-style: italic; color: var(--green-light); font-size: .95rem; letter-spacing: .04em; }
.entry h3 { font-weight: 900; font-size: 1.35rem; margin: 2px 0 6px; }
.entry h3 em { font-weight: 700; opacity: .7; }
.entry p { font-weight: 600; line-height: 1.55; opacity: .9; }

.side { display: flex; flex-direction: column; gap: 20px; }
.card { background: var(--green); padding: 22px 24px; }
.card h3 { font-weight: 900; font-style: italic; letter-spacing: .06em; margin-bottom: 14px; }
.facts { list-style: none; display: flex; flex-direction: column; gap: 8px; font-style: italic; }
.cta.big { margin: 4px 0 0; font-size: 1rem; text-align: center; padding: 14px; align-self: stretch; }

.footer {
  max-width: var(--max); margin: 60px auto 0;
  padding: 28px 24px 40px;
  border-top: 3px solid #222;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-style: italic; opacity: .8;
}
.footer a:hover { color: var(--green); }

@media (max-width: 900px) {
  .topbar { width: 100%; }
  .nav { position: static; width: 100%; min-height: 0; padding: 14px 16px; }
  .nav a { font-size: 1.05rem; }
  .hero { grid-template-columns: 1fr; gap: 50px; padding: 36px 16px 40px; }
  .right { flex-direction: row; padding-top: 0; }
  .right .photo { flex: 1; }
  .block { padding: 60px 16px 30px; }
  .projects, .resume { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .corner-swirl { display: none; }
}
@media (max-width: 560px) {
  .id { flex-wrap: wrap; gap: 22px; }
  .avatar { width: 92px; height: 92px; }
  .about-title { margin: 44px 0 18px; }
  .label { font-size: 1.6rem; }
  .folder-body, .search, .socials { width: 100%; }
  .folder-body { padding: 30px 22px 50px; }
  .folder-body p { font-size: 1rem; }
  .squiggle { display: none; }
  .gallery-grid { grid-template-columns: 1fr; }
  .v-arrow { width: 38px; height: 38px; }
  .v-info { padding: 16px 18px 22px; }
  .nav a { font-size: .95rem; }
  .search { margin-top: 50px; font-size: 1rem; padding: 16px 18px; }
  .right { flex-direction: column; }
  .photo { border-width: 5px; border-radius: 26px; }
  .photo img, .overlay { border-radius: 21px; }
}

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