/* ============================================
   VARIABLES
   ============================================ */
:root {
  --orange: #ff6d00;
  --orange-light: #ff8c38;
  --dark: #2a2a2a;
  --dark-secondary: #3a3a3a;

  --bg: #e4e4e4;
  --card-bg: #f5f5f5;
  --card-border: #c8c8c8;
  --card-shadow: rgba(0, 0, 0, 0.08);

  --tab-bg: #d8d8d8;
  --tab-border: #bfbfbf;

  --text-primary: #1a1a1a;
  --text-secondary: #666;

  --toggle-bg: #d0d0d0;
  --toggle-border: #b8b8b8;

  --grid-line: rgba(0, 0, 0, 0.07);

  --radius-pill: 999px;
  --radius-card: 20px;

  --font: "Inter", sans-serif;
  --font-bit: "Bitcount Prop Single", "Courier New", monospace;
}

[data-theme="dark"] {
  --bg: #1a1a1a;
  --card-bg: #1e1e1e;
  --card-border: #333;
  --card-shadow: rgba(0, 0, 0, 0.5);

  --tab-bg: #2e2e2e;
  --tab-border: #444;

  --text-primary: #f0f0f0;
  --text-secondary: #999;

  --toggle-bg: #2e2e2e;
  --toggle-border: #444;

  --grid-line: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .card {
  box-shadow:
    inset 0 6px 18px rgba(0, 0, 0, 0.5),
    inset 0 -2px 8px rgba(0, 0, 0, 0.3),
    inset 4px 0 12px rgba(0, 0, 0, 0.3),
    inset -4px 0 12px rgba(0, 0, 0, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.04);
}

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

html, body {
  height: 100%;
}

body {
  font-family: var(--font);
  font-weight: 300;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: background 0.2s, color 0.2s;
}

/* ============================================
   TOP BAR
   ============================================ */
.top-bar {
  display: flex;
  gap: 25px;
  align-items: center;
}

.pill {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  user-select: none;
}

.pill-dark {
  background: #222;
  color: #e0e0e0;
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.6),
    inset 0 -1px 3px rgba(0, 0, 0, 0.3);
}

/* Clock pill */
.pill-clock {
  flex-shrink: 0;
  width: 220px;
  justify-content: center;
  padding: 10px 22px;
  font-family: var(--font-bit);
  font-size: 22px;
  font-weight: 200;
  letter-spacing: 0.04em;
  text-transform: none;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  gap: 4px;
  align-items: baseline;
}

#clock-ampm {
  font-size: 12px;
  opacity: 0.7;
  letter-spacing: 0.06em;
}

/* Marquee pill */
.pill-marquee {
  flex: 1;
  padding: 10px 20px;
  font-family: var(--font-bit);
  font-size: 22px;
  font-weight: 200;
  letter-spacing: 0.03em;
  text-transform: none;
  overflow: hidden;
  justify-content: flex-start;
}

.marquee-track {
  display: flex;
  white-space: nowrap;
  will-change: transform;
  animation: marquee 55s linear infinite;
}

.marquee-track span {
  display: inline-block;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  flex: 1;
  min-height: 0;
}

/* ============================================
   LEFT COLUMN
   ============================================ */
.col-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ============================================
   TAB BAR
   ============================================ */
.tab-bar {
  display: flex;
  align-items: center;
  position: relative;
  background: var(--tab-bg);
  border: 1.5px solid var(--tab-border);
  border-radius: var(--radius-pill);
  padding: 5px;
  width: 100%;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
}

/* The sliding orange pill */
.tab-slider {
  position: absolute;
  top: 5px;
  left: 0;
  height: calc(100% - 10px);
  border-radius: var(--radius-pill);
  background: var(--orange);
  pointer-events: none;
  z-index: 0;
  will-change: transform, width;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  flex: 1;
  border: none;
  background: transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.15s;
  position: relative;
  z-index: 1;
}

.tab:hover:not(.active) {
  color: var(--text-primary);
}

.tab.active {
  color: #fff;
}

/* ============================================
   SCREEN BOOT ANIMATION
   ============================================ */
@keyframes screenFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

body.booting #clock-time,
body.booting #clock-ampm {
  opacity: 0;
  animation: screenFadeIn 0.5s ease forwards;
}

body.booting .marquee-track {
  opacity: 0;
  animation: screenFadeIn 0.5s ease 0.12s forwards, marquee 55s linear infinite;
}

body.booting .panel.active {
  opacity: 0;
  animation: screenFadeIn 0.7s ease 0.45s forwards;
}

body.booting .projects-panel {
  opacity: 0;
  animation: screenFadeIn 0.7s ease 0.6s forwards;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background-color: var(--card-bg);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 8px 8px;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow:
    inset 0 4px 14px rgba(0, 0, 0, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.5);
  overflow: hidden;
  contain: layout paint;
}

.card-left {
  flex: 1;
  min-height: 0;
  position: relative;
}

.card-right {
  height: 100%;
}

/* ============================================
   CONTENT PANELS
   ============================================ */
.panel {
  display: none;
  position: absolute;
  inset: 10px;
  padding: 10px 12px;
  overflow-y: auto;
  flex-direction: column;
  gap: 8px;
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.06);
  will-change: transform;
  backface-visibility: hidden;
}

.panel.active {
  display: flex;
}

.panel.slide-out {
  display: flex;
  animation: panelSlideOut 0.36s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.panel.slide-in {
  display: flex;
  animation: panelSlideIn 0.36s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes panelSlideOut {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-100% - 20px)); }
}

@keyframes panelSlideIn {
  from { transform: translateX(calc(100% + 20px)); }
  to   { transform: translateX(0); }
}

.panel-title {
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.35em;
  color: var(--text-secondary);
  text-align: center;
  text-transform: uppercase;
  flex-shrink: 0;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--card-border);
  margin-left: -12px;
  margin-right: -12px;
  padding-left: 12px;
  padding-right: 12px;
}

/* --- ABOUT --- */
.about-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  flex-shrink: 0;
}

.profile-photo-wrap {
  width: 140px;
  height: 140px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  display: block;
  position: relative;
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.profile-photo-wrap:hover {
  transform: scale(0.985);
  border-color: var(--text-secondary);
}

.profile-photo-wrap:active {
  transform: scale(0.97);
}

.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.3);
  transform-origin: center center;
}

.skill-tags {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.tag {
  display: block;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  background: transparent;
}

.tag-pink   { border-color: #e80000; color: #e80000; }
.tag-purple { border-color: #7c00f0; color: #7c00f0; }
.tag-orange { border-color: var(--orange); color: var(--orange); }
.tag-green  { border-color: #00b341; color: #00b341; }
.tag-blue   { border-color: #007aff; color: #007aff; }

.bio {
  font-size: 12px;
  font-weight: 300;
  line-height: 1.8;
  letter-spacing: 0.02em;
  word-spacing: 0.05em;
  text-align: justify;
  text-justify: inter-word;
  color: var(--text-primary);
  flex-shrink: 0;
  margin-top: auto;
}

.accent {
  color: var(--orange);
  font-weight: 300;
}

/* --- CONTACT --- */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.form-input {
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-bottom: 1px solid var(--card-border);
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.08em;
  outline: none;
  transition: border-color 0.15s;
  resize: none;
}

.form-input::placeholder {
  color: var(--text-secondary);
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
}

.form-input:focus {
  border-color: var(--orange);
}

.form-textarea {
  flex: 1;
  min-height: 120px;
}

.send-btn {
  align-self: center;
  padding: 13px 56px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  margin-top: 6px;
}

.send-btn:hover          { background: var(--orange-light); }
.send-btn:active         { transform: scale(0.97); }
.send-btn:disabled       { opacity: 0.5; cursor: not-allowed; transform: none; }

.form-status {
  text-align: center;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.1em;
  min-height: 16px;
}

.form-status--success { color: #00b341; }
.form-status--error   { color: #e80000; }

/* --- PLAYLIST --- */
.soundcloud-wrap {
  flex: 1;
  border-radius: 10px;
  overflow: hidden;
  min-height: 0;
}

.soundcloud-wrap iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
}

/* ============================================
   BOTTOM CONTROLS
   ============================================ */
.bottom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  position: relative;
  background: var(--toggle-bg);
  border: 1.5px solid var(--toggle-border);
  border-radius: var(--radius-pill);
  padding: 3px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}

.toggle-slider {
  position: absolute;
  top: 3px;
  left: 0;
  height: calc(100% - 6px);
  border-radius: var(--radius-pill);
  background: var(--orange);
  pointer-events: none;
  z-index: 0;
  will-change: transform, width;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-option {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 26px;
  border: none;
  background: transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.15s;
  position: relative;
  z-index: 1;
}

.toggle-option:hover:not(.active) {
  color: var(--text-primary);
}

.toggle-option.active {
  color: #fff;
}

/* Email Pill */
.email-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-pill);
  padding: 7px 10px;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
  white-space: nowrap;
}

.email-pill:hover {
  background: var(--card-border);
}

.email-pill:active {
  transform: scale(0.97);
}

/* Copied feedback */
.email-pill.copied {
  background: #00b341;
  color: #fff;
  border-color: #00b341;
}

/* Resume Pill */
.resume-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--orange);
  color: #fff;
  border: 1.5px solid var(--orange);
  border-radius: var(--radius-pill);
  padding: 7px 10px;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  white-space: nowrap;
  flex-shrink: 0;
}

.resume-pill:hover {
  background: var(--orange-light);
  border-color: var(--orange-light);
}

.resume-pill:active {
  transform: scale(0.97);
}

/* ============================================
   RIGHT COLUMN
   ============================================ */
.col-right {
  display: flex;
  flex-direction: column;
}

/* ============================================
   PROJECTS PANEL
   ============================================ */
.card-right {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.projects-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px;
  gap: 0;
  position: absolute;
  inset: 10px;
  border-radius: 12px;
  background: var(--card-bg);
  will-change: transform;
  transition: transform 0.36s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  padding-bottom: 14px;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.filter-btn {
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.08em;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

/* "All" button — neutral dark */
.filter-btn.active {
  background: var(--dark);
  color: #fff;
  border-color: var(--dark);
}

[data-theme="dark"] .filter-btn.active:not(.filter-ux):not(.filter-graphic):not(.filter-branding):not(.filter-illustration):not(.filter-3d) {
  background: var(--text-primary);
  color: var(--bg);
  border-color: var(--text-primary);
}

/* Colored filter buttons — idle state shows color */
.filter-ux         { border-color: #e80000; color: #e80000; }
.filter-graphic    { border-color: #7c00f0; color: #7c00f0; }
.filter-branding   { border-color: var(--orange); color: var(--orange); }
.filter-illustration { border-color: #00b341; color: #00b341; }
.filter-3d         { border-color: #007aff; color: #007aff; }

/* Active state — fill with the badge color */
.filter-ux.active          { background: #e80000;         border-color: #e80000;         color: #fff; }
.filter-graphic.active     { background: #7c00f0;         border-color: #7c00f0;         color: #fff; }
.filter-branding.active    { background: var(--orange);   border-color: var(--orange);   color: #fff; }
.filter-illustration.active{ background: #00b341;         border-color: #00b341;         color: #fff; }
.filter-3d.active          { background: #007aff;         border-color: #007aff;         color: #fff; }

/* Hover — slightly deepen the color */
.filter-ux:hover          { background: rgba(232,0,0,0.08); }
.filter-graphic:hover     { background: rgba(124,0,240,0.08); }
.filter-branding:hover    { background: rgba(255,109,0,0.08); }
.filter-illustration:hover{ background: rgba(0,179,65,0.08); }
.filter-3d:hover          { background: rgba(0,122,255,0.08); }

.filter-divider {
  height: 1px;
  background: var(--card-border);
  margin: 0 -16px;
  flex-shrink: 0;
  margin-bottom: 14px;
}

/* Bento grid */
.bento-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  align-content: start;
}

.bento-grid::-webkit-scrollbar { display: none; }

.project-card {
  border-radius: 10px;
  background: var(--tab-bg);
  border: 1px solid var(--card-border);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, border-color 0.15s;
  position: relative;
}

.project-card:hover {
  transform: scale(0.985);
  border-color: var(--text-secondary);
}

.project-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70%;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, transparent 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(to top, black 0%, transparent 100%);
  mask-image: linear-gradient(to top, black 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 1;
}

.project-card:hover::after {
  opacity: 1;
}

.project-thumb {
  flex: 1;
  background: var(--tab-bg);
  min-height: 0;
}

.project-label {
  padding: 8px 10px;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 4px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}

.project-card:hover .project-label {
  transform: translateY(0);
}

.project-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
  white-space: nowrap;
  display: block;
  width: 100%;
}

.project-title.is-scrolling {
  animation: titleScroll 3s ease-in-out infinite alternate;
}

@keyframes titleScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(var(--scroll-x, 0px)); }
}

.project-cats {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px;
}

.project-cat {
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
  color: #fff;
}

.project-cat.cat-ux          { background: #e80000; }
.project-cat.cat-graphic     { background: #7c00f0; }
.project-cat.cat-branding    { background: var(--orange); }
.project-cat.cat-illustration{ background: #00b341; }
.project-cat.cat-3d          { background: #007aff; }

/* Grid areas are assigned dynamically via JS */
.project-card {
  transition: opacity 0.2s, transform 0.15s;
}

.project-card.fade-out {
  opacity: 0;
  transform: scale(0.96);
}

/* ============================================
   PROJECT DETAIL VIEW
   ============================================ */

.project-detail {
  position: absolute;
  inset: 10px;
  border-radius: 12px;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 14px;
  transform: translateX(calc(100% + 20px));
  transition: transform 0.36s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  overflow: hidden;
}

.project-detail.open {
  transform: translateX(0);
}

.projects-panel.slide-away {
  transform: translateX(calc(-100% - 20px));
}

/* Left text panel */
.detail-text-panel {
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--card-border);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: none;
}
.detail-text-panel::-webkit-scrollbar { display: none; }

.detail-back {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  width: 40px;
  height: 40px;
  transition: background 0.15s;
  flex-shrink: 0;
}

.detail-back:hover { background: #333; color: #fff; }

.detail-sticky-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  padding: 18px 18px 20px;
  border-bottom: 1px solid var(--card-border);
  border-radius: 12px 12px 0 0;
}

.detail-scroll-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 18px 18px;
}

.detail-progress-track {
  flex: 1;
  height: 8px;
  background: var(--card-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.detail-progress-fill {
  height: 100%;
  width: 0%;
  background: #111;
  border-radius: var(--radius-pill);
  transition: width 0.08s linear;
}

.detail-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.detail-tag {
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  text-transform: uppercase;
}

.detail-tag.cat-ux           { border-color: #e80000;       color: #e80000; }
.detail-tag.cat-graphic      { border-color: #7c00f0;       color: #7c00f0; }
.detail-tag.cat-branding     { border-color: var(--orange); color: var(--orange); }
.detail-tag.cat-illustration { border-color: #00b341;       color: #00b341; }
.detail-tag.cat-3d           { border-color: #007aff;       color: #007aff; }

.detail-title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.1;
  flex-shrink: 0;
}

.detail-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 0 14px;
  border-top: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  flex-shrink: 0;
}

.detail-tools {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--card-border);
  flex-shrink: 0;
}

.tool-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.tool-icon svg {
  width: 40px;
  height: 40px;
  display: block;
}

.tool-icon-img {
  width: 40px;
  height: 40px;
  display: block;
  object-fit: contain;
}

.meta-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 11px;
}

.meta-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--orange);
  min-width: 72px;
  flex-shrink: 0;
}

.meta-value {
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-links {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  margin-bottom: 20px;
}

.detail-link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--text-primary);
  border-radius: var(--radius-pill);
  padding: 7px 12px;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
  white-space: nowrap;
}

.detail-link-btn:hover {
  background: var(--card-border);
}

.detail-link-btn:active {
  transform: scale(0.97);
}

.detail-link-btn-accent {
  background: var(--text-primary);
  color: var(--card-bg);
  border-color: var(--text-primary);
}

.detail-link-btn-accent:hover {
  background: var(--text-secondary);
  border-color: var(--text-secondary);
}

.detail-desc {
  font-size: 12px;
  font-weight: 300;
  line-height: 1.85;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
}
.detail-desc p { margin: 0 0 1.2em 0; }
.detail-desc p:last-child { margin-bottom: 0; }
.desc-subtitle {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 4px;
  margin-top: 1.4em;
}
.detail-desc p:first-of-type .desc-subtitle,
.desc-subtitle:first-child { margin-top: 0; }

/* Right image bento */
.detail-images {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  min-height: 0;
}

.detail-images::-webkit-scrollbar { display: none; }

/* Shared base for all detail image frames */
.detail-img-base {
  border-radius: 12px;
  border: 1px solid var(--card-border);
  width: 100%;
  flex-shrink: 0;
  cursor: zoom-in;
  position: relative;
  overflow: hidden;
  transition: opacity 0.15s;
}

.detail-img-base:hover { opacity: 0.88; }

.detail-img-inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--tab-bg);
  background-size: cover;
  background-position: top center;
  transform: translateY(0);
  transition: transform 2.5s linear;
  will-change: transform;
}

.detail-img-inner.is-panning-y {
  transform: translateY(var(--pan-y, 0px));
}

.detail-img-inner.is-panning-x {
  transform: translateX(var(--pan-x, 0px));
}

/* Full-height headliner: hover-triggered left-right pan */
@keyframes hPan {
  from { background-position: left 70%; }
  to   { background-position: right 70%; }
}

.detail-img-full .detail-img-inner.hpan-active {
  animation: hPan 6s ease-in-out infinite alternate;
  animation-delay: -3s;
}

/* Video in detail view */
.detail-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  transform: scale(1.15) translateY(-5%);
  transform-origin: center center;
  display: block;
  filter: saturate(1.3) contrast(1.05);
}

.detail-video-native {
  object-fit: contain;
  transform: none;
  object-position: center;
}

.mute-indicator {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 6px 8px;
  display: flex;
  align-items: center;
  z-index: 3;
  pointer-events: none;
  transition: opacity 0.2s;
}

.mute-indicator .icon-unmuted { display: none; }
.mute-indicator.muted   .icon-muted   { display: block; }
.mute-indicator.muted   .icon-unmuted { display: none; }
.mute-indicator:not(.muted) .icon-muted   { display: none; }
.mute-indicator:not(.muted) .icon-unmuted { display: block; }

/* Reversed y-pan: starts at bottom, pans to top on hover */
.detail-img-inner.pan-reversed {
  transform: translateY(var(--pan-y, 0px));
}

.detail-img-inner.pan-reversed.is-panning-y {
  transform: translateY(0);
}

/* Reversed x-pan: starts near right, pans to left on hover */
.detail-img-inner.pan-reversed-x {
  transform: translateX(var(--pan-x-start, 0px));
}
.detail-img-inner.pan-reversed-x.is-panning-x {
  transform: translateX(0);
}

/* Frame types — full width */
.detail-img-headliner { aspect-ratio: 4 / 3; }
.detail-img-wide      { aspect-ratio: 16 / 9; }
.detail-img-full      { aspect-ratio: unset; height: 100%; }

/* Frame types — half width (used inside .detail-img-bottom) */
.detail-img-landscape { aspect-ratio: 4 / 3; }
.detail-img-square    { aspect-ratio: 1 / 1; }
.detail-img-portrait  { aspect-ratio: 2 / 3; }

/* 2-column grid for all non-headliner images */
.detail-img-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  align-items: start;
  flex-shrink: 0;
}

/* Section labels in detail view */
.detail-section-label {
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 10px 0 4px;
  flex-shrink: 0;
}

/* Featured layout: left image spans 2 rows, right gets 2 stacked */
.detail-section-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  flex-shrink: 0;
}

.detail-section-featured > :first-child {
  grid-row: 1 / 3;
  aspect-ratio: unset;
  align-self: stretch;
}

/* Wide / headliner / full frames span full width inside any 2-col grid */
.detail-img-grid > .detail-img-wide,
.detail-img-grid > .detail-img-headliner,
.detail-img-grid > .detail-img-full,
.detail-section-featured > .detail-img-wide,
.detail-section-featured > .detail-img-headliner,
.detail-section-featured > .detail-img-full {
  grid-column: 1 / -1;
}

/* Tab bar hidden on desktop */
.detail-tab-bar { display: none; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1050px) {
  body {
    padding: 16px;
    gap: 14px;
    min-height: 100vh;
    height: auto;
  }

  /* Keep pills side by side but allow shrinking */
  .top-bar {
    flex-direction: row;
    gap: 10px;
    align-items: center;
  }

  .pill-clock {
    width: auto;
    flex-shrink: 0;
  }

  .pill-marquee {
    flex: 1;
    min-width: 0;
  }

  /* Stack main layout vertically */
  .layout {
    grid-template-columns: 1fr;
    flex: none;
    min-height: auto;
  }

  /* Left col: give the card a fixed height */
  .col-left {
    gap: 12px;
  }

  .card-left {
    flex: none;
    height: 480px;
  }

  /* Right col full width, fixed height */
  .col-right {
    min-height: 520px;
  }

  .card-right {
    height: 100%;
    min-height: 520px;
  }

  /* Bottom controls wrap if needed */
  .bottom-controls {
    flex-wrap: wrap;
    gap: 10px;
  }

  /* Project detail: tab-based layout on small screens */
  .project-detail {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .detail-text-panel {
    display: none;
  }
  .detail-text-panel.detail-panel-active {
    display: flex;
    overflow-y: auto;
    min-height: 0;
    flex: 1;
  }

  .detail-images {
    display: none;
    overflow-y: auto;
    flex: 1;
  }
  .detail-images.detail-panel-active {
    display: flex;
  }

  .detail-img-top,
  .detail-img-cell {
    width: 100%;
  }

  /* Tab bar — pill style matching the about/music nav */
  .detail-tab-bar {
    display: flex;
    align-items: center;
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 5px;
    margin: 10px 10px 6px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  }

  .detail-tab-slider {
    position: absolute;
    top: 5px;
    left: 0;
    height: calc(100% - 10px);
    border-radius: 10px;
    background: #111;
    pointer-events: none;
    z-index: 0;
    will-change: transform, width;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .detail-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-family: var(--font);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    transition: color 0.15s;
    position: relative;
    z-index: 1;
  }

  .detail-tab-btn:hover:not(.active) {
    color: var(--text-primary);
  }

  .detail-tab-btn.active {
    color: #fff;
  }

  /* Slide animations for tab switching */
  @keyframes slideInRight {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
  }
  @keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to   { transform: translateX(0); }
  }

  .detail-panel-slide-from-right {
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  .detail-panel-slide-from-left {
    animation: slideInLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
}


/* Music tab playing blink */
@keyframes musicBlink {
  0%, 100% { opacity: 1;   color: #fff; }
  50%       { opacity: 0.2; color: #fff; }
}

.tab[data-tab="music"].playing {
  animation: musicBlink 2s ease-in-out infinite;
  color: #fff;
}

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.88);
  border-radius: var(--radius-card);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  transform: scale(0.95);
  transition: transform 0.2s ease;
  user-select: none;
}

.lightbox.open .lightbox-img {
  transform: scale(1);
}

.lightbox-video {
  display: none;
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.lightbox.open .lightbox-video {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}

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

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 3px;
}

@media (max-width: 480px) {
  .top-bar {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }

  .pill-clock {
    width: 100%;
    justify-content: center;
  }

  .pill-marquee {
    width: 100%;
    flex: none;
  }
}
