/* ==========================================================================
   ASYRAF — FACE AI RECOGNITION
   ========================================================================== */


/* --------------------------------------------------------------------------
   VARIABLES
   -------------------------------------------------------------------------- */

:root {
  --bg: #0a0a0d;
  --card: #141417;
  --card-secondary: #101013;

  --text: #f5f5f7;
  --text-secondary: #a3a3ab;
  --text-muted: #66666f;

  --border: rgba(255, 255, 255, 0.10);

  --button-bg: #f5f5f7;
  --button-text: #0a0a0d;

  --success: #22c55e;
  --danger: #ef4444;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --shadow:
    0 25px 70px -25px rgba(0, 0, 0, 0.7);
}


/* --------------------------------------------------------------------------
   RESET
   -------------------------------------------------------------------------- */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;

  background: var(--bg);

  color: var(--text);

  font-family:
    'Inter',
    'Segoe UI',
    sans-serif;

  -webkit-font-smoothing: antialiased;

  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: none;
  font-family: inherit;
}

svg {
  display: block;
}


/* ==========================================================================
   NAVBAR
   ========================================================================== */

.navbar {
  position: fixed;

  top: 20px;
  left: 0;
  right: 0;

  z-index: 1000;

  display: flex;

  justify-content: center;

  padding: 0 20px;
}

.nav-pill {
  width: 100%;

  max-width: 1100px;

  min-height: 58px;

  display: flex;

  align-items: center;

  padding: 10px 14px 10px 16px;

  background: rgba(22, 22, 26, 0.92);

  border: 1px solid var(--border);

  border-radius: 999px;

  box-shadow: var(--shadow);

  backdrop-filter: blur(18px);
}

.nav-logo {
  display: flex;

  align-items: center;

  gap: 10px;

  font-size: 15px;

  font-weight: 800;
}

.nav-logo-mark {
  width: 32px;
  height: 32px;

  display: flex;

  align-items: center;

  justify-content: center;

  background: var(--text);

  color: var(--bg);

  border-radius: 9px;

  font-family: Georgia, serif;

  font-size: 17px;

  font-style: italic;
}

.nav-logo-text {
  letter-spacing: 0.02em;
}

.nav-right {
  margin-left: auto;
}

.back-gallery {
  padding: 10px 15px;

  border: 1px solid var(--border);

  border-radius: 999px;

  color: var(--text-secondary);

  font-size: 12px;

  font-weight: 600;

  transition:
    color 0.2s ease,
    background 0.2s ease;
}

.back-gallery:hover {
  color: var(--text);

  background: rgba(255, 255, 255, 0.06);
}


/* ==========================================================================
   PAGE
   ========================================================================== */

.face-page {
  width: 100%;

  max-width: 1100px;

  margin: 0 auto;

  padding:
    170px
    24px
    100px;
}


/* ==========================================================================
   INTRO
   ========================================================================== */

.project-intro {
  max-width: 850px;

  margin-bottom: 70px;
}

.project-label {
  margin-bottom: 18px;

  color: var(--text-muted);

  font-family:
    'JetBrains Mono',
    monospace;

  font-size: 11px;

  font-weight: 600;

  letter-spacing: 0.18em;
}

.project-intro h1 {
  max-width: 900px;

  font-size:
    clamp(
      58px,
      9vw,
      110px
    );

  line-height: 0.9;

  letter-spacing: -0.065em;

  font-weight: 800;
}

.project-intro h1 span {
  display: block;

  color: var(--text-muted);
}

.project-description {
  max-width: 630px;

  margin-top: 32px;

  color: var(--text-secondary);

  font-size: 16px;

  line-height: 1.8;
}


/* --------------------------------------------------------------------------
   STACK
   -------------------------------------------------------------------------- */

.project-stack {
  display: flex;

  flex-wrap: wrap;

  gap: 8px;

  margin-top: 28px;
}

.project-stack span {
  padding: 8px 12px;

  border: 1px solid var(--border);

  border-radius: 999px;

  color: var(--text-secondary);

  font-family:
    'JetBrains Mono',
    monospace;

  font-size: 10px;
}


/* ==========================================================================
   SCANNER
   ========================================================================== */

.scanner-section {
  margin-bottom: 120px;
}

.scanner-card {
  padding: 20px;

  background: var(--card);

  border: 1px solid var(--border);

  border-radius: 28px;

  box-shadow: var(--shadow);
}


/* --------------------------------------------------------------------------
   STATUS
   -------------------------------------------------------------------------- */

.scanner-status {
  display: flex;

  align-items: center;

  justify-content: space-between;

  padding: 4px 3px 18px;
}

.status-left {
  display: flex;

  align-items: center;

  gap: 10px;

  color: var(--text-secondary);

  font-size: 12px;

  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;

  background: var(--text-muted);

  border-radius: 50%;

  transition:
    background 0.3s ease,
    box-shadow 0.3s ease;
}

.status-dot.active {
  background: var(--success);

  box-shadow:
    0 0 12px
    rgba(34, 197, 94, 0.8);
}

.status-right {
  color: var(--text-muted);

  font-family:
    'JetBrains Mono',
    monospace;

  font-size: 10px;

  letter-spacing: 0.18em;
}


/* ==========================================================================
   CAMERA
   ========================================================================== */

.camera-wrapper {
  position: relative;

  width: 100%;

  aspect-ratio: 4 / 3;

  overflow: hidden;

  background: #050506;

  border: 1px solid var(--border);

  border-radius: 20px;
}


/* --------------------------------------------------------------------------
   PLACEHOLDER
   -------------------------------------------------------------------------- */

.camera-placeholder {
  position: absolute;

  inset: 0;

  z-index: 3;

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  padding: 30px;

  text-align: center;

  background:
    radial-gradient(
      circle at center,
      #16161a,
      #08080a 70%
    );
}

.camera-placeholder.hidden {
  display: none;
}

.camera-placeholder-icon {
  margin-bottom: 20px;

  color: var(--text-muted);
}

.camera-placeholder h2 {
  margin-bottom: 9px;

  font-size: 20px;
}

.camera-placeholder p {
  max-width: 400px;

  color: var(--text-muted);

  font-size: 13px;

  line-height: 1.7;
}


/* --------------------------------------------------------------------------
   VIDEO
   -------------------------------------------------------------------------- */

#camera {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: cover;

  transform: scaleX(-1);

  opacity: 0;

  transition: opacity 0.35s ease;
}

#camera.active {
  opacity: 1;
}


/* --------------------------------------------------------------------------
   SCAN OVERLAY
   -------------------------------------------------------------------------- */

.scan-overlay {
  position: absolute;

  inset: 0;

  z-index: 2;

  display: none;

  pointer-events: none;
}

.scan-overlay.active {
  display: block;
}

.corner {
  position: absolute;

  width: 50px;
  height: 50px;
}

.top-left {
  top: 25px;
  left: 25px;

  border-top:
    2px solid
    rgba(255, 255, 255, 0.8);

  border-left:
    2px solid
    rgba(255, 255, 255, 0.8);
}

.top-right {
  top: 25px;
  right: 25px;

  border-top:
    2px solid
    rgba(255, 255, 255, 0.8);

  border-right:
    2px solid
    rgba(255, 255, 255, 0.8);
}

.bottom-left {
  bottom: 25px;
  left: 25px;

  border-bottom:
    2px solid
    rgba(255, 255, 255, 0.8);

  border-left:
    2px solid
    rgba(255, 255, 255, 0.8);
}

.bottom-right {
  right: 25px;
  bottom: 25px;

  border-right:
    2px solid
    rgba(255, 255, 255, 0.8);

  border-bottom:
    2px solid
    rgba(255, 255, 255, 0.8);
}

.scan-line {
  position: absolute;

  top: 15%;
  left: 10%;

  width: 80%;
  height: 1px;

  opacity: 0;

  background:
    rgba(255, 255, 255, 0.7);
}

.scan-overlay.scanning .scan-line {
  opacity: 1;

  animation:
    scanLine
    1.4s
    ease-in-out
    infinite;
}

@keyframes scanLine {

  0% {
    top: 15%;
  }

  50% {
    top: 85%;
  }

  100% {
    top: 15%;
  }

}


/* ==========================================================================
   CONTROLS
   ========================================================================== */

.control-panel {
  display: grid;

  grid-template-columns:
    repeat(2, 1fr);

  gap: 12px;

  margin-top: 16px;
}

.control-panel button {
  min-height: 50px;

  padding: 13px 18px;

  border-radius: 14px;

  cursor: pointer;

  font-size: 13px;

  font-weight: 700;

  transition:
    transform 0.25s var(--ease),
    opacity 0.25s ease,
    background 0.25s ease;
}

.start-camera-btn {
  background: var(--button-bg);

  color: var(--button-text);
}

.start-camera-btn:hover {
  transform: translateY(-2px);
}

.scan-btn {
  background:
    rgba(255, 255, 255, 0.08);

  border:
    1px solid
    var(--border);

  color: var(--text);
}

.scan-btn:not(:disabled):hover {
  background:
    rgba(255, 255, 255, 0.12);

  transform: translateY(-2px);
}

.scan-btn:disabled {
  cursor: not-allowed;

  opacity: 0.35;
}


/* ==========================================================================
   RESULT
   ========================================================================== */

.result-card {
  margin-top: 16px;

  padding: 20px;

  background: var(--card-secondary);

  border: 1px solid var(--border);

  border-radius: 16px;
}

.result-header {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 15px;

  margin-bottom: 14px;
}

.result-label,
.result-state {
  font-family:
    'JetBrains Mono',
    monospace;

  font-size: 9px;

  font-weight: 600;

  letter-spacing: 0.15em;
}

.result-label {
  color: var(--text-muted);
}

.result-state {
  padding: 5px 8px;

  border: 1px solid var(--border);

  border-radius: 999px;

  color: var(--text-muted);
}

.result-state.success {
  color: var(--success);

  border-color:
    rgba(34, 197, 94, 0.3);
}

.result-state.failed {
  color: var(--danger);

  border-color:
    rgba(239, 68, 68, 0.3);
}

.result {
  min-height: 30px;

  color: var(--text-secondary);

  font-size: 14px;

  line-height: 1.7;
}

.result strong {
  color: var(--text);

  font-size: 18px;
}


/* ==========================================================================
   PRIVACY
   ========================================================================== */

.privacy-note {
  display: flex;

  align-items: center;

  justify-content: center;

  gap: 7px;

  margin-top: 16px;

  color: var(--text-muted);

  font-size: 10px;
}


/* ==========================================================================
   INFORMATION
   ========================================================================== */

.project-information {
  display: grid;

  grid-template-columns:
    80px
    minmax(0, 650px);

  gap: 30px;

  padding-top: 80px;

  border-top: 1px solid var(--border);
}

.information-number {
  color: var(--text-muted);

  font-family:
    'JetBrains Mono',
    monospace;

  font-size: 11px;
}

.information-label {
  display: inline-block;

  margin-bottom: 18px;

  color: var(--text-muted);

  font-family:
    'JetBrains Mono',
    monospace;

  font-size: 10px;

  font-weight: 600;

  letter-spacing: 0.18em;
}

.information-content h2 {
  margin-bottom: 20px;

  font-size:
    clamp(
      34px,
      5vw,
      55px
    );

  line-height: 1;

  letter-spacing: -0.05em;
}

.information-content p {
  color: var(--text-secondary);

  font-size: 15px;

  line-height: 1.9;
}


/* ==========================================================================
   TABLET
   ========================================================================== */

@media (max-width: 900px) {

  .navbar {
    top: 14px;

    padding: 0 14px;
  }

  .face-page {
    padding:
      150px
      20px
      80px;
  }

  .project-intro {
    margin-bottom: 55px;
  }

}


/* ==========================================================================
   MOBILE
   ========================================================================== */

@media (max-width: 640px) {

  .navbar {
    top: 12px;

    padding: 0 12px;
  }

  .nav-pill {
    padding:
      8px
      10px
      8px
      12px;
  }

  .nav-logo-mark {
    width: 30px;
    height: 30px;
  }

  .nav-logo-text {
    font-size: 14px;
  }

  .back-gallery {
    padding: 8px 10px;

    font-size: 10px;
  }

  .face-page {
    padding:
      125px
      15px
      65px;
  }

  .project-intro {
    margin-bottom: 45px;
  }

  .project-description {
    margin-top: 24px;

    font-size: 14px;
  }

  .scanner-card {
    padding: 12px;

    border-radius: 20px;
  }

  .camera-wrapper {
    border-radius: 14px;
  }

  .camera-placeholder h2 {
    font-size: 17px;
  }

  .camera-placeholder p {
    font-size: 11px;
  }

  .control-panel {
    grid-template-columns: 1fr;
  }

  .privacy-note {
    align-items: flex-start;

    font-size: 9px;
  }

  .project-information {
    grid-template-columns: 1fr;

    gap: 15px;

    padding-top: 60px;
  }

}


/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration:
      0.001ms !important;

    transition-duration:
      0.001ms !important;
  }

}