/*
 * Flute of the Soul — the Mac shell
 * ---------------------------------
 * Turns the page into a real macOS desktop: wallpaper, menu bar, Finder
 * sidebar, dock, and windows that read like actual applications. The palette
 * comes from soul.css — warm white paper with the peacock feather's teal and
 * temple gold as accents.
 *
 * Load order matters: styles.css → soul.css → mac-app.css → boot.css.
 *
 * The existing markup uses Tailwind 2 light utilities (bg-white, text-gray-*).
 * Rewriting every occurrence would touch thousands of lines, so the
 * "Tailwind reconciliation" block near the bottom retunes those utilities to
 * this palette. That is the one place !important is justified here.
 */

/* ------------------------------------------------------------- foundation */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  min-height: 100dvh;
}

/* The desktop: warm white with two soft feather-coloured blooms. Fixed, so
   windows scroll over it the way real wallpaper sits still. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(
      50% 40% at 14% 6%,
      rgba(27, 156, 147, 0.1),
      transparent 68%
    ),
    radial-gradient(
      44% 38% at 88% 4%,
      rgba(192, 138, 46, 0.09),
      transparent 68%
    ),
    var(--paper);
}

::selection {
  background: rgba(27, 156, 147, 0.24);
  color: var(--ink);
}

/* Focus is always visible — non-negotiable. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ----------------------------------------------------------- the menu bar */
.mac-menu-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: 30px;
  padding: 0 0.9rem;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--hairline);
  font-size: 13px;
  color: var(--ink-soft);
}

.mac-menu-apple {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 14.5px;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.mac-menu-items {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.menu-link {
  padding: 0.15rem 0.55rem;
  border-radius: 5px;
  color: var(--ink-soft);
  font-size: 13px;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.menu-link:hover,
.menu-link.active {
  background: rgba(15, 122, 110, 0.1);
  color: var(--peacock);
}

/* ------------------------------------------------------ the Finder sidebar */
/* Mobile only. On desktop the menu bar and the dock are the navigation, and
   the content gets the full width of the desktop. */
.sidebar {
  position: fixed;
  top: 52px;
  bottom: 0;
  left: 0;
  height: auto;
  width: min(82vw, 280px);
  z-index: 800;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  padding-top: 0.5rem;
  padding-bottom: 6rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(28px);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  border-right: 1px solid var(--hairline);
}

/* The "FAVORITES" heading. */
.sidebar > .p-4 {
  font-family: var(--font-mono) !important;
  font-size: 10px !important;
  letter-spacing: 0.2em;
  color: var(--ink-faint) !important;
  padding: 0.85rem 1rem 0.4rem !important;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 1px 0.5rem;
  padding: 0.42rem 0.6rem;
  border-radius: 7px;
  color: var(--ink-soft);
  font-size: 14px;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-link:hover {
  background: rgba(22, 24, 29, 0.05);
  color: var(--ink);
}

.sidebar-link.active {
  background: rgba(15, 122, 110, 0.11);
  color: var(--peacock);
  font-weight: 500;
}

.sidebar-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: var(--peacock);
}

.sidebar-link.active .sidebar-icon {
  color: var(--gold);
}

/* ------------------------------------------------------------ the workspace */
.content-wrapper {
  margin-left: 0;
  padding: calc(30px + 1.5rem) clamp(0.75rem, 3vw, 2.5rem) 7.5rem;
  min-height: 100vh;
}

/* Desktop: no sidebar, no hamburger — the menu bar and dock navigate. */
@media (min-width: 901px) {
  .sidebar {
    top: 30px;
  }

  .sidebar,
  .hamburger-menu {
    display: none;
  }
}

/* --------------------------------------------------------------- a window */
.mac-window {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(30px);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* Unified titlebar. Traffic lights only colour up on hover, like real macOS
   inactive windows do not. */
.section-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  height: 44px;
  padding: 0 0.9rem;
  background: rgba(242, 239, 233, 0.82);
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

/* Centre the window title the way macOS does. */
.section-header > div:not(.window-controls) {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: 60%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.window-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1;
}

.window-control {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(22, 24, 29, 0.16);
  transition: background-color 0.2s ease;
}

.mac-window:hover .control-close {
  background: #ff5f57;
}

.mac-window:hover .control-minimize {
  background: #febc2e;
}

.mac-window:hover .control-maximize {
  background: #28c840;
}

.section-content {
  padding: clamp(1.25rem, 3vw, 2.25rem);
  color: var(--ink-soft);
}

/* -------------------------------------------------------------- the dock */
.mac-dock {
  position: fixed;
  bottom: 0.85rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 850;
  display: flex;
  align-items: flex-end;
  gap: 0.15rem;
  padding: 0.45rem 0.6rem;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(26px);
  -webkit-backdrop-filter: saturate(180%) blur(26px);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  max-width: calc(100vw - 1.5rem);
  /* No overflow clipping: it would cut off the magnified icons and the
     tooltips, which is exactly what made the hover look broken. */
  overflow: visible;
}

.dock-item {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: none;
  border-radius: 11px;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  transform-origin: bottom center;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.2s ease;
}

/* The hovered icon lifts above its neighbours instead of colliding with them. */
.dock-item:hover,
.dock-item:focus-visible {
  z-index: 3;
  color: var(--peacock);
}

.dock-item svg {
  width: 23px;
  height: 23px;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}



/* Dock label — a floating chip above the icon, with a small pointer. */
.dock-item::before {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 14px);
  z-index: 2;
  padding: 0.35em 0.7em;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-md);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 4px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

/* the pointer */
.dock-item::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  z-index: 2;
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.94);
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  opacity: 0;
  transform: translate(-50%, 4px) rotate(45deg);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.dock-item:hover::before {
  opacity: 1;
  transform: translate(-50%, 0);
}

.dock-item:hover::after {
  opacity: 1;
  transform: translate(-50%, 0) rotate(45deg);
}

/* The running-app dot has to move clear of the label's pointer. */
.dock-item.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  top: auto;
  width: 4px;
  height: 4px;
  border: none;
  border-radius: 50%;
  background: var(--peacock);
  opacity: 1;
  transform: translateX(-50%);
}

.dock-item.active:hover::after {
  /* while hovering, the label pointer takes over */
  background: rgba(255, 255, 255, 0.94);
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  width: 8px;
  height: 8px;
  bottom: calc(100% + 9px);
  transform: translate(-50%, 0) rotate(45deg);
}

/* --------------------------------------------------- desktop icon grid */
.mac-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.5rem;
}

.mac-folder-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 0.4rem;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.mac-folder-item:hover {
  background: rgba(15, 122, 110, 0.08);
  border-color: var(--hairline);
}

.mac-folder-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(22, 24, 29, 0.16));
}

.mac-folder-label {
  font-size: 12px;
  line-height: 1.3;
  color: var(--ink-soft);
  word-break: break-word;
}

/* ----------------------------------------------------- About, as an app */
/* Reads like Contacts/System Settings: a portrait plate, then grouped rows. */
.mac-profile-header {
  display: grid;
  place-items: center;
  padding: clamp(1.75rem, 5vw, 3rem) 1rem 0;
  background: radial-gradient(
    60% 80% at 50% 0%,
    rgba(27, 156, 147, 0.1),
    transparent 70%
  );
}

.mac-profile-avatar {
  width: clamp(96px, 18vw, 132px);
  height: clamp(96px, 18vw, 132px);
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--hairline-gold);
  box-shadow: 0 0 0 6px rgba(27, 156, 147, 0.09), var(--shadow-lg);
  background: var(--paper-raised);
}

.mac-profile-info {
  padding: clamp(1.25rem, 3vw, 2rem) clamp(1.25rem, 4vw, 2.75rem)
    clamp(1.75rem, 4vw, 2.5rem);
  text-align: center;
}

.mac-profile-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0.75rem 0 0;
}

.mac-profile-title {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1rem;
}

.profile-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--peacock);
  padding: 0.35em 0.75em;
  border: 1px solid rgba(15, 122, 110, 0.26);
  border-radius: 999px;
  background: rgba(15, 122, 110, 0.06);
}

.mac-profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
  gap: 1px;
  margin: clamp(1.5rem, 4vw, 2.25rem) auto 0;
  max-width: 30rem;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  overflow: hidden;
}

.stat-item {
  background: var(--paper-raised);
  padding: 1rem 0.5rem;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin-top: 0.2em;
}

.mac-profile-bio {
  font-size: 1rem;
  line-height: 1.68;
  color: var(--ink-soft);
  max-width: 44rem;
  margin: clamp(1.5rem, 4vw, 2rem) auto 0;
  text-align: left;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 550;
  padding: 0.75em 1.4em;
  border: none;
  border-radius: 999px;
  background: var(--peacock);
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.download-btn:hover {
  background: var(--peacock-deep);
  transform: translateY(-1px);
}

/* ------------------------------------------------------- shared components */
.project-grid,
.skill-grid,
.gallery {
  display: grid;
  gap: 0.85rem;
}

.project-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
}

.skill-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 8rem), 1fr));
}

.gallery {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
}

.project-item,
.skill-item,
.certificate-item,
.timeline-content,
.contact-info {
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 11px;
  transition: border-color 0.2s ease, transform 0.2s ease,
    background-color 0.2s ease;
}

.project-item {
  padding: 1.1rem;
  cursor: pointer;
}

.project-item:hover,
.certificate-item:hover,
.skill-item:hover {
  border-color: var(--hairline-gold);
  background: rgba(242, 239, 233, 0.82);
  transform: translateY(-2px);
}

.project-title,
.skill-name,
.certificate-title {
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 550;
  color: var(--ink);
}

.skill-item {
  padding: 1rem 0.5rem;
  text-align: center;
}

.skill-icon {
  width: 34px;
  height: 34px;
  margin: 0 auto 0.55rem;
  transition: transform 0.2s ease;
}

.skill-item:hover .skill-icon {
  transform: translateY(-3px) scale(1.06);
}

.certificate-item {
  overflow: hidden;
}

.certificate-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--paper-raised);
}

.certificate-title {
  padding: 0.75rem 0.85rem;
}

/* Timeline — a real chronology, so the rail earns its place. */
.timeline {
  position: relative;
  padding: 0.5rem 0;
}

.timeline::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 9px;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent,
    var(--hairline-gold) 12%,
    var(--hairline-gold) 88%,
    transparent
  );
}

.timeline-item {
  position: relative;
  width: 100%;
  padding: 0 0 1.1rem 2.4rem;
}

.timeline-item::after {
  content: "";
  position: absolute;
  top: 1.15rem;
  left: 4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--peacock);
  z-index: 1;
}

.timeline-item:hover::after {
  background: var(--gold);
  border-color: var(--gold);
}

.timeline-content {
  padding: 1.1rem 1.25rem;
}

.timeline-content h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.12rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.timeline-content ul {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* Journey tabs — segmented control. */
.journey-tab {
  font-family: var(--font-ui);
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.45em 1em !important;
  border: 1px solid var(--hairline) !important;
  border-radius: 8px !important;
  background: var(--paper-sunk) !important;
  color: var(--ink-soft) !important;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease,
    border-color 0.16s ease;
}

.journey-tab:hover {
  color: var(--ink) !important;
  border-color: var(--hairline-gold) !important;
}

.journey-tab.active {
  background: var(--peacock) !important;
  border-color: var(--peacock) !important;
  color: #04120f !important;
}

/* Terminal — Krishna's flute has holes; a prompt has a cursor. */
.terminal {
  color: rgba(255, 255, 255, 0.86);
  background: #1b1e26;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  overflow: hidden;
}

.terminal-header {
  background: #262a34;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 0.5rem 0.85rem;
}

.terminal-user {
  color: var(--peacock);
}

.terminal-path {
  color: var(--gold);
}

.terminal-output {
  color: rgba(255, 255, 255, 0.72);
}

/* Forms */
.form-input,
.form-textarea {
  width: 100%;
  background: var(--paper-sunk);
  border: 1px solid var(--hairline);
  border-radius: 9px;
  padding: 0.7em 0.9em;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--ink-faint);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--peacock);
  box-shadow: 0 0 0 3px rgba(15, 122, 110, 0.15);
}

.submit-btn,
.github-button {
  font-family: var(--font-ui);
  font-weight: 550;
  border-radius: 999px;
  background: var(--peacock);
  color: #ffffff;
  border: none;
  padding: 0.7em 1.35em;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.submit-btn:hover,
.github-button:hover {
  background: var(--peacock-deep);
  transform: translateY(-1px);
}

/* Modals */
.modal-overlay,
.project-detail-modal,
.certificate-modal {
  background: rgba(22, 24, 29, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.resume-frame {
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--paper-raised);
}

/* Blog cards inside the Blogs window */
#blog-list > a {
  display: block;
  height: 100%;
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 11px;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

#blog-list > a:hover {
  border-color: var(--hairline-gold);
  transform: translateY(-2px);
}

.blog-sidebar-link {
  color: var(--ink-soft) !important;
  border-radius: 7px;
}

.blog-sidebar-link:hover {
  background: rgba(15, 122, 110, 0.09) !important;
  color: var(--ink) !important;
}

/* ------------------------------------------ Tailwind 2 reconciliation ---- */
/* The markup predates this theme and assumes a light surface. Rather than
   rewrite every utility in index.html, retune them for the dark shell. */
.content-wrapper .bg-white,
.content-wrapper .bg-gray-50,
.content-wrapper .bg-gray-100 {
  background-color: var(--paper-raised) !important;
}

.content-wrapper .bg-gray-200 {
  background-color: var(--paper-sunk) !important;
}

.content-wrapper .text-gray-900,
.content-wrapper .text-gray-800,
.content-wrapper .text-black {
  color: var(--ink) !important;
}

.content-wrapper .text-gray-700,
.content-wrapper .text-gray-600 {
  color: var(--ink-soft) !important;
}

.content-wrapper .text-gray-500,
.content-wrapper .text-gray-400 {
  color: var(--ink-faint) !important;
}

.content-wrapper .border,
.content-wrapper .border-b,
.content-wrapper .border-t,
.content-wrapper .border-gray-200,
.content-wrapper .border-gray-300 {
  border-color: var(--hairline) !important;
}

.content-wrapper .text-blue-500,
.content-wrapper .text-blue-600 {
  color: var(--peacock) !important;
}

.content-wrapper .bg-blue-500,
.content-wrapper .bg-blue-600 {
  background-color: var(--peacock) !important;
  color: #04120f !important;
}

.content-wrapper .shadow,
.content-wrapper .shadow-md,
.content-wrapper .shadow-lg {
  box-shadow: var(--shadow-md) !important;
}

/* The résumé PDF mock stays light — it is a printed document, not chrome. */
.pdf-page {
  background: #ffffff !important;
  color: #1a1a1a !important;
  border-radius: 8px;
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.pdf-page * {
  color: inherit !important;
  border-color: rgba(0, 0, 0, 0.16) !important;
}

.pdf-page .text-gray-600 {
  color: #555 !important;
}

/* ------------------------------------------------------------- responsive */
/* Touch targets, an off-canvas Finder sidebar, and a dock that stays usable
   on a phone. Everything below 900px is treated as touch-first. */
@media (max-width: 900px) {
  .content-wrapper {
    padding: calc(52px + 1rem) 0.75rem 4.5rem;
  }

  .sidebar.active {
    transform: translateX(0);
    box-shadow: 0 0 60px rgba(22, 24, 29, 0.2);
  }

  .sidebar-link {
    padding: 0.7rem 0.75rem;
    font-size: 15px;
  }

  .hamburger-menu {
    position: fixed;
    top: 7px;
    left: 0.75rem;
    right: auto;
    bottom: auto;
    margin: 0;
    z-index: 950;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 38px;
    height: 38px;
    padding: 0 9px;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    /* White glass with dark bars, matching the menu bar it sits under. */
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    box-shadow: var(--shadow-md);
    cursor: pointer;
  }

  .hamburger-menu span {
    display: block;
    height: 1.5px;
    width: 100%;
    background: var(--ink);
    border-radius: 2px;
    transition: transform 0.22s ease, opacity 0.22s ease;
  }

  .hamburger-menu.active span:nth-child(1) {
    transform: translateY(5.5px) rotate(45deg);
  }

  .hamburger-menu.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger-menu.active span:nth-child(3) {
    transform: translateY(-5.5px) rotate(-45deg);
  }

  /* The menu bar IS the header on mobile: taller, with the hamburger sitting
     inside it and the wordmark beside it. Its links move to the sidebar. */
  .mac-menu-bar {
    height: 52px;
    padding: 0 0.75rem;
    gap: 0.65rem;
  }

  .mac-menu-items {
    display: none;
  }

  .mac-menu-apple {
    margin-left: 3.1rem;
    font-size: 15px;
  }

  .logo-mark--menu {
    width: 28px;
    height: 15px;
  }

  .mac-window {
    border-radius: 12px;
  }

  .section-header {
    height: 40px;
  }

  /* Titles overlap traffic lights on narrow windows — left-align instead. */
  .section-header > div:not(.window-controls) {
    position: static;
    left: auto;
    transform: none;
    max-width: none;
    font-size: 12.5px;
  }

  .mac-folder-grid {
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  }

  .mac-profile-bio {
    font-size: 0.95rem;
  }

  /* The sidebar is the navigation on mobile, so the dock would only be a
     second copy of it competing for thumb space. */
  .mac-dock {
    display: none;
  }

  .timeline-item {
    padding-left: 2.1rem;
  }
}

@media (max-width: 520px) {
  body::after {
    opacity: 0.28;
    width: 78vw;
  }

  .section-content {
    padding: 1rem 0.9rem;
  }

  .mac-profile-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .stat-value {
    font-size: 1.2rem;
  }

  .mac-dock {
    bottom: 0.5rem;
    gap: 0.3rem;
    padding: 0.4rem 0.5rem;
    border-radius: 15px;
  }
}

/* Fine pointers only: hover lift on cards can feel sticky on touch. */
@media (hover: none) {
  .project-item:hover,
  .certificate-item:hover,
  .skill-item:hover,
  .soul-card:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------- remaining Tailwind holdouts */
/*
 * The social buttons still carried per-brand fills (LinkedIn blue, GitHub
 * near-black, Instagram pink, Kaggle grey). Five different brand colours in
 * one row fought the palette, so they become one quiet set that answers in
 * peacock on hover. The glyphs keep their own shapes, so nothing is lost.
 */
.content-wrapper .bg-blue-600,
.content-wrapper .bg-blue-700,
.content-wrapper .bg-gray-600,
.content-wrapper .bg-gray-700,
.content-wrapper .bg-gray-800,
.content-wrapper .bg-gray-900,
.content-wrapper .bg-pink-500,
.content-wrapper .bg-pink-600 {
  background-color: var(--paper-sunk) !important;
  color: var(--ink-soft) !important;
  border: 1px solid var(--hairline);
  transition: background-color 0.18s ease, color 0.18s ease,
    transform 0.18s ease, border-color 0.18s ease;
}

.content-wrapper a.bg-blue-600:hover,
.content-wrapper a.bg-gray-800:hover,
.content-wrapper a.bg-gray-600:hover,
.content-wrapper a.bg-pink-500:hover {
  background-color: var(--peacock) !important;
  color: #ffffff !important;
  border-color: var(--peacock);
  transform: translateY(-2px);
}

/* text-white only ever sat on those fills, so it must follow them. */
.content-wrapper .bg-blue-600.text-white,
.content-wrapper .bg-gray-800.text-white,
.content-wrapper .bg-gray-600.text-white,
.content-wrapper .bg-pink-500.text-white {
  color: var(--ink-soft) !important;
}

.content-wrapper a.bg-blue-600.text-white:hover,
.content-wrapper a.bg-gray-800.text-white:hover,
.content-wrapper a.bg-gray-600.text-white:hover,
.content-wrapper a.bg-pink-500.text-white:hover {
  color: #ffffff !important;
}

/* The résumé viewer chrome. */
.pdf-content {
  background-color: var(--paper-sunk) !important;
}

.pdf-status-bar {
  background: var(--peacock) !important;
  color: #ffffff !important;
}

/* The blog reader's split pane. */
#blog-reader .bg-white,
#blog-reader .border-gray-200 {
  background-color: var(--paper-raised) !important;
  border-color: var(--hairline) !important;
}

/* The menu-bar clock sits at the far right, as it does on a Mac. */
.menu-clock {
  margin-left: auto;
  font-family: var(--font-ui);
  font-size: 12.5px;
  color: var(--ink-soft);
  white-space: nowrap;
}

@media (max-width: 520px) {
  .menu-clock {
    display: none;
  }
}

/* ------------------------------------------------------------ the timeline */
/*
 * The original timeline was a two-column layout: items 50% wide, the right
 * column pushed across with left: 50%. This theme stacks them in a single
 * column against one rail, so those offsets have to be cleared — otherwise
 * every "right" item is shoved half a page across and overflows the window.
 */
.timeline-item,
.timeline-left,
.timeline-right {
  position: relative;
  left: auto;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.timeline-left::after,
.timeline-right::after {
  left: 4px;
  right: auto;
}

/* Long unbroken strings (URLs, IDs) must not push the card wider. */
.timeline-content {
  min-width: 0;
  overflow-wrap: anywhere;
}

.timeline-content ul {
  padding-left: 1.1rem;
  margin: 0.5rem 0 0;
}

.timeline-content li {
  list-style: disc;
}

/* Contact fields, explicitly: a light well with dark text and a peacock ring. */
.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--ink-faint);
  opacity: 1;
}

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

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

.contact-info {
  padding: 1rem 1.1rem;
}

.contact-item {
  gap: 0.65rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.contact-icon {
  color: var(--peacock);
  flex-shrink: 0;
  margin-right: 0 !important;
}
