/* Small custom touches (kept minimal to not fight the compiled Tailwind CSS) */
.icon-btn{
  position: relative;
  overflow: hidden;
}
.icon-btn svg{
  transition: transform 300ms ease, opacity 300ms ease;
}
.icon-btn:hover svg{
  transform: rotate(12deg) scale(1.06);
}
.lang-indicator{
  position:absolute;
  right:-6px;
  bottom:-6px;
  font-size:9px;
  line-height:1;
  padding:3px 4px;
  border-radius:9999px;
  border:1px solid rgba(0,0,0,.15);
  background: rgba(255,255,255,.9);
  color:#000;
}
.dark .lang-indicator{
  border:1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.6);
  color:#fff;
}
.prose a{
  text-decoration: none;
  text-underline-offset: 3px;
}

/* About page: "direct message" link */
.prose a.dm-link{
  color: #126eda;
  text-decoration: underline;
  text-decoration-thickness: 1px;
}
.prose a.dm-link:hover{
  opacity: .85;
}

/* Home: slightly larger gap after Skills */
#skills{
  margin-bottom: 0.6rem;
}



/* Selection colors (light/dark) */
:root {
  --selection-bg: rgba(120, 120, 120, 0.22);
  --selection-color: #000;
  --skill-card-bg: rgba(0, 0, 0, 0.03);
  --skill-border: rgba(0, 0, 0, 0.10);
  --skill-muted: rgba(0, 0, 0, 0.62);
  --ring-bg: rgba(0, 0, 0, 0.12);
  --ring-fg: #126cd6;
}

.dark {
  --selection-bg: rgba(255, 255, 255, 0.16);
  --selection-color: #fff;
  --skill-card-bg: rgba(255, 255, 255, 0.06);
  --skill-border: rgba(255, 255, 255, 0.00);
  --skill-muted: rgba(255, 255, 255, 0.70);
  /* Background track for progress rings: fully hidden in dark theme (no gray outline) */
  --ring-bg: rgba(255,255,255,0.00);
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-color);
}



/* Layout: keep footer at the bottom on short pages */
html, body { height: 100%; }
body{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main{ flex: 1 0 auto; }
footer{ flex-shrink: 0; }

/* Make icon buttons work for both stroke + fill icons */
.icon-btn svg {
  fill: currentColor;
}

/* Skills cards (Home) */
.skill-card {
  display: flex;
  gap: 18px;
  padding: 22px;
  border-radius: 24px;
  background: var(--skill-card-bg);
  border: 1px solid var(--skill-border);
  transition: transform 200ms ease, background-color 300ms ease, border-color 300ms ease;
}

.skill-card:hover {
  transform: translateY(-2px);
  border-color: rgba(18,108,214,.55);
  box-shadow: 0 18px 44px rgba(18,108,214,.16);
}

@media (max-width: 640px) {
  .skill-card {
    flex-direction: column;
  }
}

.skill-ring {
  position: relative;
  width: 80px;
  height: 80px;
  flex: 0 0 80px;
  display: grid;
  place-items: center;
}

.ring-svg {
  width: 80px;
  height: 80px;
  transform: rotate(-90deg);
}

.ring-bg,
.ring-fg {
  fill: none;
  stroke-width: 8;
}

.ring-bg {
  stroke: var(--ring-bg);
}

/* Force-hide the track ring in dark theme (removes the gray outline completely) */
.dark .ring-bg {
  stroke: rgba(255,255,255,0) !important;
}

.ring-fg {
  stroke: var(--ring-fg);
  stroke-linecap: round;
  transition: stroke-dashoffset 800ms ease;
}

.skill-icon {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.dark .skill-icon{
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.00);
}


.skill-icon-svg {
  width: 30px;
  height: 30px;
  opacity: 0.9;
}

.skill-content {
  width: 100%;
}

.skill-title {
  font-size: 28px;
  font-weight: 400;
  color: inherit;
  margin: 0;
}

@media (max-width: 640px) {
  .skill-title {
    font-size: 24px;
  }
}

.skill-desc {
  margin: 6px 0 0;
  opacity: .78;
  font-size: 15px;
}

.skill-subtitle {
  margin-top: 16px;
  font-size: 16px;
  letter-spacing: 0.06em;
  opacity: .95;
  font-weight: 400;
}

.skill-tags {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-tag {
  background: var(--ring-fg);
  color: #fff;
  padding: 8px 12px;
  border-radius: 12px;
  font-weight: 400;
  font-size: 14px;
  line-height: 1;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
  cursor: pointer;
}

.skill-tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(18,108,214,.30);
  filter: brightness(1.02);
}

.skill-tag:active {
  transform: translateY(0);
}

/* Skill modal */
.skill-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.skill-modal.show {
  display: flex;
}

.skill-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.56);
}

.skill-modal-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  border-radius: 24px;
  background: #fff;
  color: #000;
  border: 1px solid rgba(0, 0, 0, 0.14);
  padding: 18px 18px 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}

.dark .skill-modal-card {
  background: #0b0b0b;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
}

.skill-modal-title {
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.skill-modal-body {
  margin-top: 8px;
  opacity: 0.85;
  line-height: 1.55;
}

.skill-modal-btn {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.10);
  color: inherit;
  font-weight: 800;
  transition: background-color 200ms ease, border-color 200ms ease, transform 200ms ease;
}

.dark .skill-modal-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.skill-modal-btn:hover {
  transform: translateY(-1px);
}



/* Planet highlight in dark theme:
   - only the top ~25–30% is visible
   - then becomes fully transparent (no hard cutoff)
   NOTE: use vh/clamp so it doesn't scale with the huge planet element height */
.dark #blur{
  /* visible but subtle glow only at the very top (≈25–30%), then fades out */
  /* Slightly larger (+~30%) and a bit more visible (+~20%) */
  height: clamp(104px, 36vh, 364px) !important;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0.42) 0%,
    rgba(255,255,255,0.24) 12%,
    rgba(255,255,255,0.00) 30%,
    rgba(255,255,255,0.00) 100%
  ) !important;
  opacity: 1;
}

/* Home: fine-tune spacing before the "Мои навыки" section */
#skills{
  margin-top: 1.25rem !important;
}

/* Divider inside the Skills section */
.skills-hr{
  /* Keep it tight: spacing similar to a normal paragraph break */
  margin: 0 0 16px;
}

/* GMT hover tooltip */
.tz-hover{ color: #126cd6; border-bottom: none; cursor: help; font-weight: 400; }
.tz-hover:hover{ color: #126cd6; }

.tz-hover:hover {
  filter: brightness(1.06);
}


.tz-hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(2px);
  padding: 8px 12px;
  border-radius: 12px;
  background: #ffffff;
  color: #111111;
  font-size: 14px;
  white-space: nowrap;
  box-shadow: 0 14px 34px rgba(0,0,0,0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 50;
}

.tz-hover::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid #ffffff;
  opacity: 0;
  transition: opacity 140ms ease;
  z-index: 49;
}

.tz-hover:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.tz-hover:hover::before {
  opacity: 1;
}

.dark .tz-hover::after {
  background: #111111;
  color: #f6f6f6;
  box-shadow: 0 14px 34px rgba(0,0,0,0.55);
}

.dark .tz-hover::before {
  border-top-color: #111111;
}


/* Header behavior:
   - Home: transparent at top, becomes blurred/solid after scroll.
   - Inner pages: always solid (body.header-solid). */
#header{
  background: transparent;
  border-bottom: 1px solid transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#header.scrolled,
body.header-solid #header{
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.78);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.dark #header.scrolled,
.dark body.header-solid #header{
  background: rgba(0,0,0,0.62);
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
/* Simple themed divider line */
.site-hr{
  height: 1px;
  border: 0;
  background: rgba(0,0,0,0.14);

  margin: 14px 0;
}
.dark .site-hr{
  background: rgba(255,255,255,0.22);
}
/* Align "All projects" link to the title baseline */
.all-projects-link{ position: relative; top: 2px; }

/* Section subheads on Projects page */
.section-subhead{
  color: rgba(0,0,0,0.90);
  font-size: 1.25rem;
  font-weight: 500;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
}
.dark .section-subhead{ color: #ffffff; }

/* Skills note helper (in case utility class is missing) */
.skills-note{ margin-top: 0.75rem;   margin-bottom: 14px;
}


/* Mobile drawer fixes */

/* Make the mobile drawer work regardless of Astro scoped CSS attributes */
#drawer.open{
  height: 100vh !important;         /* overrides Tailwind h-0 */
  height: 100dvh !important;
}

#header-drawer-button > #drawer-open{ display: block; }
#header-drawer-button > #drawer-close{ display: none; }

#header-drawer-button.open > #drawer-open{ display: none; }
#header-drawer-button.open > #drawer-close{ display: block; }

/* Improve tap target reliability on mobile */
#header-drawer-button{
  touch-action: manipulation;
}

/* ================================
   Mobile drawer (v33): reliable on all pages
   Uses opacity/visibility instead of height hacks.
   ================================ */

#drawer{
  /* Always full-screen; we hide via opacity/visibility so it never gets stuck at height:0 */
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px);

  /* Override Tailwind transition-[height] */
  transition-property: opacity, transform !important;
  transition-duration: 220ms !important;
  transition-timing-function: ease !important;

  /* Ensure above header */
  z-index: 999 !important;
}

#drawer.open{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* Prevent iOS overscroll glow issues inside the drawer */
#drawer nav{
  -webkit-overflow-scrolling: touch;
}
