/* ============================================================
   VINEIN // OS  —  RESPONSIVE + FX STYLESHEET
   responsive.css  →  glitch · utility keyframes · media queries · a11y
   ============================================================ */

/* ---------- Glitch text (red-only RGB split) ---------- */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; pointer-events: none; -webkit-user-select: none; user-select: none; }
.glitch::before { color: var(--red); left: 2px; text-shadow: -1px 0 var(--red-deep);
  clip-path: inset(0 0 0 0); animation: glitch-a 3s steps(2) infinite; }
.glitch::after { color: var(--red-bright); left: -2px; text-shadow: 1px 0 var(--red);
  clip-path: inset(0 0 0 0); animation: glitch-b 2.4s steps(2) infinite; opacity: .8; }
@keyframes glitch-a {
  0%,92%,100% { clip-path: inset(0 0 100% 0); transform: translate(0); }
  93% { clip-path: inset(12% 0 64% 0); transform: translate(-3px,0); }
  95% { clip-path: inset(48% 0 30% 0); transform: translate(3px,0); }
  97% { clip-path: inset(74% 0 8% 0); transform: translate(-2px,0); }
}
@keyframes glitch-b {
  0%,90%,100% { clip-path: inset(0 0 100% 0); transform: translate(0); }
  91% { clip-path: inset(70% 0 12% 0); transform: translate(3px,0); }
  94% { clip-path: inset(20% 0 56% 0); transform: translate(-3px,0); }
  96% { clip-path: inset(40% 0 38% 0); transform: translate(2px,0); }
}

/* ---------- shared keyframes ---------- */
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   RESPONSIVE  (desktop-down → tablet → mobile)
   ============================================================ */

/* large tablet / small laptop */
@media (max-width: 1024px) {
  .hero-wrap { grid-template-columns: 1.2fr .8fr; gap: 1rem; }
  .hero-portrait { max-width: 380px; }
  .about-grid { grid-template-columns: 300px 1fr; gap: 2.5rem; }
  .contact-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .contact-info { flex-direction: row; flex-wrap: wrap; }
  .contact-card { flex: 1 1 200px; }
}

/* tablet */
@media (max-width: 860px) {
  body { font-size: 16px; }

  /* nav → drawer */
  .nav-toggle { display: flex; }
  .nav-links { position: fixed; inset: 0 0 0 auto; width: min(82vw, 340px);
    flex-direction: column; align-items: flex-start; justify-content: center; gap: .4rem;
    padding: 2rem; background: rgba(8,8,11,.96); backdrop-filter: blur(20px);
    border-left: 1px solid var(--red-line); transform: translateX(100%);
    transition: transform .45s var(--ease); z-index: 1000; }
  .nav-links.open { transform: translateX(0); }
  .nav-link { font-size: 1.25rem; padding: .6rem 0; width: 100%; }
  .nav-link::after { left: 0; right: auto; width: 40px; }
  .nav-link.ext { font-size: 1.05rem; }

  /* hero → single column, portrait behind/under */
  #hero { padding-top: 7rem; text-align: center; }
  .hero-wrap { grid-template-columns: 1fr; }
  .hero-copy { max-width: 100%; margin: 0 auto; order: 2; }
  .hero-kicker, .tag { justify-content: center; }
  .hero-cta, .hero-socials { justify-content: center; }
  .hero-figure { order: 1; justify-content: center; max-width: 320px; margin: 0 auto 1rem; }
  .hero-portrait { margin: 0 auto; }
  .hero-portrait .p-bracket, .hero-portrait .p-label { display: none; }
  .hero-foot { position: static; margin-top: 2.5rem; justify-content: center; }
  .scroll-ind { display: none; }
  .hero-status { text-align: center; width: 100%; }

  /* about stack */
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-figure { max-width: 340px; }

  /* skills single column */
  .skills-grid { grid-template-columns: 1fr; gap: 1.2rem; }

  /* timeline → left rail */
  .constellation-line { left: 8px; }
  .node { width: 100%; left: 0 !important; text-align: left; padding: 1rem 0 1rem 2.4rem; }
  .node-left, .node-right { text-align: left; }
  .node-dot { left: 1px !important; right: auto !important; }
  .node-left .node-card li { text-align: left; }

  .hud .edge { display: none; }
}

/* phone */
@media (max-width: 560px) {
  .section { padding: 4rem 0; }
  .stats-grid { grid-template-columns: 1fr; gap: 1rem; }
  .info-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .playlists-grid { grid-template-columns: 1fr; }
  .contact-info { flex-direction: column; }
  .footer-top { flex-direction: column; align-items: flex-start; }
  .footer-bottom { flex-direction: column; }
  .btn { padding: .9rem 1.5rem; font-size: .74rem; }
  .hero-socials a { width: 44px; height: 44px; }
  .boot-log { min-height: 150px; }
  .hud .corner { width: 18px; height: 18px; }
}

/* very small */
@media (max-width: 360px) {
  .hero-name { font-size: 2.3rem; }
  .tools-grid { grid-template-columns: 1fr; }
}

/* landscape phones — let hero breathe */
@media (max-height: 560px) and (orientation: landscape) and (max-width: 920px) {
  #hero { min-height: auto; padding: 7rem 0 3rem; }
  .hero-figure { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .hero-portrait img, .hero-aura { animation: none !important; }
  .fx-grain, .boot-scan, .scroll-ind, .constellation-line::before { display: none !important; }
}

/* ---------- Touch / coarse pointer: kill hover-only flourishes ---------- */
@media (hover: none) {
  .card:hover { transform: none; }
  .project-card:hover, .tool-card:hover, .stat-card:hover, .node-card:hover, .playlist-card:hover { transform: none; }
}

/* print */
@media print {
  #boot, .hud, .fx-overlay, .cursor-dot, .cursor-ring, #nav, .scroll-top, #hero-canvas { display: none !important; }
  body { background: #fff; color: #000; }
}
