:root {
  --ink:    #111;
  --bg:     #fff;
  --muted:  #f0f0f0;
  --radius: 10px;
  --pill:   40px;
  --font:   -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --max-w:  760px;
  --pad-x:  40px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img  { display: block; max-width: 100%; }
ul   { list-style: none; }
a    { color: inherit; text-decoration: none; }

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── NAV ─────────────────────────────────────── */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px var(--pad-x);
}
.logo                  { font-size: 28px; font-weight: 900; letter-spacing: -1.2px; line-height: 1; }
.logo:hover            { opacity: .7; }
.nav-links             { display: flex; gap: 26px; }
.nav-links a           { font-size: 15px; }
.nav-links a:hover     { text-decoration: underline; text-underline-offset: 3px; }

/* ── PAGE SHELL ──────────────────────────────── */
main {
  flex: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px var(--pad-x) 100px;
}

/* ── PAGE HEADING ────────────────────────────── */
.page-heading {
  font-size: 44px;
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1;
  margin-bottom: 32px;
}

/* ── ABOUT ───────────────────────────────────── */
.about-layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start; 
  gap: 0px;
}
 
.about-body { flex: 1; min-width: 0; }
.about-name              { font-weight: 700; margin-bottom: 16px; }
.about-bio p             { margin-bottom: 14px; }
.about-bio p:last-child  { margin-bottom: 0; }
.about-bio a             { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
 
.about-photo {
  flex-shrink: 0;
  position: relative;
  width: 275px; 
  aspect-ratio: 3 / 5; 
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg); 
}

.about-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 57%; 
}

/* Photo-swap keyframes */
@keyframes photo-a {
  0%,  49.9% { opacity: 1; }
  50%, 100%  { opacity: 0; }
}
@keyframes photo-b {
  0%,  49.9% { opacity: 0; }
  50%, 100%  { opacity: 1; }
}
 
.about-photo .photo-1 { animation: photo-a 1s linear infinite; }
.about-photo .photo-2 { animation: photo-b 1s linear infinite; }
 
/* Social pill */
.social-footer { 
  margin-top: 30px; 
  display: flex; 
  justify-content: center; 
}
.social-pill { 
  display: inline-flex; 
  gap: 22px; 
  background: var(--muted); 
  border-radius: var(--pill); 
  padding: 10px 26px; 
}
.social-pill a:hover { 
  text-decoration: underline; 
  text-underline-offset: 3px; 
}

/* ═══════════════════════════════════════════════
   EXPERIENCE
   ═══════════════════════════════════════════════ */
.job-list { display: flex; flex-direction: column; gap: 40px; }

.job {
  display: flex;
  align-items: flex-start;
  gap: 28px;
}

.job-text              { flex: 1; min-width: 0; }
.job-company           { font-weight: 700; margin-bottom: 1px; }
.job-location          { font-style: italic; font-size: 14px; }
.job-dates             { font-style: italic; font-size: 14px; margin-bottom: 8px; }
.job-desc              { font-size: 15px; line-height: 1.6; }
.job-desc a            { text-decoration: underline; text-underline-offset: 2px; }

/* ── STICKER LOGO ────────────────────────────── */

.job-logo {
  flex-shrink: 0;
  display: block;
  width: 84px;
  height: 84px;
  border-radius: 5px;
  overflow: hidden;
  transform: rotate(-4deg);
  transform-origin: center center;
  box-shadow: 0 0 0 0 var(--ink);
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: scale 0.25s ease-out; 
}

.job:nth-child(even) .job-logo { transform: rotate(4deg); }

.job-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
  padding: 9px;
}

.job-logo--dark img {
  background: transparent;
  padding: 0;
}

.job:nth-child(odd):hover .job-logo { scale: 1.15; }
.job:nth-child(even):hover .job-logo { scale: 1.15; }
.job:nth-child(odd) .job-logo:active { scale: 1.15; }
.job:nth-child(even) .job-logo:active { scale: 1.15; }

/* ═══════════════════════════════════════════════
   PROJECTS
   ═══════════════════════════════════════════════ */
.projects-title {
  font-size: 44px; font-weight: 900; letter-spacing: -2px;
  text-align: center; margin-bottom: 22px;
}
.filter-bar              { display: flex; justify-content: center; margin-bottom: 28px; }
.filter-pills            { display: inline-flex; background: var(--muted); border-radius: var(--pill); padding: 4px; gap: 2px; }
.filter-pills a {
  display: inline-block; width: 72px; text-align: center;
  padding: 7px 0; border-radius: var(--pill); font-size: 14px;
  cursor: pointer; transition: background .15s, color .15s; user-select: none;
}
.filter-pills a:hover:not(.active) { background: rgba(0,0,0,.07); }
.filter-pills a.active             { background: var(--ink); color: var(--bg); }

/* ── Grid ────────────────────────────────────── */
.projects-grid { 
  columns: 3; 
  column-gap: 10px; 
}

.project-card {
  display: block; 
  break-inside: avoid; 
  margin-bottom: 10px;
  border-radius: var(--radius); 
  overflow: hidden; 
  cursor: pointer;
  outline: none; 
  border: none; 
  -webkit-tap-highlight-color: transparent;
}

.project-card img {
  width: 100%; 
  height: auto; 
  display: block;
  transform: scale(1.03); 
  transition: opacity .18s ease, transform .18s ease;
}

.project-card:hover img { 
  opacity: .85; 
  transform: scale(1.05); 
}
.project-card[hidden] { display: none; }

/* ── Modals (Compact Smartphone Size) ──────── */
.modal {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.6); 
  padding: 20px;
  align-items: center; 
  justify-content: center;
}
.modal.is-open { display: flex; }

.modal-box { 
  background: var(--bg); 
  border-radius: 16px; 
  
  width: 100%; 
  max-width: 400px; 
  height: auto; 
  max-height: 90vh; 
  
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.modal-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  flex-shrink: 0;
  overflow: hidden; 
}

.modal-img img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  display: block; 
  transform: scale(1.05);
}

.modal-body { 
  padding: 24px; 
  overflow-y: auto;
}

.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,.4); color: #fff; font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none; z-index: 10;
}
.modal-close:hover { background: rgba(0,0,0,.65); }

.modal-title { 
  font-family: var(--font);
  font-size: 18px; 
  font-weight: 700; 
  letter-spacing: -.3px; 
  margin-bottom: 12px; 
  color: var(--ink);
}

.modal-tags { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 8px; 
  margin-bottom: 16px; 
}

.modal-tag { 
  background: var(--muted);
  border: none; 
  border-radius: var(--pill); 
  padding: 4px 14px; 
  font-size: 13px; 
  font-family: var(--font); 
  color: var(--ink);
  cursor: pointer;
  transition: background .15s ease;
}

.modal-tag:hover {
  background: rgba(0,0,0,.1); 
}

.modal-desc { 
  font-family: var(--font);
  font-size: 15px; 
  line-height: 1.6; 
  color: #444; 
}

.modal-links {
  font-family: var(--font);
  font-size: 15px;
}

/* ═══════════════════════════════════════════════
   GLOBAL RESPONSIVE / MOBILE
   ═══════════════════════════════════════════════ */
@media (max-width: 680px) {
  :root                  { --pad-x: 20px; }
  .logo                  { font-size: 22px; }
  .nav-links             { gap: 14px; }
  .nav-links a           { font-size: 13px; }
  .page-heading          { font-size: 34px; letter-spacing: -1px; margin-bottom: 22px; }
  .projects-title        { font-size: 34px; letter-spacing: -1px; }
  .projects-grid         { columns: 1; }
  
  /* Experience specific overrides */
  .job                   { gap: 18px; }
  .job-logo              { width: 66px; height: 66px; }

  /* About section layout on mobile */
  .about-layout { 
    flex-direction: column; 
    align-items: center; 
    gap: 32px; 
  }
  
  .about-body { display: contents; }
  .about-name, .about-bio { width: 100%; }
  
  .about-photo {
    order: 3; 
    align-self: center; 
    width: 100%;
    max-width: 240px; 
    aspect-ratio: 3 / 4;
  }
  
  .social-footer {
    order: 4; 
    margin-top: 0 !important; 
  }
}

@media (min-width: 681px) and (max-width: 960px) {
  .projects-grid { columns: 2; }
}