@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Nocturne design tokens. */
:root {
  --color-bg: #161826;
  --color-surface: #232532;
  --color-text: #e9e9ed;
  --color-accent: #9184d9;
  --color-divider: color-mix(in srgb, #e9e9ed 16%, transparent);

  --color-neutral-100: #f3f5fe;
  --color-neutral-200: #e4e7f5;
  --color-neutral-300: #cfd3e5;
  --color-neutral-400: #b2b6ca;
  --color-neutral-500: #9397ab;
  --color-neutral-800: #3f424d;
  --color-neutral-900: #292b31;

  --color-accent-100: #f5f4ff;
  --color-accent-200: #e7e5fe;
  --color-accent-300: #d2cefd;
  --color-accent-400: #b5abfc;
  --color-accent-800: #423a6a;

  --color-section: #262a60;
  --color-section-glow: #353b80;

  --font: "Inter", system-ui, sans-serif;

  --space-2: 5.6px;
  --space-3: 8.4px;
  --space-4: 11.2px;
  --space-6: 16.8px;
  --space-8: 22.4px;

  --radius-md: 8px;
  --radius-lg: 14px;
  --shadow-sm: 0 0 0 1px #3f424d;

  --gutter: clamp(18px, 5vw, 64px);
  --section-y: clamp(48px, 8vw, 104px);
  --danger: #e07a73;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--color-bg); }
body {
  color: var(--color-text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  overflow-x: hidden;
}
h1, h2, h3 { font-weight: 500; line-height: 1.12; margin: 0; }
p { margin: 0; }
img { display: block; max-width: 100%; }
a { color: var(--color-accent); text-underline-offset: 3px; }
a:hover { color: var(--color-accent-400); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

/* — shared bits — */
.tag {
  display: inline-flex; align-items: center; font-size: 11px;
  letter-spacing: 0.02em; padding: 3px 10px; border-radius: 6px;
}
.tag-accent { background: var(--color-accent-800); color: var(--color-accent-100); }
.tag-neutral { background: var(--color-neutral-800); color: var(--color-neutral-100); }
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent); }
.kicker { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent); }
.section-title { font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.025em; text-wrap: balance; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 15px; font-weight: 500;
  padding: 11px 20px; border-radius: var(--radius-md);
  border: 1px solid var(--color-divider); background: transparent;
  color: var(--color-text); text-decoration: none; cursor: pointer;
}
.btn:hover { background: rgba(233, 233, 237, 0.07); color: var(--color-text); }
.btn-primary { color: var(--color-accent); border-color: var(--color-accent); }
.btn-primary:hover { background: rgba(145, 132, 217, 0.12); color: var(--color-accent-300); }
.btn-sm { font-size: 14px; font-weight: 400; padding: 6px 12px; }

/* — hero — */
.hero {
  position: relative;
  min-height: min(92vh, 820px);
  display: flex; flex-direction: column;
  overflow: hidden;
  background: radial-gradient(ellipse 70% 60% at 62% 42%, #1c1f30 0%, var(--color-bg) 70%);
}
/* The owl artwork, barely visible in the dark: the face is darkened and faded into the page,
   and two copies of the image clipped to the eyes keep them glowing. main.js lights it and
   makes it blink. On wide screens it sits to the right behind the headline; on narrower ones
   it is pinned to the right edge so the eyes stay clear of the title; on phones it is centred
   so both eyes fit. */
.owl {
  --owl-w: clamp(560px, 78vw, 1240px);
  --eye-ry: 11.4%;
  position: absolute; top: 44%;
  left: max(calc(50% - clamp(280px, 39vw, 620px)), calc(100% - 0.85 * var(--owl-w)));
  width: var(--owl-w); aspect-ratio: 1080 / 900;
  transform: translateY(-50%);
  opacity: 0; transition: opacity 2.4s ease;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 52% 50% at 50% 46%, #000 30%, transparent 78%);
  mask-image: radial-gradient(ellipse 52% 50% at 50% 46%, #000 30%, transparent 78%);
}
.owl.lit { opacity: 1; }
.owl.blink { --eye-ry: 0.4%; }
.owl img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.owl-face { filter: brightness(0.16) saturate(0.55) hue-rotate(15deg); }
.owl-eye {
  opacity: 0.85; filter: saturate(1.1);
  clip-path: ellipse(9.6% var(--eye-ry) at var(--eye-x) var(--eye-y));
  transition: clip-path 110ms ease-in;
}
.owl-eye-left { --eye-x: 29.2%; --eye-y: 41.2%; filter: saturate(1.1) drop-shadow(0 0 18px rgba(240, 180, 60, 0.35)); }
.owl-eye-right { --eye-x: 72.3%; --eye-y: 40.6%; }
.hero-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to right, rgba(22, 24, 38, 0.6) 0%, rgba(22, 24, 38, 0.3) 30%, transparent 55%),
    linear-gradient(to top, var(--color-bg) 0%, transparent 35%);
}

.topnav {
  position: relative;
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-6);
  padding: clamp(14px, 3vw, 28px) var(--gutter);
}
.brand {
  display: flex; align-items: center; gap: 10px; margin-right: auto;
  font-weight: 500; font-size: 20px; letter-spacing: -0.02em;
  color: var(--color-text); text-decoration: none;
}
.brand:hover { color: var(--color-text); }
.brand-eyes { display: flex; gap: 4px; }
.brand-eyes span { width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); }
.topnav-links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-6); font-size: 14px; }
.topnav-links > a { color: var(--color-neutral-300); text-decoration: none; }
.topnav-links > a:hover { color: var(--color-accent); }

.lang {
  display: flex; overflow: hidden; font-size: 12px;
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.lang button {
  font: inherit; font-size: 12px; padding: 5px 9px; border: 0; cursor: pointer;
  background: transparent; color: var(--color-neutral-400);
}
.lang button + button { border-left: 1px solid var(--color-divider); }
.lang button[aria-pressed="true"] { background: var(--color-accent-800); color: var(--color-accent-100); }

.who { display: inline-flex; align-items: center; gap: 8px; color: var(--color-text); text-decoration: none; }
.who:hover { color: var(--color-accent); }
.who img { width: 28px; height: 28px; border-radius: 50%; }

.hero-body {
  position: relative; flex: 1;
  display: flex; flex-direction: column; justify-content: flex-end; gap: var(--space-6);
  padding: 0 var(--gutter) clamp(40px, 8vw, 96px);
  max-width: 820px;
}
.tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.hero h1 { font-size: clamp(40px, 7.5vw, 88px); line-height: 1; letter-spacing: -0.035em; text-wrap: balance; }
.hero-sub { font-size: clamp(16px, 1.8vw, 19px); line-height: 1.5; color: var(--color-neutral-300); max-width: 520px; text-wrap: pretty; }
.ctas { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: var(--space-2); }

/* — games — */
.games {
  padding: var(--section-y) var(--gutter);
  display: flex; flex-direction: column; gap: clamp(24px, 4vw, 40px);
}
.section-head { display: flex; flex-direction: column; gap: var(--space-2); max-width: 560px; }
.featured {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  background: var(--color-surface); border-radius: var(--radius-lg); overflow: hidden;
  color: var(--color-text); text-decoration: none; box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.featured:hover {
  color: var(--color-text);
  box-shadow: 0 0 0 1px #9184d9, 0 16px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(-2px);
}
.featured-cover { aspect-ratio: 16 / 9; overflow: hidden; background: var(--color-neutral-900); }
.featured-cover img { width: 100%; height: 100%; object-fit: cover; }
.featured-cover img.contain { object-fit: contain; }
.featured-body {
  display: flex; flex-direction: column; justify-content: center; gap: var(--space-4);
  padding: clamp(20px, 3.5vw, 40px);
}
.featured-body .tag { align-self: flex-start; }
.featured-body h3 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.02em; }
.featured-body p { color: var(--color-neutral-300); }
.featured-play { color: var(--color-accent); font-weight: 500; }

.soon {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: var(--space-6);
}
.soon:empty { display: none; }
.soon li { display: flex; flex-direction: column; background: var(--color-surface); border-radius: var(--radius-md); overflow: hidden; }
.soon-cover { aspect-ratio: 16 / 9; overflow: hidden; background: var(--color-neutral-900); }
.soon-cover img {
  width: 100%; height: 100%; object-fit: cover; object-position: top;
  opacity: 0.75; filter: grayscale(0.25);
}
.soon-cover img.contain { object-fit: contain; object-position: center; }
.soon-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-4); }
.soon-name { font-weight: 500; }
.soon-meta .tag { padding: 2px 8px; letter-spacing: 0; background: var(--color-neutral-800); color: var(--color-neutral-200); white-space: nowrap; }

/* — about — */
.about {
  padding: var(--section-y) var(--gutter);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(32px, 6vw, 80px); align-items: center;
}
.about-text { display: flex; flex-direction: column; gap: var(--space-4); max-width: 480px; }
.about-text > p { color: var(--color-neutral-300); font-size: 16px; line-height: 1.6; text-wrap: pretty; }
.about-text > p.nord { color: var(--color-neutral-400); font-size: 14px; line-height: 1.55; display: flex; align-items: center; gap: 10px; }
.flag { display: flex; flex: none; width: 18px; height: 12px; border-radius: 2px; overflow: hidden; }
.flag span { flex: 1; }
.flag span:nth-child(1) { background: #3b4fa8; }
.flag span:nth-child(2) { background: var(--color-neutral-100); }
.flag span:nth-child(3) { background: #c8443f; }
.founders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); }
.founder { display: flex; flex-direction: column; gap: var(--space-3); }
.founder-photo {
  aspect-ratio: 4 / 5; border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  background: repeating-linear-gradient(135deg, #1d2030 0 10px, #202334 10px 20px);
  overflow: hidden;
}
.founder-photo img { width: 100%; height: 100%; object-fit: cover; }
.founder-name { display: block; font-weight: 500; }
.founder-role { display: block; font-size: 13px; color: var(--color-neutral-400); }

/* — community — */
.community { padding: 0 var(--gutter) var(--section-y); }
.community-card {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-8); padding: clamp(28px, 5vw, 56px); border-radius: var(--radius-lg);
  background: radial-gradient(ellipse 80% 120% at 0% 0%, var(--color-section-glow) 0%, var(--color-section) 60%);
}
.community-text { display: flex; flex-direction: column; gap: var(--space-3); max-width: 520px; }
.community-text h2 { font-size: clamp(26px, 3.5vw, 36px); letter-spacing: -0.025em; }
.community-text p { color: var(--color-neutral-200); font-size: 16px; text-wrap: pretty; }
.btn-discord { color: var(--color-accent-200); border-color: var(--color-accent-300); }
.btn-discord:hover { background: rgba(210, 206, 253, 0.12); color: var(--color-accent-100); }

/* — footer — */
.footer {
  padding: var(--space-8) var(--gutter) clamp(28px, 4vw, 40px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-6);
  font-size: 13px; color: var(--color-neutral-400);
  background: linear-gradient(to right, transparent, rgba(233, 233, 237, 0.16) 48px, rgba(233, 233, 237, 0.16) calc(100% - 48px), transparent) no-repeat top / 100% 1px;
}
.footer nav { display: flex; flex-wrap: wrap; gap: var(--space-6); }
.footer nav a { color: var(--color-neutral-300); text-decoration: none; }
.footer nav a:hover { color: var(--color-accent); }

/* — login, callback and account pages — */
.button {
  display: inline-block; padding: 10px 18px;
  border: 1px solid var(--color-accent); border-radius: var(--radius-md);
  background: transparent; color: var(--color-accent);
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
}
.button:hover { background: rgba(145, 132, 217, 0.12); color: var(--color-accent-300); }
.button:disabled { opacity: 0.6; cursor: wait; }
.button.secondary { border-color: var(--color-divider); color: var(--color-text); }
.button.secondary:hover { background: rgba(233, 233, 237, 0.07); }
.button.danger { border-color: var(--danger); color: var(--danger); }
.button.danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.panel { max-width: 420px; margin: 48px auto; padding: 0 16px; }
.panel h1 { font-size: 32px; letter-spacing: -0.025em; margin: 16px 0; }
.panel p { line-height: 1.5; margin-bottom: 12px; }
.back { color: var(--color-neutral-400); text-decoration: none; }
.fine { color: var(--color-neutral-400); font-size: 0.9rem; }
.error { color: var(--danger); }
.avatar { width: 64px; height: 64px; border-radius: 50%; }
.panel label { display: block; margin: 16px 0 6px; font-size: 13px; color: var(--color-neutral-300); }
.panel input {
  width: 100%; padding: 10px; margin-bottom: 12px;
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
  background: var(--color-surface); color: var(--color-text); caret-color: var(--color-accent);
  font: inherit;
}
.panel input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
