/* —— Minimal portfolio —— */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #030508;
  --surface: #0a0f18;
  --surface-elevated: #0f1624;
  --text: #e8edf5;
  --text-muted: #8a9bb8;
  --accent: #3b82f6;
  --accent-bright: #60a5fa;
  --accent-dim: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.22);
  --border: rgba(96, 165, 250, 0.14);
  --card-surface: rgba(15, 22, 36, 0.92);
  --card-shadow-depth: rgba(0, 0, 0, 0.37);
  --dialog-backdrop: rgba(0, 0, 0, 0.65);
  --editor-bar-bg: rgba(7, 10, 16, 0.92);
  --yt-backdrop: rgba(0, 0, 0, 0.72);
  --yt-panel-bg: #070a10;
  /* Ends in bg-matched transparent for smooth blend with body */
  --header-radial: radial-gradient(
    ellipse 185% 145% at 50% -35%,
    rgba(59, 130, 246, 0.16) 0%,
    rgba(59, 130, 246, 0.08) 22%,
    rgba(59, 130, 246, 0.03) 42%,
    rgba(59, 130, 246, 0.008) 62%,
    rgba(3, 5, 8, 0) 100%
  );
  --font: system-ui, "Segoe UI", sans-serif;
  --radius: 8px;
  --max: min(92vw, 1580px);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f1f4fb;
  --surface: #e2e8f4;
  --surface-elevated: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-bright: #3b82f6;
  --accent-dim: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.14);
  --border: rgba(15, 23, 42, 0.12);
  --card-surface: rgba(255, 255, 255, 0.95);
  --card-shadow-depth: rgba(15, 23, 42, 0.1);
  --dialog-backdrop: rgba(15, 23, 42, 0.4);
  --editor-bar-bg: rgba(255, 255, 255, 0.92);
  --yt-backdrop: rgba(15, 23, 42, 0.45);
  --yt-panel-bg: #f8fafc;
  --header-radial: radial-gradient(
    ellipse 185% 145% at 50% -35%,
    rgba(37, 99, 235, 0.12) 0%,
    rgba(37, 99, 235, 0.05) 22%,
    rgba(37, 99, 235, 0.02) 42%,
    rgba(37, 99, 235, 0.006) 62%,
    rgba(241, 244, 251, 0) 100%
  );
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(ellipse 85% 55% at 50% -22%, var(--accent-glow), transparent 55%);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 200;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #f8fafc;
  border-radius: 6px;
}

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

/* —— Header —— */
.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 0.75rem 1.35rem;
  border-bottom: 1px solid var(--border);
  background-color: transparent;
  background-image: var(--header-radial);
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 100% 100%;
}

.site-brand {
  min-width: 0;
  flex: 1;
}

.site-title {
  margin: 0;
  font-size: clamp(1.85rem, 5.5vw, 3.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.site-subtitle {
  margin: 0.4rem 0 0;
  font-size: clamp(0.82rem, 2vw, 0.98rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  line-height: 1.35;
  max-width: 28rem;
}

.site-subtitle[hidden] {
  display: none !important;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.nav-btn {
  margin: 0;
  padding: 0.4rem 0.9rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}

.nav-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-btn--primary {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.12);
  font-weight: 600;
}

.nav-btn--primary:hover {
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent-bright);
}

html[data-theme="light"] .nav-btn--primary {
  border-color: rgba(37, 99, 235, 0.42);
  background: rgba(37, 99, 235, 0.1);
}

html[data-theme="light"] .nav-btn--primary:hover {
  background: rgba(37, 99, 235, 0.18);
  color: var(--accent-bright);
}

html[data-theme="light"] .contact-line {
  background: rgba(15, 23, 42, 0.04);
}

html[data-theme="light"] .contact-empty code {
  background: rgba(15, 23, 42, 0.06);
}

.nav-btn--small {
  padding: 0.3rem 0.65rem;
  font-size: 0.82rem;
}

.nav-btn--theme {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 5.5rem;
  justify-content: center;
}

.nav-btn--theme .theme-toggle__icon {
  font-size: 1rem;
  line-height: 1;
}

body:not(.portfolio-editor-on) #btn-add-project {
  display: none !important;
}

body:not(.portfolio-editor-on) .project-card-actions {
  display: none !important;
}

body:not(.portfolio-editor-on) .ap-featured-field {
  display: none !important;
}

body:not(.portfolio-editor-on) #btn-insights {
  display: none !important;
}

body:not(.portfolio-editor-on) .project-click-badge {
  display: none !important;
}

.editor-unlock-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--editor-bar-bg);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.editor-unlock-bar__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.editor-unlock-bar__input {
  width: min(200px, 42vw);
  padding: 0.35rem 0.55rem;
  font: inherit;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
}

.editor-unlock-bar__input::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

/* —— Insights (editor-only) —— */
.dialog-inner--insights {
  max-width: min(720px, 94vw);
}

.insights-scope-hint {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.insights-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.insights-section-title {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.insights-hour-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 128px;
  padding: 0 0.15rem;
  border-bottom: 1px solid var(--border);
}

.insights-hour-bar-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}

.insights-hour-bar {
  width: 100%;
  max-width: 18px;
  margin: 0 auto;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--accent-bright), var(--accent-dim));
  opacity: 0.92;
}

.insights-hour-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  line-height: 1;
  white-space: nowrap;
}

.insights-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.insights-cal-dow {
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
  padding: 0.2rem 0;
}

.insights-cal-cell {
  min-height: 2.5rem;
  padding: 0.35rem 0.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  font-size: 0.72rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
}

.insights-cal-cell--empty {
  border: none;
  background: transparent;
  min-height: 0;
  padding: 0;
}

.insights-cal-cell--muted {
  opacity: 0.45;
}

.insights-cal-day {
  font-weight: 600;
  font-size: 0.8rem;
}

.insights-cal-count {
  font-size: 0.7rem;
  color: var(--accent-bright);
  font-variant-numeric: tabular-nums;
}

.insights-cal-month-label {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.insights-clicks {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.insights-clicks li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0.55rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  font-size: 0.88rem;
}

.insights-clicks-count {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent-bright);
  flex-shrink: 0;
}

.insights-actions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* —— Main grid —— */
#main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 0.5rem 3rem;
  padding-bottom: calc(3rem + 52px);
}

/* Featured spotlight: one large card, centered above the grid */
.project-featured-section {
  margin-bottom: 2.5rem;
  text-align: center;
}

.project-featured-eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.95;
}

.project-featured-mount {
  display: flex;
  justify-content: center;
  width: 100%;
}

.project-featured-mount .project-card {
  width: 100%;
  max-width: min(920px, 96vw);
}

.project-card--featured .project-title {
  font-size: 1.25rem;
}

.project-card--featured .project-desc {
  font-size: 0.98rem;
}

@media (hover: hover) and (pointer: fine) {
  .project-card--featured:hover {
    transform: scale(1.02);
  }
}

.project-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .project-grid {
    gap: 2.4rem;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1320px) {
  .project-grid {
    gap: 2.85rem;
    grid-template-columns: repeat(3, 1fr);
  }
}

/* —— Project card —— */
.project-card {
  --card-glow-rgb: 59, 130, 246;
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: visible;
  border: none;
  background: transparent;
  transition: transform 0.3s ease;
  transform-origin: center center;
}

.project-card-surface {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card-surface);
  transition: border-color 0.28s ease, box-shadow 0.28s ease;
}

@media (hover: hover) and (pointer: fine) {
  .project-card:hover {
    z-index: 2;
    transform: scale(1.025);
  }

  .project-card:hover .project-card-surface {
    animation: project-card-glow-breathe 10s ease-in-out infinite;
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-card:hover .project-card-surface {
    animation: none;
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: reduce) {
  .project-card:hover {
    transform: none;
  }

  .project-card:hover .project-card-surface {
    border-color: rgba(var(--card-glow-rgb), 0.45);
    box-shadow:
      0 0 0 1px rgba(var(--card-glow-rgb), 0.28),
      0 12px 32px var(--card-shadow-depth),
      0 0 28px rgba(var(--card-glow-rgb), 0.32),
      0 0 48px rgba(var(--card-glow-rgb), 0.18);
  }
}

@keyframes project-card-glow-breathe {
  0%,
  100% {
    border-color: rgba(var(--card-glow-rgb), 0.42);
    box-shadow:
      0 0 0 1px rgba(var(--card-glow-rgb), 0.24),
      0 12px 32px var(--card-shadow-depth),
      0 0 26px rgba(var(--card-glow-rgb), 0.3),
      0 0 46px rgba(var(--card-glow-rgb), 0.16),
      0 0 72px rgba(var(--card-glow-rgb), 0.08);
  }

  50% {
    border-color: rgba(var(--card-glow-rgb), 0.52);
    box-shadow:
      0 0 0 1px rgba(var(--card-glow-rgb), 0.34),
      0 14px 38px var(--card-shadow-depth),
      0 0 38px rgba(var(--card-glow-rgb), 0.42),
      0 0 64px rgba(var(--card-glow-rgb), 0.24),
      0 0 96px rgba(var(--card-glow-rgb), 0.12);
  }
}

.project-click-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 6;
  min-width: 1.65rem;
  padding: 0.2rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  color: #f8fafc;
  background: rgba(0, 0, 0, 0.58);
  border: 1px solid rgba(59, 130, 246, 0.5);
  border-radius: 999px;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.project-card-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
  max-width: calc(100% - 1rem);
}

.project-edit-btn {
  padding: 0.25rem 0.5rem;
  font: inherit;
  font-size: 0.75rem;
  color: #dbeafe;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(59, 130, 246, 0.45);
  border-radius: 6px;
  cursor: pointer;
}

.project-edit-btn:hover {
  background: rgba(59, 130, 246, 0.28);
}

.project-remove-btn {
  padding: 0.25rem 0.5rem;
  font: inherit;
  font-size: 0.75rem;
  color: #fecaca;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: 6px;
  cursor: pointer;
}

.project-remove-btn:hover {
  background: rgba(248, 113, 113, 0.25);
}

.project-card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  background: var(--surface);
  cursor: default;
}

.project-card-media.project-card-media--youtube {
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .project-card-media.project-card-media--youtube:hover {
    outline: 1px solid rgba(59, 130, 246, 0.35);
    outline-offset: 0;
  }
}

.project-thumb,
.project-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-preview {
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.preview-video,
.preview-gif {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (hover: hover) and (pointer: fine) {
  .project-card-media:hover .project-preview {
    opacity: 1;
  }
}

.project-card-media.is-touch-open .project-preview {
  opacity: 1;
}

@media (hover: none) {
  .project-card-media::after {
    content: "Tap image for preview";
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    color: var(--text);
    background: rgba(0, 0, 0, 0.55);
    border-radius: 4px;
    pointer-events: none;
  }

  .project-card-media.is-touch-open::after {
    content: "Tap again to close";
  }

  .project-card-media.project-card-media--youtube::after {
    content: "Tap to play on YouTube";
  }
}

.project-card-info {
  padding: 1.15rem 1.2rem 1.2rem;
  border-radius: 0 0 var(--radius) var(--radius);
}

.project-title {
  margin: 0 0 0.4rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

.project-title a {
  color: var(--text);
  text-decoration: none;
}

.project-title a:hover {
  color: var(--accent);
}

.project-desc {
  margin: 0;
  font-size: 0.9125rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.project-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.project-gallery-cell {
  width: 72px;
  height: 48px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.project-gallery-cell img,
.project-gallery-cell video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* —— About dialog —— */
dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  max-width: min(90vw, 520px);
  background: var(--surface-elevated);
  color: var(--text);
}

/* About dialog: nearly full screen so images + text have room to breathe */
#about-dialog.about-dialog {
  width: min(98vw, 1600px);
  max-width: 98vw;
  max-height: 94vh;
  overflow: hidden;
}

#about-dialog .dialog-inner {
  display: flex;
  flex-direction: column;
  max-height: 94vh;
  box-sizing: border-box;
}

#about-dialog .about-layout {
  display: grid;
  grid-template-columns: minmax(280px, min(46vw, 520px)) minmax(0, 1fr);
  gap: 1.25rem 1.75rem;
  align-items: start;
  flex: 1;
  min-height: 0;
}

#about-dialog .about-images {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  flex-shrink: 0;
}

#about-dialog .about-image {
  display: block;
  width: 100%;
  max-width: min(560px, 100%);
  height: auto;
  /* Tall panel: each image can use ~⅖ of viewport height; px cap for large monitors */
  max-height: min(560px, 38vh);
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.4));
}

@media (max-width: 620px) {
  #about-dialog .about-layout {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  #about-dialog .about-images {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
  }

  #about-dialog .about-image {
    flex: 1 1 min(160px, 48vw);
    max-width: min(340px, 48vw);
    max-height: min(280px, 38vh);
  }
}

#about-dialog .about-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-right: 1rem;
  box-sizing: border-box;
  scrollbar-gutter: stable;
}

.add-project-dialog {
  max-width: min(94vw, 520px);
  max-height: min(92vh, 900px);
  overflow: hidden;
}

.add-project-dialog .dialog-inner--form {
  max-height: min(88vh, 860px);
  overflow: auto;
  padding-top: 2.5rem;
}

.add-project-dialog h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.form-hint {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.form-hint code {
  font-size: 0.8em;
  padding: 0.1em 0.35em;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
}

.field-label {
  display: block;
  margin: 0.85rem 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.field-label:first-of-type,
.form-hint + .field-label {
  margin-top: 0;
}

.field-input,
.field-textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  font: inherit;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
}

.field-textarea {
  resize: vertical;
  min-height: 4rem;
}

.ap-featured-field {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.08);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
  cursor: pointer;
}

.checkbox-label input {
  margin: 0.2rem 0 0;
  flex-shrink: 0;
}

.field-file {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.field-fieldset {
  margin: 0.75rem 0 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
}

.field-fieldset .field-label {
  margin-top: 0;
}

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.radio-label {
  font-size: 0.9rem;
  font-weight: normal;
  color: var(--text);
  cursor: pointer;
}

.form-error {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: #f87171;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.form-actions--secondary {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  justify-content: flex-start;
}

.btn-primary,
.btn-ghost {
  padding: 0.55rem 1rem;
  font: inherit;
  font-size: 0.9rem;
  border-radius: 6px;
  cursor: pointer;
}

.btn-primary {
  border: none;
  background: var(--accent);
  color: #f8fafc;
  font-weight: 600;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-ghost {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-link {
  padding: 0;
  font: inherit;
  font-size: 0.85rem;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-link:hover {
  color: var(--accent-bright);
}

.ap-current-wrap {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.ap-replace-hint {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ap-keep-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--accent-bright);
  line-height: 1.35;
}

.ap-current-previews {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ap-current-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.ap-current-row--gallery {
  flex-direction: column;
  gap: 0.4rem;
}

.ap-current-tag {
  flex-shrink: 0;
  width: 3.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding-top: 0.2rem;
}

.ap-current-cell {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
}

.ap-current-cell img,
.ap-current-cell video {
  display: block;
  width: 100%;
  max-height: 140px;
  object-fit: contain;
  vertical-align: middle;
}

.ap-current-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ap-current-gallery .ap-current-cell {
  width: 88px;
  height: 60px;
}

.ap-current-gallery .ap-current-cell img,
.ap-current-gallery .ap-current-cell video {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
}

dialog::backdrop {
  background: var(--dialog-backdrop);
}

.dialog-inner {
  padding: 1.5rem;
  position: relative;
}

.dialog-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
}

.dialog-close:hover {
  color: var(--text);
}

.about-dialog h2,
.contact-dialog h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
}

.contact-intro {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: justify;
  text-justify: inter-word;
}

.contact-dialog-body {
  margin: 0;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-dialog-body .contact-links {
  margin: 0;
}

.contact-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.contact-line .contact-label {
  flex-shrink: 0;
  padding-right: 0.35rem;
}

.contact-line a {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  color: var(--accent);
  text-decoration: none;
}

.contact-line a:hover {
  text-decoration: underline;
}

.contact-label {
  color: var(--text-muted);
  font-weight: 500;
}

.contact-empty {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.contact-empty code {
  font-size: 0.82em;
  padding: 0.1em 0.35em;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
}

.about-body p {
  margin: 0 0 1rem;
  color: var(--text-muted);
  text-align: justify;
  text-justify: inter-word;
  hyphens: none;
  word-break: normal;
  overflow-wrap: normal;
  text-wrap: pretty;
}

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

.dot {
  opacity: 0.6;
}

.form-hint--field {
  margin: 0.35rem 0 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

body.yt-lightbox-open {
  overflow: hidden;
}

.yt-lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
}

.yt-lightbox[hidden] {
  display: none !important;
}

.yt-lightbox-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--yt-backdrop);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.yt-lightbox.is-open .yt-lightbox-backdrop {
  opacity: 1;
}

.yt-lightbox-panel {
  position: fixed;
  z-index: 2;
  display: flex;
  flex-direction: column;
  background: var(--yt-panel-bg);
  border: 1px solid var(--border);
  box-shadow: 0 28px 100px var(--card-shadow-depth);
  overflow: hidden;
  will-change: top, left, width, height;
}

.yt-lightbox-close {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 3;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  border-radius: 8px;
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text);
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.yt-lightbox-close:hover {
  background: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.yt-lightbox-frame {
  flex: 1;
  min-height: 0;
  position: relative;
  padding-top: 0;
}

.yt-lightbox-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .yt-lightbox-backdrop {
    transition: none;
  }
}
