:root {
  /* Spacing */
  --spacing-xxs: 6px;
  --spacing-xs: 8px;
  --spacing-s: 12px;
  --spacing-m: 24px;
  --spacing-l: 28px;

  /* Fonts */
  --font-noto-sans-jp: 'Noto Sans JP', sans-serif;
  --font-open-sans: 'Open Sans', sans-serif;
  --font-work-sans: 'Work Sans', sans-serif;
  --font-SFR: 'SFR', sans-serif;
  --font-relationship: 'Relationship of Melodrame', var(--font-SFR), sans-serif;

  /* Colors */
  --onyx: #0F180Cff;
  --cherry-rose: #AB0046ff;
  --rich-mahogany: #32160Fff;
  --sapphire-sky: #2771C3ff;
  --bright-lavender: #B493E0ff;
  --pink-carnation: #E688C1ff;
  --powder-blue: rgb(196, 221, 255);

  /* Gradients */
  --gradient-top: linear-gradient(0deg, #0F180Cff, #AB0046ff, #32160Fff, #2771C3ff, #B493E0ff, #E688C1ff, #B8C9E0ff);
  --gradient-right: linear-gradient(90deg, #0F180Cff, #AB0046ff, #32160Fff, #2771C3ff, #B493E0ff, #E688C1ff, #B8C9E0ff);
  --gradient-bottom: linear-gradient(180deg, #0F180Cff, #AB0046ff, #32160Fff, #2771C3ff, #B493E0ff, #E688C1ff, #B8C9E0ff);
  --gradient-left: linear-gradient(270deg, #0F180Cff, #AB0046ff, #32160Fff, #2771C3ff, #B493E0ff, #E688C1ff, #B8C9E0ff);
  --gradient-top-right: linear-gradient(45deg, #0F180Cff, #AB0046ff, #32160Fff, #2771C3ff, #B493E0ff, #E688C1ff, #B8C9E0ff);
  --gradient-bottom-right: linear-gradient(135deg, #0F180Cff, #AB0046ff, #32160Fff, #2771C3ff, #B493E0ff, #E688C1ff, #B8C9E0ff);
  --gradient-top-left: linear-gradient(225deg, #0F180Cff, #AB0046ff, #32160Fff, #2771C3ff, #B493E0ff, #E688C1ff, #B8C9E0ff);
  --gradient-bottom-left: linear-gradient(315deg, #0F180Cff, #AB0046ff, #32160Fff, #2771C3ff, #B493E0ff, #E688C1ff, #B8C9E0ff);
  --gradient-radial: radial-gradient(#E688C1ff, #B493E0ff, #B8C9E0ff, #2771C3ff, #32160Fff, #0F180Cff);

  /* Miscellaneous */
  --transition-base: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-logo-height: 40rem;
}

/* -------------------------------------------------------------------------- */
/* Font Definitions                                                           */
/* -------------------------------------------------------------------------- */

@font-face {
  font-family: 'SFR';
  src: url('../src/SFRfont.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Relationship of Melodrame';
  src: url('../src/Relationship_of_mélodrame.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* -------------------------------------------------------------------------- */
/* General & Base Elements                                                    */
/* -------------------------------------------------------------------------- */

html {
  scroll-behavior: smooth;
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--onyx);
  background-image: radial-gradient(
    circle at bottom center, 
    rgb(240, 222, 233) 15%,
    #E688C1ff, 
    var(--sapphire-sky) 45%, 
    var(--onyx) 50%,
    transparent 4500.2555%
  );
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-position: center 30vh;
  background-size: 100% 100%;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' seed='5' stitchTiles='stitch' result='noise'/%3E%3CfeColorMatrix in='noise' type='saturate' values='0' result='grey'/%3E%3CfeComponentTransfer in='grey'%3E%3CfeFuncA type='gamma' amplitude='1.8' exponent='1.4' offset='-0.05'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px 180px;
  opacity: 0.20;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 9999;
}

/* Default font stack for inputs and general body text (Original Font) */
body, input, textarea, select {
  font-family: var(--font-SFR), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* Headings and Titles (Updated to 'Relationship of Melodrame' Font) */
h1, h2, h3, h4, h5, h6, .container .header h2 {
  font-family: var(--font-relationship) !important;
  text-align: center !important;
}

main {
  position: relative;
  flex: 1 0 auto; 
}

/* -------------------------------------------------------------------------- */
/* Keyframe Animations                                                        */
/* -------------------------------------------------------------------------- */

@keyframes neon-flicker {
  0%, 19%, 23%, 52%, 56%, 100% {
    opacity: 1;
    box-shadow:
      inset 0 0 8px #fff,
      inset 0 0 15px var(--cherry-rose),
      0 0 8px #fff,
      0 0 22px rgb(117, 1, 49),
      0 0 55px #AB0046,
      0 0 95px #AB0046;
  }
  18% {
    opacity: 0.85;
    box-shadow:
      inset 0 0 4px rgba(255,255,255,0.4),
      inset 0 0 6px rgba(171,0,70,0.3),
      0 0 3px rgba(255,255,255,0.5),
      0 0 8px rgba(117,1,49,0.4),
      0 0 18px rgba(171,0,70,0.3),
      0 0 30px rgba(171,0,70,0.15);
  }
  22% { 
    opacity: 0.7; 
    box-shadow: inset 0 0 2px rgba(255,255,255,0.2), 0 0 2px rgba(255,255,255,0.3), 0 0 6px rgba(117,1,49,0.3), 0 0 12px rgba(171,0,70,0.2), 0 0 20px rgba(171,0,70,0.1); 
  }
  53% { 
    opacity: 0.55; 
    box-shadow: inset 0 0 2px rgba(255,255,255,0.15), 0 0 2px rgba(255,255,255,0.2), 0 0 5px rgba(117,1,49,0.25), 0 0 10px rgba(171,0,70,0.15); 
  }
  54% { 
    opacity: 0.9; 
    box-shadow: inset 0 0 6px rgba(255,255,255,0.8), inset 0 0 10px rgba(171,0,70,0.6), 0 0 6px rgba(255,255,255,0.7), 0 0 16px rgb(117,1,49), 0 0 40px #AB0046, 0 0 65px #AB0046; 
  }
  55% { 
    opacity: 0.45; 
    box-shadow: inset 0 0 1px rgba(255,255,255,0.1), 0 0 1px rgba(255,255,255,0.1), 0 0 4px rgba(171,0,70,0.1); 
  }
}

/* -------------------------------------------------------------------------- */
/* Gallery & Navigation                                                       */
/* -------------------------------------------------------------------------- */

.bg-sticker-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none; 
  z-index: 1;
  overflow: hidden;
}

.sticker {
  position: absolute;
  width: 140px; 
  height: auto;
  opacity: 0.7; 
  mix-blend-mode: screen; 
  transition: opacity 0.3s ease;
}

main {
  position: relative;
  flex: 1 0 auto;
  overflow: visible; /* Allows flanker images to extend outside container bounds */
}

.flanker-gif {
  position: absolute;
  width: 130px;
  height: auto;
  opacity: 0.75;
  mix-blend-mode: screen; /* Drops black background */
  pointer-events: none;  /* Allows clicks to pass through to inputs */
  z-index: 2;
  transition: opacity 0.3s ease;
}

/* Desktop positioning calculated relative to page center */
.flanker-gif.top-left     { top: 120px; left: calc(50% - 560px); transform: rotate(-10deg); }
.flanker-gif.top-right    { top: 180px; right: calc(50% - 560px); transform: rotate(12deg); }
.flanker-gif.middle-left  { top: 45%; left: calc(50% - 400px); transform: rotate(-5deg); }
.flanker-gif.bottom-left  { bottom: 120px; left: calc(50% - 700px); transform: rotate(8deg); }
.flanker-gif.bottom-right { bottom: 80px; right: calc(50% - 450px); transform: rotate(-15deg); }

@media screen and (max-width: 900px) {

  .flanker-gif {
    position: fixed; /* Lock to viewport corners on small screens */
    width: 65px;
    opacity: 0.20;   /* Low opacity so text stays fully readable over it */
  }

  .flanker-gif.top-left     { top: 90px; left: 10px; right: auto; }
  .flanker-gif.top-right    { top: 90px; right: 10px; left: auto; }
  .flanker-gif.middle-left  { display: none; } /* Hide middle GIF to prevent center clutter */
  .flanker-gif.bottom-left  { bottom: 20px; left: 10px; right: auto; }
  .flanker-gif.bottom-right { bottom: 20px; right: 10px; left: auto; }
}
#navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: nowrap;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 80px; 
  padding: 0 52px;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--transition-base), height var(--transition-base), border-color var(--transition-base), backdrop-filter var(--transition-base);
}

#navbar.solid {
  background: rgba(15, 24, 12, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  height: 60px;
  border-bottom-color: var(--powder-blue);
}

#navbar .brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  opacity: 1;
  height: 100%;
  position: relative;
}

#navbar .brand:hover { opacity: 0.6; }
#navbar .brand:active { opacity: 0.4; transition: opacity 0.1s ease; }

#navbar .brand img {
  display: block;
  height: 30px; 
  width: auto;
  max-width: 220px;
  object-fit: contain;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 36px;
  flex-wrap: nowrap;
  margin-left: auto;
}

.nav-links, .nav-socials {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links { gap: 36px; }
.nav-socials { gap: 20px; align-items: center; }

.nav-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(233, 240, 248);
  font-size: 1.1rem;
  opacity: 0.9;
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.nav-socials a:hover {
  opacity: 1;
  transform: scale(1.12);
}

.nav-links a {
  font-family: var(--font-SFR);
  font-weight: 400;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgb(233, 240, 248);
  text-decoration: none;
  opacity: 0.9;
  position: relative;
  transition: opacity var(--transition-base);
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 1px;
  background: var(--powder-blue);
  transition: width var(--transition-base);
}

.nav-links a:hover { opacity: 1; }
.nav-links a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 101;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--powder-blue);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* -------------------------------------------------------------------------- */
/* Buttons & Triggers                                                         */
/* -------------------------------------------------------------------------- */

#trigger {
  display: block;
  margin: 3rem auto 1rem;
  padding: 0.75rem 2.5rem;
  font-family: sans-serif;
  font-weight: 150;
  font-size: 1rem;
  font-style: italic;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--onyx);
  background-color: rgba(180, 147, 224, 0.924);
  border: 4px solid #fff;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  overflow: visible;
  width: 50%;
  max-width: 500px;
  transition: opacity var(--transition-base), transform var(--transition-base);
  box-shadow:
    inset 0 0 8px #fff,
    inset 0 0 15px var(--cherry-rose),
    0 0 8px #fff,
    0 0 20px rgb(117, 1, 49),
    0 0 60px #AB0046ff,
    0 0 100px #AB0046ff;
  animation: neon-flicker 2.4s steps(1) infinite;
}

 #trigger{
  font-family: sans-serif;
  font-weight: 550;
  color: rgba(15, 24, 12, 0.775);
}

#trigger:hover {
  opacity: 1;
  background-color: rgba(180, 147, 224, 1);
  transform: scale(1.01);
}

#trigger.is-hiding {
  opacity: 0;
  transform: scale(0.92);
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  height: 0;
  border-width: 0;
  pointer-events: none;
  overflow: hidden;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    height 0.32s cubic-bezier(0.4, 0, 0.2, 1) 0.1s,
    margin 0.32s cubic-bezier(0.4, 0, 0.2, 1) 0.1s,
    padding 0.32s cubic-bezier(0.4, 0, 0.2, 1) 0.1s,
    border-width 0.32s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

/* -------------------------------------------------------------------------- */
/* Layout & Form Elements                                                     */
/* -------------------------------------------------------------------------- */

.container {
  max-width: 100% !important;
  width: 100% !important;
  padding: 2rem 1.5rem !important;
  margin: 120px auto 0 auto !important;
  box-sizing: border-box;
}

.container .header h2 {
  font-size: 4rem;
  color: var(--bright-lavender);
  font-weight: 800;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.173);
}

.container .header .subtitle { font-style: italic; }
.container .header p { font-weight: 500; }

.container .submission {
  margin-top: 5%;
  border-radius: 0 !important;
}

.container .submission form {
  padding: 0 !important;
  margin-bottom: 15vh;
  max-width: 100% !important;
  width: 100% !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

#form-body {
  margin-top: 5vh;
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.08s, opacity 0.5s ease 0.25s;
}

.container table, 
.container table tbody, 
.container table tr, 
.container table td {
  display: flex !important;
  flex-direction: column !important;
  margin: auto;
  width: 90%;
  max-width: 1000px;
  box-sizing: border-box;
  text-align: left !important;
}

.container table tr {
  margin-bottom: 1.25rem;
}

p, label, .form-text {
  font-family: var(--font-work-sans);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--powder-blue);
  letter-spacing: 0.05em;
  display: block;
  width: 100%;
}

td input, 
input, 
textarea,
select {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0.5rem 0 0 0 !important;
  box-sizing: border-box;
  display: block;
  border: solid 2px var(--powder-blue);
  border-radius: 25px;
  padding: 1rem;
  background-color: rgba(255, 255, 255, 0.05) !important;
  color: #ffffff !important;
  outline: none;
  box-shadow: none !important;
  transition: background-color 0.4s ease, border-color 0.4s ease;
  font-family: inherit;
  resize: vertical;
}

input:hover, textarea:hover, select:hover {
  border-color: var(--pink-carnation);
}

input:focus, textarea:focus, select:focus {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border-color: var(--bright-lavender);
}

input::placeholder, textarea::placeholder {
  color: rgba(196, 221, 255, 0.588);
  opacity: 0.6;
}

.submission button[type="submit"] {
  display: block;
  margin: 3rem auto 0;
  width: 80%;
  max-width: 600px;
  padding: 0.6rem 0;
  font-family: var(--font-SFR);
  font-weight: 450;
  font-size: .95rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--onyx);
  background-color: rgba(180, 147, 224, 0.924);
  border: 4px solid #fff;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity var(--transition-base), transform var(--transition-base);
  box-shadow: 
    inset 0 0 8px #fff,
    inset 0 0 10px var(--cherry-rose),
    0 0 8px #fff,
    0 0 20px rgb(117, 1, 49),
    0 0 60px #AB0046ff,
    0 0 80px #AB0046ff;
}

.submission button[type="submit"]:hover {
  opacity: 1;
  background-color: rgba(180, 147, 224, 1);
  transform: scale(1.01); 
}

.submission button[type="submit"]:active {
  opacity: 0.85;
  transform: scale(0.97);
  transition: transform 0.1s ease, opacity 0.1s ease;
}

/* -------------------------------------------------------------------------- */
/* Footer                                                                     */
/* -------------------------------------------------------------------------- */

footer {
  flex-shrink: 0;
  margin-top: auto;
  padding-bottom: 40px;
  position: relative; 
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  background: none;
}

.brand-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1200px;
  margin: 2rem 0 auto;
}

.brand-footer img {
  display: block;
  width: 100%;
  max-width: 320px; 
  height: auto;
  margin: 4vh auto 2rem auto; 
}

.brand-footer h2 {
  margin: 0 0 4rem 0;
  font-weight: 1000;
  font-size: 18rem;
  background-image: radial-gradient(
    circle at bottom center,
    rgb(240, 222, 233) 10%,
    var(--sapphire-sky) 40%,
    var(--sapphire-sky) 70%,
    var(--bright-lavender) 100%
  );
  background-size: 100% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-flow 6s ease-in-out infinite;
  font-style: italic;
  letter-spacing: 1vh;
}

.contact-wrapper {
  display: flex;
  flex-direction: column !important;
  justify-content: center;
  align-items: center;
  gap: 1.5rem !important;
  width: 100%;
  margin: 0 auto;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.contact-wrapper ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column !important;
  align-items: center !important;
  gap: 1rem !important;
}

.contact-wrapper ul li {
  display: block !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

.contact-wrapper ul li a {
  font-family: var(--font-SFR);
  font-weight: 300;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--onyx);
  text-decoration: none;
  opacity: 0.9;
  position: relative;
  transition: opacity var(--transition-base);
  white-space: nowrap;
  display: inline-block !important;
}

.contact-wrapper ul li a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 1px;
  background: var(--onyx);
  transition: width var(--transition-base);
}

.contact-wrapper ul li a:hover { opacity: 1; }
.contact-wrapper ul li a:hover::after { width: 100%; }

.contact-wrapper .footer-socials {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  gap: 24px;
}

.contact-wrapper .footer-socials a {
  font-size: 1.15rem;
  color: var(--onyx);
  opacity: 0.9;
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.contact-wrapper .footer-socials a::after { display: none; }
.contact-wrapper .footer-socials a:hover { opacity: 1; transform: scale(1.12); }

/* -------------------------------------------------------------------------- */
/* Custom Cursor                                                              */
/* -------------------------------------------------------------------------- */

.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(233, 240, 248, 0.8);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  opacity: 0;
  transform: translate(0, 0);
  transition: opacity 220ms ease, box-shadow 220ms ease, border-color 220ms ease, width 220ms ease, height 220ms ease;
}

.custom-cursor--init { opacity: 1; }

.custom-cursor--link {
  width: 36px;
  height: 36px;
  border-color: rgba(171, 0, 70, 0.6);
  box-shadow:
    0 0 8px 2px rgba(171, 0, 70, 1),
    0 0 20px 5px rgba(171, 0, 70, 0.75),
    0 0 40px 10px rgba(171, 0, 70, 0.45),
    0 0 70px 18px rgba(171, 0, 70, 0.2);
}

/* -------------------------------------------------------------------------- */
/* Media Queries                                                              */
/* -------------------------------------------------------------------------- */

@media screen and (max-width: 900px) {
  .nav-toggle { display: flex; }
  #navbar { background-color: rgba(0, 0, 0, 0); backdrop-filter: blur(5rem); }
  .nav-right {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    margin-left: 0;
    padding: 28px 24px 32px;
    background-color: rgba(3, 0, 1, 0.342);
    backdrop-filter: blur(7rem);
    border-bottom: 1px solid var(--powder-blue);
    opacity: 0;
    transform: translateY(-12px);
    pointer-events: none;
    transition: opacity var(--transition-base), transform var(--transition-base);
  }
  #navbar.nav-open .nav-right { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-links { flex-direction: column; align-items: center; gap: 20px; }
  .nav-socials { gap: 28px; }
  .nav-right input { width: auto !important; }
  .brand-footer h2 { font-size: 20vw; margin-bottom: 2rem; }
}

@media screen and (max-width: 480px) {
  #navbar { padding: 0 24px; }
}