/*
 * Refinement layer.
 *
 * styles.css is a compiled, minified bundle whose source has drifted, so it is
 * left alone. Everything here either fixes a defect in that bundle or styles
 * markup this layer introduces. Written against the existing tokens
 * (--accent, --surface, --border, --text-*) so both themes follow automatically.
 */

/* The off-canvas drawer is position:fixed, so body's overflow-x:clip does not
   contain it and it briefly widens the page while it settles. `clip` rather
   than `hidden` keeps sticky and smooth scrolling intact. */
html {
  overflow-x: clip;
}

/* ---------------------------------------------------------------- CV modal */

/* Previously this reused .mobile-drawer, which body.nav-open drives — so the
   hamburger button opened the CV as well. It now owns its visibility. */
.cv-modal {
  display: grid;
  inset: 0;
  opacity: 0;
  place-items: center;
  pointer-events: none;
  position: fixed;
  transition: opacity 0.22s ease, visibility 0.22s ease;
  visibility: hidden;
  z-index: 80;
  background: color-mix(in srgb, #04070d 62%, transparent);
  backdrop-filter: blur(6px);
  padding: clamp(0.75rem, 3vw, 2rem);
}

.cv-modal.is-open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.cv-modal .cv-panel {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  height: auto;
  max-height: min(92vh, 60rem);
  overflow: auto;
  padding: clamp(0.85rem, 2vw, 1.25rem);
  transform: translateY(12px) scale(0.985);
  transition: transform 0.26s cubic-bezier(0.2, 1, 0.36, 1);
  width: min(96vw, 64rem);
}

.cv-modal.is-open .cv-panel {
  transform: translateY(0) scale(1);
}

/* The close control reuses .mobile-menu-button, which the desktop breakpoint
   hides — leaving no visible way out of the modal above 900px. */
.cv-modal .mobile-menu-button {
  display: inline-flex;
}

@media (prefers-reduced-motion: reduce) {
  .cv-modal,
  .cv-modal .cv-panel {
    transition: none;
  }
}

/* ------------------------------------------------------- language switcher */

.btn-lang {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  min-width: 3.25rem;
  padding-inline: 0.85rem;
  text-align: center;
}

/* The mobile header hides .btn to make room; the language switch is small
   enough to stay, and hiding it would strand Turkish visitors on English. */
@media (max-width: 900px) {
  .header-actions .btn.btn-lang {
    /* Sized to sit beside the theme toggle and menu button rather than to
       .btn's full 3.25rem call-to-action height. */
    display: inline-flex;
    font-size: 0.74rem;
    height: 2.8rem;
    letter-spacing: 0.06em;
    min-height: 0;
    min-width: 0;
    padding: 0 0.85rem;
  }
}

/* ------------------------------------------------------------- skill strip */

.skill-strip {
  padding-block: 0.35rem 0.15rem;
}

.skill-strip .marquee-content {
  align-items: stretch;
  gap: 0.55rem;
}

.skill-chip {
  align-items: center;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 600;
  gap: 0.55rem;
  letter-spacing: 0.01em;
  min-height: 2.6rem;
  padding: 0.4rem 1.05rem 0.4rem 0.45rem;
  transition: border-color 0.22s ease, color 0.22s ease, background 0.22s ease;
  white-space: nowrap;
}

.skill-chip-icon {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 999px;
  color: var(--accent-strong);
  display: inline-flex;
  flex: none;
  height: 1.75rem;
  justify-content: center;
  transition: background 0.22s ease, color 0.22s ease;
  width: 1.75rem;
}

.skill-chip-icon svg {
  height: 1rem;
  width: 1rem;
}

.marquee-track:hover .skill-chip,
.skill-chip:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  color: var(--text);
}

.skill-chip:hover .skill-chip-icon {
  background: color-mix(in srgb, var(--accent) 26%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .skill-strip .marquee-track {
    animation: none;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 0.55rem;
    width: 100%;
  }

  .skill-strip .marquee-content[aria-hidden='true'] {
    display: none;
  }
}

/* --------------------------------------------------------- project visuals */

/* The preview panel was a pale gradient over a pale surface, which nearly
   vanished in the light theme. Mix against the text colour instead so the
   panel keeps a contrast floor in both themes. */
.project-visual {
  --panel: #17101d;
  background:
    radial-gradient(120% 90% at 12% 0%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 58%),
    linear-gradient(165deg, color-mix(in srgb, var(--accent-secondary) 12%, transparent), transparent 70%),
    var(--panel);
  border-color: var(--border-strong);
  box-shadow: inset 0 1px 0 hsla(0, 0%, 100%, 0.08);
}

/* Window chrome and mock lines were hard-coded white, so they disappeared on
   the light theme. currentColor tracks the active palette. */
.project-visual .project-window-bar span,
.project-visual .project-mock-lines span {
  background: hsla(0, 0%, 100%, 0.42);
}

.project-visual .muted-label {
  color: hsla(0, 0%, 100%, 0.72);
}

/* The panel stays dark in both themes, so its own contents are always light. */
html.light .project-visual {
  --panel: #241726;
}

.project-card {
  border-color: var(--border-strong);
}

.project-card:hover .project-visual {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-strong));
}
