/* ==========================================================================
   Resul Kılınç — academic portfolio, deep burgundy, card-based surfaces
   ========================================================================== */

:root {
  color-scheme: dark light;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Source Serif 4", "Georgia", serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, Monaco, monospace;

  /* Deep bordeaux base + warm neutrals */
  --bordeaux-950: #14080c;
  --bordeaux-900: #1f0e14;
  --bordeaux-800: #2c141c;
  --bordeaux-700: #3d1d28;
  --bordeaux-600: #4a2430;

  --slate: #a8989c;
  --light-slate: #e8ddd9;
  --lightest-slate: #f7f1ee;

  --wine: #b87a8c;
  --wine-bright: #d9a8b4;
  --wine-dim: #8f5f6f;
  --wine-glow: rgba(200, 140, 155, 0.12);
  --wine-line: rgba(220, 170, 185, 0.14);

  --spot-x: 50%;
  --spot-y: 32%;
  --radius-lg: 0.875rem;
  --radius-md: 0.5rem;
  --radius-sm: 0.35rem;
  --shadow-lg: 0 24px 56px rgba(8, 2, 6, 0.55);
  --shadow-glass: 0 10px 40px rgba(8, 2, 6, 0.35);
  --nav-width: 17rem;
  --header-h: 3.75rem;
  --toolbar-size: 2.65rem;
  --transition: 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg-base: var(--bordeaux-900);
  --bg-elevated: rgba(36, 18, 26, 0.92);
  --bg-glass: rgba(42, 22, 30, 0.72);
  --text-primary: var(--lightest-slate);
  --text-muted: #b9a8ac;
  --border-subtle: rgba(255, 210, 220, 0.09);
  --accent: var(--wine-bright);
  --accent-dim: var(--wine);
  --grain-opacity: 0.045;
}

[data-theme="light"] {
  color-scheme: light;
  --bg-base: #faf6f4;
  --bg-elevated: rgba(255, 252, 251, 0.94);
  --bg-glass: rgba(255, 255, 255, 0.86);
  --text-primary: #2a1419;
  --text-muted: #6b555c;
  --border-subtle: rgba(60, 20, 35, 0.1);
  --accent: #8b4a5c;
  --accent-dim: #6d3a4a;
  --grain-opacity: 0.03;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .top-dock__chip--theme {
    animation: none !important;
  }
  dialog.modal--res-ai[open],
  dialog.modal--res-ai::backdrop {
    animation: none !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.68;
  color: var(--text-primary);
  background-color: var(--bg-base);
  background-image:
    radial-gradient(ellipse 90% 60% at var(--spot-x) var(--spot-y), var(--wine-glow), transparent 52%),
    radial-gradient(ellipse 50% 40% at 100% 0%, rgba(120, 60, 80, 0.08), transparent 50%),
    radial-gradient(ellipse 45% 35% at 0% 100%, rgba(80, 40, 55, 0.1), transparent 48%);
  background-attachment: fixed;
}

body.nav-open {
  overflow: hidden;
}

body.modal-open {
  overflow: hidden;
}

.ambient-spotlight {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background: radial-gradient(
    480px circle at var(--spot-x) var(--spot-y),
    rgba(200, 130, 150, 0.06),
    transparent 60%
  );
  mix-blend-mode: screen;
}

[data-theme="light"] .ambient-spotlight {
  mix-blend-mode: multiply;
  opacity: 0.55;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 10000;
  padding: 0.6rem 1rem;
  background: var(--bordeaux-800);
  color: var(--lightest-slate);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500;
}

.skip-link:focus {
  left: 0.5rem;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Mobile header & floating toolbar
   -------------------------------------------------------------------------- */

.mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-h);
  padding: 0.5rem 1rem;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

@media (min-width: 1024px) {
  .mobile-header {
    display: none;
  }
}

.mobile-header__brand {
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-decoration: none;
  font-family: var(--font-display);
}

.mobile-header__actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mobile-header__theme-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
}

.top-dock__theme-caption--mobile {
  font-size: 0.58rem;
  max-width: 3.2rem;
}

.theme-toggle--prominent {
  box-shadow:
    0 0 0 1px rgba(220, 160, 175, 0.4),
    0 0 14px rgba(200, 130, 155, 0.3);
}

.fab--deer svg {
  display: block;
}

.mobile-header__hint {
  display: none;
  font-size: 0.7rem;
  color: var(--text-muted);
  max-width: 6rem;
  line-height: 1.2;
}

@media (min-width: 380px) {
  .mobile-header__hint {
    display: block;
  }
}

.fab {
  width: var(--toolbar-size);
  height: var(--toolbar-size);
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  backdrop-filter: blur(12px);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-glass);
  transition: transform var(--transition), background var(--transition);
}

.fab:hover {
  transform: translateY(-2px);
  background: var(--bg-glass);
}

.fab svg {
  width: 1.35rem;
  height: 1.35rem;
}

.fab--accent {
  background: linear-gradient(160deg, var(--bordeaux-700), var(--bordeaux-900));
  color: var(--wine-bright);
  border-color: rgba(200, 140, 155, 0.35);
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.nav-toggle__bar {
  display: block;
  height: 2px;
  width: 1.25rem;
  margin: 0 auto;
  background: currentColor;
  border-radius: 2px;
}

.theme-toggle {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  position: relative;
}

.theme-toggle__icon {
  position: absolute;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
}

.theme-toggle__icon--sun {
  background: radial-gradient(circle at 30% 30%, #fff7cc, #f59e0b);
  opacity: 1;
}

.theme-toggle__icon--moon {
  background: radial-gradient(circle at 40% 35%, #e2e8f0, #475569);
  opacity: 0;
}

[data-theme="dark"] .theme-toggle__icon--sun {
  opacity: 0;
}

[data-theme="dark"] .theme-toggle__icon--moon {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Shell layout: sidebar + main
   -------------------------------------------------------------------------- */

.app-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

@media (min-width: 1024px) {
  .app-shell {
    grid-template-columns: var(--nav-width) 1fr;
  }
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.75rem 1.25rem;
  border-right: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  backdrop-filter: blur(16px);
  overflow-y: auto;
}

@media (max-width: 1023px) {
  .sidebar {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(20rem, 88vw);
    max-width: 100%;
    height: 100vh;
    z-index: 55;
    padding: 5rem 1.25rem 2rem;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    box-shadow: var(--shadow-lg);
    border-left: 1px solid var(--border-subtle);
    border-right: none;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }
}

@media (min-width: 1024px) {
  .sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    transform: none;
    box-shadow: none;
    border-left: none;
    border-right: 1px solid var(--border-subtle);
  }
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.sidebar__brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, var(--bordeaux-600), var(--bordeaux-900));
  display: grid;
  place-items: center;
  color: var(--wine-bright);
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  font-family: var(--font-sans);
}

.sidebar__brand-text {
  font-weight: 500;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  font-size: 1.05rem;
  line-height: 1.2;
}

.sidebar__brand-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.site-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.site-nav__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin: 0.5rem 0 0.25rem;
  font-family: var(--font-mono);
}

.site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.site-nav__link {
  display: block;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 400;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.site-nav__link:hover {
  color: var(--accent);
  background: rgba(220, 160, 175, 0.07);
}

.site-nav__link.is-active {
  color: var(--text-primary);
  background: rgba(220, 160, 175, 0.1);
  border-color: rgba(220, 160, 175, 0.18);
}

.sidebar__connect {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.connect-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.connect-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.4rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
}

.connect-link:hover {
  border-color: var(--accent);
}

@media (max-width: 1023px) {
  .sidebar .site-nav__list {
    gap: 0.25rem;
  }
}

.main-content {
  padding: 1.25rem 1.25rem 4rem;
  max-width: 58rem;
}

@media (min-width: 1024px) {
  .main-content {
    padding: 2.5rem 3rem 5rem;
  }
}

/* --------------------------------------------------------------------------
   Sections & typography
   -------------------------------------------------------------------------- */

.section {
  margin-bottom: 3.5rem;
  scroll-margin-top: 6rem;
}

.section__title {
  font-size: clamp(1.35rem, 2.8vw, 1.75rem);
  font-weight: 500;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section__title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--wine-line), transparent);
  opacity: 0.95;
}

.section__subtitle {
  font-size: 1.05rem;
  font-weight: 500;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  margin: 1.5rem 0 0.85rem;
  color: var(--text-primary);
}

.hero {
  margin-bottom: 3.25rem;
}

.hero__grid {
  display: grid;
  gap: 1.75rem;
  align-items: center;
}

@media (min-width: 800px) {
  .hero__grid {
    grid-template-columns: 1fr minmax(200px, 260px);
  }
}

.hero__eyebrow {
  font-size: 0.8rem;
  color: var(--accent);
  margin: 0 0 0.4rem;
  font-weight: 400;
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero__title {
  font-size: clamp(2.1rem, 5.5vw, 3.1rem);
  font-weight: 500;
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
  line-height: 1.1;
  color: var(--text-primary);
}

.hero__role {
  margin: 0 0 1rem;
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: -0.01em;
}

.hero__tagline {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 40rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.92rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn--primary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: none;
}

.btn--primary:hover {
  background: rgba(200, 140, 155, 0.14);
}


.btn--ghost {
  background: var(--bg-glass);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.glass-panel {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-glass);
}

.hero__portrait-card {
  justify-self: center;
  width: 100%;
  max-width: 15rem;
  padding: 1rem;
  text-align: center;
}

.hero__portrait-ring {
  margin: 0 auto 0.75rem;
  width: min(100%, 13.5rem);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(145deg, rgba(220, 160, 175, 0.55), rgba(120, 60, 80, 0.35));
  box-shadow: 0 12px 40px rgba(8, 2, 6, 0.4);
}

.hero__portrait-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 2px solid var(--bg-base);
}

.hero__portrait-caption {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.4;
}

.hero__res-ai-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero__res-ai-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
}

.hero__deer-ico {
  flex-shrink: 0;
}

.hero__res-ai-desc {
  margin: 0.45rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 36rem;
}

.hero__res-ai-panel strong {
  font-weight: 500;
}

.about__images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}

.about__images img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  object-fit: cover;
  aspect-ratio: 3/4;
  border: 1px solid var(--border-subtle);
}

.prose p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.prose p:last-child {
  margin-bottom: 0;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.pill {
  display: inline-flex;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 400;
  border: 1px solid var(--border-subtle);
  background: rgba(220, 160, 175, 0.08);
  color: var(--text-primary);
}

.course-grid {
  display: grid;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .course-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.course-item {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.9rem;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.timeline__item {
  position: relative;
  padding: 1.1rem 1.15rem 1.1rem 1.35rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-glass);
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85rem;
  bottom: 0.85rem;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), rgba(200, 140, 155, 0.25));
}

.timeline__date {
  font-size: 0.78rem;
  font-weight: 500;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--accent);
  display: block;
  margin-bottom: 0.35rem;
}

.timeline__title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 500;
  font-family: var(--font-display);
}

.timeline__meta {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.timeline__text {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.projects-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .projects-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.project-card {
  padding: 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 100%;
}

.project-card__title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 500;
  font-family: var(--font-display);
}

.project-card__problem,
.project-card__desc,
.project-card__tech {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.status {
  display: inline-flex;
  align-self: flex-start;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status--live {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.status--progress {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
}

.status--done {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

.project-card__link {
  font-size: 0.88rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.project-card__link:hover {
  text-decoration: underline;
}

.skills-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .skills-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.skill-block h3 {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  font-weight: 500;
  font-family: var(--font-display);
}

.skill-block ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.badge {
  display: inline-flex;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
}

.interests__images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

.interests__images img {
  width: 100%;
  border-radius: var(--radius-md);
  aspect-ratio: 3/4;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
}

.res-ai-section .res-ai-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.pipeline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.pipeline__step {
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px dashed var(--border-subtle);
  color: var(--text-muted);
}

.pipeline__step.is-active {
  border-style: solid;
  border-color: var(--accent);
  color: var(--text-primary);
  background: rgba(220, 160, 175, 0.12);
}

/* Contact */
.contact-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.contact-note {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.wa-templates {
  margin-top: 1.25rem;
}

.wa-templates__title {
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
}

.wa-templates__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.wa-chip {
  display: inline-flex;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.82rem;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  text-decoration: none;
  transition: border-color var(--transition), background var(--transition);
}

.wa-chip:hover {
  border-color: #25d366;
  background: rgba(37, 211, 102, 0.1);
}

.site-footer {
  margin-top: 2rem;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--accent);
}

.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1.25rem;
  z-index: 45;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-glass);
}

@media (min-width: 1024px) {
  .back-to-top {
    right: 2rem;
    bottom: 2rem;
  }
}

.back-to-top[hidden] {
  display: none;
}

/* Modals */
dialog.modal {
  width: min(42rem, 94vw);
  max-height: min(88vh, 720px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0;
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
}

dialog.modal::backdrop {
  background: rgba(18, 8, 12, 0.78);
  backdrop-filter: blur(8px);
}

dialog.modal--res-ai[open] {
  animation: resAiModalIn 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
}

dialog.modal--res-ai::backdrop {
  animation: resAiBackdropIn 0.42s ease both;
}

@keyframes resAiModalIn {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes resAiBackdropIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.modal__title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 500;
  font-family: var(--font-display);
}

.modal__close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.2rem;
}

.modal__body {
  padding: 1rem 1.1rem 1.25rem;
  overflow: auto;
  max-height: calc(88vh - 5rem);
}

.form-grid {
  display: grid;
  gap: 0.65rem;
}

.form-row label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.form-row input,
.form-row textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.15);
  color: var(--text-primary);
  font: inherit;
}

[data-theme="light"] .form-row input,
[data-theme="light"] .form-row textarea {
  background: #fff;
}

.form-row textarea {
  min-height: 6rem;
  resize: vertical;
}

.form-status {
  font-size: 0.88rem;
  margin: 0.25rem 0 0;
  min-height: 1.25rem;
}

.form-status.is-error {
  color: #fb7185;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.res-ai-layout {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .res-ai-layout {
    grid-template-columns: 1fr 1.1fr;
  }
}

.res-ai-pipeline-panel {
  font-size: 0.88rem;
}

.res-ai-chat {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  max-height: 320px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.12);
}

.res-ai-chat__log {
  flex: 1;
  overflow-y: auto;
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.res-ai-chat__msg {
  display: flex;
}

.res-ai-chat__msg--user {
  justify-content: flex-end;
}

.res-ai-chat__bubble {
  max-width: 92%;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.res-ai-chat__msg--user .res-ai-chat__bubble {
  background: rgba(155, 122, 133, 0.12);
  border: 1px solid rgba(155, 122, 133, 0.25);
}

.res-ai-chat__msg--assistant .res-ai-chat__bubble {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
}

.res-ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.res-ai-chip {
  font-size: 0.78rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  cursor: pointer;
  color: var(--text-primary);
}

.res-ai-chip:hover {
  border-color: var(--accent);
}

.res-ai-form {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.res-ai-form input {
  flex: 1;
  min-width: 0;
}

.modal__footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.wa-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.wa-quick a {
  font-size: 0.85rem;
  color: #25d366;
}

.overlay-scrim {
  display: none;
}

@media (max-width: 1023px) {
  body.nav-open .overlay-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 52;
  }
}

/* --------------------------------------------------------------------------
   Top-right — compact chips: theme, Res AI, Gmail
   -------------------------------------------------------------------------- */
.top-dock {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 65;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  max-width: calc(100vw - 2rem);
}

@media (max-width: 1023px) {
  .top-dock {
    display: none;
  }
}

.top-dock__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.65rem;
  min-height: 2.15rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-glass);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.top-dock__chip:hover {
  transform: translateY(-1px);
  border-color: rgba(220, 160, 175, 0.28);
  box-shadow: 0 10px 28px rgba(8, 2, 6, 0.32);
}

.top-dock__theme-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.top-dock__theme-caption {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1;
  max-width: 4.5rem;
  text-align: center;
}

.top-dock__chip--theme {
  padding: 0.32rem;
  width: 2.35rem;
  min-width: 2.35rem;
  height: 2.35rem;
  min-height: 2.35rem;
  justify-content: center;
  position: relative;
  box-shadow:
    0 0 0 1px rgba(220, 160, 175, 0.45),
    0 0 18px rgba(200, 130, 155, 0.35);
  animation: themeGlowPulse 3.2s ease-in-out infinite;
}

@keyframes themeGlowPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(220, 160, 175, 0.45),
      0 0 14px rgba(200, 130, 155, 0.28);
  }
  50% {
    box-shadow:
      0 0 0 2px rgba(232, 190, 200, 0.55),
      0 0 22px rgba(210, 150, 170, 0.42);
  }
}

.top-dock__chip--theme .theme-toggle__icon {
  width: 1.05rem;
  height: 1.05rem;
}

.top-dock__chip-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}

.top-dock__chip-icon svg {
  width: 17px;
  height: 17px;
  display: block;
}

.top-dock__chip-icon--deer svg {
  width: 19px;
  height: 22px;
}

.top-dock__chip-icon--gmail {
  width: 1.35rem;
  height: 1.35rem;
  min-width: 1.35rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #ea4335, #fbbc04);
  color: #fff;
  font-weight: 600;
  font-size: 0.72rem;
}

.top-dock__chip-label {
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

.top-dock__chip--ai {
  border-color: rgba(200, 140, 155, 0.22);
}

.top-dock__chip--mail .top-dock__chip-label {
  color: var(--text-primary);
}

/* Gmail-style compose modal */
dialog.modal--gmail {
  width: min(36rem, 96vw);
  max-height: min(92vh, 800px);
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  color: #202124;
}

[data-theme="dark"] dialog.modal--gmail {
  background: #1f1f1f;
  color: #e8eaed;
  border-color: rgba(255, 255, 255, 0.08);
}

.gmail-compose {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.gmail-compose__toolbar {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  background: #f1f3f4;
  border-bottom: 1px solid #dadce0;
}

[data-theme="dark"] .gmail-compose__toolbar {
  background: #303030;
  border-bottom-color: #444;
}

.gmail-compose__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.gmail-compose__dot--min {
  background: #ffbd2e;
}
.gmail-compose__dot--max {
  background: #27c93f;
}
.gmail-compose__dot--close {
  background: #ff6058;
}

.gmail-compose__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.65rem;
  background: #fff;
  border-bottom: 1px solid #dadce0;
}

[data-theme="dark"] .gmail-compose__head {
  background: #1f1f1f;
  border-bottom-color: #444;
}

.gmail-compose__logo {
  font-size: 0.88rem;
  font-weight: 600;
  color: #5f6368;
}

[data-theme="dark"] .gmail-compose__logo {
  color: #9aa0a6;
}

.gmail-compose__close-form {
  margin: 0;
}

.gmail-compose__x {
  color: #5f6368 !important;
  font-size: 1.35rem !important;
}

.gmail-compose__body {
  padding: 0.75rem 1rem 1rem;
  background: #fff;
  max-height: calc(92vh - 6rem);
}

[data-theme="dark"] .gmail-compose__body {
  background: #1f1f1f;
}

.form-grid--gmail .form-row label {
  color: #5f6368;
  font-size: 0.75rem;
}

[data-theme="dark"] .form-grid--gmail .form-row label {
  color: #9aa0a6;
}

.form-grid--gmail .form-row input,
.form-grid--gmail .form-row textarea {
  background: #fff;
  border: 1px solid #dadce0;
  color: #202124;
}

[data-theme="dark"] .form-grid--gmail .form-row input,
[data-theme="dark"] .form-grid--gmail .form-row textarea {
  background: #303030;
  border-color: #444;
  color: #e8eaed;
}

.gmail-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #dadce0;
  margin-bottom: 0.35rem;
}

[data-theme="dark"] .gmail-field {
  border-bottom-color: #444;
}

.gmail-field__label {
  font-size: 0.8rem;
  color: #5f6368;
  min-width: 2rem;
}

.gmail-field__input {
  flex: 1;
  border: none;
  font: inherit;
  background: transparent;
}

.gmail-field__input--readonly {
  color: #1a73e8;
  font-size: 0.88rem;
}

.gmail-compose__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.btn--send {
  background: #1a73e8;
  color: #fff !important;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.35rem;
  font-weight: 600;
  cursor: pointer;
}

.btn--send:hover {
  background: #1765cc;
  transform: none;
}

.wa-quick {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #dadce0;
}

[data-theme="dark"] .wa-quick {
  border-top-color: #444;
}

.wa-quick__label {
  font-size: 0.8rem;
  color: #5f6368;
  margin-right: 0.5rem;
}

/* Res AI modal — geyik rozeti */
.modal__header-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.modal__deer-badge {
  flex-shrink: 0;
  width: 3.1rem;
  height: 3.6rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(155, 122, 133, 0.12);
  border: 1px solid rgba(155, 122, 133, 0.25);
  color: var(--wine-bright);
}

.modal__deer-badge svg {
  display: block;
}

.modal__pipeline-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0;
}

.modal__subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.35;
}

dialog.modal--res-ai .modal__header {
  align-items: flex-start;
}

.hero__res-ai-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}

@media (min-width: 640px) {
  .hero__res-ai-panel {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.prose strong,
.project-card__problem strong,
.project-card__tech strong {
  font-weight: 500;
  color: var(--text-primary);
}
