:root {
  --bg: #fffaf0;
  --panel: #eee6d8;
  --text: #151412;
  --muted: #655f58;
  --line: #d8cebd;
  --warm: #b1b11c;
  --warm-soft: #ecec9c;
  --white: #ffffff;
  --ink: #050505;
  --shadow: 0 28px 80px rgba(24, 20, 14, 0.18);
  --max: 1180px;
  --font-main: Hagrid, zbgz, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  line-height: 1.55;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, rgba(21, 20, 18, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(21, 20, 18, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 78%);
}

body.modal-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--text);
  text-decoration: none;
}

a:visited,
a:active {
  color: var(--text);
}

button {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(20px, 4vw, 56px);
  background: rgba(255, 250, 240, 0.9);
  border-bottom: 1px solid rgba(21, 20, 18, 0.13);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  font-weight: 750;
  letter-spacing: 0;
}

.brand__icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.95rem;
}

.site-nav a {
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--warm);
}

.site-nav a:hover {
  background: var(--warm-soft);
  color: var(--ink);
}

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

.section {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
  padding: clamp(58px, 8vw, 110px) 0;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
  min-height: calc(100vh - 72px);
  padding-top: clamp(18px, 3vw, 42px);
}

.hero__content {
  position: relative;
  z-index: 1;
}

.hero-logo {
  width: min(100%, 620px);
  margin-bottom: 38px;
  padding: 0;
  animation: logoSlideInLeft 950ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-logo img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--warm);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 740px;
  margin-bottom: 18px;
  font-size: 7.4rem;
  line-height: 0.88;
  letter-spacing: 0;
  text-transform: uppercase;
}

h2 {
  max-width: 760px;
  margin-bottom: 20px;
  font-size: 4rem;
  line-height: 1.02;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.35rem;
  line-height: 1.16;
}

.hero__intro {
  max-width: 570px;
  color: var(--muted);
  font-size: 1.32rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 1px solid var(--text);
  border-radius: 999px;
  color: var(--text);
  font-weight: 700;
  box-shadow: 4px 4px 0 transparent;
}

.button--dark {
  background: var(--text);
  color: var(--bg);
}

.button--light {
  background: transparent;
}

.button:hover {
  box-shadow: 4px 4px 0 var(--warm);
  transform: translateY(-1px);
}

.hero__image-wrap {
  position: relative;
  overflow: hidden;
  min-height: 440px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: rotate(1.2deg);
}

.hero__image {
  width: 100%;
  height: 100%;
  min-height: 440px;
  object-fit: cover;
  filter: contrast(1.04) saturate(0.86);
  transform: scale(1.02);
}

.section-heading {
  margin-bottom: clamp(28px, 5vw, 56px);
}

.section-heading--wide {
  display: grid;
  max-width: 920px;
}

.section-heading--wide .eyebrow,
.section-heading--wide h2 {
  grid-column: 1;
}

.section-heading--wide p:not(.eyebrow) {
  grid-column: 1;
  max-width: 660px;
  color: var(--muted);
}

.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
  column-gap: clamp(34px, 6vw, 88px);
  row-gap: 24px;
  border-top: 1px solid var(--line);
}

.about .section-heading {
  grid-column: 1;
  margin-bottom: 0;
}

.about__grid {
  display: contents;
}

.about__text {
  grid-column: 1;
  max-width: 760px;
  color: var(--muted);
  font-size: 1.08rem;
}

.skill-list {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  align-self: start;
  gap: 30px 34px;
  list-style: none;
  margin-top: calc(0.78rem * 1.55 + 32px);
  padding: 0;
  user-select: none;
}

.skill-list li {
  position: relative;
  display: inline-flex;
  max-width: 220px;
  color: var(--text);
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: 0;
  transform: rotate(var(--word-rotate, -2deg)) translate(var(--word-x, 0), var(--word-y, 0));
  touch-action: pan-y;
}

.skill-list button {
  position: relative;
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: left;
  letter-spacing: 0;
  text-decoration-line: underline;
  text-decoration-color: var(--warm-soft);
  text-decoration-thickness: 0.22em;
  text-underline-offset: -0.02em;
  text-decoration-skip-ink: none;
  cursor: pointer;
}

.skill-list button::before {
  content: none;
}

.skill-list button:hover::before,
.skill-list button:focus-visible::before {
  content: none;
}

.skill-list button:focus-visible {
  outline: 2px solid var(--warm);
  outline-offset: 5px;
  border-radius: 6px;
}

.skill-list li:nth-child(1) {
  --word-rotate: -3deg;
  --word-x: 8px;
  --word-y: 2px;
}

.skill-list li:nth-child(2) {
  --word-rotate: 2deg;
  --word-x: -4px;
  --word-y: 16px;
}

.skill-list li:nth-child(3) {
  --word-rotate: -1deg;
  --word-x: 20px;
  --word-y: -2px;
}

.skill-list li:nth-child(4) {
  --word-rotate: 3deg;
  --word-x: -10px;
  --word-y: 10px;
}

.skill-list li:nth-child(5) {
  --word-rotate: -2deg;
  --word-x: 12px;
  --word-y: 8px;
}

.skill-list li:nth-child(6) {
  --word-rotate: 2deg;
  --word-x: -2px;
  --word-y: 20px;
}

.skill-list li:nth-child(7) {
  --word-rotate: -2deg;
  --word-x: 18px;
  --word-y: 4px;
}

.portfolio {
  border-top: 1px solid var(--line);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.filter-button {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.filter-button.is-active,
.filter-button:hover {
  border-color: var(--text);
  background: var(--warm);
  color: var(--ink);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.project-card {
  display: grid;
  grid-template-rows: 260px 1fr;
  overflow: hidden;
  padding-top: 14px;
  border: 1px solid rgba(21, 20, 18, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.project-card:hover {
  border-color: var(--ink);
  box-shadow: 0 18px 44px rgba(46, 39, 28, 0.11);
  transform: translateY(-3px);
}

.project-card__image {
  width: calc(100% - 28px);
  height: 260px;
  margin: 0 auto;
  object-fit: cover;
  background: var(--panel);
}

.project-card__body {
  display: grid;
  align-content: start;
  padding: 18px;
}

.project-card__meta {
  display: block;
  margin-bottom: 12px;
  color: var(--warm);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.project-card h3 {
  color: var(--text);
}

.project-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.contact {
  padding-bottom: 70px;
}

.contact__panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(260px, 0.45fr);
  gap: clamp(28px, 6vw, 82px);
  padding: clamp(26px, 5vw, 52px);
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  box-shadow: none;
}

.contact__panel p {
  max-width: 650px;
  color: var(--muted);
}

.contact__eyebrow {
  color: var(--warm);
}

.contact__links {
  display: grid;
  gap: 12px;
  align-content: center;
}

.contact__links a {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px clamp(20px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.modal.is-open {
  display: block;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 29, 26, 0.58);
}

.modal__content {
  position: relative;
  overflow: auto;
  width: min(860px, calc(100% - 44px));
  max-height: calc(100vh - 56px);
  margin: 28px auto;
  border-radius: 8px;
  background: var(--bg);
  box-shadow: var(--shadow);
  outline: none;
}

.modal__content--wide {
  width: min(1180px, calc(100% - 44px));
}

.modal__close {
  position: sticky;
  top: 14px;
  left: calc(100% - 58px);
  z-index: 2;
  width: 42px;
  height: 42px;
  margin: 14px 14px -56px auto;
  border: 1px solid rgba(255, 253, 245, 0.36);
  border-radius: 50%;
  background: rgba(31, 29, 26, 0.84);
  color: var(--bg);
  cursor: pointer;
  font-size: 1.7rem;
  line-height: 1;
}

@keyframes logoSlideInLeft {
  from {
    opacity: 0;
    transform: translateX(-96px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes logoSlideDownMobile {
  from {
    opacity: 0;
    transform: translateY(-56px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.project-detail__hero {
  width: 100%;
  height: min(34vh, 320px);
  object-fit: cover;
  background: var(--panel);
  cursor: zoom-in;
  transition: filter 160ms ease;
}

.project-detail__hero:hover {
  filter: brightness(0.92);
}

.project-detail__body {
  padding: clamp(22px, 4vw, 40px);
}

.project-detail__intro {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(260px, 0.48fr);
  gap: clamp(28px, 4vw, 54px);
  margin-bottom: 32px;
}

.project-detail__intro h2 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: 3rem;
  line-height: 1.04;
  overflow-wrap: anywhere;
  word-break: normal;
}

.project-detail__intro p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

.pdf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.pdf-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 10px 15px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
}

.pdf-button--dark,
.pdf-button:hover {
  background: var(--ink);
  color: var(--bg);
}

.banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}

.banner-button {
  display: grid;
  min-width: 145px;
  min-height: 58px;
  align-content: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  text-align: center;
}

.banner-button span {
  color: var(--warm);
  font-size: 0.72rem;
  font-weight: 800;
}

.banner-button strong {
  color: var(--bg);
  font-size: 0.9rem;
  line-height: 1;
}

.detail-list {
  display: grid;
  gap: 18px;
  margin: 0;
}

.detail-list div {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.detail-list dt {
  margin-bottom: 6px;
  color: var(--warm);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.media-split {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(260px, 1fr);
  gap: 18px;
  align-items: start;
}

.gallery--side {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  object-fit: cover;
  background: var(--panel);
  cursor: zoom-in;
  transition: transform 160ms ease, filter 160ms ease;
}

.gallery img:hover {
  filter: brightness(0.92);
  transform: translateY(-2px);
}

.photo-detail {
  padding: clamp(22px, 4vw, 40px);
}

.photo-detail__header {
  max-width: 780px;
  margin-bottom: clamp(26px, 4vw, 46px);
}

.photo-detail__header h2 {
  margin-bottom: 14px;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 1;
}

.photo-detail__header p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

.photo-masonry {
  column-count: 3;
  column-gap: 14px;
}

.photo-masonry img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 14px;
  break-inside: avoid;
  border-radius: 8px;
  background: var(--panel);
  cursor: zoom-in;
  transition: filter 160ms ease, transform 160ms ease;
}

.photo-masonry img:hover {
  filter: brightness(0.92);
  transform: translateY(-2px);
}

.video-section {
  display: grid;
  gap: 16px;
  margin: 0;
}

.video-card {
  margin: 0;
}

.video-card video {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 70vh;
  border-radius: 8px;
  background: var(--ink);
}

.video-card figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(5, 5, 5, 0.9);
}

.image-lightbox.is-open {
  display: flex;
}

.image-lightbox__image {
  max-width: min(100%, 1400px);
  max-height: calc(100vh - 56px);
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.32);
}

.image-lightbox__close {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 250, 240, 0.36);
  border-radius: 50%;
  background: rgba(255, 250, 240, 0.12);
  color: var(--bg);
  cursor: pointer;
  font-size: 1.8rem;
  line-height: 1;
}

@media (max-width: 900px) {
  .hero,
  .about__grid,
  .section-heading--wide,
  .contact__panel,
  .project-detail__intro {
    grid-template-columns: 1fr;
  }

  .section-heading--wide p:not(.eyebrow) {
    grid-column: 1;
  }

  .about {
    display: block;
  }

  .about .section-heading {
    margin-bottom: 20px;
  }

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

  .skill-list {
    grid-column: 1;
    grid-row: auto;
    max-width: 680px;
    gap: 24px 28px;
    margin-top: 0;
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .media-split {
    grid-template-columns: 1fr;
  }

  .gallery--side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .photo-masonry {
    column-count: 2;
  }

  .project-card {
    grid-template-rows: 230px 1fr;
  }

  .project-card__image {
    height: 230px;
  }

  .hero {
    min-height: auto;
  }

  .hero__image-wrap {
    transform: none;
  }

  h1 {
    font-size: 5.6rem;
  }

  h2 {
    font-size: 3.2rem;
  }

  .project-detail__intro h2 {
    font-size: 2.4rem;
  }
}

@media (max-width: 640px) {
  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  .site-header {
    align-items: center;
    flex-direction: row;
    gap: 14px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
    gap: 2px;
    padding: 3px;
    font-size: 0.78rem;
  }

  .site-nav a {
    padding: 5px 7px;
  }

  .section {
    width: min(100% - 28px, var(--max));
  }

  .hero__image-wrap,
  .hero__image {
    min-height: 320px;
  }

  .hero-logo {
    width: min(100%, 360px);
    margin-bottom: 26px;
    animation-name: logoSlideDownMobile;
  }

  h1 {
    font-size: 3.7rem;
  }

  h2 {
    font-size: 2.25rem;
  }

  .project-detail__intro h2 {
    font-size: 1.9rem;
  }

  .hero__intro {
    font-size: 1.12rem;
  }

  .skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 20px;
    margin: 0;
    overflow: visible;
    padding: 0;
  }

  .skill-list li {
    max-width: 180px;
    font-size: 0.94rem;
    transform: rotate(var(--word-rotate, -2deg));
  }

  .filter-row {
    width: 100%;
    max-width: 100%;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 24px;
    padding: 0 0 6px;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }

  .filter-row::-webkit-scrollbar {
    display: none;
  }

  .filter-button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 7px 12px;
    font-size: 0.86rem;
    white-space: nowrap;
  }

  .project-grid,
  .gallery {
    grid-template-columns: 1fr;
  }

  .gallery--side {
    grid-template-columns: 1fr;
  }

  .photo-detail {
    padding: 22px;
  }

  .photo-detail__header h2 {
    font-size: 2.2rem;
  }

  .photo-masonry {
    column-count: 1;
    column-gap: 12px;
  }

  .photo-masonry img {
    margin-bottom: 12px;
  }

  .project-card {
    grid-template-rows: 220px 1fr;
  }

  .project-card__image {
    height: 220px;
  }

  .hero .button-row {
    gap: 8px;
    margin-top: 22px;
  }

  .hero .button {
    width: auto;
    min-height: 38px;
    padding: 8px 13px;
    font-size: 0.82rem;
  }

  .modal__content {
    width: min(100% - 24px, 860px);
    max-height: calc(100vh - 24px);
    margin: 12px auto;
  }

  .project-detail__hero {
    height: 220px;
  }
}
