/* ═══════════════════════════════════════════════
   AHLYE DESIGNS — Main Stylesheet
   ═══════════════════════════════════════════════ */

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

:root {
  --bg:               #080808;
  --surface:          rgba(255,255,255,0.04);
  --border:           rgba(255,255,255,0.08);
  --border-p-500:     rgba(93,255,160,0.2);
  --border-p-accent:  rgba(0, 255, 106, 0.35);
  --text:             #f0ede8;
  --text-muted:       rgba(240,237,232,0.45);
  --accent:           #5dffa0;
  --accent-dim:       rgba(93,255,160,0.15);
  --nav-h:            120px;
  --bottom-h:         120px;
  --radius:           12px;
  --ease:             cubic-bezier(0.16, 1, 0.3, 1);
  --white:            #ffffff;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { height: 3px; width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ═══════════════════════════════════════════════
   BACKGROUND STAGE
   ═══════════════════════════════════════════════ */

   #bg-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.bg-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: opacity 1s var(--ease);
}
.bg-layer.inactive { opacity: 0; }
.bg-layer.active   { opacity: 1; }

.bg-noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  pointer-events: none;
}

.bg-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 70% at 50% 50%, transparent 30%, rgba(8,8,8,0.85) 100%);
  pointer-events: none;
}

/* ═══════════════════════════════════════════════
   TOP NAVIGATION
   ═══════════════════════════════════════════════ */
#top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  border-bottom: 1px solid transparent;
  transition: background 0.4s, border-color 0.4s, backdrop-filter 0.4s;
}
#top-nav.scrolled {
  background: rgba(8,8,8,0.7);
  border-color: var(--border);
  backdrop-filter: blur(20px);
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  /* gap: 12px; */
  text-decoration: none;
  color: var(--text);
}
.logo-img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(93,255,160,0.4));
  transition: filter 0.3s, transform 0.3s;
}
.nav-logo:hover .logo-img {
  filter: drop-shadow(0 0 20px rgba(93,255,160,0.7));
  transform: rotate(-5deg) scale(1.05);
}
.logo-wordmark {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  line-height: 1;
}
.sub-logo {
  display: flex;
  flex-direction: column;;
}
.sub-logo-img {
  width: 100px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(93,255,160,0.4));
}
.nav-logo:hover .sub-logo-img {
  filter: drop-shadow(0 0 20px rgba(93,255,160,0.7));
  transform: rotate(5deg) scale(1.05);
}
.logo-wordmark em {
  display: block;
  font-style: normal;
  font-weight: 400;
  font-size: .8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  position: relative;
  top: -15px;
  left: 5px;
  /* transform: rotate(3deg) scale(1.05); */
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-item {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Jost','Inter', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s, background 0.2s;
  letter-spacing: 0.01em;
  position: relative;
}
.nav-item:hover,
.nav-item.active {
  color: var(--text);
  background: var(--surface);
}
.nav-item.nav-cta {
  color: var(--accent);
  border: 1px solid rgba(93,255,160,0.25);
  margin-left: 8px;
}
.nav-item.nav-cta:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ─── MEGA MENUS ─── */
.mega-menu {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  z-index: 99;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.mega-menu.open {
  pointer-events: all;
  opacity: 1;
  transform: translateY(0);
}

.mega-menu-inner {
  background: rgba(12,12,12,0.95);
  backdrop-filter: blur(32px);
  border-bottom: 1px solid var(--border);
  padding: 32px 40px 36px;
}

.mega-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ─── SERVICES CARD GRID ─── */
.service-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 8px;
}

.service-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  border-radius: 10px;
  padding: 4px 4px 12px;
  border: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
  width: 100%;
}
.service-card:hover {
  border-color: var(--border);
  background: rgba(255,255,255,0.04);
}

.service-card-img {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,0.75);
  overflow: hidden;
  transition: filter 0.2s;
}
.service-card:hover .service-card-img {
  filter: brightness(1.15);
}

.service-card span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
  transition: color 0.2s;
}
.service-card:hover span {
  color: var(--text);
}

/* Team card */
.team-inner { display: flex; flex-direction: column; }
.team-card {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 480px;
}
.team-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  flex-shrink: 0;
  background: #111;
}
.team-avatar img { width: 100%; height: 100%; object-fit: cover; }
.team-info h3 {
  font-family: 'Jost', sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 2px;
}

.team-info p {
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 8px;
}

.team-info p:first-of-type ~ p, .team-info ul {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  text-transform: none;
}

.team-bio {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.app-callout a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--white);
  text-decoration: none;
  border-bottom: 1px solid rgba(93,255,160,0.3);
  padding-bottom: 2px;
}

/* Menu backdrop */
#menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 98;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
#menu-backdrop.show {
  opacity: 1;
  pointer-events: all;
}

/* ═══════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════ */
   
#hero {
  position: relative;
  width: 100%;
  height: 100vh;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--nav-h) 40px var(--bottom-h);
  pointer-events: none;
}
    
main video {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.25;
  transition: opacity 0.3s ease;
}

#canvas-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.25;
  transition: opacity 0.3s ease;
}
#canvas-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
}

.hero-mascot {
  width: 120px;
  height: 120px;
  position: relative;
}
.hero-mascot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 32px rgba(93,255,160,0.35));
  animation: float 4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero-headline {
  font-family: 'Jost', sans-serif;
  font-size: clamp(42px, 6vw, 80px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #ffffff;
  text-shadow: 0 2px 24px rgba(0,0,0,0.5);
}
.hero-headline .accent {
  color: var(--accent);
  position: relative;
}
.hero-headline .accent::after {
  content: '';
  position: absolute;
  bottom: 10px; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 1;
  border-radius: 2px;
}

.hero-sub {
  font-size: 13px;
  font-weight: 400;
  margin-top: 1rem;
  color: var(--text);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: calc(var(--bottom-h) + 20px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  animation: pulse-down 2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pulse-down {
  0%, 100% { opacity: 0.4; transform: translateX(-50%) translateY(0); }
  50%       { opacity: 0.8; transform: translateX(-50%) translateY(4px); }
}

/* ═══════════════════════════════════════════════
   BOTTOM WORK NAVIGATION
   ═══════════════════════════════════════════════ */
#bottom-work-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-h);
  z-index: 50;
  background: linear-gradient(to top, rgba(8,8,8,0.96) 60%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 40px;
  gap: 10px;
}

.work-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.work-nav-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.work-nav-controls {
  display: flex;
  gap: 12px;
}
.work-nav-controls button {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 28px; height: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
}
.work-nav-controls button:hover {
  color: var(--text);
  background: rgba(255,255,255,0.08);
}

/* Track */
.work-track-wrapper {
  overflow: hidden;
  flex: 1;
  display: flex;
  align-items: center;
}

.work-track {
  display: flex;
  gap: 6px;
  list-style: none;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 4px 2px;
  align-items: center;
  width: 100%;
}
.work-track::-webkit-scrollbar { display: none; }

/* Work item */
.work-item {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.3s, background 0.3s;
  cursor: pointer;
}
.work-item:hover,
.work-item.active {
  border-color: var(--border-p-500);
  background: rgba(93,255,160,0.05);
}

.work-item-name {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.3s;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.work-item:hover .work-item-name,
.work-item.active .work-item-name {
  color: var(--text);
}

/* Dot — always takes up space so the item never resizes on hover/active */
.work-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.3s;
}
.work-item.active .work-dot {
  opacity: 1;
  animation: blink 1.5s ease-in-out infinite;
}

.work-item-tag {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  padding: 0 10px 0 0;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
}
.work-item:hover .work-item-tag,
.work-item.active .work-item-tag {
  opacity: 0.6;
}

.work-item-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  margin: 5px 6px 5px 0;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--border-p-accent);
  background: rgba(93,255,160,0.05);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s, background 0.2s;
  pointer-events: none;
}
.work-item:hover .work-item-more,
.work-item.active .work-item-more {
  opacity: 1;
  pointer-events: all;
}
.work-item-more:hover {
  background: rgba(93,255,160,0.15);
}
.work-item-more svg {
  transition: transform 0.2s;
}
.work-item-more:hover svg {
  transform: translateX(3px);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* Progress bar */
.progress-bar-wrap {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: rgba(255,255,255,0.05);
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width linear;
  border-radius: 0 2px 2px 0;
  opacity: 0.7;
}

/* ═══════════════════════════════════════════════
   CONTACT OVERLAY
   ═══════════════════════════════════════════════ */
.contact-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(8,8,8,0.8);
  opacity: 0;
  visibility: hidden;                 /* removed from rendering entirely */
  pointer-events: none;
  transition: opacity 0.4s var(--ease), visibility 0s 0.4s;
}
.contact-overlay:target {
  opacity: 1;
  visibility: visible;
  backdrop-filter: blur(2px);         /* blur only while open */
  pointer-events: all;
  transition: opacity 0.4s var(--ease);
}
.contact-inner {
  text-align: center;
  padding: 60px;
}
.contact-inner h2 {
  font-family: 'jost', 'Syne', sans-serif;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  color: var(--accent);
  animation: fadeInUp 2s ease forwards;
  opacity: 0;
}
.contact-inner p {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 1.5rem;
  animation: fadeInUp 2s 1s ease forwards;
  opacity: 0;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.contact-email {
  display: inline-block;
  font-family: 'Syne', sans-serif;
  font-size: clamp(20px, 3vw, 36px);
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 2px solid rgba(93,255,160,0.3);
  padding-bottom: 4px;
  transition: border-color 0.2s;
}
.contact-email:hover { border-color: var(--accent); }
.contact-close-hint {
  margin-top: 48px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text);
  opacity: 0.5;
}

html:has(dialog[open]) {
    overflow: hidden;
}

.modal-content input:focus {
    background-color: var(--white);
}

.modal-content input, .modal-content textarea {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
    margin-bottom: 15px;
    background-color: #ffffffbb;
    font-family: "Jost", BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-weight: 600;
    font-style: normal;
    line-height: 1.6;
    letter-spacing: 0.05rem;
}

.modal-content input, .modal-content textarea,.modal-content .btn-submit {
  font-size: 1.25rem;
}

.modal-content h1 {
    margin: 0;
}

.modal-content button.btn-submit {
  width: 100%;
  padding: 10px;
}

.modal-content i {
    font-size: 2rem;
}

.close-modal {
  position: absolute;
  top: 20px;
  left: 20px;
  background: none;
  border: none;
  cursor: pointer;
  color: white;
}
.close-modal i { font-size: 3em; }


/* ═══════════════════════════════════════════════
   CASE STUDY PAGE (placeholder styles)
   ═══════════════════════════════════════════════ */
.case-page {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--bg);
  overflow-y: auto;
  padding: 80px 40px 40px;
  animation: slide-up 0.5s var(--ease) both;
}
@keyframes slide-up {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ═══════════════════════════════════════════════
   MOBILE  (phones & small tablets)
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {

  :root {
    --nav-h:    72px;
    --bottom-h: 96px;
  }

  /* ── Top nav ── */
  #top-nav { padding: 0 12px; }
  .logo-img { width: 56px; height: 56px; }
  .sub-logo-img { width: 64px; }
  .logo-wordmark em { font-size: 0.65rem; top: -8px; left: 3px; }
  .nav-item { padding: 8px 10px; font-size: 12px; }
  .nav-item.nav-cta { margin-left: 4px; }

  /* ── Mega menus ── */
  .mega-menu-inner { padding: 20px 16px 24px; max-height: calc(100vh - var(--nav-h)); overflow-y: auto; overscroll-behavior: none; }
  .service-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .team-card { flex-direction: column; align-items: flex-start; gap: 12px; }

  /* ── Hero ── */
  #hero { padding: var(--nav-h) 16px var(--bottom-h); }
  .hero-headline { font-size: clamp(34px, 10vw, 48px); }
  .scroll-hint { bottom: calc(var(--bottom-h) + 10px); }

  /* ── Bottom work carousel ── */
  .work-nav-controls { gap: 20px; }
  #bottom-work-nav { padding: 0 12px; }
  .work-item-name { padding: 8px 12px; font-size: 12px; }

  /* ── Contact overlay ── */
  .close-modal { top: 20px; }
  .contact-overlay { overflow-y: auto; place-items: initial; overscroll-behavior: contain; }
  .contact-inner { margin: auto; padding: 24px 16px 40px; width: 100%; max-width: 480px; }
  .modal-content h1 { font-size: 1.05rem; }
  .modal-content form { width: 100%; }
  .modal-content input, .modal-content textarea, .modal-content .btn-submit { font-size: 1rem; }
  .contact-close-hint { display: none; } /* no Esc key on phones */
}
