/* ================================
   POLARHOLE LAB — GLOBAL STYLES
   styles/style.css
   ================================ */

/* FONT SETUP (local TTF from /fonts) */
@font-face {
  font-family: "PHL-Display";
  src: url("../fonts/SpaceGrotesk-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PHL-Text";
  src: url("../fonts/Inter-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PHL-Text";
  src: url("../fonts/Inter-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* RESET / BASE */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: #041017;
  color: #e5f4ff;
  font-family: "PHL-Text", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.6;
}

/* Global CSS variables for theme */

:root {
  --phl-bg: #041017;
  --phl-bg-alt: #071b26;
  --phl-bg-soft: #061824;
  --phl-surface: #0a2735;
  --phl-surface-alt: #103447;
  --phl-border-soft: rgba(174, 217, 255, 0.18);
  --phl-accent: #4fd6ff;
  --phl-accent-soft: rgba(79, 214, 255, 0.15);
  --phl-accent-strong: #00c2ff;
  --phl-highlight: #f9f871;
  --phl-danger: #ff6b81;
  --phl-text-main: #e5f4ff;
  --phl-text-muted: #9bb4c5;
  --phl-grid-line: rgba(138, 192, 221, 0.17);
  --phl-radius-lg: 24px;
  --phl-radius-md: 16px;
  --phl-radius-pill: 999px;
  --phl-shadow-soft: 0 18px 45px rgba(0, 14, 33, 0.6);
  --phl-shadow-subtle: 0 10px 30px rgba(2, 35, 58, 0.4);
}

/* Layout helpers */

.phl-shell {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: 20px;
}

.phl-body {
  background-image: radial-gradient(
      circle at 10% -10%,
      rgba(79, 214, 255, 0.28),
      transparent 55%
    ),
    radial-gradient(
      circle at 90% 110%,
      rgba(249, 248, 113, 0.12),
      transparent 60%
    );
  background-color: var(--phl-bg);
}

/* Images global: never wider than 350px */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.phl-image-constraint,
.phl-hero-image {
  max-width: 350px;
}

/* HEADER */

.phl-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(
    to bottom,
    rgba(4, 16, 23, 0.98),
    rgba(4, 16, 23, 0.9),
    rgba(4, 16, 23, 0.7)
  );
  backdrop-filter: blur(22px);
  border-bottom: 1px solid rgba(138, 192, 221, 0.25);
}

.phl-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 10px;
  gap: 16px;
}

.phl-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.phl-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  font-family: "PHL-Display", system-ui, sans-serif;
  font-size: 16px;
  letter-spacing: 0.06em;
  color: #021017;
  background: radial-gradient(circle at 30% 20%, #f9f871, #4fd6ff);
  box-shadow: 0 0 22px rgba(79, 214, 255, 0.9);
}

.phl-logo-mark--small {
  width: 26px;
  height: 26px;
  font-size: 13px;
}

.phl-logo-text {
  font-family: "PHL-Display", system-ui, sans-serif;
  font-size: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--phl-text-main);
}

/* NAV */

.phl-nav {
  display: flex;
}

.phl-nav-list {
  display: flex;
  align-items: center;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.phl-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  text-decoration: none;
  color: var(--phl-text-muted);
  background: transparent;
  transition:
    color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.phl-nav-link::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background-color: transparent;
  transition: background-color 0.18s ease;
}

.phl-nav-link:hover {
  color: var(--phl-text-main);
  background-color: rgba(12, 62, 88, 0.8);
  box-shadow: var(--phl-shadow-subtle);
  transform: translateY(-1px);
}

.phl-nav-link--active {
  color: var(--phl-bg);
  background: linear-gradient(120deg, #f9f871, #4fd6ff);
  box-shadow: 0 0 24px rgba(79, 214, 255, 0.7);
}

.phl-nav-link--active::before {
  background-color: rgba(4, 16, 23, 0.7);
}

/* BURGER — LAB CAPSULE ICON */

.phl-burger {
  display: none; /* по умолчанию скрыт, включаем в @media */
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 54px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(138, 192, 221, 0.5);
  background:
    radial-gradient(circle at 0 0, rgba(79, 214, 255, 0.3), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(249, 248, 113, 0.18), transparent 60%),
    rgba(4, 16, 23, 0.96);
  box-shadow: 0 0 0 1px rgba(1, 10, 18, 0.9);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.25s ease,
    transform 0.18s ease;
}

.phl-burger::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 0, rgba(79, 214, 255, 0.35), transparent 65%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.phl-burger:hover {
  border-color: rgba(79, 214, 255, 0.9);
  box-shadow: 0 0 16px rgba(79, 214, 255, 0.7);
  transform: translateY(-1px);
}

.phl-burger:hover::before {
  opacity: 1;
}

.phl-burger-bar {
  display: block;
  height: 2px;
  border-radius: 999px;
  background-color: #e5f4ff;
  transition:
    transform 0.22s ease,
    width 0.22s ease,
    opacity 0.18s ease,
    background-color 0.18s ease;
}

/* разная длина полос — “лабораторный” вид */
.phl-burger-bar:nth-child(1) {
  width: 14px;
  align-self: flex-start;
}

.phl-burger-bar:nth-child(2) {
  width: 22px;
}

.phl-burger-bar:nth-child(3) {
  width: 18px;
  align-self: flex-end;
}

/* вертикальный отступ между полосками */
.phl-burger-bar + .phl-burger-bar {
  margin-top: 4px;
}

/* состояние «открыто» — превращаемся в светящийся X внутри капсулы */

.phl-burger.is-open {
  background:
    radial-gradient(circle at 0 0, rgba(79, 214, 255, 0.4), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(249, 248, 113, 0.3), transparent 60%),
    rgba(3, 24, 37, 0.98);
  border-color: rgba(79, 214, 255, 0.95);
  box-shadow: 0 0 22px rgba(79, 214, 255, 0.8);
}

.phl-burger.is-open .phl-burger-bar:nth-child(1) {
  width: 22px;
  transform: translateY(3px) rotate(36deg);
  background-color: var(--phl-accent-strong);
}

.phl-burger.is-open .phl-burger-bar:nth-child(2) {
  opacity: 0;
  transform: translateX(10px);
}

.phl-burger.is-open .phl-burger-bar:nth-child(3) {
  width: 22px;
  transform: translateY(-3px) rotate(-36deg);
  background-color: var(--phl-accent-strong);
}


/* MAIN + SECTIONS */

.phl-main {
  padding-top: 12px;
  padding-bottom: 72px;
}

.phl-section {
  position: relative;
  padding-block: 60px;
}

/* Section kicker, generic text bits */

.phl-section-kicker {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--phl-highlight);
  margin: 0 0 12px;
}

/* Buttons */

.phl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--phl-radius-pill);
  border: 1px solid transparent;
  background-color: transparent;
  color: var(--phl-text-main);
  font-family: "PHL-Text", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.16s ease,
    border-color 0.2s ease;
}

.phl-btn-primary {
  background: radial-gradient(circle at 20% 0, #f9f871, #4fd6ff);
  border-color: rgba(1, 51, 77, 0.9);
  color: #021017;
  box-shadow: var(--phl-shadow-soft);
}

.phl-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 48px rgba(0, 16, 34, 0.85);
}

.phl-btn-ghost {
  border-color: rgba(138, 192, 221, 0.4);
  background-color: rgba(8, 44, 66, 0.9);
  color: var(--phl-text-muted);
}

.phl-btn-ghost:hover {
  border-color: var(--phl-accent);
  color: var(--phl-text-main);
  transform: translateY(-1px);
}

/* FOOTER */

.phl-footer {
  border-top: 1px solid rgba(138, 192, 221, 0.2);
  background: radial-gradient(
      circle at 0 100%,
      rgba(79, 214, 255, 0.15),
      transparent 55%
    ),
    #041017;
  padding-block: 26px 34px;
}

.phl-footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}

.phl-footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.phl-footer-text {
  margin: 0;
  max-width: 420px;
  font-size: 13px;
  color: var(--phl-text-muted);
}

.phl-footer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.phl-footer-link {
  font-size: 13px;
  color: var(--phl-accent);
  text-decoration: none;
  padding: 4px 0;
  position: relative;
}

.phl-footer-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 0%;
  background: linear-gradient(90deg, #f9f871, #4fd6ff);
  transition: width 0.2s ease;
}

.phl-footer-link:hover::after {
  width: 100%;
}

/* REVEAL ANIMATION BASE (IntersectionObserver target) */

.js-phl-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.35s ease-out,
    transform 0.4s ease-out;
  will-change: opacity, transform;
}

.js-phl-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* RESPONSIVE — GLOBAL LAYOUT */

@media (max-width: 767px) {
  .phl-header-inner {
    padding-block: 8px;
  }

  .phl-nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    padding-inline: 20px;
    padding-block: 10px 14px;
    background: radial-gradient(
        circle at 0 0,
        rgba(79, 214, 255, 0.16),
        transparent 60%
      ),
      #041017;
    border-bottom: 1px solid rgba(138, 192, 221, 0.3);
    transform-origin: top;
    transform: scaleY(0.8);
    opacity: 0;
    pointer-events: none;
    transition:
      opacity 0.18s ease,
      transform 0.18s ease;
  }

  .phl-nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .phl-header-inner.is-nav-open .phl-nav {
    opacity: 1;
    pointer-events: auto;
    transform: scaleY(1);
  }

  .phl-burger {
    display: inline-flex;
  }

  .phl-nav-link {
    width: 100%;
  }

  .phl-footer-inner {
    flex-direction: column;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .phl-footer-inner {
    gap: 24px;
  }
}
/* GLOBAL: убираем горизонтальный скролл */

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

/* секции с широкими подсветками не дают выходить за края */

.phl-section,
.phl-hero,
.phl-hero-inner,
.phl-depthband-inner,
.phl-sessiongrid-inner,
.phl-crosssection-inner,
.phl-loops-inner,
.phl-labshelf-inner,
.phl-closing-inner {
  overflow: hidden;
}
/* ================================
   FIXED HEADER
   ================================ */

:root {
  --phl-header-height: 64px;
}

@media (min-width: 768px) {
  :root {
    --phl-header-height: 72px;
  }
}

/* сама шапка — фиксируем сверху */

.phl-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  width: 100%;
  background: linear-gradient(
    180deg,
    rgba(3, 15, 23, 0.98),
    rgba(3, 15, 23, 0.96)
  );
  border-bottom: 1px solid rgba(138, 192, 221, 0.35);
  backdrop-filter: blur(14px);
}

/* чтобы контент не прятался под хедером */

.phl-main {
  padding-top: calc(var(--phl-header-height) + 10px);
}

/* якоря не будут прятаться под шапкой при скролле по ссылкам */

.phl-section {
  scroll-margin-top: calc(var(--phl-header-height) + 12px);
}
