/* ═══════════════════════════════════════════════
   TABLET  (≤ 860px)
   ═══════════════════════════════════════════════ */
@media (max-width: 860px) {
  #about .about-grid {
    grid-template-columns: 1fr;
  }
}


/* ═══════════════════════════════════════════════
   MOBILE  (≤ 700px)
   ═══════════════════════════════════════════════ */
@media (max-width: 700px) {

  :root {
    --nav-width: 0px;
  }

  .side-nav {
    display: none;
  }

  .main {
    margin-left: 0;
    padding-top: 56px;
  }

  /* ── Sections ── */
  section {
    padding: 44px 20px 52px;
    min-height: 100svh;
  }

  section + section::before {
    left: 20px;
    right: 20px;
  }

  .section-inner {
    max-width: 100%;
  }

  .section-label {
    font-size: 10px;
    letter-spacing: 0.28em;
    margin-bottom: 30px;
  }

  .scroll-indicator { bottom: 20px; }
  .copyright { bottom: 12px; right: 20px; font-size: 9px; }


  /* ════════════════════════════
     MOBILE TOP BAR
  ════════════════════════════ */
  .mobile-topbar {
    display: flex !important;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: rgba(17,17,17,0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--card-border);
    z-index: 500;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
  }

  .topbar-name {
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
  }

  /* ── Dropdown trigger ── */
  .mobile-nav-dropdown {
    position: relative;
  }

  .dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 7px 13px;
    cursor: pointer;
    color: var(--fg);
    font-family: 'Work Sans', sans-serif;
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
  }

  .dropdown-trigger:hover,
  .dropdown-trigger.open {
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.22);
  }

  .dropdown-trigger .chevron {
    width: 10px;
    height: 10px;
    opacity: 0.6;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    flex-shrink: 0;
  }

  .dropdown-trigger.open .chevron {
    transform: rotate(180deg);
  }

  /* ── Dropdown menu ── */
  .dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    background: rgba(20,20,20,0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.4,0,0.2,1);
    z-index: 600;
  }

  .dropdown-menu.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
  }

  .dropdown-menu a {
    display: block;
    padding: 13px 18px;
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid var(--card-border);
    transition: background 0.15s, color 0.15s;
  }

  .dropdown-menu a:last-child {
    border-bottom: none;
  }

  .dropdown-menu a.active {
    color: var(--accent);
    background: rgba(255,255,255,0.05);
  }

  .dropdown-menu a:hover {
    background: rgba(255,255,255,0.07);
    color: var(--fg);
  }


  /* ════════════════════════════
     HOME / HERO
  ════════════════════════════ */
  .hero-top {
    flex-direction: column;
    align-items: center;        /* ← was flex-start */
    text-align: center;
    gap: 20px;
    margin-bottom: 24px;
  }

  .profile-image img {
    width: 90px;
    height: 90px;
  }

  #home .hero-label {
    font-size: 10px;
    letter-spacing: 0.22em;
    margin-bottom: 6px;
  }

  #home h1 {
    font-size: clamp(32px, 9vw, 46px);
    margin-bottom: 14px;
  }

  .hero-titles { 
    gap: 7px; 
    align-items: center;
  }

  .hero-title-pill {
    flex-wrap: wrap;
    justify-content: center; 
    gap: 5px;
  }

  .hero-title-pill .pill-role { font-size: 12px; }
  .hero-title-pill .pill-sep  { font-size: 11px; }
  .hero-title-pill .pill-org  { font-size: 11px; }

  .home-skills {
    margin-top: 22px;
    padding-top: 20px;
  }

  .home-skills-row { gap: 7px; justify-content: center;}

  .skill-chip {
    font-size: 10px;
    padding: 3px 10px;
    letter-spacing: 0.06em;
  }


  /* ════════════════════════════
     ABOUT
  ════════════════════════════ */

  /* Show a compact horizontal layout for photo + heading */
  #about .about-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  /* Restore photo but as a small portrait strip */
  #about .about-photo {
    display: flex;
    width: 100%;
    height: 200px;
    aspect-ratio: unset;
    border-radius: 8px;
  }

  #about .about-text { gap: 20px; align-items: center;}

  #about .about-text h2 {
    text-align: center;
    font-size: 24px;
    line-height: 1.2;
  }

  #about .about-bio p {
    font-size: 13px;
    line-height: 1.85;
  }

  #about .about-bio p + p { margin-top: 10px; }

  .hobbies-block.hobbies-full {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
  }

  #about .hobbies-label {
    text-align: center;
    font-size: 10px;
    letter-spacing: 0.22em;
    margin-bottom: 12px;
  }


  /* ════════════════════════════
     PROJECTS
  ════════════════════════════ */
  .projects-list { gap: 14px; }



  .project-card.active {
    border-color: rgba(255,255,255,0.22);
  }

  /* Keep hover alive */
  .project-card:hover {
    transform: translateY(-2px) !important;
  }

  .project-card.active:hover {
    transform: translateY(-2px) !important;
  }

  /* Fixed preview height — no expand on focus */
  .project-preview,
  .project-card.active .project-preview {
    height: 120px !important;
    transition: none;
  }

  .project-preview img {
    filter: blur(0px) brightness(0.85) !important;
    opacity: 85% !important;
  }

  .project-card:hover .project-preview img {
    transform: scale(1.02);
  }

  .project-body {
    padding: 14px 16px;
    gap: 12px;
  }

  .project-body .card-icon {
    width: 30px;
    height: 30px;
  }

  .project-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .project-info-left h3 {
    font-size: 15px;
    letter-spacing: 0.01em;
  }

  .project-tags { gap: 5px; }

  .project-info .project-date {
    font-size: 11px;
    letter-spacing: 0.03em;
    margin-left: 0;
  }

  .project-read-more { display: none; }

  /* ── Expanded panel (mobile) ── */
  .project-card-wrap:has(.project-card.is-expanded) {
    margin-left: 0;
    margin-right: 0;
  }

  .expand-toolbar {
    padding: 14px 16px;
  }

  .expand-minimize-btn {
    font-size: 11px;
    letter-spacing: 0.12em;
  }

  .expand-minimize-btn svg {
    width: 11px;
    height: 11px;
  }

  .expand-github-btn {
    font-size: 10px;
    letter-spacing: 0.1em;
    padding: 6px 12px;
    gap: 7px;
  }

  .expand-github-btn svg {
    width: 13px;
    height: 13px;
  }

  .expand-body {
    padding: 22px 16px 28px;
    gap: 24px;
  }

  .expand-section h4 {
    font-size: 10px;
    letter-spacing: 0.18em;
  }

  .expand-section p {
    font-size: 13px;
    line-height: 1.8;
  }

  .expand-section p + p {
    margin-top: 14px;
  }

  .expand-media-row,
  .expand-media-row.media-wide {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .expand-figure figcaption {
    font-size: 11px;
  }

  .expand-figure.full-width img {
    max-height: 200px;
  }
  /* ════════════════════════════
     EXPERIENCE
  ════════════════════════════ */
  .experience-entries { gap: 14px; }

  .experience-card,
  .experience-card.img-right {
    flex-direction: column;
    min-height: unset;
  }


  .experience-card.active {
    border-color: rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.05);
  }

  .exp-photo {
    width: 100%;
    height: 130px;
    border-right: none !important;
    border-left: none !important;
    border-bottom: 1px solid var(--card-border);
    order: 0 !important;
    flex-shrink: unset;
  }

  .exp-card-body {
    order: 1 !important;
    padding: 16px 16px 20px;
  }

  .exp-header {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    align-items: flex-start;
    justify-content: space-between;
  }

  .exp-header-left { gap: 10px; }

  .exp-icon { width: 32px; height: 32px; }

  .exp-title-group .exp-role   { font-size: 12px; }
  .exp-title-group .exp-company { font-size: 11px; }

  .exp-header-right .exp-date { font-size: 11px; }
  .exp-header-right .exp-type { font-size: 10px; }

  .exp-card-body ul { gap: 7px; margin-top: 4px; }
  .exp-card-body ul li { font-size: 12px; line-height: 1.75; }


  /* ════════════════════════════
     EDUCATION
  ════════════════════════════ */
  .education-entries { gap: 12px; }

  .education-entry {
    padding: 18px 16px;
    gap: 14px;
  }

  .education-entry.active {
    border-color: rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.05);
  }

  .edu-icon { width: 32px; height: 32px; }

  .education-entry .edu-degree { font-size: 14px; }
  .education-entry .edu-school { font-size: 12px; }
  .education-entry .edu-period { font-size: 11px; }


  /* ════════════════════════════
     CONTACT
  ════════════════════════════ */
  .contact-cards { gap: 12px; }

  .contact-card {
    max-width: 100%;
    padding: 18px 16px;
    gap: 16px;
  }

  .contact-card:hover {
    transform: scale(1.03);
  }

  .contact-card .card-icon   { width: 24px; height: 24px; }
  .contact-card .contact-text { font-size: 13px; }

}
/* end @media 700px */

@media (max-width: 700px) {
  .project-card.active {
    transform: scale(1.03);
  }

  .experience-card.active {
    transform: scale(1.03);
  }

  .education-entry.active {
    transform: scale(1.03);
  }

  #exp-photo-opticent {
    height: 200px;
  }

  #exp-photo-opticent img {
    object-position: center 20%;
  }
}