@font-face {
  font-family: 'Futura LT Pro';
  src: url('/fonts/FuturaLTPro-Medium.woff2') format('woff2'),
    url('/fonts/FuturaLTPro-Medium.woff') format('woff');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Futura LT Pro';
  src: url('/fonts/FuturaLTPro-Bold.woff2') format('woff2'),
    url('/fonts/FuturaLTPro-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Futura LT Pro';
  src: url('/fonts/FuturaLTPro-XBold.woff2') format('woff2'),
    url('/fonts/FuturaLTPro-XBold.woff') format('woff');
  font-weight: 800;
  font-style: normal;
}

@font-face {
  font-family: 'Futura LT Pro';
  src: url('/fonts/FuturaLTPro-Black.woff2') format('woff2'),
    url('/fonts/FuturaLTPro-Black.woff') format('woff');
  font-weight: 900;
  font-style: normal;
}

@font-face {
  font-family: 'Avenir Next LT Pro';
  src: url('/fonts/AvenirNextLTPro-Regular.woff2') format('woff2'),
    url('/fonts/AvenirNextLTPro-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Avenir Next LT Pro';
  src: url('/fonts/AvenirNextLTPro-Demi.woff2') format('woff2'),
    url('/fonts/AvenirNextLTPro-Demi.woff') format('woff');
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: 'Avenir Next LT Pro';
  src: url('/fonts/AvenirNextLTPro-Bold.woff2') format('woff2'),
    url('/fonts/AvenirNextLTPro-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
}

:root {
  /* Global CSS Variables - strict design tokens */
  --color-magma: #FE5000;
  --color-snowfall: #E8E8E8;
  --color-rich-black: #1A1A1B;
  --color-bg: #1E1E1E;

  /* Theme mappings - Dark by default */
  --theme-bg: var(--color-bg);
  --theme-surface: var(--color-rich-black);
  --theme-text: var(--color-snowfall);

  /* Typography Scales */
  --font-primary: 'Avenir Next LT Pro', sans-serif;
  --font-secondary: 'Futura LT Pro', sans-serif;
}

[data-theme="light"] {
  --theme-bg: #FFFFFF;
  --theme-surface: var(--color-snowfall);
  --theme-text: var(--color-rich-black);
}

/* Custom Cursor */
body.has-custom-cursor,
body.has-custom-cursor * {
  cursor: none !important;
}

.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #fff;
  pointer-events: none;
  z-index: 99999;
  mix-blend-mode: difference;
  opacity: 0;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), height 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.custom-cursor.active {
  opacity: 1;
}

.custom-cursor.hovering {
  width: 48px;
  height: 48px;
}

/* Global Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--theme-bg);
  color: var(--theme-text);
  font-family: var(--font-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography System */
h1 {
  font-family: var(--font-secondary);
  font-size: 64px;
  line-height: normal;
  color: var(--color-magma);
}

h2 {
  font-family: var(--font-secondary);
  font-size: 32px;
  line-height: normal;
  color: var(--theme-text);
}

.desc-text {
  font-family: var(--font-primary);
  font-size: 20px;
  line-height: normal;
}

.resume-header {
  font-family: var(--font-primary);
  font-size: 15px;
  line-height: normal;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--theme-text);
}

p,
a {
  font-family: var(--font-primary);
  font-size: 10px;
  line-height: 16px;
  color: var(--theme-text);
}

a {
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-magma);
}

/* Layout Architecture */
.layout-wrapper {
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px;
  min-height: 100vh;
}

.layout-header {
  margin-bottom: 60px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Desktop CSS Grid */
.layout-main {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 20px;
  align-items: start;
}

.grid-item {
  background-color: var(--theme-surface);
  padding: 40px;
}

.layout-main>.grid-item {
  grid-column: span 5;
}

.layout-main>.grid-item.small-item {
  grid-column: span 3;
  padding: 24px;
}

.layout-main>.grid-item.small-item .desc-text {
  font-size: 14px;
}

.layout-main>.grid-item.small-item .project-tags span {
  font-size: 8px;
  padding: 4px 8px;
}

.project-card {
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.project-tags {
  display: flex;
  gap: 8px;
  position: absolute;
  bottom: 80px;
  /* Positioned below title, in the lower third */
  left: 50%;
  transform: translateX(-50%);
}

.project-tags span {
  opacity: 0;
  transform: translateY(20px);
  background-color: var(--color-magma);
  color: var(--color-rich-black);
  padding: 4px 12px;
  border-radius: 4px;
  font-family: var(--font-primary);
  font-size: 10px;
  text-transform: uppercase;
  font-weight: bold;
}

.project-logo {
  width: 50%;
  max-height: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: filter 0.3s ease;
  filter: invert(1);
  /* Invert to white by default in dark mode, since SVG is black */
  z-index: 2;
}

[data-theme="light"] .project-logo {
  filter: invert(0);
  /* Black in light mode */
}

.social-icon {
  filter: invert(1);
}

[data-theme="light"] .social-icon {
  filter: invert(0);
}

.project-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  border-radius: inherit;
  transition: all 0.4s ease;

  /* Fully visible by default */
  opacity: 1;
  mix-blend-mode: normal;
  filter: grayscale(0%);
}

.project-card:hover .project-bg {
  /* Show solid color by becoming near completely transparent on hover */
  opacity: 0.1;
  mix-blend-mode: overlay;
  filter: grayscale(50%);
}



/* Tablet Strict Flexbox Fallback */
@media (max-width: 768px) {
  .layout-wrapper {
    padding: 24px;
  }

  .layout-main {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
  }

  .grid-item {
    flex: 1 1 100%;
    margin-top: 0;
  }
}

/* Mobile Clean Vertical Stack */
@media (max-width: 480px) {
  .layout-wrapper {
    padding: 16px;
  }

  .layout-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .grid-item {
    width: 100%;
    margin-top: 0;
  }
}

/* Theme Toggle Animation logic adapted from SCSS */
.toggle-wrapper {
  position: fixed;
  bottom: 40px;
  right: 40px;
  transform: scale(0.6);
  transform-origin: bottom right;
  z-index: 2000;
  /* Stays above modal */
}

.toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle label {
  position: relative;
  display: inline-block;
  width: 80px;
  height: 80px;
  background-color: var(--color-snowfall);
  border-radius: 50px;
  cursor: pointer;
  box-shadow: inset 0 0 2px 1px rgba(0, 0, 0, 0.1), 0px 9px 15px 0px rgba(255, 255, 255, 0.2);
  -webkit-tap-highlight-color: transparent;
  transition: all 0.3s ease;
}

.toggle label::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.2s cubic-bezier(0, -1.85, .27, 1.75), background-color 0.2s ease, box-shadow 0.2s ease;
  height: 42px;
  width: 42px;
  background-color: var(--color-magma);
  border-radius: 46px;
  box-shadow: inset 0px 0px 0px 8px var(--color-rich-black);
}

.toggle input {
  display: none;
}

.toggle input:checked+label {
  background-color: var(--color-rich-black);
  box-shadow: inset 0 0 2px 1px rgba(255, 255, 255, 0.1), 0px 9px 15px 0px rgba(0, 0, 0, 0.5);
}

.toggle input:checked+label::before {
  width: 10px;
  background-color: var(--color-snowfall);
  box-shadow: none;
}


/* Dribbble-style Modal Overlay */
body:has(.modal-backdrop.open) {
  overflow: hidden;
  /* Prevent background scrolling when modal is open */
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

.modal-container {
  position: fixed;
  top: 5vh;
  left: 10vw;
  right: 10vw;
  bottom: 0;
  background-color: var(--theme-bg);
  border-radius: 4px 4px 0 0;
  z-index: 1010;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(100vh);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
}

.modal-container.open {
  opacity: 1;
  transform: translateY(0);
}

.project-hero {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 80px;
}

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

.hero-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 100%;
}

.hero-row-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  width: 100%;
}

@media (max-width: 768px) {

  .hero-row-2col,
  .hero-row-3col {
    grid-template-columns: 1fr;
  }
}

/* Make specific SVGs react to dark/light mode via filters */
.reactive-svg {
  transition: filter 0.3s ease;
  /* Default state is Dark: Invert the dark SVG to make it light */
  filter: invert(1) brightness(0.9);
}

[data-theme="light"] .reactive-svg {
  /* Light mode: Show the original dark SVG on the white background */
  filter: none;
}

.project-content {
  display: grid;
  grid-template-columns: 3fr 9fr;
  gap: 40px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 100px 120px 100px;
}

.project-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: right;
  margin-top: 88px;
}

.project-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Tablet Fallback */
@media (max-width: 768px) {
  .project-sidebar {
    text-align: left;
    margin-top: 0;
  }

  .project-content {
    grid-template-columns: 1fr;
    padding: 0 24px 80px 24px;
  }
}

@media (max-width: 480px) {
  .project-hero {
    height: 50vh;
    margin-bottom: 40px;
  }

  .project-content {
    padding: 0 16px 60px 16px;
  }
}

/* Brand Colors Feature (Expandable Bars) */
.brand-colors-section {
  margin-top: 40px;
}

.brand-colors-bars {
  display: flex;
  width: 100%;
  height: 240px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.color-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px 20px;
  transition: flex 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.color-bar:hover,
.color-bar:active {
  flex: 3;
}

.color-details {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  transition-delay: 0s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.color-bar:hover .color-details,
.color-bar:active .color-details {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.15s;
}

/* Base text color inside color-bar: mostly white for these dark colors, 
   but mix-blend-mode ensures readability or we can just use white if colors are generally dark */
.color-details p {
  color: inherit;
  font-family: var(--font-primary);
  font-size: 10px;
  line-height: normal;
  text-transform: uppercase;
  margin: 0;
}

.color-details .color-name {
  font-family: var(--font-secondary);
  font-size: 16px;
  margin-bottom: 8px;
  color: inherit;
}

/* Logo Switcher */
.logo-switcher-section {
  width: 100%;
}

.logo-switcher-grid {
  display: flex;
  gap: 24px;
}

.switcher-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.switcher-display-area {
  width: 100%;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background-color: transparent;
}

.switcher-mask {
  width: 80%;
  height: 80%;
  background-color: var(--switcher-color);
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  transition: background-color 0.4s ease;
}

html:not([data-theme="light"]) .switcher-container[data-invert-active="true"] .switcher-mask {
  background-color: var(--color-snowfall) !important;
}

.switcher-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.switcher-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--theme-text);
  padding: 8px 16px;
  border-radius: 4px;
  font-family: var(--font-primary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

[data-theme="light"] .switcher-btn {
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.switcher-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .switcher-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.switcher-btn.active {
  background-color: var(--color-magma);
  border-color: var(--color-magma);
  color: #fff;
}