/* ============================================================
   RESPONSIVE STYLES
   Breakpoints (width): 1200 / 1024 / 768 / 650 / 480 / 420 / 400 / 320
   Breakpoints (height): 800 / 700 / 600 / 450
   ============================================================ */

/* ============================================================
   1200px — 3-column gallery
   ============================================================ */
@media only screen and (max-width: 1200px) {
  #page-drawing {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================================
   1024px — 2-column gallery, smaller hero text, narrower modals
   ============================================================ */
@media only screen and (max-width: 1024px) {
  #title {
    font-size: 90px;
  }

  #subtitle {
    font-size: 36px;
  }

  #page-drawing {
    grid-template-columns: repeat(2, 1fr);
  }

  #modal-drawing-1,
  #modal-drawing-2,
  #modal-drawing-3,
  #modal-control,
  #modal-desc {
    width: 600px;
  }

  #about,
  #greeting {
    width: 700px;
  }
}

/* ============================================================
   768px — 1-column gallery, mobile nav (hamburger), smaller
   hero text, narrower modals and about-me text
   ============================================================ */
@media only screen and (max-width: 768px) {

  /* Hero */
  #title    { font-size: 44px; }
  #subtitle { font-size: 24px; }

  /* Gallery */
  #page-drawing {
    grid-template-columns: 1fr;
  }

  /* Navigation: fixed single-line bar, links drop absolutely below */
  #main-nav {
    flex-wrap: nowrap;
    height: 52px;
    min-height: 52px;
    padding: 0 1.2rem;
  }

  #nav-hamburger {
    display: flex;
  }

  /* Hidden by default with animatable properties instead of display:none,
     so we can transition smoothly open/close */
  #nav-links {
    display: flex !important; /* always in flow so transition works */
    flex-direction: column;
    gap: 0 !important;
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    padding: 0 1.2rem;
    background: rgba(10, 10, 10, 0.96);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.3s ease, opacity 0.3s ease, visibility 0s 0.3s, padding 0.3s ease;
  }

  #main-nav.menu-open #nav-links {
    opacity: 1;
    visibility: visible;
    max-height: 300px; /* generous max larger than actual content */
    padding: 8px 1.2rem 14px;
    pointer-events: auto;
    transition: max-height 0.3s ease, opacity 0.3s ease, visibility 0s 0s, padding 0.3s ease;
  }

  #nav-links li a {
    display: block;
    padding: 12px 4px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  /* About Me */
  #greeting {
    font-size: 24px;
    width: auto;
  }

  .circle {
    height: 400px;
    width: 400px;
  }

  #about {
    width: 90vw;
    font-size: 14px;
  }

  /* Modals */
  #modal-drawing-1,
  #modal-drawing-2,
  #modal-drawing-3,
  #modal-control,
  #modal-desc {
    width: 450px;
  }

  #modal-legal-notice-content {
    width: 90vw;
    top: 0;
    transform: none;
    padding: 60px 20px 40px;
  }
}

/* ============================================================
   650px — narrower about text
   ============================================================ */
@media only screen and (max-width: 650px) {
  #about {
    width: 90vw;
  }
}

/* ============================================================
   480px — smaller UI text, portrait avatar, narrower modals
   ============================================================ */
@media only screen and (max-width: 480px) {
  #subtitle { font-size: 18px; }

  .circle {
    height: 300px;
    width: 300px;
  }

  #contact-text,
  #social-media-text {
    font-size: 12px;
  }

  #copyright-text {
    font-size: 10px;
  }

  #modal-drawing-1,
  #modal-drawing-2,
  #modal-drawing-3,
  #modal-control,
  #modal-desc {
    width: 350px;
  }

  #modal-desc  { font-size: 12px; }
  #about       { font-size: 12px; }

  .modal-nav   { padding: 10px 14px; }

  #main-nav    { padding: 0 1rem; }
}

/* ============================================================
   420px — smaller art tile labels and about text
   ============================================================ */
@media only screen and (max-width: 420px) {
  .art-text { font-size: 11px; }
  #about    { font-size: 12px; }
}

/* ============================================================
   400px — smallest avatar, narrowest modals
   ============================================================ */
@media only screen and (max-width: 400px) {
  .circle {
    height: 200px;
    width: 200px;
  }

  #about {
    width: 90vw;
  }

  #modal-drawing-1,
  #modal-drawing-2,
  #modal-drawing-3,
  #modal-control,
  #modal-desc {
    width: 300px;
  }
}

/* ============================================================
   320px — minimum supported width
   ============================================================ */
@media only screen and (max-width: 320px) {
  #title    { font-size: 36px; }
  #subtitle { font-size: 18px; }

  .circle {
    height: 200px;
    width: 200px;
  }
}

/* ============================================================
   HEIGHT — modal image sizing
   ============================================================ */
@media only screen and (max-height: 800px) {
  #modal-drawing-1,
  #modal-drawing-2,
  #modal-drawing-3 {
    height: 500px;
  }
}

@media only screen and (max-height: 700px) {
  #modal-drawing-1,
  #modal-drawing-2,
  #modal-drawing-3 {
    height: 450px;
  }

  #greeting { margin: 0 auto 20px; }
  #about    { margin: 20px auto 0; }

  #modal-legal-notice-content {
    top: 0;
    transform: none;
    padding-top: 60px;
  }
}

@media only screen and (max-height: 600px) {
  #modal-drawing-1,
  #modal-drawing-2,
  #modal-drawing-3,
  #modal-control,
  #modal-desc {
    width: 300px;
  }

  #modal-drawing-1,
  #modal-drawing-2,
  #modal-drawing-3 {
    height: 400px;
  }

  #greeting { font-size: 24px; }
  #about    { font-size: 14px; }

  .circle {
    height: 200px;
    width: 200px;
  }
}

@media only screen and (max-height: 450px) {
  .mouse-icon { display: none; }
}