/* ============================================================
   Portfolio — style.css
   Two-column layout on desktop: sticky sidebar + scrollable main
   Edit :root variables to change the colour palette.
   ============================================================ */

:root {
  --bg:       #F9F6F0;
  --paper:    #F9F6F0;
  --ink:      #1A1A1A;
  --ink-soft: #555555;
  --accent:   #000000;
  --accent-2: #333333;
  --line:     #E5E2DB;
  --line-strong: #D1CFC8;
  --shadow:   0 24px 70px rgba(0, 0, 0, 0.06);
  --motion-settle: cubic-bezier(.16,1,.3,1);
  --sidebar-w: clamp(270px, 27vw, 330px);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.8rem;
  overflow-x: hidden;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ── Layout ─────────────────────────────────────────────────── */

.layout {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 3vw, 2.5rem);
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 0 clamp(1.5rem, 3vw, 2.5rem);
  align-items: start;
  width: 100%;
  min-width: 0;
  position: relative;
}

@media (min-width: 901px) {
  .layout {
    padding-top: 2rem;
    height: calc(100vh - 2rem);
    align-items: stretch;
  }
}

/* ── Sidebar ─────────────────────────────────────────────────── */

.sidebar {
  padding: clamp(2rem, 4vw, 2.5rem) clamp(1rem, 2vw, 1.5rem);
  position: sticky;
  top: 0;
  height: auto;
  overflow: visible;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 18px 45px rgba(24, 33, 29, 0.1);
  text-align: center;
  transition: padding 0.25s ease, box-shadow 0.25s ease;
  animation: panelEnter 0.65s cubic-bezier(.2,.8,.2,1) both;
}

.sidebar-body {
  max-height: 1000px;
  opacity: 1;
  transform: translateY(0);
  transition: max-height 0.35s ease, opacity 0.25s ease, transform 0.35s ease;
}

.sidebar-toggle {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  z-index: 2;
  width: 1.8rem;
  height: 1.8rem;
  display: none;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink-soft);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.sidebar-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--line);
}

@media (min-width: 901px) {
  .sidebar {
    width: 100%;
    margin-left: 0;
    height: 100%;
    overflow: visible;
  }
}

.profile-photo {
  width: clamp(150px, 15vw, 190px);
  height: clamp(150px, 15vw, 190px);
  margin: 0 auto 2.4rem;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--ink);
  background: var(--line);
  box-shadow: 0 0 0 2px var(--bg), 0 10px 24px rgba(24, 33, 29, 0.12);
  transition: width 0.25s ease, height 0.25s ease, margin 0.25s ease, transform 0.25s ease;
}

.profile-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transform: scale(1.01);
}

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin: 0 0 0.55rem;
  display: none;
}
.eyebrow::before { content: "// "; color: var(--ink-soft); }

h1 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: clamp(1.9rem, 3vw, 2.65rem);
  line-height: 1.1;
  margin: 0 0 1.35rem;
  letter-spacing: 0;
  text-align: center;
  color: var(--ink);
}

.role {
  max-width: 28ch;
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(0.82rem, 1.2vw, 1rem);
  color: var(--ink-soft);
  margin: 0 auto 2rem;
  line-height: 1.65;
  text-align: center;
}

/* Vertical contact links in sidebar */
.sidebar-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 2rem 0 0;
}

.sidebar-links a {
  color: var(--ink-soft);
  text-decoration: none;
  width: 2.45rem;
  height: 2.45rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg);
  transition: color 0.2s, border-color 0.2s, transform 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-links a:hover {
  border-color: currentColor;
  background: var(--line);
  transform: translateY(-3px);
}

.social-link svg {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  fill: currentColor;
}

.social-github { color: #24292f !important; }
.social-linkedin { color: #0a66c2 !important; }
.social-email { color: #d34b4b !important; }
.social-phone { color: #198754 !important; }

.social-link:hover {
  box-shadow: 0 8px 18px rgba(24, 33, 29, 0.12);
}

/* Resume download button */
.resume-wrapper {
  position: relative;
  margin: 1.75rem 0 0;
}
.sketchy-note {
  position: relative;
  margin: 0 0 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: rotate(6deg);
  pointer-events: none;
}
.sketchy-note span {
  font-family: 'Caveat', cursive;
  font-size: 1.6rem;
  white-space: nowrap;
  color: var(--ink);
  line-height: 1;
}
.sketchy-note svg {
  width: 30px;
  height: 40px;
  margin-top: -2px;
}

.resume-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  width: 100%;
  margin: 0;
  padding: 1rem 1.1rem;
  color: var(--ink);
  background: linear-gradient(135deg, #fffdf8, #f0eadf);
  border: 1px solid #d5cec0;
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  text-align: left;
  text-decoration: none;
  clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 0 100%);
  transition: transform 0.35s var(--motion-settle), border-color 0.25s ease;
}
.resume-btn::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #e8e0d2, #d4c9b7);
  border-left: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}
.resume-card-action {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0;
  padding-top: 0;
  width: 100%;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
}
.resume-download-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 8px;
  color: var(--paper);
  background: var(--ink);
  border-radius: 8px;
  transition: transform 0.35s var(--motion-settle);
}
@media (hover: hover) {
  .resume-btn:hover { border-color: #9c907e; transform: translateY(-2px); }
  .resume-btn:hover .resume-download-icon { transform: translateY(2px); }
}
.resume-btn:active { transform: translateY(1px); }
.resume-btn:focus-visible { clip-path: none; }

/* Skills inside sidebar */
.sidebar-skills {
  display: none;
}

.skill-row {
  margin-bottom: 0.9rem;
}
.skill-row:last-child { margin-bottom: 0; }

.skill-row h4 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin: 0 0 0.25rem;
  font-weight: 500;
}

.skill-row p {
  font-size: 0.87rem;
  color: var(--ink);
  margin: 0;
  line-height: 1.5;
}

.skills-grid {
  /* wrapper kept for backwards compat — layout now inside .skills-table */
}

.skills-table {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.skill-row-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: baseline;
  gap: 1.25rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule, rgba(0,0,0,0.07));
}

.skill-row-item.last {
  border-bottom: none;
  padding-bottom: 0;
}

.skill-category {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-soft);
  font-weight: 600;
  padding-top: 2px;
  flex-shrink: 0;
}

.skill-values {
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* keep old .skill-card in case sidebar still uses it */
.skill-card {
  padding-top: 0;
  min-width: 0;
}

.skill-card h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 0.45rem;
  font-weight: 500;
}

.skill-card p {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.sidebar-location {
  display: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

/* ── Main content area ───────────────────────────────────────── */

@keyframes panelEnter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes contentReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.main {
  padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.5rem) 4rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 18px 45px rgba(24, 33, 29, 0.1);
  min-height: 0;
  min-width: 0;
  animation: panelEnter 0.75s cubic-bezier(.2,.8,.2,1) 80ms both;
}

.main-content { min-width: 0; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

@media (min-width: 901px) {
  .main {
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none;
  }

  .main::-webkit-scrollbar { display: none; }

  .desktop-tabs {
    position: sticky;
    top: calc(-1 * clamp(2rem, 4vw, 3rem));
    z-index: 3;
    justify-content: flex-end;
    margin-top: calc(-1 * clamp(2rem, 4vw, 3rem));
    padding-top: clamp(2rem, 4vw, 3rem);
    background: var(--bg);
  }
}

.desktop-tabs {
  display: flex;
  gap: clamp(1rem, 2.2vw, 1.7rem);
  margin-bottom: 2rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.desktop-tabs::-webkit-scrollbar { display: none; }

.desktop-tab {
  padding: 0 0 0.75rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.76rem;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.desktop-tab:hover,
.desktop-tab.is-active {
  color: var(--accent);
}

.desktop-tab.is-active {
  border-color: transparent;
}

/* ── Sections & Tabs ────────────────────────────────────────── */

.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  width: 44px;
  height: 44px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 8px 22px rgba(23, 32, 27, 0.12);
  transition: all 0.3s;
}

.mobile-menu-toggle span {
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: all 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

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

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.accordion-section {
  margin-top: 0.45rem;
  padding: 0;
  background: transparent;
  overflow: visible;
}

.accordion-section:first-child { margin-top: 0; }

.section-toggle {
  width: 100%;
  margin: 0;
  padding: 0.9rem 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.section-toggle .tag {
  flex-shrink: 0;
  font-size: 0.76rem;
  font-weight: 600;
}
.section-toggle .rule { display: none; }
.section-chevron {
  width: 1.5rem;
  height: 1.5rem;
  display: grid;
  place-items: center;
  flex: 0 0 1.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--accent);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1rem;
  line-height: 1;
  margin-left: auto;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.accordion-section.is-open .section-chevron {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

.section-toggle:hover .section-chevron {
  background: var(--line);
  border-color: var(--accent);
  transform: scale(1.08);
}

.accordion-section.is-open .section-toggle:hover .section-chevron {
  background: var(--accent);
}

.section-content {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.44s cubic-bezier(.22,.68,0,1.01), opacity 0.3s ease, padding-bottom 0.44s cubic-bezier(.22,.68,0,1.01);
}

.section-toggle.section-head {
  margin-bottom: 0;
}

.section-content > * {
  min-height: 0;
  overflow: hidden;
}

/* single wrapper inside OS section so grid 0fr collapse clips correctly */
.os-content-inner {
  min-height: 0;
  overflow: hidden;
}

.accordion-section.is-open .section-content {
  grid-template-rows: 1fr;
  opacity: 1;
  padding-bottom: 1.5rem;
}

@media (min-width: 901px) {
  .accordion-section {
    display: none;
    margin-top: 0;
  }

  .accordion-section.desktop-active {
    display: block;

  }

  .accordion-section .section-toggle {
    display: none;
  }

  .accordion-section .section-content,
  .accordion-section.is-open .section-content {
    grid-template-rows: 1fr;
    opacity: 1;
    padding-bottom: 0;
  }
}

.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.35s cubic-bezier(.2,.8,.2,1) var(--reveal-delay, 0ms),
    transform 0.35s cubic-bezier(.2,.8,.2,1) var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

section:not(.accordion-section) { margin-top: 2rem; }
section:not(.accordion-section):first-child { margin-top: 0; }

.section-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 2.4rem;
}

.accordion-section .section-toggle {
  margin-bottom: 0;
}

.section-head .tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
  line-height: 1;
}

.section-head .rule {
  display: none;
}

p.lede {
  max-width: 58ch;
  color: var(--ink-soft);
  font-size: 1rem;
}

/* ── Entry (experience / project) ────────────────────────────── */

.entry {
  padding: 0 0 clamp(2.8rem, 4vw, 4rem);
  position: relative;
}
.entry:last-child { padding-bottom: 0; }

.entry::before {
  display: none;
}

.entry:not(:last-child)::after {
  display: none;
}

/* LinkedIn-style Experience Layout */
.company-group {
  margin-bottom: 2rem;
}
.company-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.company-logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
}
.company-logo-placeholder {
  width: 48px;
  height: 48px;
}
.company-header-text {
  display: flex;
  flex-direction: column;
}
.company-name {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
}
.role-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--ink);
}
.company-meta, .role-meta {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* Multi-role specific */
.multi-role .roles-list {
  margin-top: 0.5rem;
}
.role-item {
  display: flex;
}
.role-timeline {
  width: 48px;
  margin-right: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-soft);
  margin-top: 6px;
  z-index: 1;
}
.timeline-line {
  width: 2px;
  background: var(--line);
  flex-grow: 1;
  position: absolute;
  top: 14px;
  bottom: -6px;
}
.role-content {
  flex: 1;
  padding-bottom: 1.5rem;
}
.role-item:last-child .role-content {
  padding-bottom: 0;
}

/* Single-role specific */
.single-role .role-title {
  font-size: 1.15rem;
  font-weight: 700;
}
.single-role .company-name {
  font-size: 1.05rem;
  font-weight: 500;
}
.single-role .role-content {
  margin-left: calc(48px + 1rem); /* Align with text */
  margin-top: 0.5rem;
}

/* Fallback entries (for Education/etc if not updated) */
.entry-head {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.entry-head-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.entry-logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.entry-title {
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 600;
  font-size: clamp(1.15rem, 1.7vw, 1.35rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.entry-title .org { color: var(--accent); }

.entry-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.entry ul, .role-content ul {
  margin: 0;
  padding-left: 1.1rem;
}
.entry li, .role-content li {
  margin-bottom: 0.45rem;
  color: var(--ink-soft);
  font-size: 0.96rem;
  max-width: 70ch;
}
.entry li:last-child, .role-content li:last-child { margin-bottom: 0; }
.entry li b, .role-content li b { color: var(--ink); font-weight: 600; }

.entry .stack, .role-content .stack {
  margin-top: 0.7rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent);
  overflow-wrap: anywhere;
}

.entry .project-link { margin-top: 0.7rem; }
.entry .project-link a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
  margin-right: 1rem;
  overflow-wrap: anywhere;
}
.entry .project-link a:hover { border-color: var(--accent); }
.entry .project-link a::after { content: " →"; }

.role-link {
  display: inline-block;
  margin-top: 0.7rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
  overflow-wrap: anywhere;
}
.role-link:hover { border-color: var(--accent); }
.role-link::after { content: " →"; }

/* ── Project cards ──────────────────────────────────────────── */

#personal-projects,
#client-projects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.project-card {
  display: grid;
  grid-template-rows: auto 1fr;
  align-self: stretch;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(44, 37, 30, 0.1);
  border-radius: 8px;
  background: #f6e8df;
  box-shadow: 0 5px 0 rgba(44, 37, 30, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}
.project-card:hover {
  transform: translateY(-4px) rotate(-0.4deg);
  box-shadow: 0 10px 0 rgba(44, 37, 30, 0.08);
}
.project-card:nth-child(3n + 2) { background: #e6f0e8; }
.project-card:nth-child(3n + 3) { background: #eee7f1; }

.project-card .entry-img,
.project-mark {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  margin: 0;
}
.project-card .entry-img {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.28);
}
.project-card .entry-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.project-mark {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.28);
  color: var(--accent);
}
.project-mark img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.project-mark span {
  position: relative;
  font-family: 'Caveat', cursive;
  font-size: 4.5rem;
  font-weight: 600;
}
.project-card-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0.55rem 0.8rem 0.65rem;
}
.project-card-kind {
  margin: 0 0 0.2rem;
  color: var(--ink-soft);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.project-card-role {
  margin: 0 0 0.15rem;
  color: var(--ink-soft);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
}
.project-card .entry-title { display: block; font-size: 1.1rem; }
.project-card .entry-desc {
  display: -webkit-box;
  max-width: 62ch;
  margin: 0.3rem 0 0;
  overflow: hidden;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.project-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem 1rem;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(44, 37, 30, 0.12);
}
.project-card-actions a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.58rem;
  border: 1px solid var(--ink);
  border-radius: 5px;
  background: var(--ink);
  color: var(--paper);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  text-decoration: none;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.project-card-actions a:hover,
.project-card-actions a:focus-visible {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--paper);
  outline: none;
}
.project-card-actions a span {
  font-size: 0.8rem;
  line-height: 1;
}
.project-card-actions .action-npm {
  padding: 0.18rem 0.3rem;
  background: transparent;
  border-color: transparent;
}
.project-card-actions .action-npm:hover,
.project-card-actions .action-npm:focus-visible {
  background: transparent;
  border-color: transparent;
}
.project-card-actions .action-npm img {
  display: block;
  height: 18px;
  width: auto;
}
.project-card-details {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1rem;
  color: var(--ink);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  text-decoration: none;
  margin-top: 1rem;
}
.project-card-details:hover { color: var(--accent); }

/* ── Project detail pages ──────────────────────────────────── */

.project-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

.project-back {
  display: inline-block;
  margin-bottom: 3rem;
  color: var(--ink-soft);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  text-decoration: none;
}
.project-back:hover { color: var(--accent); }

.project-hero {
  max-width: 760px;
  margin-bottom: 3rem;
}
.project-hero .eyebrow { margin-bottom: 0.75rem; }
.project-hero h1 {
  max-width: 15ch;
  margin: 0 0 1rem;
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 500;
  line-height: 0.98;
}
.project-lede {
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.7;
}
.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  margin-top: 1.5rem;
  color: var(--accent);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
}
.project-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(180px, 0.65fr);
  gap: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.project-detail h2 {
  margin: 0 0 1rem;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.65rem;
  font-weight: 500;
}
.project-detail p,
.project-detail li {
  color: var(--ink-soft);
  line-height: 1.7;
}
.project-detail ul { padding-left: 1.1rem; }
.project-detail li { margin-bottom: 0.55rem; }
.project-detail-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
}
.project-detail-links a {
  color: var(--accent);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  text-decoration: none;
}
.project-detail-links a:hover { text-decoration: underline; }

@media (max-width: 680px) {
  #personal-projects,
  #client-projects { grid-template-columns: 1fr; }
  .project-card .entry-img,
  .project-mark { height: auto; }
  .project-page { padding: 2rem 1.25rem 3rem; }
  .project-back { margin-bottom: 2.5rem; }
  .project-detail-grid { grid-template-columns: 1fr; gap: 2rem; }
}

@media (min-width: 681px) and (max-width: 1050px) {
  #personal-projects,
  #client-projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Project image ───────────────────────────────────────────── */

.entry-img {
  margin: 1rem 0 0.85rem;
  overflow: hidden;
  background: transparent;
  transform: translateZ(0);
}

.entry-img img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: contain;
  transition: opacity 0.2s, transform 0.45s cubic-bezier(.2,.8,.2,1);
}

.entry-img:hover img { transform: scale(1.025); }

.entry-desc {
  color: var(--ink-soft);
  font-size: 0.93rem;
  margin: 0.25rem 0 0.6rem;
}

.os-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Open Source items — match experience card style ── */
.os-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule, rgba(0,0,0,0.07));
}

.os-item:first-child { padding-top: 0; }
.os-item:last-child  { border-bottom: none; }

/* Logo square — identical sizing to .company-logo */
.os-logo-wrap {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.os-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--rule, rgba(0,0,0,0.08));
  background: #fff;
  padding: 4px;
}

.os-logo-conference {
  object-fit: cover;
  object-position: left center;
  padding: 0;
}

.os-logo-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.os-body {
  flex: 1;
  min-width: 0;
}

.os-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}

.os-repo {
  color: var(--accent);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.95rem;
  text-decoration: none;
  font-weight: 700;
}

.os-repo:hover { text-decoration: underline; }

.os-desc {
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.5;
}

.merged {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: fit-content;
  padding: 3px 9px 3px 8px;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  border-radius: 20px;
  color: #fff;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 1px 4px rgba(124, 58, 237, 0.35);
}

/* Tiny git-merge icon inside the badge */
.merged::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  background-color: rgba(255,255,255,0.85);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0-2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM6 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0-2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0-2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM7 8v8M17 18c0-3.866-3.582-7-8-7'/%3E%3C/svg%3E");
  mask-repeat: no-repeat;
  mask-size: contain;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0-2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM6 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0-2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0-2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM7 8v8M17 18c0-3.866-3.582-7-8-7'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
}

.os-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 1.25rem;
  padding: 0.7rem 1rem;
  color: var(--paper);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.os-link::after { content: " →"; }
.os-link:hover {
  text-decoration: none;
  transform: translateY(-2px);
  background: var(--accent-2);
  box-shadow: 0 9px 20px rgba(0, 0, 0, 0.18);
}

.os-link:focus-visible {
  outline: 3px solid var(--line-strong);
  outline-offset: 3px;
}

#os-link-wrapper {
  display: flex;
  justify-content: flex-end;
}

/* ── Loading state ───────────────────────────────────────────── */

.loading-msg {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  color: var(--ink-soft);
  padding-left: 1.3rem;
}

/* ── OS link ─────────────────────────────────────────────────── */

/* ── Footer ──────────────────────────────────────────────────── */

footer {
  padding: 1.5rem 2rem;
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

::selection {
  color: var(--paper);
  background: var(--accent);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 4px;
}

code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.86em;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.08);
  padding: 0.12em 0.35em;
  border-radius: 2px;
}

/* ── Responsive: compose for each screen, not just shrink ────── */

@media (max-width: 900px) {
  .desktop-tabs {
    display: none;
  }

  .mobile-menu-toggle {
    display: none;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 1.5rem clamp(1.2rem, 4vw, 2rem);
    gap: 0;
    max-width: 100%;
  }

  .sidebar {
    position: relative;
    width: 100%;
    margin: 0 0 1.5rem;
    padding: 1.75rem 1.25rem 1.5rem;
    border-radius: 22px;
  }

  .sidebar-toggle {
    display: grid;
  }

  .profile-photo {
    width: 116px;
    height: 116px;
    margin: 0 auto 1.2rem;
    border-radius: 50%;
  }

  .sidebar.is-collapsed .profile-photo {
    width: 76px;
    height: 76px;
  }

  h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  .role {
    max-width: 34ch;
    font-size: 0.85rem;
    line-height: 1.55;
    margin: 0 auto 1.25rem;
  }

  .sidebar-links {
    margin: 1.25rem 0 0;
    gap: 0.5rem;
  }

  .sidebar-links a {
    width: 2.2rem;
    height: 2.2rem;
  }

  .sidebar-links svg {
    width: 1rem;
    height: 1rem;
  }


  .main {
    padding: 1.5rem;
    border-radius: 22px;
    min-height: auto;
  }
}

@media (max-width: 1080px) {
  :root { --sidebar-w: 280px; }

  .layout {
    gap: 0 2rem;
  }

  .main {
    padding-left: 2rem;
  }
}

@media (max-width: 680px) {
  .layout {
    padding: 1rem 1rem 0;
    max-width: 620px;
  }

  .sidebar {
    padding: 1.5rem 1rem 1.35rem;
  }

  .profile-photo {
    width: 104px;
    height: 104px;
  }

  .sidebar.is-collapsed .profile-photo {
    width: 76px;
    height: 76px;
  }

  h1 {
    font-size: clamp(1.45rem, 6.6vw, 1.9rem);
  }

  .eyebrow {
    font-size: 0.66rem;
    line-height: 1.4;
  }

  .role {
    font-size: 0.82rem;
    line-height: 1.55;
    margin-bottom: 1rem;
  }

  .sidebar-links {
    gap: 0.45rem;
    margin-top: 1rem;
  }

  .sidebar-links a {
    width: 2.25rem;
    height: 2.25rem;
  }


  .sidebar-skills {
    display: none;
  }

  .skill-row h4 {
    font-size: 0.62rem;
  }

  .skill-row p {
    font-size: 0.8rem;
    line-height: 1.38;
  }

  .sidebar-location {
    font-size: 0.7rem;
    margin-top: 0.75rem;
  }

  .main {
    padding-top: 0;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .section-head {
    margin-bottom: 1.4rem;
  }

  .section-head .tag {
    font-size: 0.7rem;
  }

  .entry {
    padding: 0 0 1.8rem;
  }

  .entry::before {
    display: none;
  }

  .entry-title {
    font-size: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
  }

  .entry-meta {
    font-size: 0.7rem;
    white-space: normal;
  }

  .entry li {
    font-size: 0.9rem;
  }

  .entry .stack {
    font-size: 0.7rem;
  }

  .entry .project-link a {
    font-size: 0.72rem;
  }

  .os-item {
    flex-direction: row;       /* keep logo + body side-by-side */
    align-items: flex-start;
    gap: 0.65rem;
  }

  .os-logo-wrap {
    width: 36px;
    height: 36px;
    margin-top: 2px;           /* align with first line of text */
  }

  .os-logo {
    width: 36px;
    height: 36px;
  }

  .os-logo-placeholder {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }

  .os-header {
    flex-wrap: nowrap;         /* keep repo name + badge on one line */
    align-items: center;
    gap: 0.4rem;
  }

  .os-repo {
    font-size: 0.88rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .os-desc {
    font-size: 0.82rem;
  }

  .skills-grid { /* no-op on mobile */ }

  .skill-row-item {
    grid-template-columns: 110px 1fr;
    gap: 0.75rem;
    padding: 0.75rem 0;
  }

  .skill-category {
    font-size: 0.68rem;
  }

  .skill-values {
    font-size: 0.88rem;
  }

  .skill-card {
    padding-top: 0;
  }

  footer {
    padding: 1.2rem 1.1rem;
    font-size: 0.7rem;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 15px;
  }

  .layout {
    padding: 1rem 1.2rem 0;
  }

  .sidebar {
    padding: 1.25rem 0.9rem 1.35rem;
  }

  .profile-photo {
    width: 82px;
    height: 82px;
  }

  .sidebar.is-collapsed .profile-photo {
    width: 68px;
    height: 68px;
  }

  h1 {
    font-size: clamp(1.32rem, 6.2vw, 1.58rem);
    margin-bottom: 0.4rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  .role {
    font-size: 0.8rem;
    margin-bottom: 0.65rem;
  }

  .sidebar-links {
    gap: 0.45rem 0.75rem;
  }


  .sidebar-skills {
    grid-template-columns: 1fr;
  }

  .sidebar-location {
    display: none;
  }

  .main {
    padding-top: 1.5rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .entry {
    padding: 0 0 1.6rem;
  }

  .entry::before {
    display: none;
  }

  .entry-head {
    flex-direction: row;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .entry-logo {
    width: 40px;
    height: 40px;
  }

  .entry-title {
    font-size: 0.95rem;
    line-height: 1.35;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
  }

  .entry-meta {
    font-size: 0.68rem;
  }

  .entry ul {
    padding-left: 1rem;
    margin-top: 0.6rem;
  }

  .entry li {
    font-size: 0.88rem;
    margin-bottom: 0.4rem;
  }

  .entry-img {
    margin: 1rem -0.5rem 0.85rem;
    border-radius: 10px;
  }

  footer {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
    font-size: 0.68rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Keep each interaction on one animation timeline. Geometry is measured by
   the profile toggle; competing size transitions would give it stale bounds. */
@media (max-width: 900px) {
  .sidebar { transition: box-shadow 0.25s ease; }
  .profile-photo { transition: transform 0.25s ease; }
  .sidebar-body { transition: none; }
  .section-content { overflow: hidden; overflow-anchor: none; }
  .section-content .reveal { transition: none; }
}

@media (min-width: 901px) {
  .accordion-section .reveal { opacity: 1; transform: none; transition: none; }
}

/* The indicator tracks selection immediately while the panel settles in. */
.desktop-tabs { position: relative; }
@media (min-width: 901px) {
  .desktop-tabs { position: sticky; }
}
.tab-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 1px;
  height: 2px;
  background: var(--accent);
  transform-origin: left center;
  pointer-events: none;
  transition: transform 0.5s var(--motion-settle);
}
.desktop-tab { transition: color 0.25s ease, transform 0.4s var(--motion-settle); }
.desktop-tab:active { transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) {
  .tab-indicator, .desktop-tab { transition: none; }
}

.profile-details {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows 0.44s cubic-bezier(.22,.68,0,1.01), opacity 0.3s ease;
}
.profile-details-inner { min-height: 0; overflow: hidden; }
.sidebar.is-collapsed .profile-details { grid-template-rows: 0fr; opacity: 0; }
@media (max-width: 900px) {
  .sidebar.is-collapsed .profile-photo { width: 116px; height: 116px; }
}
@media (max-width: 680px) {
  .sidebar.is-collapsed .profile-photo { width: 104px; height: 104px; }
}
@media (max-width: 480px) {
  .sidebar.is-collapsed .profile-photo { width: 82px; height: 82px; }
}
@media (min-width: 901px) {
  .panel-stage { display: grid; isolation: isolate; }
  .panel-stage > .accordion-section { grid-area: 1 / 1; align-self: start; min-width: 0; }
  .panel-stage > .is-leaving { display: block; pointer-events: none; }
  .panel-stage > .desktop-active { z-index: 1; }
  .main { overflow-anchor: none; }
}
.reveal { opacity: 1; transform: none; transition: none; }

/* Match the content panel to the profile's natural height on desktop. */
@media (min-width: 901px) {
  .layout { height: auto; min-height: 0; align-items: start; }
  .sidebar { position: relative; top: auto; height: auto; }
  .main { height: var(--profile-panel-height, auto); min-height: 0; overflow-y: auto; }
  .desktop-tabs { top: calc(-1 * clamp(2rem, 4vw, 3rem)); }
}
#profile-name {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  font-size: clamp(1.25rem, 1.85vw, 1.65rem);
  letter-spacing: -0.035em;
}
@media (max-width: 900px) {
  #profile-name { font-size: clamp(1.25rem, 5vw, 1.8rem); }
}

/* Quiet placeholders reserve space without exposing content-source details. */
.content-placeholder {
  height: 5rem;
  width: 100%;
  max-width: 32rem;
  background:
    linear-gradient(var(--line), var(--line)) 0 0 / 55% 0.75rem no-repeat,
    linear-gradient(var(--line), var(--line)) 0 1.75rem / 100% 0.55rem no-repeat,
    linear-gradient(var(--line), var(--line)) 0 3rem / 80% 0.55rem no-repeat;
  opacity: 0.65;
}
.contact-placeholder {
  display: block;
  width: 11.6rem;
  height: 2.45rem;
  background: radial-gradient(circle closest-side, var(--line) 95%, transparent) left center / 25% 100% repeat-x;
  opacity: 0.65;
}

@media (max-width: 680px) {
  .resume-btn {
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    padding: 0.65rem 1.5rem 0.65rem 0.8rem;
  }
  .resume-card-action {
    gap: 0.55rem;
    font-size: 0.72rem;
  }
  .resume-download-icon {
    width: 28px;
    height: 28px;
    padding: 6px;
    border-radius: 6px;
  }
}
