/* ==========================================================================
   Cyram — Site Chrome (Header, Navigation, Mobile Menu, Page Hero, Footer)
   ========================================================================== */

/* ---------- Header ---------- */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px clamp(20px, 5vw, 56px);
  border-bottom: 1px solid transparent;
  transition: background 0.35s var(--ease), padding 0.35s var(--ease), border-color 0.35s var(--ease), backdrop-filter 0.35s var(--ease);
}

.header.scrolled,
.inner-page .header {
  background: rgba(7, 12, 19, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-soft);
}
.header.scrolled {
  padding-top: 14px;
  padding-bottom: 14px;
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
}
.logo-mark {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  color: var(--ink);
}
.logo-mark b {
  color: var(--accent);
  font-weight: 800;
}
.logo-sub {
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--faint);
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav a {
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
  position: relative;
  padding: 4px 0;
  transition: color 0.25s ease;
}
.nav > a::after,
.nav-group > a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}
.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
}
.nav > a:hover::after,
.nav-group > a:hover::after,
.nav a[aria-current="page"]::after {
  width: 100%;
}

/* Services Dropdown */
.nav-group { position: relative; }
.nav-group > a { display: inline-block; }

.nav-dropdown {
  position: absolute;
  left: -16px;
  top: calc(100% + 14px);
  width: 264px;
  padding: 8px;
  background: rgba(7, 12, 19, 0.98);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.42);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}
.nav-dropdown::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -16px;
  height: 16px;
}
.nav-group:hover .nav-dropdown,
.nav-group:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.nav-dropdown a {
  display: block;
  padding: 11px 12px;
  color: var(--muted);
  font-size: 0.78rem;
  border-bottom: 1px solid var(--line-soft);
}
.nav-dropdown a:last-child { border-bottom: 0; }
.nav-dropdown a:hover,
.nav-dropdown a[aria-current="page"] {
  color: var(--accent);
  background: rgba(237, 204, 74, 0.06);
}
.nav-dropdown a::after { display: none; }

.header .btn-primary {
  padding: 10px 18px;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  white-space: nowrap;
}

/* Mobile Toggle & Drawer */
.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  transform: translate(-50%, -50%);
  transition: transform 0.3s var(--ease), opacity 0.2s ease, background 0.2s ease;
}
.nav-toggle span::before { transform: translate(-50%, -6px); }
.nav-toggle span::after { transform: translate(-50%, 6px); }
body.menu-open .nav-toggle span { background: transparent; }
body.menu-open .nav-toggle span::before { transform: translate(-50%, 0) rotate(45deg); background: var(--accent); }
body.menu-open .nav-toggle span::after { transform: translate(-50%, 0) rotate(-45deg); background: var(--accent); }

.mobile-menu { display: none; }

/* ---------- Inner Page Hero (Landing Theme Harmonized) ---------- */
.page-hero {
  position: relative;
  min-height: clamp(340px, 46svh, 500px);
  padding: 138px 0 64px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background-color: var(--bg-2);
  border-bottom: 1px solid var(--line-soft);
}
.page-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-position: center;
  background-size: cover;
  opacity: 0.3;
  filter: saturate(0.85) contrast(1.04);
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(7, 12, 19, 0.72) 0%, rgba(7, 12, 19, 0.88) 100%),
    radial-gradient(110% 90% at 85% 0%, rgba(237, 204, 74, 0.11), transparent 55%);
}
.page-hero .wrap { position: relative; z-index: 2; }
.page-hero-content { max-width: 920px; }

.page-hero h1 {
  margin: 0;
  max-width: 19ch;
  font-size: clamp(2.1rem, 4.8vw, 4.2rem);
  line-height: 1.06;
  text-wrap: balance;
}
.page-hero p {
  max-width: 64ch;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.3vw, 1.12rem);
}

/* Semantic Breadcrumb */
.breadcrumb { margin-bottom: 20px; }
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--faint);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}
.breadcrumb li + li::before {
  content: "›";
  margin-right: 8px;
  color: var(--accent);
  opacity: 0.7;
}
.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb [aria-current="page"] { color: var(--ink); }

/* Sub-navigation (Services) */
.subnav-bar {
  background: rgba(7, 12, 19, 0.65);
  border-bottom: 1px solid var(--line-soft);
  padding: 16px 0;
}
.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.subnav a {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.subnav a:hover,
.subnav a[aria-current="page"] {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Next / Previous Cross-links */
.next-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
}
.next-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  transition: color 0.2s ease;
}
.next-links a:hover { color: var(--accent); }

/* Homepage Side Navigation Dots (Desktop, Accessible) */
.fp-nav {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: none;
  flex-direction: column;
  gap: 14px;
}
.fp-nav.ready { display: flex; }
.fp-nav button {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(238, 244, 251, 0.42);
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: transform 0.3s var(--ease), background 0.3s ease, border-color 0.3s ease;
}
.fp-nav button::after {
  content: attr(data-label);
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  white-space: nowrap;
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(7, 12, 19, 0.88);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s var(--ease);
}
.fp-nav button:hover::after,
.fp-nav button:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
.fp-nav button.active {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.28);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 60px 0 38px;
  background-color: #060a10;
  background-image:
    var(--grain-fine),
    var(--leather-pores),
    linear-gradient(180deg, #080f18, #05090f);
  background-blend-mode: overlay, soft-light, normal;
  background-size: 96px 96px, 140px 140px, cover;
  background-repeat: repeat, repeat, no-repeat;
  box-shadow: inset 0 1px 0 var(--edge-top);
}
.footer-top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 42px;
  border-bottom: 1px solid var(--line-soft);
}
.footer-brand p {
  color: var(--faint);
  max-width: 40ch;
  margin: 16px 0 0;
  font-size: 0.9rem;
}
.footer h4 {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 4px 0 16px;
  font-weight: 700;
}
.footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 11px;
}
.footer ul a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}
.footer ul a:hover { color: var(--accent); }
.footer-linkedin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.footer-linkedin svg { flex: 0 0 auto; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 24px;
  color: var(--faint);
  font-size: 0.8rem;
  flex-wrap: wrap;
}
.footer-bottom a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-bottom a:hover { color: var(--accent); }

/* ---------- Responsive Chrome ---------- */
@media (max-width: 960px) {
  .nav,
  .header > .btn-primary,
  .fp-nav.ready { display: none; }

  .nav-toggle { display: block; }

  .mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(7, 12, 19, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 80px 8vw 36px;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  }
  body.menu-open { overflow: hidden; }
  body.menu-open .mobile-menu {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
  .mobile-menu > a:not(.btn) {
    font-family: var(--serif);
    font-size: 1.65rem;
    text-decoration: none;
    color: var(--ink);
    padding: 12px 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .mobile-menu > a[aria-current="page"] { color: var(--accent); }

  .mobile-services {
    display: flex;
    flex-direction: column;
    margin: 4px 0 6px 14px;
    border-left: 1px solid var(--line);
    padding-left: 14px;
  }
  .mobile-services a {
    font-family: var(--sans);
    font-size: 0.96rem;
    text-decoration: none;
    color: var(--muted);
    padding: 8px 0;
  }
  .mobile-services a[aria-current="page"] { color: var(--accent); font-weight: 600; }
  .mobile-menu .btn { margin-top: 22px; width: 100%; }

  .page-hero { min-height: 340px; padding: 118px 0 48px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .logo-sub { display: none; }
  .page-hero { min-height: 300px; padding: 106px 0 38px; }
  .page-hero h1 { font-size: 2rem; }
  .footer-top { grid-template-columns: 1fr; gap: 30px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 10px; }
  .next-links { flex-direction: column; align-items: flex-start; }
}

