:root {
  --black: #030504;
  --panel: #080d09;
  --paper: #f1ead9;
  --gold: #f2c34e;
  --gold-dark: #8f5d0c;
  --green: #83ff38;
  --green-dark: #1f720f;
  --line: rgba(242, 195, 78, 0.38);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--paper);
  background:
    radial-gradient(circle at 80% 12%, rgba(62, 224, 28, .13), transparent 28rem),
    radial-gradient(circle at 15% 58%, rgba(242, 195, 78, .08), transparent 26rem),
    var(--black);
  font: 500 1rem/1.55 Arial, Helvetica, sans-serif;
  overflow-x: hidden;
}

a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; }
#embers { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .18;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.25'/%3E%3C/svg%3E");
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  width: min(1180px, calc(100% - 2rem));
  margin: 1rem auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: .7rem .85rem;
  border: 1px solid rgba(242,195,78,.32);
  border-radius: 14px;
  background: rgba(3, 6, 4, .78);
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; font-weight: 900; letter-spacing: .055em; }
.brand img { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--gold); }
.brand b { color: var(--green); }
nav { display: flex; gap: 1.3rem; }
nav a { text-decoration: none; color: #d4cbb5; font-size: .87rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
nav a:hover, nav a:focus-visible { color: var(--green); }

main { width: min(1180px, calc(100% - 2rem)); margin: 2rem auto 0; }
.hero { padding: 1.2rem 0 6rem; }
.hero-frame {
  --mx: 50%; --my: 50%;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 0 0 5px rgba(242,195,78,.04), 0 30px 90px rgba(0,0,0,.55), 0 0 55px rgba(94,255,32,.09);
  transform: rotate(-.35deg);
}
.hero-frame::before, .hero-frame::after { content: ""; position: absolute; z-index: 2; pointer-events: none; }
.hero-frame::before { inset: 8px; border: 1px solid rgba(255,228,136,.42); border-radius: 12px; }
.hero-frame::after { inset: 0; box-shadow: inset 0 0 80px rgba(0,0,0,.55); }
.hero-frame img { width: 100%; aspect-ratio: 3 / 1; object-fit: cover; }
.frame-glare { position: absolute; inset: 0; background: radial-gradient(circle 160px at var(--mx) var(--my), rgba(255,244,181,.2), transparent 65%); pointer-events: none; mix-blend-mode: screen; }
.hero-copy { width: min(900px, 92%); margin: -1.8rem auto 0; position: relative; z-index: 3; padding: 2.2rem clamp(1.2rem, 5vw, 4rem); background: linear-gradient(135deg, rgba(9,15,10,.97), rgba(2,5,3,.95)); border: 1px solid var(--line); clip-path: polygon(1.5% 0, 98.5% 1%, 100% 92%, 96% 100%, 2% 99%, 0 10%); text-align: center; }
.eyebrow { margin: 0 0 .7rem; color: var(--green); font-size: .8rem; font-weight: 900; letter-spacing: .22em; text-transform: uppercase; }
h1, h2 { margin: 0; color: var(--paper); font-family: Impact, "Arial Black", sans-serif; font-weight: 900; letter-spacing: .025em; line-height: .92; text-transform: uppercase; text-shadow: 3px 3px 0 #000; }
h1 { font-size: clamp(2.8rem, 8vw, 6.6rem); }
h2 { font-size: clamp(2.5rem, 6vw, 5.2rem); }
h1 span, h2 span { color: var(--gold); -webkit-text-stroke: 1px #7a4c05; }
.intro { max-width: 650px; margin: 1.3rem auto 0; color: #c9c1ad; font-size: clamp(1rem, 2vw, 1.15rem); }
.action-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 1rem; margin-top: 1.8rem; }
.sketch-button { position: relative; min-width: 220px; display: inline-flex; align-items: center; justify-content: center; gap: .65rem; padding: .9rem 1.2rem; color: #070906; background: var(--gold); border: 3px solid #080b08; outline: 2px solid var(--gold); box-shadow: 6px 6px 0 rgba(45,240,26,.4); text-decoration: none; font-weight: 950; letter-spacing: .045em; transform: rotate(-.6deg); transition: transform .18s ease, box-shadow .18s ease, filter .18s ease; }
.sketch-button:nth-child(2) { background: var(--paper); outline-color: var(--paper); transform: rotate(.65deg); }
.sketch-button:hover, .sketch-button:focus-visible { transform: translateY(-4px) rotate(0); box-shadow: 8px 10px 0 rgba(45,240,26,.5); filter: brightness(1.08); }
.button-mark { font-size: 1.35rem; line-height: 1; }

.creed { display: grid; grid-template-columns: 110px 1.35fr 1fr; align-items: center; gap: 2rem; padding: 5rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.roman-number { color: transparent; -webkit-text-stroke: 2px rgba(242,195,78,.55); font: 900 8rem/.8 Georgia, serif; text-align: center; }
.creed-copy { color: #c9c1ad; font-size: 1.08rem; border-left: 3px solid var(--green); padding-left: 1.5rem; }
.creed-copy p { margin: .5rem 0; }

.contract { margin: 6rem 0; padding: clamp(1.4rem, 4vw, 3rem); border: 1px solid var(--line); background: linear-gradient(145deg, rgba(17,27,16,.92), rgba(3,6,4,.95)); box-shadow: inset 0 0 60px rgba(80,255,35,.035), 0 25px 70px rgba(0,0,0,.28); }
.contract-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.chain-seal { width: 76px; height: 76px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; border: 3px double var(--gold); color: var(--gold); background: #081006; font: 900 1.35rem Georgia, serif; box-shadow: 0 0 30px rgba(126,255,59,.18); }
.ca-box { width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1rem; padding: 1rem 1rem 1rem 1.25rem; color: var(--paper); background: #010201; border: 2px dashed rgba(242,195,78,.5); cursor: pointer; text-align: left; transition: border-color .2s ease, background .2s ease; }
.ca-box:hover, .ca-box:focus-visible, .ca-box.copied { border-color: var(--green); background: #061005; outline: none; }
.ca-box code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(.82rem, 2vw, 1.05rem); color: #d7d0be; }
.copy-label { padding: .65rem .8rem; background: var(--green); color: #061004; font-size: .8rem; font-weight: 950; letter-spacing: .08em; }
.contract-note { margin: .8rem 0 0; color: #8d897f; font-size: .85rem; }

.finale { display: grid; grid-template-columns: minmax(220px, 380px) 1fr; align-items: center; gap: clamp(2rem, 7vw, 6rem); padding: 1rem 0 7rem; }
.finale img { border-radius: 50%; border: 4px solid var(--gold); box-shadow: 0 0 0 9px #11180e, 0 0 65px rgba(72,255,24,.28); transform: rotate(-2deg); }
.finale p:last-child { color: #bab29f; font-size: 1.1rem; }

footer { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 1.4rem 0 2rem; display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); color: #817b6e; font-size: .76rem; font-weight: 800; letter-spacing: .12em; }
.toast { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 30; padding: .8rem 1rem; color: #071006; background: var(--green); border: 2px solid #000; box-shadow: 5px 5px 0 var(--gold); font-size: .8rem; font-weight: 950; letter-spacing: .1em; transform: translateY(130%); opacity: 0; transition: transform .25s ease, opacity .25s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .75s ease, transform .75s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (max-width: 760px) {
  .site-header { position: relative; align-items: flex-start; }
  .brand span { display: none; }
  nav { gap: .8rem; padding-top: .7rem; }
  nav a { font-size: .7rem; }
  main { margin-top: 1rem; }
  .hero { padding-bottom: 4.5rem; }
  .hero-frame img { min-height: 250px; object-position: 37% center; }
  .hero-copy { width: 95%; margin-top: -1rem; }
  .creed { grid-template-columns: 64px 1fr; gap: 1rem; }
  .roman-number { font-size: 5rem; }
  .creed-copy { grid-column: 1 / -1; }
  .contract-top { align-items: flex-start; }
  .chain-seal { width: 58px; height: 58px; }
  .ca-box { grid-template-columns: 1fr; }
  .copy-label { text-align: center; }
  .finale { grid-template-columns: 1fr; text-align: center; }
  .finale img { width: min(280px, 78vw); margin: 0 auto; }
  footer { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
