/* =====================================================
   GLOBAL RESET
   ===================================================== */

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

html,
body {
  overflow-x: hidden;
  font-family: monospace;
  background: #f5f5f5;
}

section {
  width: 100%;
  min-height: 100vh;
  position: relative;
}


/* =====================================================
   SECTION 1 — FACEMESH SCAN
   ===================================================== */

#section1 {
  background: black;
}

#dermaPanel {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid #111;
  padding: 20px 24px;
  font-size: 14px;
  line-height: 1.6;
  width: 280px;
  backdrop-filter: blur(6px);
  z-index: 20;
  transition: opacity 0.6s ease;
}

.hidden {
  opacity: 0;
  pointer-events: none;
}


/* =====================================================
   SECTION 1 — SCIENTIFIC PANEL
   ===================================================== */

#sciencePanel {
  position: fixed;
  top: 380px;
  right: 20px;
  width: 280px;
  height: 260px;
  background: rgba(255, 255, 255, 0.88);
  border: 2px solid #111;
  padding: 12px;
  backdrop-filter: blur(6px);
  z-index: 19;
  overflow: hidden;
  transition: opacity 0.6s ease;
}

.science-header {
  margin-bottom: 10px;
}

.science-header strong {
  display: block;
  font-size: 13px;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.science-header p {
  font-size: 10px;
  line-height: 1.3;
  opacity: 0.65;
  margin-top: 3px;
}

.science-viewer {
  width: 100%;
  height: calc(100% - 42px);
  background: #f3f3f3;
  border: 1px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.science-viewer img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}


/* =====================================================
   USER RECORDS PANEL
   ===================================================== */

#recordsPanel {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 215px;
  height: 58px;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #111;
  backdrop-filter: blur(6px);
  z-index: 21;
  overflow: hidden;
  transition: width 0.35s ease, height 0.35s ease, opacity 0.6s ease;
}

#recordsPanel:hover {
  width: 320px;
  height: 560px;
}

.records-tab {
  height: 58px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 1px solid transparent;
  background: rgba(255, 255, 255, 0.95);
}

#recordsPanel:hover .records-tab {
  border-bottom: 1px solid #cfcfcf;
}

.records-tab span:first-child {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.records-id {
  font-size: 10px;
  opacity: 0.6;
  margin-top: 3px;
  letter-spacing: 0.05em;
}

.records-content {
  height: calc(100% - 58px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#recordsPanel:hover .records-content {
  opacity: 1;
  pointer-events: auto;
}

.records-inner {
  height: 100%;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.records-card {
  background: #ffffff;
  padding: 10px;
  border: 1px solid #d6d6d6;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.records-card img {
  width: 100%;
  height: auto;
  display: block;
}

.records-inner::-webkit-scrollbar {
  width: 8px;
}

.records-inner::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
}

.records-inner::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}


/* =====================================================
   INTERVENTION PANEL
   ===================================================== */

#interventionPanel {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 350px;
  min-height: 160px;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid #111;
  backdrop-filter: blur(6px);
  z-index: 21;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.6s ease;
}

#interventionPanel:hover {
  transform: translateY(-2px);
}

.intervention-content {
  width: 100%;
  height: 100%;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
}

.intervention-instruction {
  font-size: 9px;
  line-height: 1.25;
  letter-spacing: 0.05em;
  color: #666;
  margin-bottom: 12px;
  text-transform: lowercase;
}

.intervention-title {
  font-size: 16px;
  line-height: 0.95;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: #111;
  margin: 0;
}

.intervention-routine {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.intervention-routine span {
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: #7a7a7a;
}




/* =====================================================
   OPTIONAL TRANSITION SECTION
   ===================================================== */

#transition {
  min-height: auto;
  background: linear-gradient(
    to bottom,
    #f5f5f5 0%,
    #f2f2f2 18%,
    #f0eee9 55%,
    #ece7df 100%
  );
  position: relative;
  padding-bottom: 120px;
}

.transition-inner {
  width: min(860px, 88vw);
  margin: 0 auto;
  padding: 10vh 0 0;
}

.transition-inner::before {
  content: "";
  display: block;
  width: 80px;
  height: 2px;
  background: #b30000;
  margin: 40px auto 80px auto;
}

.transition-inner::after {
  content: "";
  display: block;
  width: 80px;
  height: 2px;
  background: #b30000;
  margin: 40px auto;
}

.transition-intro,
.transition-step,
.transition-outro {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.transition-intro {
  margin-bottom: 10vh;
}

.transition-step {
  margin-bottom: 0;
}

.transition-outro {
  margin-top: 0;
}

.transition-label {
  font-size: 20px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #b30000;
  font-family: monospace;
}

.routine-item {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 34px;
}

.routine-item:last-child {
  margin-bottom: 8px;
}

.routine-number {
  font-size: 14px;
  letter-spacing: 0.2em;
  color: #b30000;
  min-width: 28px;
}

.routine-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.clinical-term {
  font-family: monospace;
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #777;
}

.consumer-term {
  font-family: monospace;
  font-size: 18px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #b30000;
}


/* =====================================================
   FADE-IN ANIMATION
   ===================================================== */

.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}


/* =====================================================
   MODAL WINDOW
   ===================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 24px;
}

.modal-overlay.active {
  display: flex;
}

.modal-window {
  width: min(1280px, 95vw);
  height: 90vh;
  background: #f5f2ec;
  border: 2px solid #111;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

.modal-header {
  height: 52px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #d8d1c7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #111;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.modal-body #section-3 {
  min-height: auto;
  padding-bottom: 60px;
}


/* =====================================================
   SECTION 3 — CONSUMER INTERFACE
   ===================================================== */

#section-3 {
  min-height: auto;
  margin-top: 0;
  background: #f5f2ec;
  padding: 0 0 70px 0;
  font-family: Arial, Helvetica, sans-serif;
}

.shop-banner {
  background: #111;
  color: #fff;
  text-align: center;
  font-size: 12px;
  padding: 10px 16px;
  letter-spacing: 0.02em;
}

.shop-shell {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 20px 22px 0;
}

.shop-header {
  display: grid;
  grid-template-columns: 210px 1fr 160px;
  gap: 24px;
  align-items: center;
  margin-bottom: 14px;
}

.shop-logo {
  font-size: clamp(24px, 2.6vw, 42px);
  letter-spacing: 0.16em;
  font-weight: 500;
  color: #111;
  margin-left: 0;
}

.shop-search-wrap {
  display: flex;
  justify-content: center;
}

.shop-search {
  width: 100%;
  height: 46px;
  border: 1px solid #d3cdc3;
  border-radius: 999px;
  background: transparent;
  padding: 0 18px;
  font-size: 14px;
  outline: none;
  color: #111;
  text-align: center;
}

.shop-search::placeholder {
  color: #a7a099;
  font-style: italic;
  text-align: center;
}

.shop-icons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  font-size: 12px;
  text-transform: uppercase;
  color: #111;
}

.shop-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding: 14px 0 16px;
  border-bottom: 1px solid #ddd6cc;
  font-size: 14px;
  text-transform: lowercase;
  color: #111;
}

.shop-nav .active {
  color: #b30000;
}

.shop-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: 34px 0 40px;
}

.shop-breadcrumb {
  font-size: 14px;
  color: #7d776f;
  text-transform: lowercase;
}

.shop-recommendation {
  font-size: 13px;
  color: #b30000;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  line-height: 1.4;
  margin-top: 14px;
}

.category-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
  margin-bottom: 30px;
}

.category-pill {
  border: 1px solid #d9d2c8;
  border-radius: 999px;
  padding: 14px 10px;
  text-align: center;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.6);
  color: #111;
  text-transform: lowercase;
}


/* =====================================================
   PRODUCT GRID
   ===================================================== */

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.product-card {
  background: #fffdfa;
  border: 1px solid #ddd6cc;
  min-height: 320px;
  width: 100%;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.06);
}

.card-state {
  display: none;
  min-height: 320px;
}

.card-state.active {
  display: flex;
  flex-direction: column;
}

.product-image {
  height: 170px;
  border-bottom: 1px solid #ebe4da;
  background-color: #f7f4ee;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.product-info {
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-info.alt {
  justify-content: center;
  min-height: 320px;
  padding: 22px 18px;
}

.product-tag {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8d867c;
}

.product-tag.system {
  color: #b30000;
  letter-spacing: 0.16em;
}

.card-state .product-tag.system + ul li {
  color: #b30000;
}

.product-tag.danger {
  color: #b30000;
}

.product-info h3 {
  font-size: 18px;
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #111;
}

.product-copy {
  font-size: 12px;
  line-height: 1.35;
  color: #3d3b38;
}

.product-info ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.product-info li {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.15;
  color: #111;
  letter-spacing: -0.01em;
  font-weight: 300;
}


/* =====================================================
   REAL PRODUCT IMAGES
   ===================================================== */

.product-1 { background-image: url("product-1.png"); }
.product-2 { background-image: url("product-2.png"); }
.product-3 { background-image: url("product-3.png"); }
.product-4 { background-image: url("product-4.png"); }
.product-5 { background-image: url("product-5.png"); }
.product-6 { background-image: url("product-6.png"); }
.product-7 { background-image: url("product-7.png"); }
.product-8 { background-image: url("product-8.png"); }


/* =====================================================
   PAGINATION
   ===================================================== */

.shop-pagination-wrap {
  margin-top: 50px;
  padding: 28px 0 10px;
  text-align: center;
  border-top: 1px solid #e5ded4;
  width: 100%;
}

.results-count {
  font-size: 18px;
  color: #5f5b56;
  margin-bottom: 18px;
  font-family: Arial, Helvetica, sans-serif;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
}

.page-numbers {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  font-family: Arial, Helvetica, sans-serif;
}

.page-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: #b30000;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
}

.page-btn:hover {
  opacity: 0.7;
}

.page-number,
.page-ellipsis {
  font-size: 18px;
  color: #4e4a45;
}

.page-number {
  cursor: pointer;
}

.page-number.active {
  color: #111;
  font-weight: 700;
}


/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 1100px) {
  .shop-header {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .shop-icons {
    justify-content: flex-start;
  }

  .category-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .transition-inner {
    padding: 9vh 0 0;
  }

  .transition-intro {
    margin-bottom: 8vh;
  }

  .routine-item {
    gap: 16px;
    margin-bottom: 28px;
  }

  .consumer-term {
    font-size: 16px;
  }

  .shop-shell {
    padding: 18px 16px 0;
  }

  .shop-logo {
    font-size: 34px;
  }

  .shop-search {
    height: 42px;
    font-size: 13px;
  }

  .category-pill {
    font-size: 12px;
    padding: 12px 8px;
  }
}

@media (max-width: 700px) {
  .pagination {
    gap: 16px;
  }

  .page-number,
  .page-ellipsis,
  .page-btn,
  .results-count {
    font-size: 16px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .category-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-info h3 {
    font-size: 22px;
  }

  .product-info li {
    font-size: 18px;
  }
}
