*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
    --primary:        #f46a00;
  --primary-light:  #ff9c54;
  --secondary:      #e7a6b8;   --pink-deep:      #d9758e;
  --accent:         #b9b15d;
  --cream:          #f7e2d5;
  --cream-pink:     #f7d9cf;
  --pistachio:      #bcb365;   --ink:            #233328;
  --ink-70:         rgba(35, 51, 40, 0.70);
  --ink-50:         rgba(35, 51, 40, 0.50);
  --ink-30:         rgba(35, 51, 40, 0.30);
  --ink-15:         rgba(35, 51, 40, 0.15);
  --ink-08:         rgba(35, 51, 40, 0.08);
  --ink-06:         rgba(35, 51, 40, 0.06);
  --white:          #ffffff;
  --bg:             var(--secondary);

    --font-display:   'mudstone-sans', sans-serif;
  --font-body:      'Inter', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: hidden;
  overflow-y: hidden;
}

body.loaded {
  overflow-y: auto;
}

.pre-load {
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  background: var(--ink);
  position: fixed;
  top: 0; left: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  will-change: transform;
  transition: transform 0.9s cubic-bezier(0.87, 0, 0.13, 1);
}

.pre-load.done {
  transform: translateY(-100%);
}

.load-text {
  transform: rotate(-6deg);
  white-space: nowrap;
  width: 100vw;
  text-align: center;
}

.load-text span {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 50vw;
  line-height: 1;
  color: var(--cream);
  text-transform: uppercase;
  letter-spacing: 0em;
  display: inline-block;
  clip-path: circle(0);
  will-change: clip-path;
}

.load-text span i {
  font-style: normal;
  display: inline-block;
  transform: translateY(8vh);
  will-change: transform;
}

.load-text .l-mask { animation: l-mask 2.2s cubic-bezier(0.87, 0, 0.13, 1) forwards; }
.load-text .o-mask { animation: o-mask 2.2s cubic-bezier(0.87, 0, 0.13, 1) 0.15s forwards; }
.load-text .a-mask { animation: a-mask 2.2s cubic-bezier(0.87, 0, 0.13, 1) 0.20s forwards; }
.load-text .d-mask { animation: d-mask 2.2s cubic-bezier(0.87, 0, 0.13, 1) 0.30s forwards; }

.load-text .l-mask i { animation: letter-in 2.2s cubic-bezier(0.87, 0, 0.13, 1) forwards; }
.load-text .o-mask i { animation: letter-in 2.2s cubic-bezier(0.87, 0, 0.13, 1) 0.15s forwards; }
.load-text .a-mask i { animation: letter-in 2.2s cubic-bezier(0.87, 0, 0.13, 1) 0.20s forwards; }
.load-text .d-mask i { animation: letter-in 2.2s cubic-bezier(0.87, 0, 0.13, 1) 0.30s forwards; }

@keyframes l-mask {
  0%   { clip-path: circle(0 at 0 0); }
  65%  { clip-path: circle(145% at 0 0); }
  90%  { clip-path: circle(0 at 0 0); }
  100% { clip-path: circle(0 at 0 0); }
}
@keyframes o-mask {
  0%   { clip-path: circle(0 at 50% 100%); }
  65%  { clip-path: circle(150% at 50% 100%); }
  90%  { clip-path: circle(0 at 50% 100%); }
  100% { clip-path: circle(0 at 50% 100%); }
}
@keyframes a-mask {
  0%   { clip-path: circle(0 at 0 0); }
  65%  { clip-path: circle(145% at 0 0); }
  90%  { clip-path: circle(0 at 0 0); }
  100% { clip-path: circle(0 at 0 0); }
}
@keyframes d-mask {
  0%   { clip-path: circle(0 at 0 0); }
  65%  { clip-path: circle(145% at 0 0); }
  90%  { clip-path: circle(0 at 100% 50%); }
  100% { clip-path: circle(0 at 100% 50%); }
}
@keyframes letter-in {
  0%   { transform: translateY(8vh); }
  65%  { transform: translateY(0); }
  90%  { transform: translateY(-8vh); }
  100% { transform: translateY(-8vh); }
}

nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
  padding: 0px 48px;
  border-bottom: 0.5px solid var(--ink-08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(247, 226, 213, 0.75);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

body.loaded nav {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease 0.5s, transform 0.6s ease 0.5s;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  height: 100%;
}

.nav-logo img {
  height: 55px;
  max-height: 100%;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 200;
  color: var(--ink-50);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

#hero {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.8s ease;
}

body.loaded #hero {
  opacity: 1;
}

.hero-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.06em;
  width: 100%;
  padding: 0 3vw;
  position: relative;
  z-index: 2;
}

.hero-name-left,
.hero-name-right {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(48px, 9vw, 130px);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1;
  display: inline-block;
  will-change: transform;
}

.hero-name-left  { color: var(--primary); }
.hero-name-right { color: var(--ink); }

.hero-video-wrap {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 32vw;
  height: 42vh;
  border-radius: 24px;
  overflow: hidden;
  z-index: 1;
  opacity: 0;
  box-shadow: 0 24px 60px rgba(35, 51, 40, 0.25);
  will-change: width, height, border-radius, opacity;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-controls-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
  z-index: 2;
}

.video-btn {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.25s ease;
}

.video-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.video-progress {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  height: 30px;
  cursor: pointer;
  touch-action: none;
}

.video-progress-track {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.28);
}

.video-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: var(--primary);
  pointer-events: none;
}

.video-progress-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--white);
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.video-progress:hover .video-progress-handle,
.video-progress:focus-within .video-progress-handle {
  opacity: 1;
}

.video-time {
  flex: 0 0 auto;
  font-size: 10.5px;
  color: var(--white);
  letter-spacing: 0.02em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.custom-player {
  position: relative;
  cursor: pointer;
}

.custom-player-bigplay {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  transition: background 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.custom-player-bigplay:hover {
  background: rgba(0, 0, 0, 0.68);
}

.custom-player.is-playing .custom-player-bigplay {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.85);
}

#about-me {
  position: relative;
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  overflow: hidden;
  background: var(--cream);
}

.about-photo {
  position: absolute;
  right: 0;
  top: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
}

.about-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.about-content {
  padding: 150px 64px 80px 64px;
  grid-column: 1;
  position: relative;
  z-index: 2;
}

.about-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(60px, 8vw, 120px);
  text-transform: uppercase;
  line-height: 0.88;
  letter-spacing: -0.02em;
  margin-bottom: 40px;
  color: var(--ink);
}

.about-title span {
  color: var(--pink-deep);
}

.about-text {
  font-size: 15px;
  font-weight: 300;
  color: var(--ink-70);
  line-height: 1.8;
  margin-bottom: 40px;
  max-width: 420px;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skills-label {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(30px, 3.4vw, 44px);
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 12px;
}

.skills-heading {
  font-size: 15px;
  font-weight: 400;
  text-transform: none;
  color: var(--ink);
  letter-spacing: 0;
  margin-bottom: 24px;
}

.tools-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 20px;
}

.tool-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 72px;
  cursor: pointer;
}

.tool-badge-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  will-change: transform;
  display: block;
}

.tool-badge-name {
  font-size: 9.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-50);
  line-height: 1.3;
}

#projects {
  padding: 120px 48px;
  background: var(--secondary);
}

.section-label {
  font-size: 10px;
  color: var(--ink-70);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.section-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 0.5px;
  background: var(--ink-30);
}

#projects .section-label {
  margin-bottom: 20px;
}

.projects-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(60px, 8vw, 120px);
  text-transform: uppercase;
  line-height: 0.88;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 56px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}

.polaroid-frame {
  background: var(--white);
  padding: 16px 16px 28px 16px;
  border-radius: 4px;
  box-shadow: 0 12px 28px rgba(35, 51, 40, 0.12);
  transform: rotate(-2deg);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s ease;
  cursor: pointer;
}

.polaroid-frame:nth-child(even) {
  transform: rotate(2.5deg);
}

.polaroid-frame:hover {
  transform: rotate(0deg) scale(1.03);
  box-shadow: 0 20px 40px rgba(35, 51, 40, 0.2);
  z-index: 5;
}

.polaroid-inner {
  display: flex;
  flex-direction: column;
}

.project-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  transition: transform 0.6s cubic-bezier(0.33, 1, 0.68, 1);
}

.polaroid-frame:hover .project-placeholder {
  transform: scale(1.02);
}

.proj-1 .project-placeholder { background: #1c2b20; }
.proj-2 .project-placeholder { background: #6b2f12; }
.proj-3 .project-placeholder { background: #4a4222; }
.proj-4 .project-placeholder { background: #6b1f38; }
.proj-5 .project-placeholder { background: #2c3a1f; }
.proj-6 .project-placeholder { background: #7a3a12; }
.proj-7 .project-placeholder { background: #22303e; }
.proj-8 .project-placeholder { background: #3a2440; }
.proj-9 .project-placeholder { background: #1f3a4a; }
.proj-10 .project-placeholder { background: #4a2f1f; }

.project-thumb-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-thumb-lottie {
  width: 100%;
  height: 100%;
}

.project-thumb-lottie svg {
  width: 100% !important;
  height: 100% !important;
}

.polaroid-caption {
  margin-top: 18px;
  text-align: center;
}

.project-card-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

#contact {
  padding: 120px 48px 80px;
  border-top: 0.5px solid var(--ink-08);
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--pistachio);
}

.contact-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(34px, 11vw, 140px);
  text-transform: uppercase;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 48px;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .contact-title {
    font-size: clamp(26px, 13vw, 48px);
  }
}

.contact-title span {
  color: var(--pink-deep);
}

.contact-links {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 80px;
}

.contact-link {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-50);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 0.5px solid var(--ink-30);
  padding-bottom: 4px;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.contact-link:hover {
  color: var(--ink);
  border-color: var(--primary);
}

footer {
  padding: 24px 48px;
  border-top: 0.5px solid var(--ink-06);
  background: var(--cream-pink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copy,
.footer-made {
  font-size: 11px;
  color: rgba(35, 51, 40, 0.45);
  letter-spacing: 0.05em;
}

.footer-made span {
  color: var(--primary);
}

.project-cover {
  width: 100%;
  aspect-ratio: 2.4 / 1;
  max-height: 900px;
  overflow: hidden;
  background: var(--ink-08);
}

.project-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-detail {
  max-width: 1000px;
  margin: 0 auto;
  padding: 64px 48px 120px;
}

.project-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-50);
  text-decoration: none;
  margin-bottom: 32px;
  transition: color 0.3s ease;
}

.project-detail-back:hover {
  color: var(--primary);
}

.project-detail-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(32px, 5vw, 56px);
  text-transform: uppercase;
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 28px;
}

.project-detail-desc {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.8;
  color: var(--ink-70);
  max-width: 640px;
}

.project-detail-desc--full {
  max-width: 1000px;
}

.project-detail-desc--spaced {
  margin-top: 28px;
}

.highlight-text {
  color: var(--primary);
  font-weight: 600;
}

.project-section {
  margin-top: 56px;
}

.project-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-50);
  margin-bottom: 16px;
}

.project-detail-media {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: var(--ink-08);
}

.project-detail-media img,
.project-detail-media video,
.custom-player-video {
  width: 100%;
  height: auto;
  display: block;
}

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

.project-row-item {
  border: none;
  padding: 0;
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--ink-08);
  cursor: pointer;
  aspect-ratio: 4 / 3;
  transition: transform 0.4s cubic-bezier(0.33, 1, 0.68, 1), box-shadow 0.3s ease;
}

.project-row-item:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 28px rgba(35, 51, 40, 0.18);
}

.project-row-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.gallery-lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35, 51, 40, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.gallery-lightbox-img {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.gallery-lightbox-close {
  position: absolute;
  top: 32px;
  right: 32px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.25s ease;
}

.gallery-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

body.modal-open {
  overflow: hidden;
}

.section-divider {
  height: 1px;
  background: var(--ink-08);
  margin: 0 48px;
}

@media (max-width: 700px) {
  .project-row {
    grid-template-columns: 1fr;
  }

  .project-detail {
    padding: 48px 24px 80px;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    height: 100dvh;
    width: 70vw;
    max-width: 320px;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 28px;
    padding: 100px 40px;
    background: var(--cream);
    box-shadow: -12px 0 40px rgba(35, 51, 40, 0.15);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.83, 0, 0.17, 1);
    z-index: 101;
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-links a {
    font-size: 14px;
  }
}

img, video {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;
}
