:root {
  --black: #000;
  --ink: #0f110e;
  --bone: #e9e2d2;
  --ember: #e0512b;
  --gold: #E3B463;
  --gold-glow: rgba(227, 180, 99, .45);
  --line: rgba(233, 226, 210, .14);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { background: var(--black); }

body {
  font-family: 'Instrument Sans', sans-serif;
  color: var(--bone);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

::selection { background: var(--ember); color: var(--ink); }

img { display: block; max-width: none; }

a { color: inherit; text-decoration: none; }

:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }

/* ===== FRAME ===== */
.frame {
  width: 1440px;
  max-width: 100%;
  margin: 0 auto;
  background: var(--ink);
  position: relative;
  overflow: clip;
}

/* ===== LOGO ===== */
.logo {
  position: absolute;
  top: 3.47vw;
  left: 3.47vw;
  width: 7.08vw;
  height: auto;
  aspect-ratio: 102 / 92;
  z-index: 70;
  filter: drop-shadow(0 3px 16px rgba(0, 0, 0, .55));
  transition: transform .4s cubic-bezier(.2, .7, .2, 1);
}

.logo:hover { transform: translateY(-3px); }

@media (min-width: 1440px) {
  .logo {
    top: 50px;
    left: 50px;
    width: 102px;
    height: 92px;
  }
}

/* ===== FILM GRAIN ===== */
.grain {
  position: absolute;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: .06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='.55'/></svg>");
}

/* ===== HERO / IMAGE A ===== */
.hero {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 1440 / 804;
  overflow: hidden;
  background: #000;
}

.hero-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: 58% 38%;
  animation: breathe 26s ease-in-out infinite alternate;
}

@keyframes breathe {
  from { transform: scale(1.03); }
  to   { transform: scale(1.11) translateY(-12px); }
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(8, 10, 8, .42) 0%,
    rgba(8, 10, 8, 0) 26%,
    rgba(8, 10, 8, 0) 52%,
    rgba(10, 12, 9, .88) 100%
  );
}

.cue {
  position: absolute;
  right: 3.6vw;
  bottom: 22.4%;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.cue span {
  font: 400 clamp(8px, 0.7vw, 10px)/1 'Space Mono', monospace;
  letter-spacing: .34em;
  writing-mode: vertical-rl;
  color: rgba(233, 226, 210, .6);
}

.cue-line {
  width: 1px;
  height: clamp(40px, 4vw, 58px);
  background: rgba(233, 226, 210, .22);
  position: relative;
  overflow: hidden;
}

.cue-line::after {
  content: '';
  position: absolute;
  left: 0;
  width: 1px;
  height: 46%;
  background: var(--bone);
  animation: cueDrop 2.2s ease-in-out infinite;
}

@keyframes cueDrop {
  0%   { top: -46%; }
  100% { top: 110%; }
}

/* ===== FIG.B / IMAGE B ===== */
.figb {
  display: flex;
  justify-content: flex-end;
  padding-top: 50px;
  padding-bottom: 50px;
  background: #000;
}

.figb-frame {
  width: 1076px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1076 / 383;
  overflow: hidden;
  background: #000;
}

.figb-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== IMAGE C + IMAGE D: FIXED ===== */
.imgc {
  position: relative;
  width: 1440px;
  height: 461px;
  overflow: visible;
  background: #000;
}

.imgc > img:first-child {
  width: 1440px;
  height: 461px;
}

.imgd {
  position: absolute;
  right: 0;
  bottom: -154.5px;
  width: 864px;
  height: 309px;
  z-index: 2;
}

/* ===== TITLES ON IMAGE C ===== */
.titles {
  position: absolute;
  top: 0;
  left: 0;
  padding-left: 50px;
  z-index: 3;
  pointer-events: none;
  max-width: calc(100% - 50px);
}

.title1 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(20px, 2.22vw, 32px);
  line-height: 1.5;
  font-weight: 700;
  color: var(--gold);
}

.title2,
.title3 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(16px, 1.67vw, 24px);
  line-height: 1.5;
  font-weight: 400;
  color: var(--gold);
  margin-top: 6px;
}

/* ===== IMAGE E + TITLE 4 ===== */
.coming-soon-row {
  display: flex;
  align-items: center;
  padding-top: 48px;
  gap: clamp(24px, 3.33vw, 48px);
}

.imge {
  width: clamp(100px, 11vw, 159px);
  height: auto;
  aspect-ratio: 159 / 161;
  flex-shrink: 0;
}

.title4 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(16px, 1.67vw, 24px);
  line-height: 1.5;
  font-weight: 400;
  color: var(--gold);
}

/* ===== BLACK BACKGROUND WRAPPER ===== */
.guild-bg {
  width: 100%;
  background: #000;
  position: relative;
}

/* ===== GUILD COPY ===== */
.guild-copy {
  position: relative;
  z-index: 2;
  padding: 50px 50px 0 50px;
  width: 100%;
}

.title5 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(20px, 2.22vw, 32px);
  line-height: 1.5;
  font-weight: 700;
  color: var(--gold);
}

.title6 {
  width: 700px;
  max-width: 100%;
  margin-top: 50px;
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(16px, 1.67vw, 24px);
  line-height: 1.5;
  font-weight: 400;
  color: var(--gold);
}

.guild-intro,
.guild-outro {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(16px, 1.67vw, 24px);
  line-height: 1.5;
  font-weight: 400;
  color: var(--gold);
}

/* ===== GUILD ROLES ===== */
.guild-roles {
  list-style: none;
  margin-top: 24px;
  margin-bottom: 24px;
  padding: 0;
}

.guild-roles li {
  position: relative;
  padding-left: clamp(24px, 2.5vw, 36px);
  margin-bottom: 16px;
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(16px, 1.67vw, 24px);
  line-height: 1.5;
  font-weight: 400;
  color: var(--gold);
  transition: color .3s ease, text-shadow .3s ease;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.guild-roles li:last-child {
  margin-bottom: 0;
}

.guild-roles li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.35em;
  width: clamp(10px, 0.97vw, 14px);
  height: clamp(10px, 0.97vw, 14px);
  background: var(--gold);
  transform: rotate(45deg) scale(1);
  border-radius: 2px;
  box-shadow: 0 0 6px var(--gold-glow);
  transition: transform .4s cubic-bezier(.2, .7, .2, 1),
              box-shadow .4s ease,
              background .3s ease;
}

.guild-roles li:hover {
  color: #fff;
  text-shadow: 0 0 18px var(--gold-glow);
}

.guild-roles li:hover::before {
  transform: rotate(225deg) scale(1.3);
  box-shadow: 0 0 20px var(--gold), 0 0 40px var(--gold-glow);
  background: #fff;
}

.guild-roles li {
  opacity: 0;
  transform: translateX(-20px);
  animation: bulletSlideIn .6s cubic-bezier(.2, .7, .2, 1) forwards;
}

.guild-roles li:nth-child(1) { animation-delay: .1s; }
.guild-roles li:nth-child(2) { animation-delay: .25s; }
.guild-roles li:nth-child(3) { animation-delay: .4s; }

@keyframes bulletSlideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===== TITLE 7: FIXED POSITION, FIXED FONT ===== */
.title7 {
  position: absolute;
  z-index: 3;
  left: 10%;
  transform: translateX(-10%);
  top: 750px;
  font-family: 'Montserrat', sans-serif;
  font-size: 32px;
  line-height: 48px;
  font-weight: 700;
  color: #171A1F;
  white-space: nowrap;
}

/* ===== CONTACT FORM: ✅ RESPONSIVE WIDTH WITH FLOOR ===== */
.contact-form {
  position: absolute;
  z-index: 3;
  left: 10%;
  transform: translateX(-10%);
  top: 800px;

  width: clamp(300px, 29.17vw, 420px); /* ✅ scales from 420px down to 300px min */
  background: rgba(255, 255, 255, .30);
  border: 1px solid rgba(255, 255, 255, .60);
  border-radius: 12px;
  padding: 28px clamp(16px, 2.5vw, 36px); /* ✅ horizontal padding shrinks too */
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.textbox {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.textbox .label {
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  line-height: 26px;
  font-weight: 700;
  color: #fff;
}

.textbox input {
  width: 100%;                         /* ✅ fills available form width */
  height: 44px;
  padding: 0 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  line-height: 26px;
  font-weight: 400;
  color: #DEE1E6;
  background: #C2A061;
  border: 1px solid #BCC1CA;
  border-radius: 12px;
  outline: none;
  transition: border-color .25s ease, box-shadow .25s ease;
}

.textbox input::placeholder {
  color: rgba(222, 225, 230, .6);
}

.textbox input:hover {
  border-color: #A7ADB7;
}

.textbox input:focus {
  border-color: #9095A0;
  box-shadow: 0 0 0 3px rgba(144, 149, 160, .25);
}

.textbox input:disabled {
  color: #DEE1E6;
  border-color: #BCC1CA;
  opacity: .7;
  cursor: not-allowed;
}

.textarea {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.textarea .label {
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  line-height: 26px;
  font-weight: 700;
  color: #fff;
}

.textarea textarea {
  width: 100%;                         /* ✅ fills available form width */
  height: 113px;
  padding: 9px 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  line-height: 26px;
  font-weight: 400;
  color: #DEE1E6;
  background: #C2A061;
  border: 1px solid #DEE1E6;
  border-radius: 16px;
  outline: none;
  resize: none;
  transition: border-color .25s ease, box-shadow .25s ease;
}

.textarea textarea::placeholder {
  color: rgba(222, 225, 230, .6);
}

.textarea textarea:hover {
  border-color: #DEE1E6;
}

.textarea textarea:focus {
  border-color: #DEE1E6;
  box-shadow: 0 0 5px rgba(222, 225, 230, .20);
}

.textarea textarea:disabled {
  color: #DEE1E6;
  border-color: #DEE1E6;
  opacity: .7;
  cursor: not-allowed;
}

/* ===== FORM VALIDATION STATES ===== */
.textbox input.error,
.textarea textarea.error {
  border-color: #E85D4A;
  box-shadow: 0 0 0 3px rgba(232, 93, 74, .25);
}

.textbox input.error:focus,
.textarea textarea.error:focus {
  border-color: #E85D4A;
  box-shadow: 0 0 0 3px rgba(232, 93, 74, .35);
}

.textbox input.valid,
.textarea textarea.valid {
  border-color: #6BBF7A;
  box-shadow: 0 0 0 3px rgba(107, 191, 122, .2);
}

.field-error {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  line-height: 20px;
  font-weight: 600;
  color: #E85D4A;
  margin-top: 4px;
  display: none;
}

.field-error.visible {
  display: block;
}

@keyframes fieldShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

.shake {
  animation: fieldShake .4s ease;
}

.textbox input:disabled.error,
.textarea textarea:disabled.error {
  box-shadow: none;
  opacity: .7;
}

/* ===== SUCCESS MESSAGE ===== */
.form-success {
  position: absolute;
  z-index: 3;
  left: 10%;
  transform: translateX(-10%);
  top: 800px;                          /* ✅ same position as .contact-form */

  width: clamp(300px, 29.17vw, 420px); /* ✅ same responsive width as form */
  background: rgba(255, 255, 255, .30);
  border: 1px solid rgba(255, 255, 255, .60);
  border-radius: 12px;
  padding: 48px 36px;
  display: none;                        /* ✅ hidden by default */
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;

  /* Fade-in animation */
  opacity: 0;
  transition: opacity .5s ease;
}

.form-success.visible {
  display: flex;
  opacity: 1;
}

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #E3B463 0%, #6BBF7A 100%);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 32px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.success-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 24px;
  line-height: 36px;
  font-weight: 700;
  color: #fff;
}

.success-text {
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  line-height: 26px;
  font-weight: 400;
  color: rgba(255, 255, 255, .85);
  max-width: 320px;
}

/* Hide form when success is shown */
.contact-form.hidden {
  display: none;
}

.button {
  width: 100%;                         /* ✅ fills available form width */
  height: 52px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Nunito', sans-serif;
  font-size: 18px;
  line-height: 28px;
  font-weight: 400;
  color: #fff;
  background: linear-gradient(90deg, #E3B463 0%, #7DA4CD 53%, rgba(48, 77, 223, .62) 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background .3s ease, opacity .3s ease;
}

.button:hover {
  background: rgba(55, 154, 230, .54);
}

.button:active {
  background: rgba(55, 154, 230, .54);
}

.button:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* ===== IMAGE F: FIXED ===== */
.imgf {
  position: relative;
  z-index: 1;
  margin-top: -204px;
  width: 1440px;
}

.imgf img {
  width: 1440px;
  height: 1145px;
}

/* ===== FOOTER ===== */
footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 96px 50px 40px;
  background: #000;
}

.footer-logo {
  width: 102px;
  max-width: 30vw;
  height: auto;
  aspect-ratio: 102 / 92;
}

.title8 {
  margin-top: 48px;
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(14px, 1.25vw, 18px);
  line-height: 28px;
  font-weight: 400;
  color: #E3B463;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }

  .guild-roles li {
    opacity: 1;
    transform: none;
  }
}

/* In styles.css */
.htmx-indicator {
  display: none;
  margin-left: 8px;
  opacity: 0.7;
}
.htmx-request .htmx-indicator {
  display: inline;
}
.form-errors ul {
  color: #d32f2f;
  margin: 8px 0;
  padding-left: 20px;
}
.success {
  color: #2e7d32;
  font-weight: 600;
}