/* Afkalt — base: tokens, reset, typography, buttons, nav, cubes, footer */

:root {
  --bg: #080b11;
  --bg-2: #0b0e15;
  --panel: #11161f;
  --panel-2: #161c27;
  --panel-3: #1f2634;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);

  --text: #f1f4fa;
  --muted: #a9b2c2;
  --dim: #788398;

  --grass: #6cc644;
  --grass-2: #4e9a2f;
  --diamond: #4fe0d5;
  --gold: #f2c94c;
  --redstone: #ff5d5d;
  --accent-soft: rgba(108, 198, 68, 0.12);

  /* Brand gradients — the new signature accent (headlines, highlights, glows). */
  --brand: var(--grass);
  --grad-brand: linear-gradient(110deg, #7ad24f 0%, #4fe0d5 100%);
  --grad-text: linear-gradient(100deg, #96e36f, #4fe0d5);

  /* Clean sans everywhere. --font-pixel is the old name, kept so every page picks up the new face;
     --font-game is only for things drawn like the game's own UI (inventory slots, item glyphs). */
  --font-display: 'Inter Tight', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-pixel: var(--font-display);
  --font-game: 'Silkscreen', ui-monospace, 'Cascadia Mono', monospace;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --container: 1200px;
  --nav-h: 80px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 50px -28px rgba(0, 0, 0, 0.75);
  --shadow-pop: 0 30px 70px -32px rgba(0, 0, 0, 0.85);
  --elev-1: 0 2px 10px -4px rgba(0, 0, 0, 0.5);
  --elev-2: 0 16px 40px -18px rgba(0, 0, 0, 0.65);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
  overflow-x: hidden;
}

img, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -0.025em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: rgba(108, 198, 68, 0.35); color: #fff; }
:focus-visible { outline: 2px solid var(--grass); outline-offset: 3px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .container { padding: 0 18px; } }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grass);
}
.eyebrow::before {
  content: ''; width: 16px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--grass), transparent);
}

.text-grad {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}

/* ---------- buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  padding: 0.78em 1.25em;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: transform 0.14s cubic-bezier(.2, .8, .2, 1), filter 0.15s ease, background-color 0.15s ease, box-shadow 0.18s ease;
}
.btn:active { transform: translateY(1px); }

/* Primary */
.btn-mc {
  background: linear-gradient(180deg, #7fd957, var(--grass) 55%, var(--grass-2));
  color: #06130a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 26px -14px rgba(108, 198, 68, 0.55);
}
.btn-mc:hover { filter: brightness(1.05); transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 3px 6px rgba(0, 0, 0, 0.35), 0 18px 34px -14px rgba(108, 198, 68, 0.7); }
.btn-mc:active { transform: translateY(0); }

/* Secondary */
.btn-stone {
  background: var(--panel-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 1px 2px rgba(0, 0, 0, 0.3);
}
.btn-stone:hover { background: var(--panel-3); transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--line-2), var(--elev-2); }
.btn-stone:active { transform: translateY(0); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.015);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 1px var(--line-2); transform: translateY(-2px); }
.btn-ghost:active { transform: translateY(0); }

/* Discord blurple (login, "Join our Discord"); the logo is an inline svg inside the button. */
.btn-discord {
  background: #5865f2;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 24px -16px rgba(88, 101, 242, 0.9);
}
.btn-discord:hover { background: #6773f4; transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 14px 28px -14px rgba(88, 101, 242, 0.9); }
.btn-discord:active { transform: translateY(0); }
/* No max-width here: in an icon-only button, iPhone browsers resolve the global "svg { max-width: 100% }"
   against the button's own (content-sized) width and shrink the logo to nothing. */
.btn-discord svg { flex: none; max-width: none; }
.btn-icon { padding: 0.6em 0.7em; }

.btn-sm { padding: 0.58em 0.95em; font-size: 0.84rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 0.95em 1.6em; font-size: 1rem; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; filter: none; }

/* ---------- CSS 3D cube ---------- */
[data-cube] {
  --s: 44px;
  display: inline-block;
  width: var(--s);
  height: var(--s);
  flex-shrink: 0;
  /* True isometric (like Minecraft inventory icons): no perspective, so all
     edges stay equal and the block reads as a perfect cube. */
  --cube-rest: rotateX(-35.264deg) rotateY(45deg) scale3d(0.62, 0.62, 0.62);
  --cube-turn: rotateX(-35.264deg) rotateY(225deg) scale3d(0.62, 0.62, 0.62);
}
.cube {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: var(--cube-rest);
  transition: transform 0.6s cubic-bezier(.2, .8, .2, 1);
}
.cube-face {
  position: absolute;
  inset: 0;
  background-size: 100% 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  backface-visibility: hidden;
}
/* Shading like the game's item renderer: bright top, two darker sides. */
.cube-front  { transform: translateZ(calc(var(--s) / 2)); filter: brightness(0.82); }
.cube-back   { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); filter: brightness(0.82); }
.cube-right  { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); filter: brightness(0.64); }
.cube-left   { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); filter: brightness(0.64); }
.cube-top    { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); filter: brightness(1.05); }
.cube-bottom { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); filter: brightness(0.5); }

.cube-spin .cube { animation: cube-spin 9s linear infinite; }
@keyframes cube-spin {
  from { transform: rotateX(-35.264deg) rotateY(45deg) scale3d(0.62, 0.62, 0.62); }
  to   { transform: rotateX(-35.264deg) rotateY(405deg) scale3d(0.62, 0.62, 0.62); }
}

/* A block icon sitting in a soft rounded tile, like an app icon. */
.cube-tile {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: calc(var(--s, 44px) + 16px); height: calc(var(--s, 44px) + 16px);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 0 0 1px var(--line);
}

/* Reusable "app icon" tile for a block — a soft gradient square with a hairline. */
.block-tile {
  box-sizing: content-box;
  display: inline-grid; place-items: center;
  padding: 9px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015));
  box-shadow: inset 0 0 0 1px var(--line), var(--elev-1);
}

/* ---------- textured strips ---------- */
[data-texture] {
  background-repeat: repeat-x;
  background-size: 48px 48px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.grass-strip { height: 24px; background-position: 0 0; }

/* ---------- nav (floating glass bar) ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  padding: 16px 24px;
  transition: padding 0.25s ease;
}
.nav-inner {
  position: relative;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 36px;
  padding: 0 10px 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, backdrop-filter 0.25s ease;
}
.nav.is-scrolled { padding: 10px 24px; }
.nav.is-scrolled .nav-inner,
.nav.is-open .nav-inner {
  background: rgba(13, 17, 25, 0.72);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  backdrop-filter: blur(20px) saturate(1.3);
  border-color: var(--line-2);
  box-shadow: 0 12px 40px -18px rgba(0, 0, 0, 0.8);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}
.brand [data-cube] { --s: 30px; }
.brand-tld { color: var(--dim); font-weight: 600; }

.nav-links { display: flex; align-items: center; gap: 2px; margin-right: auto; }
.nav-links a { padding: 8px 14px; border-radius: 999px; font-size: 0.9rem; font-weight: 500; color: var(--muted); transition: color 0.15s, background-color 0.15s; }
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.nav-links .mobile-only { display: none; }

.nav-cta { display: flex; align-items: center; gap: 10px; }

.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border: 0; border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px var(--line-2);
  cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--text); position: relative; transition: transform 0.2s;
}
.nav-toggle span::before, .nav-toggle span::after { content: ''; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav.is-open .nav-toggle span { background: transparent; }
.nav.is-open .nav-toggle span::before { transform: translateY(6px) rotate(45deg); }
.nav.is-open .nav-toggle span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 880px) {
  .nav { padding: 12px 16px; }
  .nav.is-scrolled { padding: 8px 16px; }
  .nav-inner { gap: 12px; justify-content: space-between; height: 54px; }
  .nav-toggle { display: inline-flex; order: 3; }
  .nav-cta .btn-ghost { display: none; }
  .nav-cta { margin-left: auto; }
  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 6px); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: rgba(11, 14, 22, 0.97);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    border: 1px solid var(--line-2);
    border-radius: var(--radius-lg);
    padding: 10px;
    box-shadow: var(--shadow-pop);
  }
  .nav.is-open .nav-links { display: flex; }
  .nav-links a { padding: 13px 14px; border-radius: 10px; font-size: 1rem; }
  .nav-links a:hover { background: rgba(255, 255, 255, 0.06); }
  .nav-links .mobile-only { display: block; }
}
@media (max-width: 400px) {
  .brand { font-size: 0.98rem; }
  .nav-cta .btn { padding: 0.6em 0.85em; font-size: 0.8rem; }
}

/* ---------- reveal ---------- */
/* Cards rise gently into place as they scroll into view. */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.8s cubic-bezier(.2, .8, .2, 1);
}
.js .reveal.is-visible { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.08s !important; }
.reveal-d2 { transition-delay: 0.16s !important; }
.reveal-d3 { transition-delay: 0.24s !important; }

/* ---------- footer ---------- */
.footer { position: relative; background: #06080c; border-top: 1px solid var(--line); margin-top: 40px; }
.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 40px;
  padding: 64px 24px 44px;
}
.footer-brand p { color: var(--muted); margin-top: 14px; max-width: 300px; font-size: 0.9rem; }
.footer-brand .btn-discord { margin-top: 18px; }
.footer h4 { font-family: var(--font-body); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); margin-bottom: 14px; }
.footer li + li { margin-top: 9px; }
.footer li a { color: var(--muted); font-size: 0.9rem; transition: color 0.15s; }
.footer li a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 22px 24px 30px;
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
  color: var(--dim);
  font-size: 0.8rem;
}
@media (max-width: 760px) {
  .footer-inner { grid-template-columns: 1fr 1fr; padding: 48px 18px 34px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { padding: 18px 18px 26px; }
}

/* ---------- app pages (panel, legal, login, login callback) ----------
   A calm, solid dark canvas with one faint glow at the top, and solid cards with a hairline border. */
:root {
  --glass: linear-gradient(180deg, #131a24, #0f151d);
}
:is(.panel-page, .legal-page, .callback-page, .auth-page) {
  background:
    radial-gradient(1200px 460px at 50% -140px, rgba(108, 198, 68, 0.08), transparent 70%),
    radial-gradient(900px 500px at 85% 10%, rgba(79, 224, 213, 0.05), transparent 65%),
    var(--bg);
  background-attachment: fixed;
}
.glass-card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* ---------- phones: finger-sized buttons, and no zoom when tapping a field ----------
   iPhones zoom the whole page into any field whose text is under 16px, so fields are 16px here. */
@media (max-width: 760px) {
  .btn-sm { min-height: 40px; }
  /* The :not()s only raise specificity, so this beats page rules like ".console-group select". */
  input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']),
  select:not([hidden]):not([data-zoom-ok]), textarea:not([hidden]):not([data-zoom-ok]) { font-size: 16px !important; }
}

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