/* ===================================
   Portfolio - Common Styles
   Blueprint Background + Tracing Paper
=================================== */

:root {
  --bp-bg: #0a1929;
  --panel-bg: rgba(240, 245, 250, 0.92);
  --panel-border: rgba(180, 200, 220, 0.5);
  --panel-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --text: #1a2a3a;
  --text-muted: #4a5a6a;
  --accent: #0891b2;
  --accent-hover: #06b6d4;
  --divider: rgba(100, 120, 140, 0.2);
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
  }
}

body {
  background: var(--bp-bg) url('assets/blueprint-bg.png') repeat;
  background-size: auto;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.7;
  min-height: 100vh;
}

/* Dark overlay for vignette effect */
.bg-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse at center,
    rgba(10, 25, 41, 0.3) 0%,
    rgba(10, 25, 41, 0.6) 60%,
    rgba(5, 15, 30, 0.85) 100%
  );
}

/* ===================================
   Navigation
=================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--panel-border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.nav-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

/* ===================================
   Language Toggle
=================================== */
.lang-toggle {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 99;
  display: flex;
  background: var(--panel-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.lang-toggle button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.lang-toggle button:hover {
  background: rgba(8, 145, 178, 0.1);
}

.lang-toggle button.active {
  background: var(--accent);
  color: white;
}

/* ===================================
   Tracing Paper Panel (Content Container)
=================================== */
.panel {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 40px;
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: var(--panel-shadow);
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===================================
   Hero Section
=================================== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px 20px 80px;
}

.hero-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: var(--panel-shadow);
  padding: 48px;
  max-width: 860px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 32px;
  line-height: 1.9;
  word-break: keep-all;
}

/* Hero description - enhanced readability */
.hero-content p {
  background: rgba(8, 145, 178, 0.04);
  padding: 16px 20px;
  border-left: 3px solid rgba(8, 145, 178, 0.4);
  border-radius: 0 6px 6px 0;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===================================
   Hero Card - Premium Style
=================================== */
.hero-card {
  background: rgba(245, 248, 252, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(8, 145, 178, 0.35);
  border-radius: 16px;
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(8, 145, 178, 0.08),
    0 0 24px rgba(8, 145, 178, 0.12);
  padding-top: 0;
  overflow: hidden;
}

/* Title Block Header Bar */
.hero-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 48px;
  height: 48px;
  background: rgba(8, 145, 178, 0.06);
  border-bottom: 1px solid rgba(8, 145, 178, 0.2);
  margin-bottom: 24px;
}

.hero-title-bar .bar-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #0891b2;
}

.hero-title-bar .bar-info {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.hero-content {
  padding: 0 48px 48px;
}

/* Name Badge */
.name-badge {
  display: inline-block;
  background: rgba(240, 245, 250, 0.7);
  border: 1px solid rgba(8, 145, 178, 0.5);
  border-radius: 3px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #0891b2;
  margin-bottom: 12px;
}

/* Project Badge */
.project-badge {
  display: inline-block;
  background: rgba(240, 245, 250, 0.85);
  border: 1px solid rgba(8, 145, 178, 0.4);
  border-radius: 3px;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #0891b2;
  margin-bottom: 6px;
}

/* Subpage Hero - Enhanced but simpler */
.hero-subpage {
  background: rgba(245, 248, 252, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(8, 145, 178, 0.25);
  border-radius: 12px;
  box-shadow:
    0 6px 32px rgba(0, 0, 0, 0.2),
    0 0 16px rgba(8, 145, 178, 0.08);
}

/* Subpage Hero Section - Reduced height */
.hero-sub {
  min-height: auto;
  padding-top: 100px;
  padding-bottom: 60px;
}

/* Fallback for browsers supporting :has() */
.hero:has(.hero-subpage) {
  min-height: auto;
  padding-top: 100px;
  padding-bottom: 60px;
}

/* ===================================
   Buttons
=================================== */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
  cursor: pointer;
  border: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: white;
  border: 1px solid var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-secondary:hover {
  background: rgba(8, 145, 178, 0.1);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* ===================================
   Section Styles
=================================== */
.section {
  padding: 60px 20px;
}

.section + .section {
  padding-top: 30px;
}

.section-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: var(--panel-shadow);
  padding: 40px;
  max-width: 860px;
  margin: 0 auto;
}

.section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
}

.section h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.2em;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

.section h2::after {
  content: "";
  display: block;
  flex: 1;
  height: 1px;
  background: var(--divider);
}

.section p {
  margin-top: 16px;
  color: var(--text-muted);
}

/* Case Study - Text paragraphs enhanced readability */
.section-panel > p {
  background: rgba(8, 145, 178, 0.04);
  padding: 16px 20px;
  border-left: 3px solid rgba(8, 145, 178, 0.3);
  border-radius: 0 6px 6px 0;
  line-height: 1.9;
  word-break: keep-all;
}

.section-panel > p + p {
  margin-top: 20px;
}

/* ===================================
   Project Cards
=================================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.project-card {
  background: white;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.project-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.project-card-body {
  padding: 20px;
}

.project-card h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: var(--text);
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.project-card-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===================================
   Inline Trailer (Project Cards)
=================================== */
.project-media {
  position: relative;
  overflow: hidden;
}

.project-media img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.project-media .video-container {
  display: none;
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
}

.project-media .video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  z-index: 1;
}

.project-media .video-container .close-trailer {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,0.7);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.project-media .video-container .close-trailer:hover {
  background: rgba(0,0,0,0.9);
}

.project-media .video-container .sound-on {
  position: absolute;
  top: 8px;
  right: 48px;
  height: 32px;
  padding: 0 12px;
  background: rgba(8, 145, 178, 0.85);
  border: none;
  border-radius: 16px;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.2s;
}

.project-media .video-container .sound-on:hover {
  background: rgba(8, 145, 178, 1);
}

.project-media .video-container .sound-on.hidden {
  display: none;
}

.project-media.playing img {
  display: none;
}

.project-media.playing .video-container {
  display: block;
}

/* ===================================
   Figure / Images
=================================== */
figure {
  margin: 24px 0;
  background: white;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  overflow: hidden;
}

figure img {
  width: 100%;
  display: block;
}

figcaption {
  padding: 14px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-align: center;
  border-top: 1px solid var(--divider);
  background: rgba(240, 245, 250, 0.7);
}

.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.img-grid figure {
  margin: 0;
}

/* ===================================
   Video Embed
=================================== */
.video-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  margin-top: 24px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  border: 2px solid rgba(8, 145, 178, 0.4);
  box-shadow: 0 4px 20px rgba(8, 145, 178, 0.15);
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Video section - special styling */
#trailer .section-panel,
#playthrough .section-panel {
  background: rgba(235, 242, 248, 0.95);
  border-color: rgba(8, 145, 178, 0.25);
}

/* ===================================
   Info List
=================================== */
.info-list {
  margin-top: 16px;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  color: var(--text-muted);
}

.info-list li {
  background: rgba(255, 255, 255, 0.6);
  padding: 12px 16px;
  border-radius: 6px;
  border-left: 3px solid var(--accent);
  line-height: 1.6;
}

.info-list strong {
  color: var(--text);
  margin-right: 4px;
}

/* ===================================
   Contact Links
=================================== */
.contact-links {
  margin-top: 20px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.contact-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.contact-links a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* ===================================
   Footer
=================================== */
footer {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 24px;
  max-width: 860px;
  margin: 0 auto;
}

/* ===================================
   Back to Top
=================================== */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--panel-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  z-index: 90;
}

.back-to-top:hover {
  background: var(--accent);
  color: white;
}

/* ===================================
   Responsive
=================================== */

/* Tablet */
@media (max-width: 768px) {
  .hero {
    min-height: auto;
    padding: 100px 16px 60px;
  }

  .hero-panel,
  .section-panel {
    padding: 32px;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  .hero p {
    font-size: 1.1rem;
  }

  .section {
    padding: 60px 16px;
  }

  /* Hero Title Bar - Tablet */
  .hero-title-bar {
    padding: 12px 32px;
  }

  .hero-content {
    padding: 0 32px 32px;
  }

  .project-grid {
    gap: 20px;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .hero {
    padding: 80px 12px 40px;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 1rem;
    max-width: 100%;
    line-height: 1.8;
  }

  .hero-content p {
    padding: 12px 16px;
  }

  .hero-panel,
  .section-panel {
    padding: 20px;
    border-radius: 12px;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 10px;
  }

  .hero-buttons .btn {
    width: 100%;
    text-align: center;
  }

  /* Hero Title Bar - Mobile */
  .hero-title-bar {
    padding: 10px 20px;
    height: auto;
    min-height: 44px;
  }

  .hero-title-bar .bar-label {
    font-size: 0.65rem;
  }

  .hero-title-bar .bar-info {
    font-size: 0.65rem;
  }

  .hero-content {
    padding: 0 20px 24px;
  }

  /* Navigation - Mobile */
  .nav-inner {
    padding: 10px 16px;
  }

  .nav-logo {
    font-size: 1rem;
  }

  .nav-links {
    gap: 12px;
  }

  .nav-links a {
    font-size: 0.75rem;
  }

  /* Section - Mobile */
  .section {
    padding: 40px 12px;
  }

  .section h2 {
    font-size: 1.25rem;
    flex-wrap: wrap;
  }

  .section h2::after {
    flex-basis: 100%;
    margin-top: 8px;
  }

  /* Section panel text - Mobile */
  .section-panel > p {
    padding: 12px 14px;
    font-size: 0.95rem;
  }

  /* Project Cards - Mobile */
  .project-card-body {
    padding: 16px;
  }

  .project-card h3 {
    font-size: 1.1rem;
  }

  .project-card p {
    font-size: 0.85rem;
  }

  .project-card-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .project-card-buttons .btn {
    width: 100%;
    text-align: center;
  }

  /* Lang Toggle - Mobile */
  .lang-toggle {
    top: 60px;
    right: 12px;
  }

  /* Footer - Mobile */
  .footer-panel {
    padding: 16px;
  }

  /* Back to Top - Mobile */
  .back-to-top {
    width: 40px;
    height: 40px;
    bottom: 16px;
    right: 16px;
  }

  /* Image Grid - Mobile */
  .img-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Info List - Mobile */
  .info-list {
    padding-left: 16px;
  }

  .info-list li {
    font-size: 0.9rem;
  }
}

/* Small Mobile */
@media (max-width: 380px) {
  .hero h1 {
    font-size: 1.5rem;
  }

  .hero-title-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 8px 16px;
  }

  .nav-links {
    gap: 8px;
  }

  .nav-links a {
    font-size: 0.7rem;
  }
}
