/* ============================================================
   CR7 VFX — Premium Mobile Redesign v3
   Target: 360px · 375px · 390px · 414px · 430px · 768px
   Style Reference: Linear · Vercel · Stripe · Apple · Raycast
   ============================================================ */

/* ── MOBILE TOKENS ──────────────────────────────────────────── */
:root {
  /* Mobile-specific spacing */
  --mob-pad:        20px;
  --mob-pad-lg:     24px;
  --mob-radius:     18px;
  --mob-radius-lg:  24px;
  --mob-radius-sm:  12px;

  /* Mobile typography */
  --mob-h1:         clamp(46px, 13vw, 68px);
  --mob-h2:         clamp(28px, 7.5vw, 42px);
  --mob-h3:         clamp(18px, 5vw, 24px);
  --mob-body:       15px;
  --mob-body-sm:    13px;
  --mob-label:      11px;

  /* Touch targets */
  --mob-touch:      52px;
  --mob-touch-lg:   56px;

  /* Bottom nav height */
  --bottom-nav-h:   72px;
}


/* ============================================================
   SECTION 1: TOPBAR — Compact, Premium Mobile Header
   ============================================================ */

@media (max-width: 768px) {
  .topbar {
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    background: rgba(3, 5, 14, 0.88);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  .nav {
    height: 64px;
    padding: 0;
    gap: 0;
  }

  /* Brand compact */
  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .brand-text {
    font-size: 18px;
  }

  /* Hide desktop nav — show bottom nav instead */
  .nav-links {
    display: none !important;
  }

  /* Hide hamburger — we use bottom nav */
  .menu-button {
    display: none !important;
  }
}


/* ============================================================
   SECTION 2: BOTTOM NAVIGATION — Premium iOS-style
   ============================================================ */

/* Bottom Nav Container */
.bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    background: rgba(4, 6, 18, 0.92);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px));
    height: var(--bottom-nav-h);
    align-items: stretch;
    /* Subtle top glow */
    box-shadow:
      0 -1px 0 rgba(0, 229, 255, 0.06),
      0 -20px 40px rgba(0, 0, 0, 0.5);
    /* Smooth hide/show transition */
    transition:
      transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
      opacity 0.3s ease;
  }

  .bn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.40);
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 6px 4px;
    border-radius: 14px;
    margin: 2px 3px;
    transition:
      color 0.2s ease,
      background 0.2s ease,
      transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
    -webkit-tap-highlight-color: transparent;
    position: relative;
    min-width: 0;
  }

  .bn-item:active {
    transform: scale(0.88);
  }

  .bn-item.active {
    color: var(--cyan);
  }

  /* Active indicator pill */
  .bn-item.active::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--cyan);
    border-radius: 0 0 2px 2px;
    box-shadow: 0 0 8px var(--cyan);
    animation: bn-indicator 0.25s ease;
  }

  @keyframes bn-indicator {
    from { width: 0; opacity: 0; }
    to   { width: 20px; opacity: 1; }
  }

  .bn-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .bn-item.active .bn-icon {
    transform: scale(1.15);
    color: var(--cyan);
    filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.7));
  }

  /* Special CTA item — Hire Me */
  .bn-item-cta {
    position: relative;
  }

  .bn-item-cta .bn-icon-wrap {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan) 0%, var(--violet) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
      0 4px 0 rgba(0, 80, 120, 0.8),
      0 0 20px rgba(0, 229, 255, 0.40);
    transition:
      transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1),
      box-shadow 0.15s ease;
    margin-bottom: -2px;
  }

  .bn-item-cta:active .bn-icon-wrap {
    transform: scale(0.88) translateY(3px);
    box-shadow:
      0 1px 0 rgba(0, 80, 120, 0.8),
      0 0 10px rgba(0, 229, 255, 0.25);
  }

  .bn-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
    white-space: nowrap;
  }

  .bn-item-cta .bn-label {
    color: var(--cyan);
    font-weight: 700;
    font-size: 9.5px;
  }

  /* Ensure main content doesn't hide behind bottom nav */
  body {
    padding-bottom: var(--bottom-nav-h);
  }

  /* Music button position adjust */
  .music-btn {
    bottom: calc(var(--bottom-nav-h) + 16px);
    right: 16px;
    width: 44px;
    height: 44px;
  }
}


/* ============================================================
   SECTION 3: PAGE SHELL & LAYOUT
   ============================================================ */

@media (max-width: 768px) {
  .page-shell {
    width: calc(100% - 40px);
    max-width: 100%;
    margin: 0 auto;
  }
}

@media (max-width: 430px) {
  .page-shell {
    width: calc(100% - 32px);
  }
}

@media (max-width: 360px) {
  .page-shell {
    width: calc(100% - 28px);
  }
}


/* ============================================================
   SECTION 4: HERO — Mobile Premium Layout
   ============================================================ */

@media (max-width: 768px) {
  .hero {
    min-height: 100dvh;
    min-height: -webkit-fill-available;
  }

  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 96px 0 36px;
    position: relative;
  }

  /* VFX card on top, centered */
  .hero-right {
    order: -1;
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
  }

  .showcase-card {
    width: min(88%, 340px);
    animation: float-slow 7s ease-in-out infinite;
  }

  .sc-gif {
    height: 220px;
    border-radius: calc(var(--radius-lg) - 3px);
  }

  .hero-left {
    width: 100%;
  }

  /* Badge */
  .hero-badge {
    font-size: 10px;
    padding: 8px 14px;
    gap: 8px;
    margin-bottom: 20px;
  }

  /* Title */
  .hero-title {
    font-size: var(--mob-h1);
    line-height: 0.86;
    letter-spacing: -0.065em;
    margin-bottom: 4px;
  }

  .ht-studio {
    font-size: clamp(16px, 4.5vw, 22px);
    margin-top: 10px;
    color: var(--text-muted);
    letter-spacing: -0.01em;
  }

  /* Tagline */
  .hero-tagline {
    font-size: 14.5px;
    line-height: 1.7;
    margin-bottom: 28px;
    max-width: 100%;
    color: var(--text-2);
  }

  /* Actions — full-width, stacked */
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 36px;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    height: var(--mob-touch-lg);
    justify-content: center;
    font-size: 13.5px;
  }

  /* Stats — compact row */
  .hero-stats {
    gap: 0;
    width: 100%;
    justify-content: space-between;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--mob-radius);
    backdrop-filter: blur(16px);
  }

  .hs-item {
    text-align: center;
    flex: 1;
  }

  .hs-item strong {
    font-size: clamp(24px, 7vw, 36px);
    justify-content: center;
  }

  .hs-item > span {
    font-size: 10px;
    letter-spacing: 0.04em;
    margin-top: 3px;
  }

  .hs-divider {
    width: 1px;
    height: 36px;
    background: rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
    align-self: center;
  }

  /* Hide scroll cue on mobile */
  .scroll-cue {
    display: none;
  }
}

@media (max-width: 390px) {
  .hero-title { font-size: clamp(44px, 14vw, 62px); }
  .hero-content { padding: 88px 0 32px; }
  .sc-gif { height: 200px; }
  .hero-stats { padding: 14px 16px; }
}

@media (max-width: 360px) {
  .hero-title { font-size: clamp(40px, 13vw, 56px); }
  .hero-tagline { font-size: 14px; }
}


/* ============================================================
   SECTION 5: SECTION COMMON — Mobile
   ============================================================ */

@media (max-width: 768px) {
  .section {
    padding: 64px 0;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 32px;
  }

  .section-title {
    font-size: var(--mob-h2);
    line-height: 1.05;
    letter-spacing: -0.04em;
  }

  .section-desc {
    max-width: 100%;
    font-size: 14.5px;
    line-height: 1.72;
    color: var(--text-muted);
  }

  .s-label {
    font-size: var(--mob-label);
    letter-spacing: 0.18em;
    margin-bottom: 12px;
  }

  .s-label-line {
    width: 24px;
  }
}

@media (max-width: 430px) {
  .section { padding: 56px 0; }
}


/* ============================================================
   SECTION 6: ABOUT — Mobile Redesign
   ============================================================ */

@media (max-width: 768px) {
  .about-grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
  }

  /* Profile — horizontal compact card */
  .about-profile {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--mob-radius-lg);
    backdrop-filter: blur(20px);
  }

  .profile-frame {
    width: 88px;
    height: 88px;
    min-width: 88px;
    aspect-ratio: 1;
    border-radius: 16px;
    flex-shrink: 0;
  }

  .pf-ring-1, .pf-ring-2 {
    display: none; /* Too busy on small screens */
  }

  .pf-img {
    border-radius: 14px;
    border-width: 1.5px;
    box-shadow: 0 0 24px rgba(0, 212, 255, 0.20);
  }

  .pf-status {
    bottom: -10px;
    right: -8px;
    padding: 5px 10px;
    font-size: 11px;
    gap: 5px;
  }

  .profile-meta {
    margin-top: 0;
    text-align: left;
    flex: 1;
    min-width: 0;
  }

  .pm-name {
    font-size: 18px;
    letter-spacing: -0.02em;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .pm-role {
    font-size: 12.5px;
    margin-bottom: 10px;
  }

  .pm-tags {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
  }

  .pm-tags span {
    font-size: 11px;
    padding: 4px 10px;
  }

  /* Content */
  .about-content {
    padding-top: 0;
  }

  .about-text p {
    font-size: var(--mob-body);
    line-height: 1.78;
    margin-bottom: 12px;
  }

  /* Highlights — compact cards */
  .about-highlights {
    gap: 10px;
  }

  .ah-item {
    padding: 14px 16px;
    border-radius: var(--mob-radius-sm);
    gap: 14px;
    transition: border-color 0.2s, background 0.2s;
  }

  .ah-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
  }

  .ah-text strong {
    font-size: 13.5px;
    margin-bottom: 2px;
  }

  .ah-text span {
    font-size: 12px;
    line-height: 1.5;
  }
}


/* ============================================================
   SECTION 7: SKILLS — 2-column premium card grid
   ============================================================ */

@media (max-width: 768px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .skill-card {
    padding: 18px 16px;
    border-radius: var(--mob-radius);
    /* Disable hover tilt/lift on touch */
    transition: border-color 0.2s ease;
  }

  .skill-card:hover {
    transform: none; /* Remove hover lift on mobile */
  }

  /* Touch feedback instead */
  .skill-card:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
  }

  .sk-num {
    font-size: 10px;
    margin-bottom: 10px;
    letter-spacing: 0.08em;
  }

  .sk-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    margin-bottom: 12px;
  }

  .skill-card h3 {
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 7px;
    line-height: 1.25;
  }

  .skill-card p {
    font-size: 12px;
    line-height: 1.55;
    margin-bottom: 12px;
    color: var(--text-muted);
  }

  .sk-bar {
    height: 2.5px;
  }

  .sk-glow {
    display: none; /* GPU intensive on mobile */
  }
}

@media (max-width: 390px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .skill-card {
    padding: 15px 13px;
  }

  .skill-card h3 {
    font-size: 13px;
  }

  .skill-card p {
    font-size: 11.5px;
  }
}


/* ============================================================
   SECTION 8: PROJECTS — Mobile-optimized cards
   ============================================================ */

@media (max-width: 768px) {
  /* Featured project — stacked */
  .project-featured {
    display: flex;
    flex-direction: column;
    border-radius: var(--mob-radius-lg);
    margin-bottom: 16px;
    min-height: auto;
  }

  .pf-media {
    min-height: 240px;
    max-height: 280px;
    border-radius: var(--mob-radius-lg) var(--mob-radius-lg) 0 0;
    overflow: hidden;
    flex-shrink: 0;
  }

  .pf-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .pf-media-overlay {
    background: linear-gradient(
      to top,
      rgba(8, 12, 24, 1) 0%,
      rgba(8, 12, 24, 0.4) 50%,
      transparent 100%
    );
  }

  .pf-content {
    padding: 20px var(--mob-pad);
    border-radius: 0 0 var(--mob-radius-lg) var(--mob-radius-lg);
  }

  .pf-content h3 {
    font-size: clamp(22px, 6vw, 30px);
    margin: 10px 0 12px;
    letter-spacing: -0.03em;
  }

  .pf-content p {
    font-size: 13.5px;
    line-height: 1.68;
    margin-bottom: 16px;
  }

  /* Project tags — scrollable */
  .project-tags {
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
  }

  .project-tags span {
    font-size: 10.5px;
    padding: 4px 10px;
  }

  /* Project card grid — single column on mobile */
  .project-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .project-card-wide {
    grid-column: auto;
  }

  .project-card {
    min-height: 300px;
    border-radius: var(--mob-radius-lg);
    /* No hover tilt on mobile */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }

  .project-card:hover {
    transform: none;
  }

  .project-card:active {
    transform: scale(0.98);
    transition: transform 0.12s ease;
  }

  .pc-content {
    padding: 20px 18px;
  }

  .pc-content h3 {
    font-size: clamp(18px, 5vw, 24px);
    margin: 8px 0 10px;
    letter-spacing: -0.03em;
  }

  .pc-content p {
    font-size: 12.5px;
    line-height: 1.6;
    margin-bottom: 10px;
  }

  /* Type badge */
  .project-type-badge {
    font-size: 10px;
    padding: 4px 10px;
    letter-spacing: 0.08em;
  }

  .btn-sm {
    height: 40px;
    padding: 0 16px;
    font-size: 11.5px;
  }
}

@media (max-width: 430px) {
  .project-card {
    min-height: 280px;
  }

  .pf-media {
    min-height: 220px;
  }
}


/* ============================================================
   SECTION 9: SHOWCASE — Mobile
   ============================================================ */

@media (max-width: 768px) {
  /* Featured showcase — stacked */
  .showcase-featured {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    border-radius: var(--mob-radius-lg);
    margin-bottom: 16px;
  }

  .sf-info {
    order: 1;
  }

  .sf-media {
    order: 0;
  }

  .sf-info h3 {
    font-size: clamp(20px, 5.5vw, 28px);
    margin: 10px 0 12px;
    letter-spacing: -0.03em;
  }

  .sf-info p {
    font-size: 13.5px;
    line-height: 1.68;
    margin-bottom: 12px;
  }

  .sf-video {
    border-radius: var(--mob-radius);
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }

  /* Aura grid — single column */
  .aura-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .aura-card-wide {
    grid-column: auto;
  }

  .aura-card {
    border-radius: var(--mob-radius);
    transition: border-color 0.2s ease;
  }

  .aura-card:hover {
    transform: none;
  }

  .aura-card:active {
    transform: scale(0.98);
    transition: transform 0.12s ease;
  }

  .ac-video-wrap video,
  .ac-video-wrap iframe {
    border-radius: var(--mob-radius) var(--mob-radius) 0 0;
    aspect-ratio: 16 / 9;
  }

  .ac-info {
    padding: 16px;
  }

  .ac-info h4 {
    font-size: 17px;
    margin-bottom: 5px;
    letter-spacing: -0.02em;
  }

  .ac-info p {
    font-size: 12.5px;
    line-height: 1.58;
  }
}


/* ============================================================
   SECTION 10: WORKFLOW — Compact mobile cards
   ============================================================ */

@media (max-width: 768px) {
  .workflow-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .workflow-card {
    padding: 22px 20px;
    border-radius: var(--mob-radius-lg);
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
    /* Remove hover tilt on mobile */
    transition: border-color 0.2s ease;
  }

  .workflow-card:hover {
    transform: none;
  }

  .workflow-card:active {
    transform: scale(0.98);
    transition: transform 0.12s ease;
  }

  /* Left column: number + icon */
  .wf-left-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  /* We need to reorder elements — using flex order */
  .wf-num {
    font-size: 10px;
    letter-spacing: 0.1em;
    margin-bottom: 0;
    order: 0;
    color: var(--text-subtle);
  }

  .wf-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    margin-bottom: 0;
    flex-shrink: 0;
    order: 1;
  }

  .workflow-card h3 {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 8px;
    line-height: 1.25;
  }

  .workflow-card p {
    font-size: 13px;
    line-height: 1.68;
    color: var(--text-muted);
  }

  /* Stacked layout within card */
  .workflow-card {
    flex-direction: column;
    gap: 0;
  }

  .wf-num {
    margin-bottom: 12px;
  }

  .wf-icon {
    margin-bottom: 16px;
  }
}


/* ============================================================
   SECTION 11: CONTACT — Mobile CTA
   ============================================================ */

@media (max-width: 768px) {
  .contact-wrapper {
    padding: 32px 22px;
    border-radius: var(--mob-radius-lg);
    /* Simplify decoration on mobile */
    text-align: center;
  }

  .cw-glow-ring {
    animation: none; /* Skip expensive animation on mobile */
    opacity: 0.15;
  }

  .contact-title {
    font-size: clamp(24px, 6.5vw, 36px);
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin: 14px auto 14px;
    max-width: 100%;
  }

  .contact-desc {
    font-size: 14px;
    line-height: 1.72;
    margin-bottom: 28px;
    max-width: 100%;
  }

  .contact-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  /* Contact buttons full-width on mobile */
  .contact-actions .btn {
    width: 100%;
    height: var(--mob-touch-lg);
    justify-content: center;
    font-size: 14px;
  }

  /* Specific button colors adjustment */
  .btn-ghost-fb,
  .btn-ghost-discord,
  .btn-ghost-phone {
    border-radius: var(--mob-radius-sm);
  }
}

@media (max-width: 390px) {
  .contact-wrapper {
    padding: 28px 18px;
  }

  .contact-title {
    font-size: clamp(22px, 6vw, 32px);
  }
}


/* ============================================================
   SECTION 12: FOOTER — Mobile
   ============================================================ */

@media (max-width: 768px) {
  .footer {
    padding: 28px 0;
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }

  .footer-brand {
    font-size: 14px;
  }

  .footer-copy {
    font-size: 12px;
    line-height: 1.6;
  }

  .footer-nav {
    gap: 16px;
  }

  .footer-nav a {
    font-size: 12.5px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    padding: 0 4px;
  }
}


/* ============================================================
   SECTION 13: BUTTONS — Mobile optimization
   ============================================================ */

@media (max-width: 768px) {
  .btn {
    height: var(--mob-touch);
    padding: 0 24px;
    font-size: 13.5px;
    letter-spacing: 0.03em;
    /* Disable hover transform on touch */
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  }

  .btn:hover {
    transform: none;
  }

  .btn:active {
    transform: scale(0.95) translateY(2px) !important;
  }

  /* Disable shimmer on mobile (perf) */
  .btn::after {
    display: none;
  }

  .btn-primary:hover,
  .btn-ghost:hover,
  .btn-glow:hover,
  .btn-gold:hover,
  .btn-outline:hover {
    transform: none;
    filter: none;
  }

  .btn-primary:active {
    filter: brightness(0.88) !important;
  }
}


/* ============================================================
   SECTION 14: ANIMATIONS — Mobile performance
   ============================================================ */

@media (max-width: 768px) {
  /* Reduce animation intensity on mobile */
  .showcase-card {
    animation-duration: 9s;
  }

  /* Disable card tilt on touch */
  .project-card,
  .workflow-card,
  .aura-card,
  .skill-card {
    transform-style: flat;
  }

  /* Simpler reveal animation */
  .u-reveal {
    transform: translateY(20px);
    transition-duration: 0.55s;
  }

  /* Reduce particle count (handled in JS) */
  #particles-canvas {
    opacity: 0.3;
  }

  /* Reduce hero bg animation intensity */
  .hb-image {
    animation-duration: 70s;
  }

  /* Hide expensive blobs on mobile */
  .hb-blob-2, .hb-blob-3 {
    display: none;
  }

  .hb-blob-1 {
    width: 280px;
    height: 280px;
    opacity: 0.10;
  }

  /* Reduce section glow */
  .s-bg-glow {
    width: 400px;
    height: 400px;
    opacity: 0.12;
    filter: blur(80px);
  }
}


/* ============================================================
   SECTION 15: TYPOGRAPHY — Mobile
   ============================================================ */

@media (max-width: 768px) {
  h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.035em;
  }

  p {
    font-size: var(--mob-body);
    line-height: 1.75;
  }

  /* Prevent overflow */
  h1, h2, h3 {
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
  }
}


/* ============================================================
   SECTION 16: SCROLL + SAFE AREAS
   ============================================================ */

@media (max-width: 768px) {
  html {
    /* Smooth scroll on mobile */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }

  /* No horizontal overflow */
  body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* Safe area for notch/island devices */
  .topbar {
    padding-top: env(safe-area-inset-top, 0px);
  }

  .nav {
    height: calc(64px + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
  }
}


/* ============================================================
   SECTION 17: TABLET BREAKPOINT (768px)
   ============================================================ */

@media (min-width: 481px) and (max-width: 768px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .aura-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .workflow-grid {
    grid-template-columns: 1fr;
  }

  .hero-content {
    padding: 100px 0 44px;
  }

  .sc-gif {
    height: 260px;
  }

  .about-profile {
    max-width: 480px;
  }

  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-card-wide {
    grid-column: 1 / -1;
  }
}


/* ============================================================
   SECTION 18: ACCESSIBILITY & TAP FEEDBACK
   ============================================================ */

@media (max-width: 768px) {
  /* Tap highlight removal for custom feedback */
  * {
    -webkit-tap-highlight-color: transparent;
  }

  /* Focus visible for keyboard users */
  a:focus-visible,
  button:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
    border-radius: 4px;
  }

  /* Improve touch target sizes */
  .nav-link,
  .footer-nav a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}


/* ============================================================
   SECTION 19: OVERFLOW PREVENTION
   ============================================================ */

@media (max-width: 768px) {
  /* Prevent any horizontal scroll */
  .hero,
  .about-section,
  .skills-section,
  .projects-section,
  .showcase-section,
  .workflow-section,
  .contact-section,
  .footer {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* Contain images */
  img {
    max-width: 100%;
    height: auto;
  }

  /* Contain videos */
  video {
    max-width: 100%;
  }

  /* Hero orbs — hide on very small screens to prevent overflow */
  .orb-1, .orb-2, .orb-3, .orb-4, .orb-5 {
    display: none;
  }
}


/* ============================================================
   SECTION 20: SMALL SCREEN (360px) FINE-TUNING
   ============================================================ */

@media (max-width: 360px) {
  :root {
    --mob-pad: 16px;
    --mob-touch: 48px;
    --mob-touch-lg: 52px;
  }

  .section {
    padding: 48px 0;
  }

  .skills-grid {
    gap: 8px;
  }

  .skill-card {
    padding: 14px 12px;
  }

  .project-grid {
    gap: 10px;
  }

  .aura-grid {
    gap: 10px;
  }

  .contact-actions .btn {
    height: var(--mob-touch);
    font-size: 13px;
  }

  .bottom-nav {
    height: 68px;
  }
}
