/* ==========================================================================
   2ne1.com — Classic Reimagined Theme
   Honoring the beloved original 2ne1 layout with modern web craft.
   ========================================================================== */

:root {
  --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', 'JetBrains Mono', Menlo, Consolas, monospace;

  /* Classic Theme Colors (default) */
  --bg-page: #285088;
  --bg-banner: #000000;
  --text-banner: #ffb030;
  --bg-card: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-outer: #000000;
  --border-card: #e2e8f0;
  --link-primary: #1060c0;
  --link-hover: #ffa000;
  --accent-amber: #ffb030;
  --accent-dark: #000000;
  --btn-bg: #f8fafc;
  --btn-border: #cbd5e1;
  --btn-text: #0f172a;
  --btn-primary-bg: #1060c0;
  --btn-primary-text: #ffffff;
  --btn-primary-hover: #08428c;
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.12);
  --proto-bar-bg: #000000;
  --proto-bar-text: #e2e8f0;
}

[data-theme="dark"] {
  --bg-page: #0a0f18;
  --bg-banner: #05080e;
  --text-banner: #f59e0b;
  --bg-card: #131b29;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-outer: #1e293b;
  --border-card: #27354a;
  --link-primary: #60a5fa;
  --link-hover: #fbbf24;
  --accent-amber: #f59e0b;
  --accent-dark: #05080e;
  --btn-bg: #1e293b;
  --btn-border: #334155;
  --btn-text: #f8fafc;
  --btn-primary-bg: #2563eb;
  --btn-primary-text: #ffffff;
  --btn-primary-hover: #1d4ed8;
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.4);
  --proto-bar-bg: #05080e;
  --proto-bar-text: #cbd5e1;
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-page);
}

a {
  color: var(--link-primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover, a:focus-visible {
  color: var(--link-hover);
  text-decoration: underline;
}

/* ==========================================================================
   Top Prototype Switcher Bar
   ========================================================================== */
.proto-bar {
  background: var(--proto-bar-bg);
  border-bottom: 2px solid var(--accent-amber);
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--proto-bar-text);
  position: sticky;
  top: 0;
  z-index: 100;
}

.proto-bar__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.proto-bar__label {
  color: var(--accent-amber);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.proto-bar__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.proto-link {
  color: #94a3b8;
  transition: color 0.15s;
}

.proto-link:hover {
  color: #ffffff;
  text-decoration: none;
}

.proto-link--active {
  color: var(--accent-amber);
  font-weight: 700;
  text-decoration: underline;
}

.proto-link--root {
  color: #cbd5e1;
  font-weight: 600;
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid #475569;
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}

.theme-toggle-btn:hover {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}

/* ==========================================================================
   Page Container
   ========================================================================== */
.page-container {
  width: 100%;
  max-width: 1140px;
  margin: 20px auto 40px;
  padding: 0 16px;
  flex: 1;
}

/* ==========================================================================
   Classic Header Banner
   ========================================================================== */
.classic-header {
  border: 2px solid var(--border-outer);
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
  background: var(--bg-banner);
}

.classic-header__topbar {
  padding: 24px 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #222222;
}

.classic-brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.classic-title {
  color: #ffffff;
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.classic-tagline {
  color: var(--text-banner);
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.classic-socials {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #94a3b8;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.classic-socials a {
  color: #cbd5e1;
}

.classic-socials a:hover {
  color: var(--text-banner);
}

.classic-socials .sep {
  opacity: 0.5;
}

/* Classic Ribbon Bar */
.classic-ribbon {
  background: #000000;
  padding: 10px 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.classic-ribbon__title {
  color: var(--text-banner);
  font-weight: 700;
  font-size: 1.05rem;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}

.classic-ribbon__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.filter-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.pill {
  background: #111111;
  color: #cbd5e1;
  border: 1px solid #333333;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
}

.pill:hover {
  border-color: var(--text-banner);
  color: #ffffff;
}

.pill--active {
  background: var(--text-banner);
  color: #000000;
  border-color: var(--text-banner);
}

.search-box input {
  background: #111111;
  border: 1px solid #333333;
  color: #ffffff;
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  border-radius: 3px;
  min-width: 240px;
  outline: none;
  transition: border-color 0.15s;
}

.search-box input:focus {
  border-color: var(--text-banner);
}

/* ==========================================================================
   Main Modules Grid
   ========================================================================== */
.classic-main {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* The Classic Module Frame */
.module {
  display: grid;
  grid-template-columns: 46px 1fr;
  border: 2px solid var(--border-outer);
  box-shadow: var(--shadow-card);
  background: var(--bg-card);
  transition: opacity 0.2s ease;
}

.module[hidden] {
  display: none !important;
}

/* Vertical Spine (The Iconic 2ne1 Feature) */
.module__spine {
  background: #000000;
  border-right: 2px solid var(--border-outer);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 4px;
}

.spine-text {
  color: var(--text-banner);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.45;
  text-align: center;
  text-transform: lowercase;
  letter-spacing: 1px;
}

/* Content Column */
.module__content {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Individual Project Entry */
.entry {
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--border-card);
}

.entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.entry[hidden] {
  display: none !important;
}

.entry__header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.entry__prefix {
  color: var(--accent-amber);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
}

.entry__title {
  font-size: 1.18rem;
  font-weight: 700;
}

.entry__title a {
  color: var(--link-primary);
}

.entry__title a:hover {
  color: var(--link-hover);
}

.entry__years {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.05);
  padding: 1px 6px;
  border-radius: 2px;
  margin-left: auto;
}

[data-theme="dark"] .entry__years {
  background: rgba(255, 255, 255, 0.08);
}

.entry__body {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.entry__thumb {
  flex-shrink: 0;
  width: 140px;
  order: 2; /* Thumb on the right, honoring the classic layout */
}

.entry__thumb img {
  width: 100%;
  height: 94px;
  object-fit: cover;
  border: 1px solid var(--border-outer);
  display: block;
}

.thumb-play-btn {
  position: relative;
  display: block;
  width: 100%;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
}

.play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 0.9;
  transition: opacity 0.15s, background 0.15s;
}

.thumb-play-btn:hover .play-overlay {
  opacity: 1;
  background: rgba(16, 96, 192, 0.85);
}

.entry__desc {
  flex: 1;
  order: 1;
}

.entry__desc p {
  color: var(--text-secondary);
  font-size: 0.94rem;
  margin-bottom: 10px;
  line-height: 1.55;
}

.entry__desc p strong {
  color: var(--text-primary);
}

.entry__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* Action Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  border-radius: 2px;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--btn-text);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.btn:hover {
  background: var(--btn-text);
  color: var(--btn-bg);
  border-color: var(--btn-text);
  text-decoration: none;
}

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

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

/* ==========================================================================
   Footer
   ========================================================================== */
.classic-footer {
  margin-top: 30px;
  border: 2px solid var(--border-outer);
  background: #000000;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 12px 20px;
}

.classic-footer__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* ==========================================================================
   Media Modal (<dialog>)
   ========================================================================== */
.media-dialog, .optricks-dialog {
  border: none;
  background: transparent;
  padding: 0;
  margin: auto;
  max-width: 900px;
  width: 94vw;
  outline: none;
}

.media-dialog::backdrop, .optricks-dialog::backdrop {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.media-dialog__box {
  background: var(--bg-card);
  border: 2px solid var(--border-outer);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
}

.media-dialog__header {
  background: #000000;
  color: var(--text-banner);
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--accent-amber);
}

.media-dialog__close {
  background: transparent;
  border: 1px solid #444444;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 8px;
  cursor: pointer;
  border-radius: 2px;
}

.media-dialog__close:hover {
  background: #cc0000;
  border-color: #cc0000;
}

.media-dialog__stage {
  padding: 16px;
  background: #000000;
}

.media-dialog__stage iframe,
.media-dialog__stage video {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 70vh;
  display: block;
  border: none;
  background: #000000;
}

/* Optricks Grid Modal */
.optricks-dialog__content {
  padding: 20px;
  max-height: 80vh;
  overflow-y: auto;
}

.optricks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.optricks-card {
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.optricks-card__title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--link-primary);
}

.optricks-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
  object-fit: cover;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 768px) {
  .classic-header__topbar {
    padding: 16px;
  }

  .classic-title {
    font-size: 1.6rem;
  }

  .module {
    grid-template-columns: 36px 1fr;
  }

  .spine-text {
    font-size: 0.95rem;
  }

  .entry__body {
    flex-direction: column;
  }

  .entry__thumb {
    order: 1;
    width: 100%;
    margin-bottom: 8px;
  }

  .entry__thumb img {
    height: 160px;
  }

  .entry__desc {
    order: 2;
  }

  .search-box input {
    min-width: 100%;
  }

  .classic-ribbon__controls {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
}

/* ==========================================================================
   Subpage & Case Study Extensions (Classic Style)
   ========================================================================== */
.classic-breadcrumb {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-amber);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.classic-breadcrumb a {
  color: var(--text-banner);
  text-decoration: none;
}

.classic-breadcrumb a:hover {
  text-decoration: underline;
  color: #ffffff;
}

.classic-breadcrumb .sep {
  color: #64748b;
}

/* Photo & Contact Sheet Grids */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.photo-card {
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.photo-card:hover {
  border-color: var(--link-hover);
  transform: translateY(-2px);
}

.photo-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 2px;
  background: #000000;
}

.photo-card__caption {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* Spec Tables */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12px;
  margin: 14px 0;
}

.spec-table th, .spec-table td {
  padding: 8px 12px;
  border: 1px solid var(--border-card);
  text-align: left;
}

.spec-table th {
  background: #000000;
  color: var(--text-banner);
  font-weight: 700;
  width: 32%;
}

.spec-table td {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* Patch PDF Grid */
.patch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin: 14px 0;
}

.patch-card {
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.patch-card__title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--link-primary);
}

.patch-card__desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  flex: 1;
}

/* Interactive Canvas Container */
.canvas-container {
  width: 100%;
  height: 380px;
  background: #05080e;
  border: 1px solid var(--border-card);
  position: relative;
  overflow: hidden;
  margin: 14px 0;
}

.canvas-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.canvas-overlay-ui {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-amber);
  background: rgba(0, 0, 0, 0.7);
  padding: 6px 12px;
  border: 1px solid rgba(255, 176, 48, 0.3);
  pointer-events: none;
}
