/*
 * PHANTASM'27 — STEP 1 FINAL MOBILE HOMEPAGE
 *
 * Mobile homepage only. This is deliberately loaded LAST so the older
 * stepped override files cannot re-introduce the alignment/gap problems.
 * Desktop is untouched.
 */

@media (max-width: 768px) {
  :root {
    --p27-m-bg: #090705;
    --p27-m-bg2: #140d09;
    --p27-m-gold: #d9a441;
    --p27-m-gold-soft: #f0cf8b;
    --p27-m-ivory: #f3e6c8;
    --p27-m-muted: #cdbf9e;
    --p27-m-maroon: #6f1d1d;
    --p27-m-line: rgba(217, 164, 65, .20);
  }

  /* ---------- page canvas ---------- */
  html,
  body,
  #root {
    width: 100% !important;
    min-width: 320px !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  /* ---------- navigation ---------- */
  .navbar,
  .site-nav {
    position: sticky !important;
    top: 0 !important;
    z-index: 200 !important;
    min-height: 64px !important;
    height: 64px !important;
    background: rgba(9, 7, 5, .96) !important;
    border-bottom: 1px solid var(--p27-m-line) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .24) !important;
  }

  .navbar-container,
  .site-nav .wrap {
    width: calc(100% - 20px) !important;
    max-width: 560px !important;
    height: 64px !important;
    margin: 0 auto !important;
    padding: 0 !important;
  }

  .logo-image {
    max-width: 44px !important;
    max-height: 44px !important;
    margin: 0 !important;
    transform: none !important;
  }

  .menu-icon,
  .nav-toggle {
    width: 44px !important;
    height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid rgba(217, 164, 65, .55) !important;
    border-radius: 8px !important;
    color: var(--p27-m-gold-soft) !important;
    background: rgba(217, 164, 65, .04) !important;
  }

  .nav-menu,
  .nav-links {
    top: 64px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: rgba(9, 7, 5, .98) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border-bottom: 1px solid var(--p27-m-line) !important;
  }

  /* ---------- homepage hero: remove all inherited artificial height/gaps ---------- */
  .hero,
  .hero-section {
    width: 100% !important;
    max-width: none !important;
    min-height: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 0 24px !important;
    overflow: hidden !important;
    isolation: isolate !important;
  }

  .hero > .wrap,
  .hero .wrap,
  .hero .container,
  .hero-section > .wrap,
  .hero-section .wrap,
  .hero-section .container {
    width: 100% !important;
    max-width: 560px !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    padding: 0 14px !important;
    transform: none !important;
    box-sizing: border-box !important;
  }

  .hero-glow {
    inset: 0 !important;
    opacity: 1 !important;
    background:
      radial-gradient(ellipse 90% 42% at 50% 0%, rgba(111, 29, 29, .36), transparent 68%),
      radial-gradient(ellipse 65% 36% at 90% 6%, rgba(217, 164, 65, .10), transparent 62%) !important;
  }

  /* Decorative shapes that previously created the large blank mobile region. */
  .hero-section > div[style*="rotate(45deg)"],
  .hero-section > div[style*="rotate(45deg"],
  .hero-section > div[style*="borderRadius: \"50%\""],
  .hero-section > div[style*="border-radius: 50%"],
  .hero-section > div[style*="50%"][style*="border"] {
    display: none !important;
  }

  /* ---------- institution row ---------- */
  .hero-institution {
    width: 100% !important;
    max-width: 520px !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    padding: 10px 0 0 !important;
    display: grid !important;
    grid-template-columns: 38px minmax(0, 1fr) 38px !important;
    align-items: center !important;
    justify-items: center !important;
    gap: 8px !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
  }

  .hero-institution .inst-logo,
  .inst-logo.left,
  .inst-logo.right {
    position: static !important;
    width: 34px !important;
    height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
    object-fit: contain !important;
    margin: 0 !important;
  }

  .hero-institution .inst-text {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
  }

  .hero-institution .inst-text::before {
    content: 'Government College of Engineering, Bargur' !important;
    display: block !important;
    width: 100% !important;
    margin: 0 auto 3px !important;
    padding: 0 !important;
    color: var(--p27-m-gold-soft) !important;
    font-family: 'Cormorant Garamond', Georgia, serif !important;
    font-size: clamp(1.15rem, 5.4vw, 1.45rem) !important;
    font-weight: 700 !important;
    line-height: 1.08 !important;
    letter-spacing: .01em !important;
    text-align: center !important;
    text-wrap: balance !important;
  }

  .hero-institution .inst-college,
  .hero-institution .inst-dept,
  .phantasm-hero-college-name {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    text-align: center !important;
  }

  .hero-institution .inst-dept {
    color: var(--p27-m-muted) !important;
    font-size: .70rem !important;
    line-height: 1.3 !important;
    letter-spacing: .045em !important;
  }

  /* ---------- hero identity ---------- */
  .hero-inner,
  .hero-content,
  .hero-copy {
    width: 100% !important;
    max-width: 520px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    text-align: center !important;
  }

  .hero .logo-image-center,
  .hero img[src*="vaagai"],
  .hero img[alt*="vaagai" i],
  .hero .vaagai-logo {
    display: block !important;
    width: min(90vw, 420px) !important;
    max-width: 90vw !important;
    max-height: 25svh !important;
    height: auto !important;
    margin: 8px auto 0 !important;
    transform: none !important;
    object-fit: contain !important;
    object-position: center !important;
    filter: drop-shadow(0 12px 26px rgba(217, 164, 65, .14)) !important;
  }

  .hero h1,
  .hero-title,
  .hero-heading {
    width: 100% !important;
    max-width: 100% !important;
    margin: 10px auto 0 !important;
    padding: 0 !important;
    text-align: center !important;
    font-family: 'Cormorant Garamond', Georgia, serif !important;
    font-size: clamp(3rem, 14vw, 4.5rem) !important;
    font-weight: 700 !important;
    line-height: .88 !important;
    letter-spacing: .01em !important;
    color: var(--p27-m-ivory) !important;
    text-shadow: 0 0 34px rgba(217, 164, 65, .18) !important;
  }

  .hero h1 .accent,
  .logo-highlight {
    background: linear-gradient(180deg, var(--p27-m-gold-soft), var(--p27-m-gold) 58%, #9c6b24) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: transparent !important;
  }

  .hero-tamil {
    margin: 6px auto 0 !important;
    text-align: center !important;
    color: var(--p27-m-gold-soft) !important;
    font-size: clamp(1.35rem, 6vw, 1.9rem) !important;
    line-height: 1.05 !important;
  }

  .hero-sub,
  .hero-subtitle,
  .hero-description,
  .description {
    width: min(100%, 500px) !important;
    max-width: 500px !important;
    margin: 10px auto 0 !important;
    padding: 0 4px !important;
    color: var(--p27-m-muted) !important;
    font-size: .86rem !important;
    line-height: 1.58 !important;
    text-align: center !important;
  }

  /* ---------- metadata ---------- */
  .hero-meta,
  .hero-details,
  .hero-stats {
    width: min(100%, 500px) !important;
    max-width: 500px !important;
    margin: 14px auto 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 7px !important;
  }

  .meta-pill,
  .hero-meta > *,
  .hero-details > * {
    min-height: 34px !important;
    padding: 7px 10px !important;
    border: 1px solid rgba(217, 164, 65, .28) !important;
    border-radius: 999px !important;
    background: rgba(217, 164, 65, .045) !important;
    color: var(--p27-m-gold-soft) !important;
    font-size: .68rem !important;
    line-height: 1.2 !important;
  }

  /* ---------- CTA: always centered and usable ---------- */
  .hero-actions,
  .hero-cta,
  .hero-actions.reveal {
    width: min(100%, 420px) !important;
    max-width: 420px !important;
    margin: 16px auto 0 !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    align-items: stretch !important;
    justify-content: center !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    z-index: 20 !important;
  }

  .hero-actions a,
  .hero-actions button,
  .hero-cta a,
  .hero-cta button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 48px !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: nowrap !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    font-size: .76rem !important;
    font-weight: 700 !important;
    letter-spacing: .03em !important;
    border-radius: 7px !important;
    box-sizing: border-box !important;
  }

  .hero-actions a[href*="/register"],
  .hero-cta a[href*="/register"],
  .hero-actions a:first-child,
  .hero-cta a:first-child {
    background: linear-gradient(180deg, var(--p27-m-gold-soft), var(--p27-m-gold)) !important;
    color: #241703 !important;
    -webkit-text-fill-color: #241703 !important;
    border: 1px solid var(--p27-m-gold) !important;
    box-shadow: 0 7px 20px rgba(217, 164, 65, .18) !important;
  }

  .hero-actions a[href*="/events"],
  .hero-cta a[href*="/events"],
  .hero-actions a:nth-child(2),
  .hero-cta a:nth-child(2) {
    background: rgba(217, 164, 65, .04) !important;
    color: var(--p27-m-gold-soft) !important;
    -webkit-text-fill-color: var(--p27-m-gold-soft) !important;
    border: 1px solid rgba(217, 164, 65, .42) !important;
  }

  /* ---------- dates / countdown: remove the old oversized gap ---------- */
  .hero .event-date,
  .hero .date,
  .hero .hero-date,
  .hero .hero-dates,
  .hero [class*="event-date"],
  .hero [class*="date-display"] {
    margin: 8px auto 0 !important;
    padding: 0 !important;
    text-align: center !important;
  }

  .hero .hero-timer,
  .hero-timer,
  .hero .countdown {
    width: min(100%, 430px) !important;
    max-width: 430px !important;
    margin: 8px auto 0 !important;
    padding: 8px 10px !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }

  .hero .countdown span,
  .countdown span {
    display: block !important;
    width: 100% !important;
    margin: 0 auto !important;
    text-align: center !important;
    font-family: 'Cormorant Garamond', Georgia, serif !important;
    font-size: clamp(1.55rem, 8vw, 2.1rem) !important;
    line-height: 1 !important;
    letter-spacing: .08em !important;
    color: var(--p27-m-gold-soft) !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  .starts-in,
  .timer-label {
    margin: 0 !important;
    color: var(--p27-m-muted) !important;
    font-size: .62rem !important;
    letter-spacing: .18em !important;
  }

  /* ---------- homepage highlights: clean hierarchy, same palette ---------- */
  .highlight-wrapper,
  .highlights-grid {
    width: 100% !important;
    max-width: 560px !important;
    margin: 18px auto 0 !important;
    padding: 0 2px !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .highlight-section,
  .highlight-technical,
  .highlight-non-technical,
  .highlight-workshop {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 16px 14px !important;
    text-align: center !important;
    background: linear-gradient(145deg, rgba(217, 164, 65, .045), rgba(20, 13, 9, .88)) !important;
    border: 1px solid var(--p27-m-line) !important;
    border-radius: 12px !important;
    box-shadow: none !important;
  }

  .highlight-section h1,
  .highlight-section h2,
  .highlight-section h3,
  .highlight-section h4,
  .highlight-title {
    margin: 0 !important;
    color: var(--p27-m-gold-soft) !important;
    -webkit-text-fill-color: var(--p27-m-gold-soft) !important;
    font-family: 'Cormorant Garamond', Georgia, serif !important;
    font-weight: 700 !important;
    text-align: center !important;
  }

  .highlight-section p,
  .highlight-description {
    margin: 6px auto 0 !important;
    color: var(--p27-m-muted) !important;
    font-size: .78rem !important;
    line-height: 1.5 !important;
    text-align: center !important;
  }

  .phantasm-home-potential {
    width: min(100%, 520px) !important;
    margin: 18px auto 8px !important;
    padding: 0 !important;
    text-align: center !important;
    color: var(--p27-m-gold-soft) !important;
    -webkit-text-fill-color: var(--p27-m-gold-soft) !important;
  }

  .phantasm-potential-lead,
  .phantasm-potential-points {
    width: min(100%, 520px) !important;
    max-width: 520px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
  }

  .ignite-list {
    width: 100% !important;
    padding: 0 !important;
    margin: 10px auto 0 !important;
    text-align: left !important;
  }

  .ignite-list li {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    padding: 0 !important;
    margin: 7px 0 !important;
    color: var(--p27-m-muted) !important;
    list-style: none !important;
  }

  .ignite-list li .ignite-arrow {
    display: none !important;
  }

  .ignite-list li::before {
    content: '' !important;
    flex: 0 0 7px !important;
    width: 7px !important;
    height: 7px !important;
    border-radius: 50% !important;
    background: var(--p27-m-gold) !important;
    position: static !important;
  }

  /* ---------- decorative footer edge ---------- */
  .gopuram,
  .hero .gopuram {
    width: 100% !important;
    height: auto !important;
    margin: 14px auto 0 !important;
    opacity: .48 !important;
  }
}

@media (max-width: 430px) {
  .hero > .wrap,
  .hero .wrap,
  .hero .container,
  .hero-section > .wrap,
  .hero-section .wrap,
  .hero-section .container {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .hero-institution {
    grid-template-columns: 28px minmax(0, 1fr) 28px !important;
    gap: 6px !important;
    padding-top: 8px !important;
  }

  .hero-institution .inst-logo,
  .inst-logo.left,
  .inst-logo.right {
    width: 26px !important;
    height: 26px !important;
  }

  .hero h1,
  .hero-title,
  .hero-heading {
    font-size: clamp(2.65rem, 13.5vw, 3.6rem) !important;
  }

  .hero-actions,
  .hero-cta {
    width: calc(100% - 8px) !important;
    max-width: 400px !important;
  }
}

@media (max-width: 360px) {
  .hero-actions,
  .hero-cta {
    grid-template-columns: 1fr !important;
  }
}
