:root {
  --dock-bg: rgba(40, 40, 44, 0.55);
  --label-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  --cream: #f7f1ea; /* HUES / Waywood brand cream */
  --blue-brand: #4c6ab5; /* Waywood text-blue-brand */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #1a1a1a;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Background portrait ---------- */
.bg {
  position: fixed;
  inset: 0;
  background: url("./assets/bg.jpg") center / cover no-repeat;
  /* slight scale crops the framing and keeps bare edges out of view */
  transform: scale(1.06);
  transform-origin: center;
  z-index: 0;
}

/* Subtle darkening at edges so white captions/dock stay legible */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 35%, transparent 45%, rgba(0, 0, 0, 0.35) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.18) 0%, transparent 25%, transparent 70%, rgba(0, 0, 0, 0.4) 100%);
}

/* ---------- Floating files ---------- */
.desktop {
  position: fixed;
  inset: 0;
  z-index: 2;
}

.file {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: grab;
  touch-action: none; /* claim pointer gestures so dragging isn't hijacked into scroll */
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none; /* stop the browser's native anchor/image drag */
}

/* While a card is being dragged: lift it above siblings and follow the cursor 1:1.
   will-change only here so idle cards don't each hold a permanent compositor layer. */
.file.dragging {
  cursor: grabbing;
  z-index: 20;
  transform: translate(-50%, -50%) scale(1.06);
  will-change: transform;
}

.file.dragging .thumb {
  box-shadow:
    0 26px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

/* Base tile chrome. Each .thumb-* class supplies its own background. */
.thumb {
  width: 104px;
  height: 104px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.35s ease;
}

/* Waywood card: the Traction Sprint "frost-cool" blue gradient (blue-brand mixed
   into cream) so it blends with the muted backdrop. Icon in brand blue. */
.thumb-waywood {
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--blue-brand) 10%, var(--cream)) 0%,
    color-mix(in oklab, var(--blue-brand) 28%, var(--cream)) 100%
  );
}

.thumb-icon {
  width: 38px;
  height: 38px;
  color: var(--blue-brand);
  filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.5));
}

/* widget tool card: the radar element, sized down to sit centered like the atlas
   orb. Tile colour matches the image's grey field (#ababab) for a seamless blend. */
.thumb-widget {
  background: #ababab url("./assets/widget-radar.png") center / 66px no-repeat;
}

/* atlas card: cream glassy tile holding the HUES gradient orb. */
.thumb-atlas {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.12)),
    var(--cream);
}

.atlas-orb {
  width: 50px;
  height: 50px;
  overflow: visible;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.14));
}

/* Substack card: the real Uncommon Sense brand icon. */
.thumb-substack {
  background: url("./assets/uncommon-sense-icon.jpg") center / cover no-repeat;
}

.caption {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  text-shadow: var(--label-shadow);
  white-space: nowrap;
  padding: 3px 12px;
  border-radius: 9px;
  background: transparent;
  transition: background 0.18s ease;
}

/* Hover = macOS Finder selection: a translucent backing behind the icon
   and a solid blue pill behind the label. No "lift" — matches the reference. */
.file::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 124px;
  height: 124px;
  transform: translateX(-50%);
  border-radius: 26px;
  background: rgba(150, 150, 150, 0.32);
  opacity: 0;
  transition: opacity 0.18s ease;
  z-index: -1;
  pointer-events: none;
}

/* Hover: subtle gray selection backing + white label (matches the live reference). */
.file:hover::before,
.file:active::before { opacity: 1; }

.file:hover .thumb { transform: scale(1.03); }

/* Press/active: the label flips to the macOS blue selection pill (reference Image #4). */
.file:active .caption {
  background: #0a84ff; /* macOS system accent blue */
  text-shadow: none;
}

/* ---------- Dock ---------- */
.dock {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: 26px;
  background: var(--dock-bg);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.dock-item {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  /* normalize so the profile <button> matches the anchor items exactly */
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
              background 0.25s ease;
}

.dock-item svg { width: 27px; height: 27px; }

.dock-item:hover {
  transform: translateY(-8px) scale(1.12);
  background: rgba(255, 255, 255, 0.16);
}

.dock-profile { padding: 0; overflow: hidden; background: #ebfec0; }
/* keep the green tile on hover so the circular logo's corners stay filled
   (otherwise the generic .dock-item:hover background exposes the bare circle) */
.dock-profile:hover { background: #ebfec0; }
.dock-profile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dock-sep {
  width: 1px;
  height: 38px;
  margin: 0 5px;
  background: rgba(255, 255, 255, 0.25);
}

/* Tooltip on hover */
.dock-item[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  background: rgba(20, 20, 22, 0.85);
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.dock-item[data-tip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- About me window (macOS Notes style) ---------- */
.about-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: about-fade 0.18s ease;
}
.about-overlay[hidden] { display: none; }

.about-window {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  animation: about-pop 0.22s cubic-bezier(0.2, 0.9, 0.25, 1);
}

.about-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}
.tl { width: 13px; height: 13px; border-radius: 50%; border: none; padding: 0; }
.tl-close { background: #ff5f57; cursor: pointer; }
.tl-min { background: #febc2e; }
.tl-zoom { background: #28c840; }

.about-content { padding: 26px 30px 30px; overflow-y: auto; }

.about-title {
  margin: 0 0 22px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #111;
}

.about-top { display: flex; gap: 22px; align-items: flex-start; }

.about-photo {
  width: 150px;
  height: 150px;
  flex: none;
  object-fit: cover;
  object-position: center 22%;
  border-radius: 14px;
  filter: grayscale(1) contrast(1.04);
}

.about-meta { flex: 1; margin: 6px 0 0; }
.meta-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 10px 2px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.meta-row:first-child { padding-top: 0; }
.about-meta dt {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #111;
  min-width: 76px;
}
.about-meta dd { margin: 0; font-size: 16px; color: #6b6b6b; }
.about-meta dd a { color: #2b8aff; text-decoration: none; }
.about-meta dd a:hover { text-decoration: underline; }

.about-bio {
  margin-top: 22px;
  padding: 20px 22px;
  background: #f0f0f1;
  border-radius: 14px;
}
.about-bio p { margin: 0 0 14px; font-size: 16px; line-height: 1.5; color: #1a1a1a; }
.about-bio p:last-child { margin-bottom: 0; }
.about-bio a { color: #2b8aff; text-decoration: none; }
.about-bio a:hover { text-decoration: underline; }
.about-bio-kicker { color: #6b6b6b; font-style: italic; }

@keyframes about-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes about-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Responsive: collapse the scattered desktop into a tidy grid ---------- */
@media (max-width: 720px) {
  .desktop {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: center;
    justify-items: center;
    gap: 44px 8px;
    padding: 72px 20px 150px; /* leave clearance for the dock */
  }

  /* Cards join the grid flow: no absolute positioning, no dragging. */
  .file {
    position: static;
    transform: none;
    cursor: pointer;
    touch-action: auto;
  }

  .thumb { width: 84px; height: 84px; border-radius: 19px; }
  .caption { font-size: 13px; }

  .dock { bottom: 20px; }
  .dock-item { width: 48px; height: 48px; }
  .dock-item svg { width: 23px; height: 23px; }

  .about-content { padding: 22px; }
  .about-title { font-size: 26px; }
  .about-top { flex-direction: column; gap: 16px; align-items: center; }
  .about-photo { width: 130px; height: 130px; }
  .about-meta { width: 100%; }
}
