/* =============================================
   LHUGER CALAJATAN — PORTFOLIO
   Layout based on bryllim.com
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #f4f4f2;
  --white:    #ffffff;
  --ink:      #111110;
  --muted:    #111110;
  --light:    #111110;
  --border:   #e4e4df;
  --purple-bg:#EEEDFE; --purple-fg:#3C3489;
  --teal-bg:  #E1F5EE; --teal-fg:  #085041;
  --coral-bg: #FAECE7; --coral-fg: #712B13;
  --pink-bg:  #FBEAF0; --pink-fg:  #72243E;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --r: 12px;
  --t: 0.18s ease;
}

[data-theme="dark"] {
  --bg:       #111110;
  --white:    #1c1c1a;
  --ink:      #f0f0ee;
  --muted:    #f0f0ee;
  --light:    #f0f0ee;
  --border:   #2e2e2c;
  --purple-bg:#2a2850; --purple-fg:#AFA9EC;
  --teal-bg:  #0d2e26; --teal-fg:  #5DCAA5;
  --coral-bg: #2e1a12; --coral-fg: #E8855A;
  --pink-bg:  #2e1520; --pink-fg:  #E87090;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

/* ===== PAGE ===== */
.page {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 1.5rem 1rem 0;
}

/* ===== PROFILE CARD ===== */
.profile-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.25rem 1.5rem 1.25rem;
  margin-bottom: 0.75rem;
  width: 100%;
  box-sizing: border-box;
}

.profile-top {
  display: flex;
  gap: 1rem;
  align-items: stretch;
}

.avatar-wrap {
  flex-shrink: 0;
}

.avatar {
  width: 110px;
  height: 100%;
  min-height: 90px;
  border-radius: 12px;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.profile-info { flex: 1; min-width: 0; }

.profile-name-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.profile-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

.verified { color: #AFA9EC; font-weight: 400; font-size: 13px; }

.top-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.menu-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 7px 3px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  flex-shrink: 0;
  line-height: 1.4;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 7px 3px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.4;
  flex-shrink: 0;
  transition: background var(--t), border-color var(--t);
}
.theme-toggle:hover { background: var(--bg); border-color: #bbb; }

[data-theme="dark"] .btn-hire { background: #f0f0ee; color: #111110; }
[data-theme="dark"] .btn-hire:hover { background: #ffffff; }

[data-theme="dark"] .stack-text-icon[style*="FF3366"] { background: #FF80A0 !important; color: #1a0008 !important; }

.profile-location {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 1px;
}

.profile-roles {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 7px;
}

.award-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  background: var(--purple-bg);
  color: var(--purple-fg);
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
  text-decoration: none;
  transition: opacity var(--t);
}
.award-badge:hover { opacity: 0.8; }

.profile-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.btn-hire {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  transition: background var(--t);
}
.btn-hire:hover { background: #333; }

.btn-ghost {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--ink);
  text-decoration: none;
  background: var(--white);
  transition: background var(--t);
}
.btn-ghost:hover { background: var(--bg); }

.arrow-more {
  font-size: 16px;
  color: var(--muted);
  margin-left: 2px;
}

/* ===== TWO COL ===== */
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 0.75rem;
  align-items: start;
  width: 100%;
}

/* Prevent grid/flex children from blowing out their track */
.col-left,
.col-right,
.section-card,
.profile-info { min-width: 0; }

/* ===== SECTION CARD ===== */
.section-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.25rem 1.4rem;
  margin-bottom: 0.75rem;
}

.sec-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.85rem;
}

.sec-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.sec-title-row .sec-title { margin-bottom: 0; }

.view-all {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}
.view-all:hover { color: var(--ink); }

/* ===== ABOUT ===== */
.about-text p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 0.7rem;
}
.about-text p:last-child { margin-bottom: 0; }
.about-text strong { color: var(--ink); font-weight: 600; }

/* ===== STACK ===== */
.stack-group { margin-bottom: 0.85rem; }
.stack-group:last-child { margin-bottom: 0; }

.stack-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--light);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stack-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 10px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  min-width: 64px;
  cursor: default;
  transition: all var(--t);
}
.stack-item:hover {
  background: var(--white);
  border-color: #bbb;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}
.stack-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
i.stack-icon {
  font-size: 28px;
  line-height: 1;
  display: block;
  width: auto;
  height: auto;
}
.stack-text-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.stack-item span {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}

/* ===== PROJECTS ===== */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.project-tile {
  display: block;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--t), border-color var(--t);
  background: var(--bg);
  overflow: hidden;
}
.project-tile:hover { border-color: #bbb; box-shadow: 0 2px 10px rgba(0,0,0,0.07); }

.project-tile-thumb {
  width: 100%;
  aspect-ratio: 5 / 3;
  overflow: hidden;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}
.project-tile-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  transition: transform 0.3s ease;
}
.project-tile:hover .project-tile-thumb img { transform: scale(1.03); }

.project-tile-name,
.project-tile-desc,
.project-tile-url { padding-left: 12px; padding-right: 12px; }
.project-tile-name { padding-top: 10px; }

.project-tile-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}

.project-tile-desc {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
  line-height: 1.4;
}

.project-tile-url {
  font-size: 11px;
  color: var(--light);
  padding-bottom: 10px;
}

/* ===== CERTIFICATIONS ===== */
.cert-list { display: flex; flex-direction: column; gap: 2px; }

.cert-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background var(--t);
}
.cert-row:last-child { border-bottom: none; }
.cert-row:hover { opacity: 0.75; }

.cert-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.cert-purple { background: var(--purple-bg); color: var(--purple-fg); }
.cert-teal   { background: var(--teal-bg);   color: var(--teal-fg); }
.cert-coral  { background: var(--coral-bg);  color: var(--coral-fg); }
.cert-gray   { background: #f0f0ec;          color: #555; }

.cert-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.cert-issuer { font-size: 12px; color: var(--muted); }

/* ===== BOTTOM ROW ===== */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 1.5rem;
}

.sidebar-extra-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.sidebar-extra-col { min-width: 0; }

.bottom-col-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.bottom-col-item {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
  line-height: 1.4;
}
.bottom-col-item.muted { color: var(--light); }

.bottom-link {
  display: block;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 5px;
  transition: color var(--t);
}
.bottom-link:hover { color: var(--ink); }

.get-in-touch {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink) !important;
  margin-top: 4px;
}

.contact-links { margin-top: 8px; }

.contact-link-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: opacity var(--t);
}
.contact-link-row:hover { opacity: 0.7; }

.social-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  object-fit: contain;
}

.contact-link-label {
  font-size: 11px;
  color: var(--muted);
  min-width: 36px;
}

.contact-link-val {
  font-size: 11px;
  color: var(--ink);
  flex: 1;
}

.arrow { font-size: 12px; color: var(--light); }

/* ===== GALLERY ===== */
.gallery-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.gallery-strip::-webkit-scrollbar { height: 3px; }
.gallery-strip::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.gallery-item {
  width: 110px;
  height: 80px;
  border-radius: 8px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--bg);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ===== EXPERIENCE ===== */
.exp-list {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 20px;
}

/* vertical line */
.exp-list::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border);
}

.exp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: none;
  position: relative;
}

/* dot marker */
.exp-row::before {
  content: '';
  position: absolute;
  left: -19px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--border);
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}

/* filled dot for current */
.exp-row.exp-row-current::before {
  background: var(--ink);
  border-color: var(--ink);
}

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

.exp-role {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.exp-current {
  font-size: 10px;
  font-weight: 600;
  background: #FFF0E0;
  color: #C45A00;
  padding: 1px 6px;
  border-radius: 20px;
  flex-shrink: 0;
}
[data-theme="dark"] .exp-current {
  background: #3a2010;
  color: #f0a060;
}

.exp-company {
  font-size: 11px;
  color: var(--muted);
}

.exp-year {
  font-size: 11px;
  color: var(--light);
  flex-shrink: 0;
}

/* ===== RECOMMENDATIONS ===== */
.rec-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  background: var(--bg);
}

.rec-quote {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 10px;
  font-style: italic;
}

.rec-author {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.rec-role {
  font-size: 11px;
  color: var(--muted);
}

.rec-dots {
  display: flex;
  gap: 5px;
}

.rec-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background var(--t);
}
.rec-dot.active { background: var(--muted); }

/* ===== GRAPHIC DESIGN WORKS ===== */
.gd-category { margin-bottom: 1.1rem; }
.gd-category:last-of-type { margin-bottom: 0; }

.gd-cat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--light);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 7px;
}

.gd-strip {
  overflow: hidden;
  padding: 4px 0 8px;
}
.gd-track {
  display: flex;
  gap: 8px;
  width: max-content;
  animation: gd-scroll 25s linear infinite;
}
.gd-track.reverse {
  animation-direction: reverse;
}
.gd-strip:hover .gd-track {
  animation-play-state: paused;
}
@keyframes gd-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.gd-item {
  flex-shrink: 0;
  width: 130px;
  height: 96px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.gd-item:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  border-color: #bbb;
}
.gd-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gd-ph-icon {
  font-size: 1.5rem;
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
}
.gd-logos     { background: var(--purple-bg); }
.gd-social    { background: var(--teal-bg); }
.gd-posters   { background: var(--coral-bg); }
.gd-stationery{ background: var(--pink-bg); }
.gd-flyers    { background: var(--purple-bg); }

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 2000;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.lightbox.open { opacity: 1; visibility: visible; }

.lightbox-img-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: min(90vw, 800px);
}
.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 10px;
  object-fit: contain;
  display: block;
}
.lightbox-caption {
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  text-align: center;
}
.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 2001;
}
.lightbox-close:hover { background: rgba(255,255,255,0.22); }

.lightbox-nav {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  line-height: 1;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.22); }
.lightbox-nav:disabled { opacity: 0.2; cursor: default; }

/* ===== EMAIL MODAL ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}
.modal {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.5rem;
  width: 100%;
  max-width: 440px;
  transform: translateY(12px);
  transition: transform 0.2s ease;
}
.modal-backdrop.open .modal { transform: translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}
.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.modal-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t);
}
.modal-close:hover { background: var(--bg); }

.modal-form { display: flex; flex-direction: column; gap: 0.85rem; }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.form-group input,
.form-group textarea {
  font-family: var(--font);
  font-size: 13px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  outline: none;
  resize: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: #AFA9EC;
  box-shadow: 0 0 0 3px rgba(175,169,236,0.15);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--light); }

.form-error {
  font-size: 12px;
  color: #e05050;
  min-height: 16px;
}

.btn-send {
  font-size: 13px;
  font-weight: 600;
  padding: 9px 0;
  border-radius: 20px;
  border: none;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  transition: background var(--t);
  margin-top: 2px;
}
.btn-send:hover { background: #333; }
.btn-send:disabled { opacity: 0.65; cursor: default; }
[data-theme="dark"] .btn-send { background: #f0f0ee; color: #111110; }
[data-theme="dark"] .btn-send:hover { background: #fff; }

/* ===== MINI GAME ===== */

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.game-header .sec-title { margin: 0; }

.game-kb-hint {
  font-size: 11px;
  color: var(--muted);
}

.ball-tray {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.throw-ball {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #dff24a, #a8c800 60%, #6a8000);
  box-shadow: 0 2px 5px rgba(0,0,0,0.25), inset 0 -2px 4px rgba(0,0,0,0.15);
  cursor: grab;
  user-select: none;
  animation: ballBounce 1.4s ease-in-out infinite;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.throw-ball.in-game {
  opacity: 0;
  pointer-events: none;
  animation: none;
}

.throw-ball.returning {
  animation: ballReturn 0.5s ease-out forwards;
}

.ball-hint {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

@keyframes ballBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%       { transform: translateY(-7px) rotate(15deg); }
}

@keyframes ballReturn {
  0%   { transform: scale(0.3) rotate(360deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg);     opacity: 1; }
}

.ball-drag-ghost {
  position: fixed;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #dff24a, #a8c800 60%, #6a8000);
  box-shadow: 0 2px 5px rgba(0,0,0,0.25), inset 0 -2px 4px rgba(0,0,0,0.15);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: none;
}

.game-wrap {
  position: relative;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  image-rendering: pixelated;
}

#walkCanvas {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  image-rendering: pixelated;
}

/* D-pad (mobile only) */
.dpad {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  pointer-events: none;
}
@media (hover: none), (max-width: 780px) {
  .dpad { display: flex; pointer-events: auto; }
  .game-kb-hint { display: none; }
}
.dpad-row {
  display: flex;
  align-items: center;
  gap: 3px;
}
.dpad-btn {
  width: 38px;
  height: 38px;
  background: rgba(0,0,0,0.35);
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  color: rgba(255,255,255,0.9);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.dpad-btn:active { background: rgba(255,255,255,0.2); }
.dpad-center { width: 38px; height: 38px; }

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  font-size: 12px;
  color: var(--light);
  padding: 2rem 0 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: 0.75rem;
}

/* ===== RESPONSIVE ===== */

/* Always prevent horizontal blowout */
html, body { overflow-x: hidden; max-width: 100%; }
.page { max-width: min(860px, 100%); }

/* ── Tablet: collapse two-col early ── */
@media (max-width: 780px) {
  /* minmax(0,1fr) not just 1fr — stops max-content children from expanding the track */
  .two-col { grid-template-columns: minmax(0, 1fr); }
}

/* ── Mobile (≤ 600px) ── */
@media (max-width: 600px) {

  /* Base */
  body { font-size: 14px; }
  .page { padding: 0.6rem 0.6rem 0; }

  /* Profile card — stack avatar above info */
  .profile-card { padding: 1rem; }
  .profile-top {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .avatar-wrap { width: 100%; }
  .avatar {
    width: 100%;
    height: 200px;
    min-height: unset;
    border-radius: 10px;
    object-position: center 20%;
  }
  .profile-name { font-size: 18px; line-height: 1.2; }
  .profile-location,
  .profile-roles { font-size: 12px; }
  .profile-actions { gap: 6px; margin-top: 2px; }
  .btn-hire,
  .btn-ghost { font-size: 12px; padding: 7px 14px; }

  /* Layout: single column — minmax(0) prevents max-content blowout */
  .two-col          { grid-template-columns: minmax(0, 1fr); }
  .projects-grid    { grid-template-columns: minmax(0, 1fr); }
  .bottom-row       { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sidebar-extra-row{ grid-template-columns: minmax(0, 1fr); }

  /* Cards */
  .section-card { padding: 1rem; margin-bottom: 0.6rem; border-radius: 10px; }
  .sec-title { font-size: 15px; }

  /* About text */
  .about-text p { font-size: 13px; }

  /* Stack */
  .stack-item { min-width: 58px; padding: 8px 8px 7px; }
  .stack-item span { font-size: 9px; }
  .stack-icon { width: 24px; height: 24px; }
  i.stack-icon { font-size: 24px; }
  .stack-text-icon { width: 24px; height: 24px; font-size: 8px; }

  /* Projects */
  .projects-grid { gap: 0.6rem; }
  .project-tile-name { font-size: 13px; }
  .project-tile-desc,
  .project-tile-url { font-size: 12px; }

  /* GD strips */
  .gd-item { width: 120px; height: 88px; }

  /* Experience & certs */
  .exp-role { font-size: 12px; white-space: normal; }
  .exp-company { font-size: 11px; }
  .exp-year { font-size: 11px; }
  .cert-icon { width: 32px; height: 32px; font-size: 9px; }
  .cert-name { font-size: 12px; }
  .cert-issuer { font-size: 11px; }

  /* Bottom info row & sidebar already set above */

  /* Contact link value — wrap long email/phone */
  .contact-link-val { font-size: 11px; word-break: break-all; }

  /* Recommendations */
  .rec-quote { font-size: 13px; }

  /* Lightbox — bigger tap targets */
  .lightbox { gap: 4px; padding: 0.5rem; }
  .lightbox-nav { width: 44px; height: 44px; font-size: 20px; }
  .lightbox-close { width: 40px; height: 40px; }
  .lightbox-img { max-height: 70vh; }

  /* Email modal — slide up from bottom */
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    padding: 1.25rem 1rem;
    max-height: 90vh;
    overflow-y: auto;
  }

  /* Footer */
  .footer { font-size: 11px; }
}

/* ── Very small screens (≤ 380px, iPhone SE) ── */
@media (max-width: 380px) {
  .profile-name { font-size: 16px; }
  .bottom-row { grid-template-columns: minmax(0, 1fr); }
  .btn-hire,
  .btn-ghost { font-size: 11px; padding: 6px 10px; }
}
