/* ============================================================
   $HAGGORD — clean, sleek, wizarding-themed one-pager
   ============================================================ */

:root {
  --bg-0: #06060c;
  --bg-1: #0b0a14;
  --bg-2: #12101d;

  --ink: #efe9da;          /* parchment text */
  --ink-soft: #b7ad95;     /* muted parchment */
  --ink-faint: #7c745f;

  --gold: #d9b24a;
  --gold-bright: #f6e39c;
  --gold-deep: #8a6a22;
  --gold-line: rgba(217, 178, 74, 0.35);

  --crimson: #6d1414;

  --serif-display: "Cinzel", "Times New Roman", serif;
  --serif-body: "EB Garamond", Georgia, serif;

  --maxw: 1120px;
  --nav-h: 64px;

  --gold-gradient: linear-gradient(135deg, #6f5417 0%, #caa23f 22%, #f6e39c 42%, #b78c2c 60%, #f3dd94 78%, #7c5e1d 100%);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: radial-gradient(120% 90% at 50% -10%, #14121f 0%, var(--bg-1) 42%, var(--bg-0) 100%);
  color: var(--ink);
  font-family: var(--serif-body);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}

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

.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -0.12em; }

/* ---------- 3D background layers ---------- */
#bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  z-index: 0;
}

/* Fallback image shown only if WebGL / model fails (body.no3d) */
.bg-fallback {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #06060c center 20% / cover no-repeat;
  opacity: 0;
  filter: grayscale(0.15) brightness(0.5) contrast(1.05);
  transition: opacity 0.8s ease;
  pointer-events: none;
}
body.no3d .bg-fallback {
  background-image: url("assets/haggord.jpg");
  opacity: 0.5;
}
body.no3d #bg { display: none; }

/* Vignette + readability wash over the 3D layer */
.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(96% 78% at 50% 44%, rgba(6,6,12,0) 0%, rgba(6,6,12,0.16) 58%, rgba(6,6,12,0.5) 100%),
    linear-gradient(180deg, rgba(6,6,12,0.52) 0%, rgba(6,6,12,0.04) 24%, rgba(6,6,12,0.10) 60%, rgba(6,6,12,0.55) 100%);
}

/* ---------- Loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-content: center;
  gap: 14px;
  text-align: center;
  background: radial-gradient(60% 60% at 50% 45%, #100e1a 0%, #06060c 100%);
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
.loader__sigil {
  font-size: 34px;
  color: var(--gold);
  animation: spin 3.4s linear infinite;
  filter: drop-shadow(0 0 12px rgba(217,178,74,0.5));
}
.loader__text {
  font-family: var(--serif-display);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--ink-soft);
}
body:not(.is-loading) .loader { opacity: 0; visibility: hidden; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Content stacking ---------- */
.nav, main, .foot { position: relative; z-index: 10; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 40px);
  z-index: 40;
  background: linear-gradient(180deg, rgba(6,6,12,0.82) 0%, rgba(6,6,12,0.32) 70%, rgba(6,6,12,0) 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.nav__brand {
  font-family: var(--serif-display);
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 20px;
  color: var(--ink);
  display: inline-flex;
  align-items: baseline;
}
.nav__dollar { color: var(--gold-bright); margin-right: 0.06em; }

.nav__links { display: flex; gap: 8px; }
.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--serif-display);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.nav__link .ico { color: var(--gold); font-size: 14px; transition: color 0.25s; }
.nav__link:hover {
  color: var(--ink);
  border-color: var(--gold-line);
  background: rgba(217,178,74,0.07);
}
.nav__link:hover .ico { color: var(--gold-bright); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 88vh;
  min-height: 88dvh;
  display: grid;
  grid-template-columns: 1fr minmax(230px, 34vw) 1fr;
  grid-template-rows: auto auto 1fr;
  grid-template-areas:
    "eyebrow eyebrow eyebrow"
    "quote   .       ca"
    "follow  mid     chart";
  align-items: start;
  gap: 14px 18px;
  text-align: center;
  padding: calc(var(--nav-h) + 12px) clamp(14px, 3vw, 40px) 72px;
}
.hero__eyebrow {
  grid-area: eyebrow;
  justify-self: center;
  margin: 0;
  font-size: 10px;
  opacity: 0.85;
}
.hero__ca {
  grid-area: ca;
  justify-self: end;
  animation: rise 1s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: 0.1s;
}
.hero__chart {
  grid-area: chart;
  align-self: center;
  justify-self: center;
  animation: rise 1s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: 0.28s;
}
.hero__follow {
  grid-area: follow;
  align-self: center;
  justify-self: center;
  animation: rise 1s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: 0.28s;
}
.hero__quote {
  grid-area: quote;
  align-self: start;
  justify-self: start;
  max-width: 220px;
  text-align: left;
  animation: rise 1s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: 0.1s;
}
.quote {
  font-family: var(--serif-body);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(14px, 1.7vw, 18px);
  line-height: 1.35;
  color: var(--ink);
  margin: 0;
  text-shadow: 0 2px 16px rgba(6, 6, 12, 0.8);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}

.eyebrow {
  font-family: var(--serif-display);
  text-transform: uppercase;
  letter-spacing: 0.34em;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  margin: 0 0 18px;
  padding-left: 0.34em;
}

.title {
  font-family: var(--serif-display);
  font-weight: 900;
  font-size: clamp(58px, 15vw, 168px);
  line-height: 0.92;
  letter-spacing: 0.02em;
  margin: 0;
  background: linear-gradient(180deg, #fbf3d2 0%, var(--gold-bright) 34%, var(--gold) 62%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 20px rgba(217,178,74,0.28)) drop-shadow(0 1px 1px rgba(0,0,0,0.5));
}
.title__dollar { font-size: 0.62em; vertical-align: 0.16em; margin-right: 0.02em; }

.tagline {
  font-family: var(--serif-body);
  font-style: italic;
  font-size: clamp(20px, 3.4vw, 30px);
  color: var(--ink);
  margin: 22px 0 4px;
}
.subtag {
  color: var(--ink-soft);
  font-size: clamp(15px, 2.2vw, 18px);
  margin: 0 0 30px;
  letter-spacing: 0.01em;
}

/* ---------- Contract address ---------- */
.ca {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: min(92vw, 480px);
  padding: 6px 6px 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: rgba(12,11,20,0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--ink);
  font-family: var(--serif-body);
  cursor: pointer;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.15s;
}
.ca:hover {
  border-color: rgba(217,178,74,0.65);
  box-shadow: 0 0 0 1px rgba(217,178,74,0.18), 0 10px 30px rgba(0,0,0,0.4);
}
.ca:active { transform: translateY(1px); }
.ca__label {
  font-family: var(--serif-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--gold);
  border-right: 1px solid var(--gold-line);
  padding-right: 12px;
}
.ca__addr {
  font-family: "SFMono-Regular", ui-monospace, "Menlo", monospace;
  font-size: 11.5px;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.ca__copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  font-family: var(--serif-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--bg-0);
  background: var(--gold-gradient);
  padding: 7px 13px;
  border-radius: 999px;
}
.ca.copied .ca__copy { background: linear-gradient(135deg,#2f7d4f,#5bc98a); color: #06120b; }

/* ---------- Buttons ---------- */
.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 30px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--serif-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.05em;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.25s ease, background 0.25s, color 0.25s, border-color 0.25s;
}
.btn .ico { font-size: 16px; }
.btn__arrow { font-size: 1.05em; transition: transform 0.25s; }
.btn--gold {
  color: #120d02;
  background: var(--gold-gradient);
  box-shadow: 0 8px 26px rgba(217,178,74,0.28), inset 0 1px 0 rgba(255,255,255,0.35);
}
.btn--gold:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(217,178,74,0.42), inset 0 1px 0 rgba(255,255,255,0.4); }
.btn--ghost {
  color: var(--ink);
  border-color: var(--gold-line);
  background: rgba(12,11,20,0.5);
}
.btn--ghost:hover {
  border-color: rgba(217,178,74,0.7);
  color: var(--gold-bright);
  transform: translateY(-2px);
}
.btn--ghost:hover .btn__arrow { transform: translateY(3px); }
.chart__cta .btn--ghost:hover .btn__arrow { transform: translate(3px, -3px); }

/* ---------- Scroll cue ---------- */
.scroll-cue {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--serif-display);
  font-size: 10.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.scroll-cue__chev { font-size: 20px; color: var(--gold); animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); opacity: 0.7; } 50% { transform: translateY(6px); opacity: 1; } }

/* ---------- Chart section ---------- */
.chart {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(8px, 2vw, 28px) clamp(16px, 4vw, 40px) clamp(56px, 9vw, 110px);
}
.chart__head { text-align: center; margin-bottom: clamp(20px, 3vw, 34px); }
.section-title {
  font-family: var(--serif-display);
  font-weight: 800;
  font-size: clamp(28px, 5vw, 46px);
  letter-spacing: 0.04em;
  margin: 0 0 10px;
  color: var(--ink);
}
.section-sub { color: var(--ink-soft); margin: 0; font-size: clamp(15px, 2.2vw, 18px); }

/* ---------- Hogwarts portrait frame ---------- */
.portrait {
  margin: 0 auto;
  max-width: 940px;
  position: relative;
}
.portrait__plate {
  width: max-content;
  max-width: 90%;
  margin: 0 auto -14px;
  position: relative;
  z-index: 3;
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  color: #211a08;
  padding: 8px 26px;
  border-radius: 6px;
  background: var(--gold-gradient);
  box-shadow: 0 6px 18px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.4);
  border: 1px solid rgba(0,0,0,0.25);
}
.portrait__frame {
  position: relative;
  padding: clamp(12px, 2.4vw, 22px);
  border-radius: 10px;
  background: var(--gold-gradient);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.5),
    0 2px 0 rgba(255,255,255,0.2) inset,
    0 26px 60px rgba(0,0,0,0.6),
    0 0 60px rgba(217,178,74,0.12);
}
/* carved inner + outer bevel lines on the gilt */
.portrait__frame::before,
.portrait__frame::after {
  content: "";
  position: absolute;
  border-radius: 8px;
  pointer-events: none;
}
.portrait__frame::before {
  inset: 5px;
  border: 1px solid rgba(0,0,0,0.35);
  box-shadow: 0 0 0 1px rgba(255,236,180,0.35);
}
.portrait__frame::after {
  inset: clamp(9px, 1.9vw, 17px);
  border: 2px solid rgba(0,0,0,0.55);
  box-shadow: inset 0 0 22px rgba(0,0,0,0.6);
}

/* corner filigree ornaments */
.corner {
  position: absolute;
  width: clamp(26px, 4vw, 42px);
  height: clamp(26px, 4vw, 42px);
  z-index: 2;
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M4 4 L4 42 Q4 20 20 8 Q34 4 42 4 Z' fill='%23f6e39c'/%3E%3Cpath d='M8 8 Q40 8 40 40 Q40 18 60 14 M8 8 Q8 40 40 40 Q18 40 14 60' stroke='%23231b06' stroke-width='2.4' fill='none' stroke-linecap='round'/%3E%3Ccircle cx='9' cy='9' r='3.4' fill='%23231b06'/%3E%3C/svg%3E");
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.5));
}
.corner--tl { top: -3px; left: -3px; }
.corner--tr { top: -3px; right: -3px; transform: scaleX(-1); }
.corner--bl { bottom: -3px; left: -3px; transform: scaleY(-1); }
.corner--br { bottom: -3px; right: -3px; transform: scale(-1,-1); }

.portrait__mat {
  position: relative;
  z-index: 1;
  border-radius: 4px;
  overflow: hidden;
  background: #0a0a12;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.8), inset 0 0 40px rgba(0,0,0,0.7);
}
.dex-embed {
  position: relative;
  width: 100%;
  height: 68vh;
  min-height: 480px;
  max-height: 760px;
}
.dex-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.dex-embed iframe.is-loaded { opacity: 1; }
.dex-loading {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  color: var(--ink-soft);
  background: #0a0a12;
}
.dex-loading__sigil { font-size: 26px; color: var(--gold); animation: spin 3.4s linear infinite; filter: drop-shadow(0 0 10px rgba(217,178,74,0.45)); }
.dex-loading__text { font-family: var(--serif-display); letter-spacing: 0.2em; text-transform: uppercase; font-size: 12px; }
.dex-loading__link {
  font-family: var(--serif-display);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--gold-bright);
  border-bottom: 1px solid var(--gold-line);
  padding-bottom: 2px;
}
.chart__cta { text-align: center; margin-top: clamp(24px, 4vw, 40px); }

/* ---------- Footer ---------- */
.foot {
  border-top: 1px solid var(--gold-line);
  background: linear-gradient(180deg, rgba(6,6,12,0) 0%, rgba(6,6,12,0.85) 40%, #06060c 100%);
  padding: 40px clamp(16px, 4vw, 40px) 46px;
  text-align: center;
}
.foot__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.foot__brand {
  font-family: var(--serif-display);
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 18px;
}
.foot__links { display: flex; gap: 20px; }
.foot__links a {
  font-family: var(--serif-display);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.foot__links a:hover { color: var(--gold-bright); border-color: var(--gold-line); }
.foot__ca {
  font-family: ui-monospace, "Menlo", monospace;
  font-size: 11.5px;
  color: var(--ink-faint);
  word-break: break-all;
  max-width: 640px;
  margin: 0 auto 14px;
  cursor: pointer;
  transition: color 0.2s;
}
.foot__ca:hover { color: var(--gold); }
.foot__fine {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-faint);
  max-width: 620px;
  margin: 0 auto;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 24px);
  z-index: 80;
  font-family: var(--serif-display);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: #06120b;
  background: linear-gradient(135deg,#5bc98a,#2f7d4f);
  padding: 11px 22px;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 780px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto 1fr auto auto;
    grid-template-areas:
      "eyebrow"
      "ca"
      "quote"
      "mid"
      "follow"
      "chart";
    justify-items: center;
    gap: 12px;
    padding-bottom: 92px;
  }
  .hero__ca, .hero__chart, .hero__follow, .hero__quote { justify-self: center; align-self: auto; }
  .hero__quote { max-width: 80vw; }
  .btn.hero__chart, .hero__follow .btn { width: min(86vw, 340px); justify-content: center; }
}

@media (max-width: 620px) {
  body { font-size: 17px; }
  .nav__link span:not(.ico) { display: none; }
  .nav__link { padding: 9px 12px; }
  .ca { flex-wrap: nowrap; }
  .ca__addr { font-size: 11.5px; }
  .cta { width: 100%; }
  .cta .btn { flex: 1 1 auto; justify-content: center; }
  .dex-embed { height: 74vh; min-height: 420px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .loader__sigil, .scroll-cue__chev { animation: none; }
  .hero__inner { animation: none; }
}
