/* MYSENPY landing page
   Navy and blue from the MYSENPY logo; the CIVIREIGN block keeps the game's gold. */

:root {
  --bg: #03060e;
  --bg-2: #060b16;
  --surface: #0a1220;
  --line: rgba(170, 205, 255, 0.1);
  --line-2: rgba(170, 205, 255, 0.2);
  --text: #eaf2ff;
  --muted: #9aa8bf;
  --dim: #5f6d85;
  --brand: #2f86ff;
  --brand-hi: #5cd0ff;
  --gold: #d9a441;
  --gold-hi: #f2c86a;

  --f-display: 'Exo 2', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-brand: 'Michroma', 'Exo 2', system-ui, sans-serif;
  --f-body: 'Exo 2', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1180px;
  --nav-h: 74px;
  --brand-glow: rgba(47, 134, 255, 0.45);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, p { margin: 0; }
::selection { background: var(--brand); color: #fff; }
:focus-visible { outline: 2px solid var(--brand-hi); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: calc(var(--maxw) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip {
  position: fixed; left: 16px; top: -60px; z-index: 200;
  padding: 10px 16px; border-radius: 10px;
  background: var(--brand); color: #fff; font-weight: 600;
  transition: top 0.2s;
}
.skip:focus { top: 16px; }

h2 { font: 700 clamp(28px, 3vw, 36px)/1.15 var(--f-display); letter-spacing: -0.01em; }

/* ---------- buttons ---------- */
/* chamfered corners, like the cut edges of the MYSENPY mark */
.btn {
  --cut: 12px;
  position: relative;
  isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 50px; padding: 0 26px;
  font: 700 14px/1 var(--f-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  transition: filter 0.2s, color 0.2s;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s; }
.btn:hover svg { transform: translateX(3px); }
.btn:focus-visible { outline: none; }
.btn-primary { background: linear-gradient(120deg, #e6f6ff 0%, #7fd8ff 30%, #2f86ff 70%, #1d5cff 100%); color: #031230; }
.btn-primary:hover { filter: brightness(1.12); }
.btn-primary:focus-visible { box-shadow: inset 0 0 0 2px #fff; }
/* outline version: gradient frame with the page colour inside */
.btn-ghost { background: linear-gradient(120deg, #7fd8ff, #1d5cff); color: var(--text); }
.btn-ghost::before {
  content: ''; position: absolute; inset: 1.5px; z-index: -1;
  background: var(--bg);
  clip-path: polygon(calc(var(--cut) - 1px) 0, 100% 0, 100% calc(100% - var(--cut) + 1px), calc(100% - var(--cut) + 1px) 100%, 0 100%, 0 calc(var(--cut) - 1px));
}
.btn-ghost:hover { color: var(--brand-hi); }
.btn-ghost:focus-visible { color: var(--brand-hi); }
.btn-ghost:focus-visible::before { inset: 3px; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s, border-color 0.3s;
}
.nav.is-scrolled, .nav.is-open {
  background: rgba(3, 6, 14, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.nav-inner {
  height: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex; align-items: center; gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; margin-right: auto; }
.brand img { width: auto; height: 32px; filter: drop-shadow(0 0 8px rgba(47, 134, 255, 0.45)); }
.brand span { font: 400 15px/1 var(--f-brand); letter-spacing: 0.16em; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { position: relative; font-size: 15px; font-weight: 500; color: var(--muted); padding: 8px 0; transition: color 0.2s; }
.nav-links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px;
  background: var(--brand-hi);
  transform: scaleX(0); transition: transform 0.25s var(--ease);
}
.nav-links a:hover, .nav-links a[aria-current] { color: var(--text); }
.nav-links a[aria-current]::after { transform: scaleX(1); }
.nav-divider { width: 1px; height: 18px; background: var(--line-2); }
.lang-btn { display: inline-flex; align-items: center; gap: 2px; font: 600 13px/1 var(--f-body); letter-spacing: 0.08em; }
.lang-btn span { padding: 6px 4px; color: var(--dim); transition: color 0.2s; }
.lang-btn i { font-style: normal; color: var(--line-2); }
.lang-btn:hover span { color: var(--muted); }
.lang-btn[data-active='en'] [data-lang='en'], .lang-btn[data-active='id'] [data-lang='id'] { color: var(--text); }
.menu-btn { display: none; width: 38px; height: 38px; border: 1px solid var(--line-2); border-radius: 9px; position: relative; }
.menu-btn i { position: absolute; left: 10px; right: 10px; height: 1.5px; background: var(--text); transition: transform 0.3s var(--ease), top 0.3s var(--ease); }
.menu-btn i:first-child { top: 15px; }
.menu-btn i:last-child { top: 21px; }
.nav.is-open .menu-btn i:first-child { top: 18px; transform: rotate(45deg); }
.nav.is-open .menu-btn i:last-child { top: 18px; transform: rotate(-45deg); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: max(88svh, 620px);
  display: flex; flex-direction: column; justify-content: center;
  padding-block: calc(var(--nav-h) + 48px) 96px;
  overflow: hidden;
  isolation: isolate;
  /* glow fades out before the bottom edge, so the hero blends into the next section */
  background: radial-gradient(ellipse 45% 50% at 80% 44%, rgba(22, 72, 196, 0.22), transparent 70%);
}
/* drifting pixels on the right side (pixels.js) */
.hero-pixels { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.hero-copy { max-width: 820px; }

.hero-title {
  font: 700 clamp(34px, 6.2vw, 84px)/1.04 var(--f-display);
  letter-spacing: -0.02em;
  max-width: 12em;
  text-wrap: balance;
}
.hero-lede {
  margin-top: 22px;
  max-width: 32em;
  font-size: clamp(17px, 1.4vw, 19px);
  color: #c3cfe2;
}
.hero-cta { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- CIVIREIGN ---------- */
.civ {
  position: relative;
  padding-block: clamp(96px, 12vw, 160px);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  /* same navy base as the hero; the gold light fades out well before the edges */
  background:
    radial-gradient(ellipse 50% 42% at 50% 46%, rgba(78, 56, 20, 0.55), rgba(48, 34, 12, 0.22) 50%, transparent 78%),
    var(--bg);
}
.civ::before {
  /* dotted field */
  content: ''; position: absolute; inset: 0; z-index: -2;
  background: radial-gradient(circle, rgba(241, 234, 217, 0.07) 1px, transparent 1.2px) 0 0 / 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 45%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 60% at 50% 45%, #000, transparent 75%);
}

/* compass rings behind the logo */
.civ-stage {
  position: absolute; inset: 0 0 18%; z-index: -1; display: grid; place-items: center; pointer-events: none;
  /* rings fade in and out instead of being cut at the section edge */
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 26%, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 26%, #000 78%, transparent 100%);
}
.civ-stage > * { grid-area: 1 / 1; }
.civ-stage::before, .civ-stage::after {
  content: ''; grid-area: 1 / 1;
  width: min(1100px, 120vw); height: 1px;
  background: linear-gradient(90deg, transparent, rgba(217, 164, 65, 0.28), transparent);
}
.civ-stage::after { width: 1px; height: min(820px, 130vh); background: linear-gradient(180deg, transparent, rgba(217, 164, 65, 0.22), transparent); }
.ring { border-radius: 50%; }
.ring-1 { width: min(540px, 84vw); aspect-ratio: 1; border: 1px solid rgba(217, 164, 65, 0.2); }
.ring-2 { width: min(720px, 112vw); aspect-ratio: 1; border: 1px dashed rgba(217, 164, 65, 0.15); animation: spin 140s linear infinite; }
.ring-3 {
  width: min(920px, 144vw); aspect-ratio: 1;
  background: repeating-conic-gradient(rgba(217, 164, 65, 0.42) 0 0.35deg, transparent 0.35deg 5deg);
  -webkit-mask-image: radial-gradient(farthest-side, transparent calc(100% - 12px), #000 calc(100% - 11px));
  mask-image: radial-gradient(farthest-side, transparent calc(100% - 12px), #000 calc(100% - 11px));
  opacity: 0.6;
  animation: spin 220s linear infinite reverse;
}
.civ-glow {
  width: min(620px, 90vw); aspect-ratio: 1.6;
  background: radial-gradient(closest-side, rgba(217, 164, 65, 0.24), transparent);
  filter: blur(20px);
  animation: breathe 7s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { opacity: 0.55; transform: scale(0.94); } }

.civ-inner { display: flex; flex-direction: column; align-items: center; }
/* logo tilts toward the pointer (main.js), floats, and gets a light sweep */
.civ-logo { position: relative; width: min(640px, 100%); perspective: 1100px; }
.civ-logo img, .civ-shine {
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  animation: civ-float 8s ease-in-out infinite;
}
.civ-logo img { width: 100%; filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 40px rgba(217, 164, 65, 0.14)); }
.civ-shine {
  position: absolute; inset: 0; pointer-events: none;
  -webkit-mask: url('../img/civireign/logo-dark.webp') center / 100% 100% no-repeat;
  mask: url('../img/civireign/logo-dark.webp') center / 100% 100% no-repeat;
  background:
    radial-gradient(circle at var(--sx, 50%) 35%, rgba(255, 236, 190, 0.28), transparent 38%),
    linear-gradient(105deg, transparent 42%, rgba(255, 244, 214, 0.75) 50%, transparent 58%);
  background-size: 100% 100%, 300% 100%;
  background-repeat: no-repeat;
  mix-blend-mode: soft-light;
  animation: civ-float 8s ease-in-out infinite, civ-sweep 6s var(--ease) infinite;
}
@keyframes civ-float { 50% { translate: 0 -10px; } }
@keyframes civ-sweep {
  0% { background-position: 0 0, 150% 0; }
  45%, 100% { background-position: 0 0, -50% 0; }
}
.civ-desc { margin-top: 32px; max-width: 30em; font-size: 17px; color: #cfc6b5; text-wrap: balance; }
.civ-status { margin-top: 8px; font-size: 14px; font-weight: 500; color: var(--gold); opacity: 0.85; }
.civ-cta { margin-top: 28px; display: flex; justify-content: center; gap: 12px; }
.civ-cta:empty { display: none; }
.civ-cta .btn-primary { background: linear-gradient(120deg, #fff3d6 0%, #f2c86a 35%, #d9a441 70%, #a87a26 100%); color: #1a1305; }

/* ---------- contact ---------- */
.info { padding-block: clamp(80px, 10vw, 128px); }
.info-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(40px, 7vw, 120px); }
.info-block { display: grid; gap: 16px; align-content: start; }
.info-block > p { color: var(--muted); font-size: 17px; max-width: 34em; }

/* contact links under About */
.links { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 14px; }
.link-row { display: flex; align-items: center; gap: 12px; font-size: 16px; }
.link-icon { display: grid; place-items: center; color: var(--brand-hi); }
.link-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.link-row a { color: var(--text); border-bottom: 1px solid var(--line-2); transition: color 0.2s, border-color 0.2s; }
.link-row a:hover { color: var(--brand-hi); border-color: var(--brand-hi); }
.link-copy {
  margin-left: 4px; padding: 3px 9px;
  border: 1px solid var(--line-2); border-radius: 6px;
  font-size: 12px; font-weight: 600; color: var(--muted);
  transition: border-color 0.2s, color 0.2s;
}
.link-copy:hover, .link-copy.is-done { border-color: var(--brand-hi); color: var(--brand-hi); }
.links-soon { font-size: 14px; color: var(--dim); }
.links-soon:empty { display: none; }

/* contact form: plain fields, no box around them */
.contact-form { margin-top: 8px; display: grid; gap: 16px; }
.topics { border: 0; margin: 0; padding: 0; min-width: 0; }
.topics legend, .field > span { padding: 0; margin-bottom: 6px; font-size: 14px; font-weight: 500; color: var(--muted); }
.topic-list { display: flex; flex-wrap: wrap; gap: 6px; }
.topic { position: relative; }
.topic input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.topic span {
  display: inline-flex; align-items: center;
  height: 32px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 999px;
  font-size: 13.5px; font-weight: 500; color: var(--muted);
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}
.topic:hover span { color: var(--text); }
.topic input:checked + span { border-color: var(--brand-hi); background: rgba(47, 134, 255, 0.16); color: var(--text); }
.topic input:focus-visible + span { outline: 2px solid var(--brand-hi); outline-offset: 2px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; }
.field input, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: rgba(3, 6, 14, 0.6);
  color: var(--text);
  font: 400 16px/1.5 var(--f-body);
  transition: border-color 0.2s, box-shadow 0.2s;
}
/* grows with the text where supported, so templates fit without a scrollbar */
.field textarea { field-sizing: content; min-height: 150px; max-height: 420px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand-hi); box-shadow: 0 0 0 3px rgba(47, 134, 255, 0.2); }
.field [aria-invalid='true'] { border-color: #ff7a8f; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.form-status { flex: 1 1 220px; font-size: 14px; color: var(--muted); }
.form-status.is-ok { color: #79e3b5; }
.form-status.is-error { color: #ff8fa1; }
.form-status a { color: var(--brand-hi); text-decoration: underline; text-underline-offset: 3px; }
.btn:disabled { opacity: 0.6; cursor: progress; }

/* ---------- footer ---------- */
.footer { padding: 64px 0 32px; border-top: 1px solid var(--line); overflow: hidden; }
.footer-brand { display: flex; justify-content: center; margin-bottom: 48px; user-select: none; }
.footer-brand p {
  font: 400 clamp(32px, 9.5vw, 136px)/1 var(--f-brand);
  letter-spacing: 0.08em;
  padding-left: 0.08em;
  background: linear-gradient(180deg, rgba(234, 242, 255, 0.92), rgba(120, 170, 255, 0.1));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  white-space: nowrap;
}
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; color: var(--dim); }
.to-top { color: var(--muted); transition: color 0.2s; }
.to-top:hover { color: var(--brand-hi); }

/* ---------- reveal ---------- */
.js [data-reveal] { opacity: 0; }
.js [data-reveal].is-in { animation: rise 0.7s var(--ease) var(--d, 0s) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .nav-inner { gap: 16px; }
  .brand img { height: 28px; }
  .brand span { font-size: 14px; }
  .nav-divider { display: none; }
  .nav-links a::after { display: none; }
  .menu-btn { display: inline-block; }
  .nav-links {
    position: fixed; inset: var(--nav-h) 0 auto; margin: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 4px var(--gutter) 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
  }
  .nav.is-open .nav-links { opacity: 1; visibility: visible; }
  .nav-links a { padding: 16px 0; font-size: 16px; border-bottom: 1px solid var(--line); }

  /* leave room under the buttons for the pixels */
  .hero { justify-content: flex-start; min-height: 86svh; padding-bottom: 72px; background: radial-gradient(ellipse 90% 32% at 50% 70%, rgba(22, 72, 196, 0.24), transparent 70%); }
  .hero-cta .btn { flex: 1 1 auto; }
  .info-grid { grid-template-columns: minmax(0, 1fr); }
  .field-row { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; animation: none !important; }
  .ring-2, .ring-3, .civ-glow, .civ-logo img { animation: none !important; }
  .civ-shine { display: none; }
}

/* ---------- 404 page ---------- */
.hero.hero-404 { min-height: 100svh; justify-content: center; padding-bottom: 64px; text-align: center; }
.nf { display: flex; flex-direction: column; align-items: center; }
.nf-code {
  font: 700 clamp(72px, 12vw, 140px)/1 var(--f-display);
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #e6f6ff 0%, #7fd8ff 35%, #2f86ff 70%, #1d5cff 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.nf-title { margin-top: 10px; font: 700 clamp(24px, 3vw, 34px)/1.2 var(--f-display); }
.nf-text { margin-top: 10px; max-width: 30em; color: var(--muted); }
.nf .btn { margin-top: 32px; }
