/* -----------------------------------------------------------
   Amber Kumar Portfolio – Global Stylesheet
   Typography: Space Mono (headers) + Space Grotesk (body)
----------------------------------------------------------- */

/* Font imports */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=Space+Mono:wght@400;700&display=swap');

/* -----------------------------------------------------------
   Theme & Global Variables
----------------------------------------------------------- */
:root {
  --bg: #ffffff;
  --text: #0f1724;
  --muted: #6b7280;
  --cta: #FF5E1A;
  --border: #e5e7eb;
  --nav: #000;
}

[data-theme="dark"] {
  --bg: #0f1724;
  --text: #f5f5f5;
  --muted: #9ca3af;
  --border: #374151;
  --nav: #000;
}

/* -----------------------------------------------------------
   Base & Resets
----------------------------------------------------------- */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .3s, color .3s;
  line-height: 1.7;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  padding-top: 3%;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.3rem; }

p, li, a, span {
  font-family: 'Space Grotesk', sans-serif;
}

figcaption {
  font-family: 'Space Mono', monospace;
  text-align: center;
  line-height: 1.7;
  padding-bottom: 5%;
}

/* -----------------------------------------------------------
   Navbar
----------------------------------------------------------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 60px;
  background: transparent;
  transition: background .3s, transform .3s;
}

.navbar.scrolled {
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(6px);
}

.navbar .left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  height: 32px;
  display: block;
}

.navbar .center {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin: auto;
}

.nav-btn {
  padding: 10px 18px;
  border: 1px solid #fff;
  color: #fff;
  background: transparent;
  text-decoration: none;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  line-height: 1;
  display: inline-block;
  transition: color .25s, background .25s, border-color .25s, transform .2s;
}

.nav-btn:hover { border-color: var(--cta); }
.nav-btn:hover::after {
  content: '';
  display: block;
  height: 2px;
  background: var(--cta);
  margin-top: 6px;
}

.nav-btn.active {
  background: var(--cta);
  color: #000;
  border-color: var(--cta);
}

.navbar:not(.scrolled) .nav-btn {
  color: var(--text);
  border-color: var(--text);
}

.navbar.scrolled .nav-btn {
  color: #fff;
  border-color: #fff;
}

.navbar.scrolled .nav-btn.active { color: #000; }

/* -----------------------------------------------------------
   Theme Toggle
----------------------------------------------------------- */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}

.theme-switch {
  position: relative;
  width: 52px;
  height: 28px;
  display: inline-block;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  border-radius: 30px;
  background: #ffffff;
  transition: .3s;
}

.slider:before {
  content: '🌞';
  position: absolute;
  left: 4px;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  transition: .35s;
  font-size: 14px;
}

input:checked + .slider { background: #111827; }
input:checked + .slider:before {
  content: '🌙';
  transform: translateX(24px);
  background: #1f2937;
  color: #fff;
}

/* -----------------------------------------------------------
   Layout
----------------------------------------------------------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 60px;
}

.mt-nav { margin-top: 110px; }
section { margin-bottom: 80px; }

/* -----------------------------------------------------------
   Buttons / Tags
----------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;

  background: var(--cta);
  border: 1px solid var(--cta);
  border-radius: 8px;

  text-decoration: none;
  font-family: 'Space Mono', monospace;
  text-transform: uppercase;

  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(255, 94, 26, 0.15);

  white-space: nowrap; /* <-- this fixes the line break issue */
}

.tag:hover {
  background: transparent;
  color: var(--cta);
  box-shadow: 0 6px 20px rgba(255, 94, 26, 0.25);
  transform: translateY(-2px);
}


/* -----------------------------------------------------------
   Cards
----------------------------------------------------------- */
.grid {
  display: grid;
  gap: 32px;
}

.home-grid {
  flex: 1 1 0;
  min-width: 0;
  max-width: 900px;
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Work page grid layout */
.work-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* Desktop: lock to exactly 3 columns */
@media (min-width: 1024px) {
  .work-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}


.card {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .6s, transform .3s ease, box-shadow .3s ease;
  text-decoration: none;
  color: inherit;
}

.card.visible {
  opacity: 1;
  transform: translateY(0);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

.card:hover .thumb {
  transform: scale(1.02);
  background-size: 110% !important;
}

.card .thumb {
  width: 100%;
  height: 180px;
  background: #E5E7EB;
  background-size: cover !important;
  background-position: center !important;
  border-radius: 6px;
  margin-bottom: 16px;
  transition: transform .3s ease, background-size .4s ease;
}

.card h3 {
  margin: 0 0 8px;
  font-family: 'Space Mono', monospace;
  font-size: 20px;
  font-weight: 400;
  transition: font-weight .3s ease;
}

.card:hover h3 {
  font-weight: 700;
}

.card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 15px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.card-tags .tag,
.tags .tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(15, 23, 36, 0.05);
  color: var(--text);
  border: 1px solid rgba(15, 23, 36, 0.15);
  border-radius: 6px;
  font-family: 'Space Mono', monospace;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
}

.card-tags .tag {
  cursor: default;
  background: rgba(15, 23, 36, 0.18);
  border-color: rgba(15, 23, 36, 0.3);
  color: rgba(15, 23, 36, 0.7);
}
.tags .tag {
  cursor: pointer;
  appearance: none;
  position: relative;
  overflow: hidden;
}

.tags .tag::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 2px;
  background: transparent;
  transition: background .2s ease;
}

.tags .tag-filter.active {
  background: rgba(255, 94, 26, 0.18);
  border-color: rgba(255, 94, 26, 0.6);
}

.tags .tag:hover {
  background: rgba(15, 23, 36, 0.1);
}
.tags .tag:hover::after {
  background: rgba(255, 94, 26, 0.6);
}


/* -----------------------------------------------------------
   Sidebar
----------------------------------------------------------- */
.wrap { display: flex; gap: 60px; }

aside.sidebar {
  position: sticky;
  top: 110px;
  width: 320px;
  flex: 0 0 320px;
  min-height: 60vh;
  border-right: 1px solid var(--border);
  padding-right: 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

aside.sidebar .left-text {
  color: var(--muted);
  line-height: 1.8;
}

aside.sidebar .likes {
  list-style: none;
  padding: 0;
  margin: 0;
}

aside.sidebar .likes li { margin: 8px 0; }

/* -----------------------------------------------------------
   Project Page Layout
----------------------------------------------------------- */
.project-page section { margin-bottom: 120px; }

.project-page img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 32px;
  border-radius: 8px;
  object-fit: cover;
  padding-top: 5%;
}

/* Figures */
figure {
  max-width: 1200px;
  margin: 0 auto;
}

figure img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Side-by-side images */
.two-pics figure {
  flex: 1;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.two-pics figure img { width: 100%; border-radius: 8px; }

.two-pics figcaption {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}

/* Inline Pair */
.inline-pair {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 80px;
  margin-bottom: 100px;
}

.inline-pair__media {
  flex: 0 0 45%;
  max-width: 45%;
}

.inline-pair__media img {
  width: 100%;
  border-radius: 8px;
}

.inline-pair__content { flex: 1; min-width: 280px; }

.inline-pair__content p {
  line-height: 1.6;
  color: var(--muted);
}

/* Inline Figures */
.inline-figures {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
}

.inline-figure { flex: 1; text-align: center; }

.inline-figure img {
  width: 100%;
  border-radius: 6px;
}

.inline-figure figcaption {
  margin-top: 12px;
  font-size: 18px;
  font-style: italic;
  color: var(--text);
}

/* -----------------------------------------------------------
   Video Wrapper
----------------------------------------------------------- */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  width: 100%;
  max-width: 900px;
  margin: 40px auto;
  overflow: hidden;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Match image figcaption bottom spacing */
.video-embed figcaption {
  padding-bottom: 5%;
}


/* -----------------------------------------------------------
   Before/After Slider – Clip-Path Version (matches HTML + JS)
----------------------------------------------------------- */

.ba-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 10px;
  cursor: ew-resize;
  user-select: none;
}

.ba-img {
  width: 100%;
  display: block;
  pointer-events: none;
}

/* Bottom image (after) */
.ba-after {
  position: relative;
  z-index: 0;
}

/* Top image (before-on-drag) */
.ba-before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  clip-path: inset(0 50% 0 0); /* 50/50 start */
  transition: clip-path 0.15s ease-out;
  z-index: 1;
}

/* Vertical handle line */
.ba-handle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  background: #ffffff;
  mix-blend-mode: difference; /* ensures visibility on any bg */
  cursor: ew-resize;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Circular knob */
.ba-handle-line {
  width: 20px;
  height: 20px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  mix-blend-mode: normal;
}

/* -----------------------------------------------------------
   Progress Footer Nav
----------------------------------------------------------- */
.progress-nav.bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 10px 40px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.05);
}

.progress-track {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: var(--cta);
  transition: width 0.2s ease-out;
}

.anchor-nav {
  display: flex;
  gap: 20px;
  justify-content: center;
  font-size: 14px;
}

.anchor-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  position: relative;
  transition: color .3s;
}

.anchor-nav a:hover { color: var(--cta); }

.anchor-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--cta);
  border-radius: 2px;
}

/* -----------------------------------------------------------
   Buttons (Primary & Secondary)
----------------------------------------------------------- */
.btn-primary {
  display: inline-block;
  padding: 14px 26px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--cta);
  border: 1px solid var(--cta);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(255, 94, 26, 0.2);
}

.btn-primary:hover {
  background: transparent;
  color: var(--cta);
  box-shadow: 0 6px 20px rgba(255, 94, 26, 0.35);
  transform: translateY(-2px);
}

.btn-primary.light {
  background: #fff;
  color: var(--cta);
}

.btn-secondary {
  display: inline-block;
  padding: 14px 26px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: all .3s;
}

.btn-secondary:hover {
  border-color: var(--cta);
  color: var(--cta);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255,94,26,0.15);
}

/* -----------------------------------------------------------
   Footer
----------------------------------------------------------- */
footer {
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  color: var(--muted);
  text-align: center;

  padding: 60px 0;     /* increased from 40px → 60px */
  margin-top: 120px;   /* increased from 80px → 120px */

  border-top: 1px solid var(--border);
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

footer:hover {
  opacity: 1;
}


/* -----------------------------------------------------------
   MOBILE STYLES
----------------------------------------------------------- */
@media (max-width: 768px) {

  .wrap { display: block; }

  aside.sidebar {
    position: static;
    width: 100%;
    border-right: none;
    padding-right: 0;
    margin-bottom: 40px;
  }

  .navbar .left .logo {
    display: none;
  }

  .project-page section { margin-bottom: 80px; }

  .project-page img { margin-bottom: 24px; }

  .inline-pair {
    flex-direction: column;
    text-align: center;
    gap: 48px;
  }

  .inline-pair__media {
    width: 100%;
    max-width: 100%;
  }

  .inline-figures {
    flex-direction: column;
    gap: 32px;
  }

  .inline-figure figcaption { font-size: 16px; }

  .two-pics figure img { width: 100%; }

  .paired-images {
    flex-direction: column !important;
    gap: 32px !important;
  }

  .paired-item figcaption { font-size: 16px !important; }

  .progress-nav.bottom {
    padding: 8px 20px 6px;
  }

  .anchor-nav {
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
  }
}
