/* ===========================
   CSS Custom Properties
   =========================== */
:root {
  --color-bg: #FAF9F6;
  --color-text: #1F1F1F;
  --color-text-muted: #CDCAC2;
  --color-border: #1F1F1F;
  --color-card-bg: #1a1a1a;
  --color-card-text: #fff;

  --font-serif: 'sabon-lt-pro', 'Georgia', serif;
  --font-sans: 'Switzer', 'Helvetica Neue', sans-serif;

  --sidebar-width: 180px;
  --sidebar-padding: 30px;
}

/* ===========================
   Reset & Base
   =========================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-serif);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button {
  cursor: url('../assets/images/icons/grab-open.svg') 9 9, pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}

/* ===========================
   Sidebar
   =========================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  padding: 40px var(--sidebar-padding);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-name {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 40px;
  display: inline-block;
  white-space: nowrap;
}

.name-reveal {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  vertical-align: bottom;
  color: var(--color-text-muted);
  transition: max-width 0.4s ease;
}

.sidebar-name:hover .name-reveal {
  max-width: 50px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-link {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  transition: color 0.2s ease;
  display: inline-block;
}

.nav-char {
  display: inline-block;
  will-change: transform;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-text);
}

/* Hamburger toggle — hidden on desktop */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: none;
  cursor: url('../assets/images/icons/grab-open.svg') 9 9, pointer;
}

.menu-toggle img {
  width: 20px;
  height: 20px;
}

/* ===========================
   Main Content
   =========================== */
.main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* ===========================
   Hero Section
   =========================== */
.hero {
  padding: 94px 60px 20px;
  max-width: 800px;
}

.hero-heading {
  font-family: var(--font-serif);
  font-size: clamp(40px, 5vw, 54px);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 40px;
}

.hero-bio {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.85;
  margin-bottom: 40px;
  max-width: 600px;
}

.hero-bio p {
  margin-bottom: 16px;
}

.hero-bio p:last-child {
  margin-bottom: 0;
}

/* ===========================
   Buttons
   =========================== */
.hero-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-outline {
  padding: 5px 10px;
  border: 1.5px solid var(--color-border);
  border-radius: 100px;
  background: transparent;
}

.btn-outline:hover {
  background: var(--color-text);
  color: var(--color-bg);
}

.btn.copied {
  background: var(--color-text);
  color: var(--color-bg);
}

.btn-email {
  height: 46px;
  padding: 0 20px;
  border: 1px solid #ECEAE3;
  border-radius: 100px;
  background: #F2F0EA;
  gap: 6px;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 16px;
}

.btn-email:hover {
  background: #ECEAE3;
}

.btn-email.copied {
  background: #ECEAE3;
  color: #2f2f2f;
}

.btn-email-sm {
  height: 40px;
  padding: 0 16px;
  font-size: 13px;
  gap: 5px;
}

.btn-email-sm .btn-email-icon img {
  width: 14px;
  height: 14px;
}

.btn-email-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-email-icon img {
  width: 18px;
  height: 18px;
  display: block;
}

/* ===========================
   Portfolio Section
   =========================== */
.portfolio {
  padding: 40px 60px 0;
}

.portfolio-filter {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.2px;
  color: #C1C1C1;
}

.filter-btn {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.2px;
  color: #CDCAC2;
  padding: 4px 0;
  border-bottom: 1.5px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.filter-btn:hover {
  color: var(--color-text);
}

.filter-btn.active {
  color: var(--color-text);
  font-weight: 600;
  border-bottom-color: var(--color-text);
}

/* ===========================
   Work Listing Overrides
   =========================== */
#work-listing .hero {
  padding-bottom: 0;
}

#work-listing .hero-heading {
  margin-bottom: 15px;
}

#work-listing .portfolio {
  padding-top: 20px;
}

/* ===========================
   Portfolio Toolbar
   =========================== */
.portfolio-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

/* ===========================
   View Toggle
   =========================== */
.portfolio-view {
  display: flex;
  gap: 4px;
}

.view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  opacity: 0.35;
  transition: opacity 0.2s ease;
}

.view-btn:hover {
  opacity: 0.7;
}

.view-btn.active {
  opacity: 1;
}

.view-icon {
  width: 16px;
  height: 16px;
}

/* ===========================
   Portfolio Grid — Full Bleed
   =========================== */
.portfolio-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
  /* Break out of .portfolio padding, then add sidebar-aligned margin */
  margin-left: calc(-1 * var(--sidebar-width) - 60px + var(--sidebar-padding));
  margin-right: calc(-60px + var(--sidebar-padding));
  padding: 0;
}

.portfolio-card {
  display: block;
  overflow: hidden;
  will-change: transform;
}

.portfolio-card.hidden {
  display: none;
}

/* ===========================
   List View
   =========================== */
.card-list-info {
  display: none;
}

.portfolio-grid.view-list {
  gap: 0;
  margin-left: 0;
  margin-right: 0;
}

.portfolio-grid.view-list .card-inner {
  display: none;
}

.portfolio-grid.view-list .card-list-info {
  display: flex;
  align-items: baseline;
  padding: 20px 0;
  border-bottom: 1px solid #E5E5E5;
}

.portfolio-grid.view-list .portfolio-card:first-child .card-list-info {
  border-top: 1px solid #E5E5E5;
}

.card-list-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 400;
  flex: 1;
}

.card-list-subtitle {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #84827B;
  flex-shrink: 0;
}

.card-list-year {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 1.2px;
  color: #84827B;
  flex-shrink: 0;
  margin-left: 40px;
}

.portfolio-grid.view-list .portfolio-card:hover .card-list-title {
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

/* ===========================
   Hover Preview
   =========================== */
.work-preview {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  width: 280px;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  transition: opacity 0.25s ease;
}

.work-preview.visible {
  opacity: 1;
}

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

.card-inner {
  width: 100%;
  min-height: 80vh;
  background-color: var(--color-card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-info {
  text-align: center;
  color: var(--color-card-text);
}

.card-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 400;
  margin-bottom: 8px;
}

.card-subtitle {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 400;
  color: #aaa;
}

/* ===========================
   3D Carousel (Homepage)
   =========================== */
.carousel-section {
  margin-left: calc(-1 * var(--sidebar-width));
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.carousel-scene {
  perspective: 3000px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-ring {
  position: relative;
  width: 1px;
  height: 1px;
  transform-style: preserve-3d;
}

.carousel-card {
  position: absolute;
  width: 80vw;
  height: 70vh;
  left: -40vw;
  top: -35vh;
  overflow: hidden;
  display: block;
}

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

.carousel-card-placeholder {
  width: 100%;
  height: 100%;
  background: var(--color-card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-card-placeholder span {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--color-card-text);
}

.carousel-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.carousel-card:hover .carousel-overlay {
  opacity: 1;
}

.carousel-overlay-title {
  font-family: var(--font-serif);
  font-size: 24px;
  color: #fff;
  margin-bottom: 6px;
}

.carousel-overlay-subtitle {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

/* ===========================
   About Image
   =========================== */
.about-image {
  margin-left: calc(-1 * var(--sidebar-width));
  width: calc(100% + var(--sidebar-width));
  padding-top: 30px;
  padding-left: 30px;
  padding-right: 30px;
}

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

/* ===========================
   Work Detail Page
   =========================== */
#work-detail {
  padding: 122px 60px 40px;
  max-width: 800px;
}

.work-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  margin-bottom: 48px;
  transition: opacity 0.2s ease;
}

.work-back-icon {
  width: 16px;
  height: 16px;
}

.work-back:hover {
  opacity: 0.6;
}

.work-title {
  font-family: var(--font-serif);
  font-size: clamp(36px, 5vw, 54px);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 40px;
}

.work-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}

.work-meta-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.work-meta-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #84827B;
  margin-bottom: 4px;
}

.work-meta-value {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.6;
}

.work-meta-value a {
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease;
}

.work-meta-value a:hover {
  opacity: 0.6;
}

.work-description {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.75;
  max-width: 600px;
  margin-bottom: 40px;
}

.work-description p {
  margin-bottom: 16px;
}

.work-description p:last-child {
  margin-bottom: 0;
}

.work-team {
  padding: 60px 0;
}

.work-team-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #84827B;
  margin-bottom: 16px;
}

.work-team-member {
  display: flex;
  gap: 24px;
  padding: 6px 0;
}

.work-team-role {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: #84827B;
  min-width: 160px;
  flex-shrink: 0;
}

.work-team-name {
  font-family: var(--font-serif);
  font-size: 15px;
}

.work-process {
  margin-bottom: 60px;
}

.work-process-btn {
  font-size: 11px;
  letter-spacing: 1.5px;
}

.work-gallery {
  width: 100vw;
  margin-left: calc(-1 * var(--sidebar-width) - 60px);
  padding: 0 var(--sidebar-padding);
}

.work-gallery img,
.work-gallery video {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 24px;
}

.work-gallery .img-protect:last-child,
.work-gallery .video-wrap:last-child {
  margin-bottom: 0;
}

/* Image protection — transparent overlay blocks download extensions */
.img-protect {
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
}

.img-protect img {
  margin-bottom: 0;
  pointer-events: none;
}

.img-protect::after,
.video-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.video-wrap {
  position: relative;
  margin-bottom: 24px;
}

.video-wrap video {
  margin-bottom: 0;
}

.video-mute-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
  z-index: 2;
}

.video-wrap:hover .video-mute-btn {
  opacity: 1;
}

.video-mute-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

.video-mute-btn .icon-muted,
.video-mute-btn .icon-unmuted {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
  display: block;
  margin: auto;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.video-mute-btn .icon-unmuted {
  visibility: hidden;
}

.video-mute-btn.unmuted .icon-muted {
  visibility: hidden;
}

.video-mute-btn.unmuted .icon-unmuted {
  visibility: visible;
}

.work-empty {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--color-text-muted);
}

.work-impact {
  padding: 60px 60px 60px 0;
}

.work-impact-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #84827B;
  margin-bottom: 40px;
}

.work-impact-item {
  margin-bottom: 40px;
}

.work-impact-item:last-child {
  margin-bottom: 0;
}

.work-impact-title {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 6px;
}

.work-impact-desc {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.6;
  color: #84827B;
}

/* ===========================
   Other Works (Work Detail)
   =========================== */
.other-works {
  padding: 60px 0;
}

.other-works-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #84827B;
  margin-bottom: 24px;
}

.other-works-track {
  display: flex;
  gap: 12px;
}

.other-works-card {
  width: 140px;
  height: 95px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  background-color: #A9A9A0;
  display: block;
  position: relative;
  overflow: hidden;
}

.other-works-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.other-works-card:hover .other-works-overlay {
  opacity: 1;
}

.other-works-title {
  font-family: var(--font-serif);
  font-size: 13px;
  color: #fff;
  margin-bottom: 2px;
}

.other-works-subtitle {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

/* ===========================
   404 Page
   =========================== */
.quote-block {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  line-height: 1.75;
  color: var(--color-text-muted);
  margin-bottom: 40px;
  max-width: 480px;
}

.quote-author {
  display: block;
  font-style: normal;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.05em;
  margin-top: 8px;
}

/* ===========================
   Image Protection
   =========================== */
img,
video {
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  image-rendering: auto;
}

.work-gallery img,
.work-gallery video,
.card-inner {
  filter: blur(0.4px);
  transform: scale(1.005);
}

/* ===========================
   Drawing Canvas (About page)
   =========================== */
#draw-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  pointer-events: none;
}

body.draw-page {
  cursor: url('../assets/images/icons/pencil.svg') 2 22, crosshair;
}

/* --- Infinite canvas (404 page) --- */
body.page-infinite {
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

body.page-infinite.hand-mode {
  cursor: url('../assets/images/icons/handcursor.svg') 9 9, grab !important;
}

body.page-infinite.hand-mode.panning {
  cursor: url('../assets/images/icons/grab-close.svg') 9 9, grabbing !important;
}

body.page-infinite .main {
  will-change: transform;
}

.draw-toolbox-toggles {
  display: flex;
  align-items: center;
  gap: 4px;
}

#hand-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ECEAE3;
  border: none;
  padding: 0;
  transition: background 0.2s ease;
}

#hand-btn:hover {
  background: #E0DED7;
}

#hand-btn.active {
  background: var(--color-text);
}

#hand-btn.active .toolbox-icon {
  filter: brightness(0) invert(1);
}

body.page-infinite #hand-btn {
  display: flex;
}

body.draw-page a,
body.draw-page button:not(.draw-toolbox-toggle):not(#hand-btn) {
  cursor: url('../assets/images/icons/grab-open.svg') 9 9, pointer;
}

/* ===========================
   Draw Toolbox
   =========================== */
.draw-toolbox {
  position: fixed;
  right: var(--sidebar-padding);
  top: 40px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.draw-toolbox.visible {
  opacity: 1;
  pointer-events: auto;
}

.draw-toolbox.dragging,
.draw-toolbox.dragging .draw-toolbox-toggle {
  cursor: url('../assets/images/icons/grab-close.svg') 9 9, grabbing;
}

/* Toggle button (toolbox icon) — always visible when toolbox is shown */
.draw-toolbox-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ECEAE3;
  border: none;
  cursor: url('../assets/images/icons/grab-open.svg') 9 9, grab;
  padding: 0;
  transition: background 0.2s ease;
}

.draw-toolbox-toggle .toolbox-icon {
  cursor: inherit
}

.draw-toolbox-toggle:hover {
  background: #E0DED7;
}

/* Pencil selector — center-expanding picker */
.pencil-selector-wrap {
  position: relative;
}

.pencil-selector-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(0);
  transform-origin: center top;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 44px;
  padding: 10px;
  border-radius: 100px;
  background: #ECEAE3;
  box-sizing: border-box;
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.pencil-selector-panel.open {
  transform: translateX(-50%) scale(1);
  opacity: 1;
}

/* Expandable panel */
.draw-toolbox-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: flex-end;
  gap: 2px;
  width: 44px;
  padding: 10px;
  border-radius: 100px;
  background: #ECEAE3;
  box-sizing: border-box;
  margin-top: 6px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease;
}

.draw-toolbox-panel.open {
  max-height: 600px;
  opacity: 1;
}

.draw-toolbox-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: url('../assets/images/icons/grab-open.svg') 9 9, pointer;
  padding: 0;
  transition: background 0.2s ease;
}

.draw-toolbox-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.draw-toolbox-btn.active {
  background: var(--color-text);
}

.draw-toolbox-btn.active .toolbox-icon {
  filter: brightness(0) invert(1);
}

.toolbox-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.draw-weight-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.draw-weight-picker.open {
  max-height: 80px;
}

.draw-color-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.draw-color-picker.open {
  max-height: 200px;
}

.draw-color-swatch {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid transparent;
  cursor: url('../assets/images/icons/grab-open.svg') 9 9, pointer;
  padding: 0;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.draw-color-swatch span {
  display: block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
}

.draw-color-swatch:hover {
  transform: scale(1.2);
}

.draw-color-swatch.active {
  border-color: var(--color-text);
}

.draw-color-random {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: conic-gradient(#DC3232, #F0C828, #3CB44B, #3282DC, #1F0954, #7F00FF);
  font-size: 0;
  line-height: 0;
  color: transparent;
}

.draw-toolbox-divider {
  width: 20px;
  height: 1px;
  background: #D6D4CD;
  margin: 2px 0;
}

body.draw-eraser {
  cursor: url('../assets/images/icons/eraser.svg') 12 12, crosshair;
}

body.draw-wand {
  cursor: url('../assets/images/icons/wand.svg') 2 2, crosshair;
}
body.draw-wand a,
body.draw-wand button {
  cursor: url('../assets/images/icons/grab-open.svg') 9 9, pointer;
}

[data-theme="dark"] body.draw-page {
  cursor: url('../assets/images/icons/pencil-light.svg') 2 22, crosshair;
}

[data-theme="dark"] body.draw-eraser {
  cursor: url('../assets/images/icons/eraser-light.svg') 12 12, crosshair;
}

[data-theme="dark"] body.draw-wand {
  cursor: url('../assets/images/icons/wand-light.svg') 2 2, crosshair;
}

[data-theme="dark"] body.page-infinite.hand-mode {
  cursor: url('../assets/images/icons/handcursor.svg') 9 9, grab !important;
}

[data-theme="dark"] body.page-infinite.hand-mode.panning {
  cursor: url('../assets/images/icons/grab-close.svg') 9 9, grabbing !important;
}

/* ===========================
   Footer — Grid Layout
   =========================== */
.footer {
  margin-left: calc(-1 * var(--sidebar-width));
  padding: 60px var(--sidebar-padding) 100px;
}

.footer-grid {
  --footer-border: #ECEAE3;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--footer-border);
}

/* Top Row — CTA */
.footer-cta {
  grid-column: span 2;
  padding: 30px 30px;
  border-bottom: 1px solid var(--footer-border);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.footer-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.footer-label-icon {
  width: 20px;
  height: 20px;
  filter: brightness(0) saturate(100%) invert(55%) sepia(5%) saturate(574%) hue-rotate(22deg) brightness(95%) contrast(87%);
}

.footer-label span {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #84827B;
}

.footer-heading {
  font-family: var(--font-serif);
  font-size: clamp(48px, 6vw, 80px);
  font-weight: 400;
  line-height: 1.05;
  color: var(--color-text);
}

/* Top Row — Services */
.footer-services {
  border-left: 1px solid var(--footer-border);
  border-bottom: 1px solid var(--footer-border);
  display: flex;
  flex-direction: column;
}

.footer-service {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: 16px;
  transition: background 0.2s ease;
}

.footer-service:hover {
  background: rgba(0, 0, 0, 0.02);
}

.footer-service + .footer-service {
  border-top: 1px solid var(--footer-border);
}

.footer-service-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.footer-service-icon.sprint-spinning {
  animation: sprint-spin 1s linear infinite;
}

@keyframes sprint-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.footer-service-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 400;
  color: #1F1F1F;
  line-height: 1.4;
}

.footer-service-desc {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  color: #84827B;
  /* margin-top: 2px; */
  line-height: 1.4;
}

/* Top Row — Illustration */
.footer-illustration {
  border-left: 1px solid var(--footer-border);
  border-bottom: 1px solid var(--footer-border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 16px;
  overflow: hidden;
}

.footer-illust-item {
  height: 100%;
  max-height: 200px;
  width: auto;
  opacity: 0.7;
}

/* Bottom Row — Socials */
.footer-socials-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
}

.footer-social {
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #84827B;
  transition: background 0.2s ease;
}

.footer-social:hover {
  background: rgba(0, 0, 0, 0.02);
}

.footer-social + .footer-social {
  border-left: 1px solid var(--footer-border);
}

.footer-social-icon {
  width: 18px;
  height: 18px;
  filter: brightness(0) saturate(100%) invert(55%) sepia(5%) saturate(574%) hue-rotate(22deg) brightness(95%) contrast(87%);
}

/* Illustration — clickable cursors */
.footer-illust-item {
  cursor: url('../assets/images/icons/grab-open.svg') 9 9, grab;
  transition: opacity 0.2s ease, filter 0.2s ease, transform 0.2s ease;
}

.footer-illust-item:hover {
  opacity: 1;
  animation: pencil-bounce 0.5s ease;
}

.footer-illust-item.active {
  opacity: 1;
  filter: brightness(0) invert(1) brightness(0.122);
}

@keyframes pencil-bounce {
  0%   { transform: translateY(0); }
  30%  { transform: translateY(-8px); }
  50%  { transform: translateY(-3px); }
  70%  { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

/* Copyright */
.footer-copyright {
  grid-column: 1 / -1;
  font-family: var(--font-sans);
  font-size: 12px;
  color: #84827B;
  text-align: center;
  padding: 16px 0;
  border-top: 1px solid var(--footer-border);
}

/* ===========================
   Theme Toggle
   =========================== */
.theme-toggle {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #ECEAE3;
  cursor: url('../assets/images/icons/grab-open.svg') 9 9, pointer;
  transition: background 0.2s ease;
}

.theme-toggle:hover {
  background: #E0DED7;
}

.theme-toggle .theme-icon {
  width: 20px;
  height: 20px;
}

.theme-toggle .theme-icon-light {
  display: none;
}

[data-theme="dark"] .theme-toggle .theme-icon-dark {
  display: none;
}

[data-theme="dark"] .theme-toggle .theme-icon-light {
  display: block;
}

/* ===========================
   Scroll to Top
   =========================== */
.scroll-top {
  position: fixed;
  bottom: 40px;
  right: var(--sidebar-padding);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ECEAE3;
  border: none;
  cursor: url('../assets/images/icons/grab-open.svg') 9 9, pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, background 0.2s ease;
}

.scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.scroll-top:hover {
  background: #E0DED7;
}

.scroll-top-icon {
  width: 20px;
  height: 20px;
}

[data-theme="dark"] .scroll-top {
  background: #2A2A2A;
}

[data-theme="dark"] .scroll-top:hover {
  background: #333;
}

[data-theme="dark"] .scroll-top-icon {
  filter: brightness(0) invert(1);
}

/* ===========================
   Dark Mode
   =========================== */
[data-theme="dark"] {
  --color-bg: #1A1A1A;
  --color-text: #F0F0F0;
  --color-text-muted: #666;
  --color-border: #F0F0F0;
  --color-card-bg: #111;
  --color-card-text: #fff;
}

[data-theme="dark"] .btn-email {
  border-color: #333;
  background: #2A2A2A;
}

[data-theme="dark"] .btn-email:hover {
  background: #333;
}

[data-theme="dark"] .btn-email.copied {
  background: #333;
  color: #F0F0F0;
}

[data-theme="dark"] .filter-label,
[data-theme="dark"] .filter-btn {
  color: #666;
}

[data-theme="dark"] .portfolio-grid.view-list .card-list-info {
  border-bottom-color: #333;
}

[data-theme="dark"] .portfolio-grid.view-list .portfolio-card:first-child .card-list-info {
  border-top-color: #333;
}

[data-theme="dark"] .card-list-subtitle,
[data-theme="dark"] .card-list-year,
[data-theme="dark"] .work-meta-label,
[data-theme="dark"] .work-team-label,
[data-theme="dark"] .work-impact-label,
[data-theme="dark"] .work-impact-desc {
  color: #999;
}

[data-theme="dark"] .other-works-label {
  color: #999;
}

[data-theme="dark"] .other-works-card {
  background-color: #3A3A3A;
}

[data-theme="dark"] .card-subtitle {
  color: #888;
}

[data-theme="dark"] .sidebar img,
[data-theme="dark"] .work-back-icon,
[data-theme="dark"] .btn-email-icon img,
[data-theme="dark"] .view-icon {
  filter: brightness(0) invert(1);
}

[data-theme="dark"] .theme-toggle .theme-icon {
  filter: brightness(0) invert(1);
}

[data-theme="dark"] .theme-toggle {
  background: #2A2A2A;
}

[data-theme="dark"] .theme-toggle:hover {
  background: #333;
}

[data-theme="dark"] .draw-toolbox-toggle,
[data-theme="dark"] .draw-toolbox-panel,
[data-theme="dark"] .pencil-selector-panel,
[data-theme="dark"] #hand-btn {
  background: #2A2A2A;
}

[data-theme="dark"] .draw-toolbox-toggle:hover,
[data-theme="dark"] #hand-btn:hover {
  background: #333;
}

[data-theme="dark"] #hand-btn.active {
  background: var(--color-text);
}

[data-theme="dark"] #hand-btn.active .toolbox-icon {
  filter: brightness(0);
}

[data-theme="dark"] .toolbox-icon {
  filter: brightness(0) invert(1);
}

[data-theme="dark"] .draw-toolbox-btn.active .toolbox-icon {
  filter: brightness(0);
}

[data-theme="dark"] .draw-toolbox-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .draw-toolbox-divider {
  background: #444;
}

[data-theme="dark"] .draw-color-swatch.active {
  border-color: #F0F0F0;
}

[data-theme="dark"] .footer-grid {
  --footer-border: #333;
}

[data-theme="dark"] .footer-label span {
  color: #999;
}

[data-theme="dark"] .footer-service-title {
  color: #F0F0F0;
}

[data-theme="dark"] .footer-service-desc {
  color: #999;
}

[data-theme="dark"] .footer-social {
  color: #999;
}

[data-theme="dark"] .footer-copyright {
  color: #999;
}

[data-theme="dark"] .footer-label-icon,
[data-theme="dark"] .footer-service-icon,
[data-theme="dark"] .footer-social-icon,
[data-theme="dark"] .footer-illust-item {
  filter: brightness(0) invert(1);
}

[data-theme="dark"] .footer-illust-item.active {
  filter: brightness(0) invert(1) brightness(0.122);
}

[data-theme="dark"] .footer-service:hover,
[data-theme="dark"] .footer-social:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Dark mode — grab cursors */
[data-theme="dark"] a,
[data-theme="dark"] button {
  cursor: url('../assets/images/icons/grab-open.svg') 9 9, pointer;
}

[data-theme="dark"] .footer-illust-item {
  cursor: url('../assets/images/icons/grab-open.svg') 9 9, grab;
}

[data-theme="dark"] .scroll-top {
  background: #333;
}

[data-theme="dark"] .scroll-top:hover {
  background: #444;
}

[data-theme="dark"] .scroll-top-icon {
  filter: brightness(0) invert(1);
}

[data-theme="dark"] .draw-toolbox-toggle {
  cursor: url('../assets/images/icons/grab-open.svg') 9 9, grab;
}

/* ===========================
   Responsive — Tablet
   =========================== */
@media (max-width: 1024px) {
  .hero {
    padding: 122px 40px 40px;
  }

  .portfolio {
    padding: 40px 40px 0;
  }

  .portfolio-grid {
    margin-left: calc(-1 * var(--sidebar-width) - 40px + var(--sidebar-padding));
    margin-right: calc(-40px + var(--sidebar-padding));
  }

  .portfolio-grid.view-list {
    margin-left: 0;
    margin-right: 0;
  }

  #work-detail {
    padding: 122px 40px 40px;
  }

  .work-gallery {
    width: 100vw;
    margin-left: calc(-1 * var(--sidebar-width) - 40px);
    padding: 0 var(--sidebar-padding);
  }

  .footer {
    padding: 80px 40px 40px;
  }

  .footer-cta {
    padding: 36px 32px;
  }

  .footer-service {
    padding: 20px;
  }

  .carousel-scene {
    perspective: 2500px;
    padding-bottom: 10vh;
  }

  .carousel-card {
    width: 85vw;
    height: 60vh;
    left: -42.5vw;
    top: -30vh;
  }
}

/* ===========================
   Responsive — Mobile
   =========================== */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
    --sidebar-padding: 24px;
  }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
  }

  .sidebar-name {
    margin-bottom: 0;
  }

  .menu-toggle {
    display: flex;
  }

  .theme-toggle {
    position: fixed;
    bottom: 24px;
    left: 24px;
    margin-top: 0;
    z-index: 60;
  }

  .theme-toggle {
    width: 38px;
    height: 38px;
  }

  .scroll-top {
    bottom: 24px;
    right: 24px;
    width: 38px;
    height: 38px;
  }

  .sidebar-nav {
    display: none;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    padding: 20px 0 4px;
  }

  .sidebar-nav.open {
    display: flex;
  }

  .main {
    margin-left: 0;
  }

  .about-image {
    margin-left: 0;
    width: 100%;
  }

  .hero {
    padding: 40px 24px 32px;
    max-width: 100%;
  }

  .hero-heading {
    font-size: 48px;
    margin-bottom: 28px;
  }

  .hero-bio {
    font-size: 15px;
    margin-bottom: 28px;
  }

  .hero-bio br {
    display: none;
  }

  .portfolio {
    padding: 32px 24px 0;
  }

  .portfolio-toolbar {
    flex-wrap: wrap;
    gap: 16px;
  }

  .portfolio-filter {
    gap: 16px;
    margin-bottom: 0;
  }

  .portfolio-grid {
    margin-left: -24px;
    margin-right: -24px;
    gap: 16px;
  }

  .portfolio-grid.view-list {
    margin-left: 0;
    margin-right: 0;
  }

  .portfolio-grid.view-list .card-list-info {
    padding: 16px 0;
  }

  .card-list-title {
    font-size: 16px;
  }

  .card-list-year {
    margin-left: 24px;
  }

  .card-inner {
    min-height: 50vh;
  }

  .card-title {
    font-size: 24px;
  }

  .card-subtitle {
    font-size: 14px;
  }

  .footer {
    margin-left: 0;
    padding: 32px 24px 80px;
  }

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

  .footer-cta {
    grid-column: 1 / -1;
    border-right: none;
    padding: 32px 24px;
  }

  .footer-heading {
    font-size: 72px;
  }

  .footer-services {
    border-left: none;
  }

  .footer-illustration {
    display: flex;
    padding: 16px 12px;
  }

  .footer-illust-item {
    max-height: 140px;
  }

  .footer-socials-row {
    grid-column: 1 / -1;
  }

  .footer-social:nth-child(2n) {
    border-left: 1px solid var(--footer-border);
  }

  .footer-social:nth-child(2n+1) {
    border-left: none;
  }

  .footer-social:nth-child(n+3) {
    border-top: 1px solid var(--footer-border);
  }

  #work-detail {
    padding: 40px 24px 32px;
    max-width: 100%;
  }

  .work-back {
    margin-bottom: 32px;
  }

  .work-title {
    font-size: 32px;
    margin-bottom: 28px;
  }

  .work-meta {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 32px;
  }

  .work-gallery {
    width: 100vw;
    margin-left: -24px;
    padding: 0 var(--sidebar-padding);
  }

  .work-gallery .img-protect,
  .work-gallery .video-wrap {
    margin-bottom: 16px;
  }

  .video-mute-btn {
    opacity: 1;
  }

  .work-impact {
    padding: 40px 0;
  }

  .other-works {
    padding: 40px 0;
  }

  .other-works-track {
    flex-wrap: wrap;
  }

  .other-works-card {
    width: 120px;
    height: 80px;
  }

  .draw-toolbox {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    top: auto;
    bottom: 24px;
    flex-direction: column-reverse;
  }

  .draw-toolbox-panel {
    margin-top: 0;
    margin-bottom: 6px;
  }

  .draw-toolbox-toggle {
    width: 38px;
    height: 38px;
  }

  .pencil-selector-panel {
    top: auto;
    bottom: calc(100% + 6px);
    transform-origin: center bottom;
  }

  .pencil-selector-panel.open {
    transform: translateX(-50%) scale(1);
  }

  .draw-toolbox-btn {
    width: 20px;
    height: 20px;
  }

  .draw-toolbox-panel,
  .pencil-selector-panel {
    width: 38px;
    padding: 9px;
  }

  .toolbox-icon {
    width: 16px;
    height: 16px;
  }

  .theme-toggle .theme-icon,
  .scroll-top-icon {
    width: 18px;
    height: 18px;
  }

  .carousel-section {
    margin-left: 0;
  }

  .carousel-scene {
    perspective: 2000px;
    padding-bottom: 15vh;
  }

  .carousel-card {
    width: 90vw;
    height: 55vh;
    left: -45vw;
    top: -27.5vh;
  }

  .carousel-overlay-title {
    font-size: 20px;
  }
}

/* ===========================
   Responsive — Small Mobile
   =========================== */
@media (max-width: 480px) {
  .sidebar {
    padding: 16px 20px;
  }

  .hero {
    padding: 32px 20px 24px;
  }

  .hero-heading {
    font-size: 32px;
    margin-bottom: 24px;
  }

  .hero-bio {
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: px;
  }

  .portfolio {
    padding: 24px 20px 0;
  }

  .portfolio-toolbar {
    gap: 12px;
  }

  .portfolio-filter {
    gap: 12px;
  }

  .filter-label,
  .filter-btn {
    font-size: 10px;
  }

  .portfolio-grid {
    margin-left: -20px;
    margin-right: -20px;
    gap: 12px;
  }

  .portfolio-grid.view-list {
    margin-left: 0;
    margin-right: 0;
  }

  .card-list-subtitle {
    display: none;
  }

  .card-list-year {
    margin-left: 16px;
  }

  .card-inner {
    min-height: 40vh;
  }

  .footer {
    padding: 32px 20px 20px;
  }

  .footer-cta {
    padding: 24px 20px;
  }

  .footer-heading {
    font-size: 60px;
  }

  .footer-copyright,
  .footer-social {
    font-size: 11px;
  }

  .footer-illust-item {
    max-height: 100px;
  }

  #work-detail {
    padding: 32px 20px 24px;
  }

  .work-title {
    font-size: 28px;
    margin-bottom: 24px;
  }

  .work-gallery {
    width: 100vw;
    margin-left: -20px;
    padding: 0 20px;
  }

  .work-gallery .img-protect,
  .work-gallery .video-wrap {
    margin-bottom: 12px;
  }

  .other-works {
    padding: 32px 0;
  }

  .other-works-card {
    width: 100px;
    height: 68px;
  }

  .carousel-scene {
    perspective: 1500px;
    padding-bottom: 20vh;
  }

  .carousel-card {
    width: 92vw;
    height: 45vh;
    left: -46vw;
    top: -22.5vh;
  }

  .carousel-overlay-title {
    font-size: 16px;
  }
}
