/* ─────────────────────────────────────────────────────────
   project-components.css — Unified Design System
   Madeleine Toyokawa Portfolio
───────────────────────────────────────────────────────── */

/* 0. FONTS */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:ital,wght@0,300;0,400;0,500;0,600;1,300&display=swap');

/* 1. DESIGN TOKENS */
:root {
  /* Colors */
  --bg:             #141416;
  --w:              rgba(255, 255, 255, 0.96);
  --dim:            rgba(255, 255, 255, 0.75);
  --muted:          rgba(255, 255, 255, 0.5);
  --border:         rgba(255, 255, 255, 0.25);
  --border-active:  rgba(255, 255, 255, 0.18);
  --glass:          rgba(255, 255, 255, 0.02);

  /* Typography — single source of truth */
  --font-heading:   'Bebas Neue', sans-serif;
  --font-body:      'Inter', sans-serif;

  /* Type scale */
  --t-hero:         clamp(2.5rem, 8vw, 6.5rem);
  --t-hero-lh:      0.88;

  --t-xl:           clamp(2rem, 3.8vw, 2.8rem);
  --t-xl-lh:        1.15;

  --t-lg:           clamp(1.8rem, 3.5vw, 2.6rem);
  --t-lg-lh:        1.2;

  --t-md:           1.3rem;
  --t-md-lh:        1.1;

  --t-body:         1rem;
  --t-body-lh:      1.75;

  --t-small:        0.85rem;
  --t-small-lh:     1.6;

  --t-xs:           0.68rem;
  --t-xs-lh:        1.6;

  /* Spacing */
  --sp-xs:          0.5rem;
  --sp-sm:          1rem;
  --sp-md:          2.2rem;
  --sp-lg:          4.5rem;
  --sp-xl:          7rem;
  --sp-2xl:         8rem;

  /* Misc */
  --radius:         10px;
  --transition:     all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --max-w:          1400px;
  --max-text:       65ch;
  --padding-x:      3rem;
}

/* 2. RESET */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--w);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: var(--t-body-lh);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

img, video, svg {
  max-width: 100%;
  display: block;
}

/* 3. ACCESSIBILITY */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  padding: 10px 20px;
  background: #fff;
  color: var(--w);
  font-weight: 700;
  z-index: 9999;
}
.skip-link:focus { top: 0; }

a:focus-visible, button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* 4. LENS CURSOR */
.lens {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 200;
  top: 0;
  left: 0;
  transform: translate(-50%,-50%);
  background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 70%);
  box-shadow: 0 0 12px 3px rgba(255,255,255,0.3), 0 0 25px 6px rgba(200,220,255,0.15);
  opacity: 0;
  transition: opacity 0.3s ease;
}

body:hover .lens {
  opacity: 1;
}

body.lens-hover .lens {
  width: 10px;
  height: 10px;
  box-shadow: 0 0 18px 5px rgba(255,255,255,0.45), 0 0 35px 10px rgba(200,220,255,0.2);
}

/* 5. HEADER */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 3rem;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.75);
  color: var(--w);
}
.logo {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--w);
  text-decoration: none;
}
nav {
  display: flex;
  gap: 2.5rem;
}
nav a {
  font-family: var(--font-body);
  font-size: var(--t-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--w);
  font-weight: 500;
  transition: color 0.25s ease;
}
nav a:hover { color: var(--w); }

/* 6. PROJECT CONTAINER */
.project-container {
  padding-top: 5rem;
  width: 100%;
}

/* 7. HERO ── Clean, no background video */
.project-hero {
  position: relative;
  width: 100%;
  min-height: 45vh;
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--border);
  /* Subtle gradient background — no video */
  background: linear-gradient(160deg,
    rgba(20,20,24,1) 0%,
    rgba(14,14,16,1) 60%,
    rgba(10,10,12,1) 100%
  );
  overflow: hidden;
}

/* Optional: hero image (non-video) */
.hero-media-wrapper {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.hero-media-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(15, 15, 16, 0.1) 0%,
    rgba(15, 15, 16, 0.92) 100%
  );
  z-index: 2;
}
.hero-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-content-wrapper {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 8rem var(--padding-x) 3rem;
}

/* Hero tags */
.hero-tags {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.hero-tag {
  font-family: var(--font-body);
  font-size: var(--t-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid var(--border-active);
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-weight: 500;
  color: var(--dim);
}

/* Hero title */
.project-title {
  font-family: var(--font-heading);
  font-size: var(--t-hero);
  line-height: var(--t-hero-lh);
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 1rem;
}

/* Hero subtitle */
.project-subtitle {
  font-family: var(--font-body);
  font-size: var(--t-small);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 300;
  line-height: var(--t-small-lh);
}

/* Hero SVG text overlay */
.hero-svg-text-container {
  width: 100%;
  max-width: 820px;
  margin-top: 1.5rem;
}
.hero-svg-text-container img {
  width: 100%;
  height: auto;
}

/* 8. STATS */
.project-stats-section {
  border-bottom: 1px solid var(--border);
  background: rgba(15, 15, 16, 0.25);
}
.project-stats-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp-lg) var(--padding-x);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2.5rem;
}
.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.stat-label {
  font-family: var(--font-body);
  font-size: var(--t-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.stat-value {
  font-family: var(--font-body);
  font-size: var(--t-small);
  color: var(--w);
  font-weight: 300;
  line-height: var(--t-small-lh);
}

/* 9. OVERVIEW */
.project-overview-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp-xl) var(--padding-x) var(--sp-lg);
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--sp-lg);
  align-items: start;
}
.overview-title {
  font-family: var(--font-body);
  font-size: clamp(1.8rem, 3.2vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--w);
  line-height: 1.2;
}
.overview-text {
  font-family: var(--font-body);
  font-size: var(--t-body);
  color: var(--dim);
  line-height: var(--t-body-lh);
  font-weight: 400;
  max-width: var(--max-text);
}

/* 10. SECTIONS */
.project-section {
  padding: var(--sp-xl) var(--padding-x);
  border-top: 1px solid var(--border);
}
.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

/* Section header — title + description above the layout */
.section-header.work {
  padding: 0 3rem var(--sp-xl);
  max-width: 1400px;
  margin: 0 auto;
  background: #000;
}
.section-title {
  font-family: var(--font-body);
  font-size: clamp(1.8rem, 3.2vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--w);
  line-height: 1.2;
  margin-bottom: 0.8rem;
}
.section-desc {
  font-family: var(--font-body);
  font-size: var(--t-body);
  color: var(--dim);
  line-height: var(--t-body-lh);
  font-weight: 400;
  max-width: var(--max-text);
}

/* 11. SPLIT LAYOUT */
.split-layout {
  display: flex;
  flex-direction: column;
  gap: var(--sp-lg);
  align-items: stretch;
}
.split-layout.media-right {
  /* Ensure image stays on left for consistency */
  grid-template-columns: 1fr 1.15fr;
}
.split-content {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

/* ── Unified text inside split content ── */
.split-content h4 {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--w);
  line-height: 1.3;
  margin-bottom: 0.4rem;
}
.split-content p,
.split-content .body-text {
  font-family: var(--font-body);
  font-size: var(--t-body);
  color: var(--dim);
  line-height: var(--t-body-lh);
  font-weight: 400;
  max-width: var(--max-text);
}
.split-content h5 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--w);
  line-height: 1.3;
  margin-bottom: 0.2rem;
}
.split-content p + h5,
.split-content h5 + p {
  margin-top: 0.8rem;
}

.split-media-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  width: 100%;
  margin-top: var(--sp-md);
}

/* Section SVG text */
.section-svg-text-container {
  display: none !important;
}

/* 12. GRID LAYOUT */
.grid-layout {
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), 1fr);
  gap: 1.25rem;
}
.grid-layout.cols-2 { --cols: 2; }
.grid-layout.cols-3 { --cols: 3; }
.grid-layout.cols-4 { --cols: 4; }

/* 13. FULLWIDTH LAYOUT */
.fullwidth-layout {
  width: 100%;
}

/* 14. MEDIA CARDS ── No cropping, full visibility */
.media-card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  transition: border-color 0.3s ease, transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s ease, z-index 0.3s ease;
}

.media-card.zoomed {
  transform: scale(1.15);
  z-index: 100;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.media-card:hover {
  border-color: var(--border-active);
}
.media-card.aspect-widescreen {
  aspect-ratio: 16/9;
}
.media-card.aspect-square {
  aspect-ratio: 1/1;
}
.media-card.light-bg {
  background: #f5f5f5;
  border-color: rgba(0, 0, 0, 0.06);
}

.media-element {
  width: 100%;
  height: 100%;
  object-fit: contain;      /* Never crop — always show full image */
  display: block;
  padding: 0.6rem;          /* Reduced padding for tighter fit */
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.media-card:hover .media-element {
  transform: scale(1.03);
}

/* Light background cards get slightly more padding */
.media-card.light-bg .media-element {
  padding: 0.8rem;
}

/* Video media cards — contain so nothing is clipped */
.media-card video.media-element {
  padding: 0;
  object-fit: contain;
  background: #000;
}

/* Zoom specific video to hide star */
.media-card video.media-element[src*="concept.mp4"] {
  object-fit: cover;
  transform: scale(1.2);
  overflow: hidden;
  border-radius: var(--radius);
}

/* 15. TECH STACK */
.tech-stack-showcase {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}
.tech-badge {
  font-family: var(--font-body);
  font-size: var(--t-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--w);
  border: 1px solid var(--border);
  background: var(--glass);
  padding: 0.4rem 0.9rem;
  font-weight: 400;
}

/* 16. ICON CARDS (split section cards) */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}
.icon-card {
  background: var(--glass);
  border: 1px solid var(--border);
  padding: 1.2rem;
  border-radius: var(--radius);
  transition: var(--transition);
}
.icon-card:hover {
  border-color: var(--border-active);
  background: rgba(255,255,255,0.04);
}
.icon-card .card-icon {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}
.icon-card h5 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--w);
  margin-bottom: 0.25rem;
}
.icon-card p {
  font-family: var(--font-body);
  font-size: var(--t-xs);
  color: var(--dim);
  line-height: 1.55;
  font-weight: 300;
}

/* 17. CTA SECTION */
.project-cta-section {
  padding: var(--sp-2xl) var(--padding-x) var(--sp-xl);
  text-align: center;
  border-top: 1px solid var(--border);
}
.cta-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  text-transform: uppercase;
  color: #fff;
  margin-bottom: var(--sp-md);
  line-height: 0.92;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-size: var(--t-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
  border: 1px solid var(--border);
  padding: 0.9rem 2rem;
  transition: var(--transition);
}
.back-btn:hover {
  color: var(--w);
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.02);
}

/* 18. RESPONSIVE — Tablet */
@media (max-width: 1100px) {
  :root {
    --padding-x: 2rem;
  }

  .project-overview-section {
    grid-template-columns: 1fr;
    gap: var(--sp-md);
  }

  .split-layout,
  .split-layout.media-right {
  /* keep same vertical layout */
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  /* On mobile, always show image above text */
  .split-layout .split-media-container {
    order: -1;
  }
  .split-layout.media-right .split-media-container {
    order: -1;
  }
}

/* 19. RESPONSIVE — Mobile */
@media (max-width: 768px) {
  :root {
    --padding-x: 1.2rem;
    --sp-xl:   4rem;
    --sp-2xl:  6rem;
    --t-body:  1rem;
  }

  header {
    padding: 1rem var(--padding-x);
  }
  nav {
    gap: 1.2rem;
  }
  nav a {
    font-size: 0.65rem;
    letter-spacing: 0.13em;
  }

  .project-hero {
    min-height: 35vh;
  }
  .hero-content-wrapper {
    padding: 6rem var(--padding-x) 2rem;
  }

  .project-stats-grid {
    padding: 3rem var(--padding-x);
    gap: 1.8rem;
  }

  .project-overview-section {
    padding: 3.5rem var(--padding-x) 2rem;
  }

  .project-section {
    padding: 3.5rem var(--padding-x);
  }

  .section-header {
    margin-bottom: 2.5rem;
  }

  /* 2-column grids collapse to 2 cols; 3+ collapse to 2 then 1 */
  .grid-layout.cols-3 {
    --cols: 2;
  }
  .grid-layout.cols-4 {
    --cols: 2;
  }

  .project-cta-section {
    padding: 5rem var(--padding-x) 4rem;
  }

  .media-card {
    border-radius: 8px;
  }
}

@media (max-width: 480px) {
  .grid-layout.cols-2,
  .grid-layout.cols-3,
  .grid-layout.cols-4 {
    --cols: 1;
  }
}

/* ─────────────────────────────────────────────────────────
   20. PREMIUM AUTO-SCROLLING MARQUEE MOCKUPS
───────────────────────────────────────────────────────── */
.marquee-layout {
  width: 100%;
  overflow: hidden;
  position: relative;
  padding: 3rem 0;
}

/* Fade gradients on side bounds for smooth infinite feel */
.marquee-layout::before,
.marquee-layout::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 120px;
  z-index: 2;
  pointer-events: none;
}
.marquee-layout::before {
  left: 0;
  background: linear-gradient(to right, var(--bg) 0%, transparent 100%);
}
.marquee-layout::after {
  right: 0;
  background: linear-gradient(to left, var(--bg) 0%, transparent 100%);
}

.marquee-track {
  display: flex;
  width: max-content;
  gap: 2.2rem;
  animation: scrollMockups 35s linear infinite;
}

.marquee-track .media-card {
  width: 290px;
  flex-shrink: 0;
}

@keyframes scrollMockups {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (max-width: 768px) {
  .marquee-layout {
    padding: 2rem 0;
  }
  .marquee-track {
    gap: 1.5rem;
    animation-duration: 25s;
  }
  .marquee-track .media-card {
    width: 210px;
  }
  .marquee-layout::before,
  .marquee-layout::after {
    width: 60px;
  }
}
