/* ==========================================================================
   Components — reusable pieces, independent of where they sit on the page.
   Buttons · panels · timeline · tag chips · project cards · dialog · tooltip
   ========================================================================== */

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  height: 2rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  padding: 0 .625rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background-color: transparent;
  background-clip: padding-box;
  color: inherit;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  outline: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease,
    transform .15s ease, box-shadow .15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
}

/* Variants */
.btn-default {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.btn-default:hover {
  background-color: color-mix(in oklab, var(--primary) 80%, transparent);
}

.btn-outline {
  border-color: var(--border);
  background-color: var(--background);
}

.btn-outline:hover {
  background-color: var(--muted);
}

.dark .btn-outline {
  border-color: var(--input);
  background-color: color-mix(in oklab, var(--input) 30%, transparent);
}

.dark .btn-outline:hover {
  background-color: color-mix(in oklab, var(--input) 50%, transparent);
}

.btn-ghost:hover {
  background-color: var(--muted);
}

.dark .btn-ghost:hover {
  background-color: color-mix(in oklab, var(--muted) 50%, transparent);
}

/* Sizes */
.btn-sm {
  height: 1.75rem;
  gap: .25rem;
  padding: 0 .625rem;
  border-radius: var(--radius-md);
  font-size: .8rem;
}

.btn-sm iconify-icon {
  font-size: .875rem;
}

.btn-icon {
  width: 2rem;
  height: 2rem;
  padding: 0;
}

.btn-icon iconify-icon {
  font-size: 1rem;
}

.btn-icon-sm {
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn-icon-sm iconify-icon {
  font-size: .875rem;
}

.btn-pill {
  height: auto;
  padding: .625rem 1.25rem;
  border-radius: 9999px;
  box-shadow: var(--shadow-sm);
  font-size: .875rem;
}

.btn-pill iconify-icon {
  font-size: 1rem;
}

.btn-pill:hover {
  transform: scale(1.05);
}

.btn-pill:active {
  transform: scale(.95);
}

/* ── Panel ──────────────────────────────────────────────────────────────── */
/* Bordered container with a label chip notched into its top edge. */
.panel {
  position: relative;
  border: 1px solid var(--border);
  border-radius: .75rem;
  background-color: var(--panel-bg);
}

.panel-edu {
  padding: 1.25rem .75rem .5rem;
}

.panel-exp {
  padding: 1.5rem .75rem 1rem;
}

.panel-projects {
  padding: 1.25rem .75rem 1rem;
  background-color: var(--muted);
  box-shadow: var(--shadow-inner);
}

.panel-label {
  position: absolute;
  top: -.75rem;
  left: 1rem;
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: 0 .5rem;
  border-radius: 9999px;
  background-color: var(--muted);
  color: var(--muted-foreground);
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .025em;
}

.panel-label iconify-icon {
  font-size: 1rem;
}

/* Soft light leaks in the panel corners. */
.panel-blobs {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  border-radius: 1rem;
}

.blob {
  position: absolute;
  height: 8rem;
  width: 8rem;
  border-radius: 9999px;
  background-color: color-mix(in oklab, var(--foreground) 5%, transparent);
  filter: blur(48px);
}

.blob-tr {
  top: -2.5rem;
  right: -2.5rem;
}

.blob-bl {
  bottom: -2.5rem;
  left: -2.5rem;
}

/* ── Timeline ───────────────────────────────────────────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.timeline-tight {
  gap: 1rem;
}

.tl-item {
  position: relative;
  display: flex;
  gap: .75rem;
}

.tl-item-center {
  align-items: center;
}

.tl-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tl-rail-stretch {
  align-self: stretch;
}

.tl-dot {
  display: flex;
  height: 2rem;
  width: 2rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
  border-radius: var(--radius-md);
  background-color: var(--card);
  color: var(--muted-foreground);
  transition: border-color .15s ease, color .15s ease;
}

.tl-dot iconify-icon {
  font-size: .875rem;
}

/* Company logo tiles fill the whole dot. */
.tl-dot img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

.tl-dot-lg {
  height: 2.25rem;
  width: 2.25rem;
}

.tl-dot-lg iconify-icon {
  font-size: 1.125rem;
}

.tl-item:hover .tl-dot {
  border-color: color-mix(in oklab, var(--foreground) 20%, transparent);
  color: var(--foreground);
}

.tl-line {
  margin-top: .5rem;
  width: 1px;
  flex: 1;
  background-color: var(--border);
}

.tl-body {
  flex: 1;
  min-width: 0;
  padding-bottom: .25rem;
}

.tl-head {
  display: flex;
  flex-direction: column;
  gap: .125rem;
}

.tl-head h3 {
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.4;
}

.tl-at {
  color: var(--muted-foreground);
  font-weight: 400;
}

.tl-at a {
  text-decoration: none;
  transition: color .15s ease;
}

.tl-at a:hover {
  color: var(--foreground);
}

.tl-period {
  flex-shrink: 0;
  color: var(--muted-foreground);
  font-size: .75rem;
  white-space: nowrap;
}

.tl-desc {
  margin-top: .375rem;
  color: var(--muted-foreground);
  font-size: .8rem;
  line-height: 1.55;
}

@media (min-width: 640px) {
  .tl-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
  }
}

/* ── Tag chips ──────────────────────────────────────────────────────────── */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
}

.tl-body .tag-row {
  margin-top: .5rem;
}

.tag-chip {
  display: flex;
  height: 1.75rem;
  width: 1.75rem;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in oklab, var(--border) 40%, transparent);
  border-radius: var(--radius-md);
  cursor: default;
  transition: border-color .15s ease;
}

.tag-chip:hover {
  border-color: color-mix(in oklab, var(--foreground) 20%, transparent);
}

.tag-chip iconify-icon {
  font-size: 1rem;
}

/* ── Project card ───────────────────────────────────────────────────────── */
/* Two stacked layers: `.project-base` (thumbnail + title) is what you see at
   rest; `.project-overlay` (description + links) crossfades in on hover or
   keyboard focus. */
.project-card {
  position: relative;
  display: flex;
  width: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background-color: var(--muted);
  box-shadow: var(--shadow-xs);
  color: var(--card-foreground);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.project-card:hover,
.project-card:focus-within {
  transform: translateY(-.25rem);
  border-color: color-mix(in oklab, var(--foreground) 15%, transparent);
  box-shadow: var(--shadow-lg);
}

.project-card[hidden] {
  display: none;
}

/* Deliberately NOT position:relative — `.project-media-fade` is absolutely
   positioned and must resolve against `.project-card`, so the gradient washes
   over the whole card and the thumbnail melts into the title area instead of
   ending in a hard edge. Adding `position` here re-introduces that seam. */
.project-media {
  padding: .5rem;
}

.project-placeholder,
.project-media img {
  display: flex;
  aspect-ratio: 16 / 10;
  height: 100%;
  width: 100%;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: .75rem;
  box-shadow: var(--shadow-inner);
  object-fit: cover;
  transition: transform .2s ease-out;
}

/* Fallback when a project has no screenshot. */
.project-placeholder {
  background-color: var(--muted);
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 14px 14px;
  color: color-mix(in oklab, var(--muted-foreground) 50%, transparent);
}

.project-placeholder iconify-icon {
  font-size: 2.5rem;
}

.project-card:hover .project-placeholder,
.project-card:hover .project-media img {
  transform: scale(1.02);
}

.project-media-fade {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to top,
      color-mix(in oklab, var(--background) 90%, transparent) 0%,
      color-mix(in oklab, var(--background) 15%, transparent) 50%,
      transparent 100%);
}

.project-base {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: .25rem 1rem .75rem;
  transition: opacity .2s ease;
}

.project-card:hover .project-base,
.project-card:focus-within .project-base {
  opacity: 0;
}

.project-title {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.375;
}

.project-title-lg {
  font-size: 1.125rem;
}

.project-overlay {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: 1rem;
  background-color: color-mix(in oklab, var(--background) 85%, transparent);
  opacity: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity .12s ease;
}

.project-card:hover .project-overlay,
.project-card:focus-within .project-overlay {
  pointer-events: auto;
  opacity: 1;
}

.project-overlay-head {
  display: flex;
  align-items: center;
  gap: .625rem;
}

.project-overlay-icon {
  display: flex;
  height: 2rem;
  width: 2rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-md);
  background-color: var(--muted);
  color: var(--muted-foreground);
}

.project-overlay-icon iconify-icon {
  font-size: 1rem;
}

/* Project logo tiles fill the slot; projects without a logo keep the icon. */
.project-overlay-icon img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

.project-desc {
  color: var(--muted-foreground);
  font-size: .8rem;
  line-height: 1.4;
}

.project-foot {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: .5rem .75rem;
}

.project-links {
  display: flex;
  flex-shrink: 0;
  gap: .375rem;
}

/* ── Dialog ─────────────────────────────────────────────────────────────── */
.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  isolation: isolate;
  background-color: rgb(0 0 0 / .1);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fade-in .1s ease both;
}

.dialog-overlay[hidden],
.dialog[hidden] {
  display: none;
}

.dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 51;
  display: grid;
  width: 100%;
  max-width: calc(100% - 2rem);
  gap: 1rem;
  padding: 1rem;
  transform: translate(-50%, -50%);
  border-radius: .75rem;
  background-color: var(--popover);
  color: var(--popover-foreground);
  font-size: .875rem;
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--foreground) 10%, transparent), var(--shadow-lg);
  outline: none;
  animation: dialog-in .1s ease both;
}

@media (min-width: 640px) {
  .dialog {
    max-width: 24rem;
  }
}

.dialog-close {
  position: absolute;
  top: .5rem;
  right: .5rem;
}

.dialog-header {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding-right: 2rem;
}

.dialog-title {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
}

.dialog-desc {
  color: var(--muted-foreground);
  font-size: .875rem;
  line-height: 1.5;
}

.copy-email {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .625rem 1rem;
  border: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
  border-radius: var(--radius-md);
  background-color: var(--card);
  color: inherit;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}

.copy-email:hover {
  border-color: color-mix(in oklab, var(--foreground) 30%, transparent);
  background-color: var(--muted);
}

.copy-email iconify-icon {
  font-size: 1rem;
}

.dialog-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}

.dialog-socials a {
  display: flex;
  height: 2.25rem;
  width: 2.25rem;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in oklab, var(--border) 50%, transparent);
  border-radius: 9999px;
  background-color: var(--card);
  color: var(--muted-foreground);
  transition: border-color .15s ease, color .15s ease;
}

.dialog-socials a:hover {
  border-color: color-mix(in oklab, var(--foreground) 30%, transparent);
  color: var(--foreground);
}

.dialog-socials iconify-icon {
  font-size: 1rem;
}

/* ── Tooltip ────────────────────────────────────────────────────────────── */
/* A single shared element, moved and filled by js/main.js. Anything with a
   `data-tip` attribute gets one. */
.tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  display: inline-flex;
  width: fit-content;
  max-width: 20rem;
  align-items: center;
  gap: .375rem;
  padding: .375rem .75rem;
  border-radius: var(--radius-md);
  background-color: var(--foreground);
  color: var(--background);
  font-size: .75rem;
  line-height: 1rem;
  pointer-events: none;
  opacity: 0;
  transform: scale(.95);
  transform-origin: bottom center;
  transition: opacity .12s ease, transform .12s ease;
}

.tooltip.is-visible {
  opacity: 1;
  transform: scale(1);
}

.tooltip-arrow {
  position: absolute;
  bottom: -3px;
  left: 50%;
  height: .625rem;
  width: .625rem;
  margin-left: -.3125rem;
  border-radius: 2px;
  background-color: var(--foreground);
  transform: rotate(45deg);
}
