/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root {
  --bg: #111111;
  --text: #6b6b6b;
  --text-hi: #ffffff;
  --slide-bg: #232323;
  --slide-bg-2: #1f1f1f;
  --pad-x: 30px;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue",
               Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

@media (hover: hover) and (pointer: fine) {
  *, *::before, *::after, html, body { cursor: none !important; }
}

::selection { background: var(--text-hi); color: var(--bg); }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  text-align: left;
}

a { color: inherit; text-decoration: none; }

/* ---------- Custom cursor ---------- */
#cursor {
   position: fixed;
   top: 0;
   left: 0;
   width: 30px;
   height: 39px;
   pointer-events: none;
   z-index: 9999;
   transform: translate3d(-200px, -200px, 0);
   will-change: transform;
 }

.cursor-inner {
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  transition: transform 320ms cubic-bezier(0.34, 1.15, 0.64, 1);
}

.cursor-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.cursor-svg path {
   fill: #000000;
   stroke: #ffffff;
   stroke-width: 1.8;
   paint-order: stroke fill;
   stroke-linejoin: round;
   stroke-linecap: round;
 }

@media (hover: none), (pointer: coarse) {
  #cursor { display: none; }
}

/* ---------- Page ---------- */
.page {
  min-height: 100vh;
  padding: clamp(28px, 4vw, 56px) var(--pad-x) 120px;
}

.masthead { margin-bottom: 0; }

.display,
.menu-heading {
  font-family: inherit;
  font-weight: 400;
  font-size: clamp(40px, 8.4vw, 96px);
  line-height: 1.04;
  letter-spacing: -0.022em;
  margin: 0;
  display: block;
}

.display {
  color: var(--text-hi);
  margin-bottom: 6px;
  transition: color 180ms ease;
}

.display.dimmed { color: var(--text); }

/* ---------- Menu (accordion) ---------- */
.menu { display: block; }

.menu-item {
  display: block;
  border: 0;
}

.menu-heading {
  display: block;
  width: 100%;
  color: var(--text);
  transition: color 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.menu-heading:hover,
.menu-heading[aria-expanded="true"] { color: var(--text-hi); }

.menu.has-active .menu-heading:not([aria-expanded="true"]) { color: var(--text); }
.menu.has-active .menu-heading:not([aria-expanded="true"]):hover { color: var(--text); }

.menu-panel {
  overflow: hidden;
}

.menu-panel[hidden] { display: none; }

.panel-inner {
  padding: 22px 0 38px;
  max-width: 64ch;
  animation: panel-in 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* ---------- About body ---------- */
.about-body p {
  margin: 0 0 1.2em;
  color: var(--text-hi);
  font-size: clamp(27px, 2.7vw, 33px);
  line-height: 1.5;
  letter-spacing: -0.005em;
}

.about-body p:last-child { margin-bottom: 0; }

.about-body a {
  color: var(--text-hi);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: opacity 160ms ease;
}

.about-body a:hover { opacity: 0.65; }

/* ---------- Contact list ---------- */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.contact-list a {
  display: inline-block;
  color: var(--text-hi);
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
  transition: opacity 160ms ease;
}

.contact-list a:hover { opacity: 0.65; }

/* ---------- Projects ---------- */
.work-list { display: block; max-width: none; }

.project { margin: 0 0 64px; max-width: 760px; }
.project:last-child { margin-bottom: 0; }

.project-head { margin-bottom: 18px; }

.project-title {
  margin: 0 0 4px;
  font-size: clamp(27px, 2.7vw, 33px);
  font-weight: 400;
  color: var(--text-hi);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.project-desc {
  margin: 0;
  font-size: clamp(18px, 1.8vw, 22px);
  color: var(--text);
  max-width: 56ch;
  line-height: 1.5;
}

.project-visual {
  position: relative;
  aspect-ratio: 2940 / 1670;
  background: var(--slide-bg);
  overflow: hidden;
  border-radius: 2px;
  user-select: none;
  margin-top: 18px;
}

.slide-stage { position: absolute; inset: 0; }

.slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #4a4a4a;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  opacity: 0;
  transition: opacity 300ms ease;
  background: linear-gradient(135deg, var(--slide-bg) 0%, var(--slide-bg-2) 100%);
  overflow: hidden;
}

.slide.is-active { opacity: 1; }

.slide img {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  object-position: center top;
  z-index: 1;
}

.slide::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid #2c2c2c;
  border-radius: 2px;
  pointer-events: none;
}

.slide-image {
  background: #000 !important;
}

.slide-image::before {
  display: none !important;
}

/* Fullscreen button */
.fullscreen-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 3;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.65);
  opacity: 0;
  transition: opacity 160ms ease, color 140ms ease;
}

.project-visual:hover .fullscreen-btn { opacity: 1; }
.fullscreen-btn:hover { color: #fff; }

.fullscreen-btn svg {
  width: 14px;
  height: 14px;
  display: block;
}

/* Image lightbox */
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-lightbox[hidden] { display: none; }

.image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.image-lightbox-box {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-lightbox-img {
  display: block;
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 2px;
}

.image-lightbox-close {
  position: fixed;
  top: 16px;
  right: 18px;
  z-index: 2;
  color: rgba(255, 255, 255, 0.45);
  font-size: 18px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 3px;
  background: none;
  border: 0;
  transition: color 140ms ease;
}

.image-lightbox-close:hover { color: rgba(255, 255, 255, 0.9); }

.image-lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  color: rgba(255, 255, 255, 0.45);
  font-size: 22px;
  padding: 14px;
  background: none;
  border: 0;
  transition: color 140ms ease;
}

.image-lightbox-nav:hover { color: rgba(255, 255, 255, 0.9); }
.image-lightbox-prev { left: 16px; }
.image-lightbox-next { right: 16px; }

.image-lightbox-counter {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.35);
  font-variant-numeric: tabular-nums;
}

.zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background: transparent;
  border: 0;
  padding: 0;
  appearance: none;
  outline: none;
  z-index: 2;
  cursor: pointer;
}

.zone-left  { left: 0; }
.zone-right { right: 0; }

.counter {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ---------- Project meta ---------- */
.project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.tech-stack {
  display: inline-block;
  color: #ffffff;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

.demo-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 4px;
  border: 1px solid #ffffff;
  color: #ffffff;
  font-size: 16px;
  font-weight: 400;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 160ms ease;
}

.demo-btn:hover { opacity: 0.65; }

/* ---------- Video modal ---------- */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-modal[hidden] { display: none; }

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.video-modal-box {
  position: relative;
  z-index: 1;
  width: min(760px, 90vw);
  border-radius: 4px;
  overflow: hidden;
  background: #0a0a0a;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.85);
}

.video-modal-player {
  display: block;
  width: 100%;
  height: auto;
  max-height: 80vh;
}

.video-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  color: rgba(255, 255, 255, 0.45);
  font-size: 16px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 3px;
  transition: color 140ms ease;
}

.video-modal-close:hover { color: rgba(255, 255, 255, 0.9); }

/* ---------- Resume corner link ---------- */
.resume-corner {
  position: fixed;
  bottom: 28px;
  right: 30px;
  z-index: 100;
  color: var(--text-hi);
  font-size: clamp(28px, 3.2vw, 38px);
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 160ms ease;
}

.resume-corner:hover { opacity: 0.65; }

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  :root { --pad-x: 20px; }
  .display, .menu-heading { font-size: clamp(34px, 11vw, 56px); }
  .panel-inner { padding: 16px 0 28px; }
  .project-meta { flex-direction: column; align-items: flex-start; }
  .demo-btn { align-self: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor-inner { transition: none; }
  .panel-inner { animation: none; }
  .slide { transition: none; }
  .video-modal-backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; }
}
