/* =====================================================================
   Glyph - shared stylesheet
   Palette pulled from the header illustration: deep space violet,
   ice cyan, ember gold.
   ===================================================================== */

:root {
  --space-900: #05040f;
  --space-800: #0a0819;
  --space-700: #120e29;
  --space-600: #1b1540;

  --glass: rgba(20, 16, 46, 0.62);
  --glass-strong: rgba(12, 10, 30, 0.88);
  --hairline: rgba(255, 255, 255, 0.10);
  --hairline-bright: rgba(255, 255, 255, 0.20);

  --cyan: #4fe3ff;
  --violet: #a875ff;
  --gold: #ffc46b;
  --rose: #ff7a9c;

  --text: #edeaf8;
  --muted: #a9a2c8;
  --dim: #7a7398;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;

  --shell: 1120px;
  --gutter: clamp(1.1rem, 4vw, 2.25rem);

  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', 'Nunito', system-ui, sans-serif;

  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.40);
}

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

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

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--space-900);
  background-image:
    /* vignette, so the edges fall away into deep space */
    radial-gradient(140% 100% at 50% 40%, transparent 42%, rgba(0, 0, 0, 0.55) 100%),
    /* near nebulae */
    radial-gradient(760px 520px at 78% 6%, rgba(168, 117, 255, 0.26), transparent 64%),
    radial-gradient(680px 480px at 12% 12%, rgba(79, 227, 255, 0.17), transparent 62%),
    radial-gradient(620px 460px at 88% 62%, rgba(255, 122, 156, 0.11), transparent 64%),
    radial-gradient(900px 620px at 22% 78%, rgba(94, 84, 255, 0.16), transparent 66%),
    /* far glow along the bottom, like a lit horizon */
    radial-gradient(1200px 620px at 50% 112%, rgba(255, 196, 107, 0.10), transparent 62%),
    /* the deep field itself, banded so it does not read as a flat wash */
    linear-gradient(178deg, #06050f 0%, #0a0819 38%, #0d0a20 62%, #06050f 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #9ceeff; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.3rem, 6vw, 3.7rem); }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.35rem); }
h3 { font-size: 1.16rem; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 1.1em; padding-left: 1.15rem; }
li { margin-bottom: 0.4em; }
li::marker { color: var(--cyan); }

::selection { background: rgba(168, 117, 255, 0.45); color: #fff; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

/* --------------------------------------------------------------- layout */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(3rem, 8vw, 5.5rem); }
.section--tight { padding-block: clamp(2.2rem, 5vw, 3.5rem); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--cyan);
  color: #04121a;
  font-weight: 800;
  padding: 0.7rem 1.1rem;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------- starfield */

#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.9;
}

/* a slow band of light across the field, the galactic plane */
.space-wash {
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 150vh;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(104deg, transparent 34%, rgba(150, 180, 255, 0.07) 47%,
                    rgba(206, 180, 255, 0.09) 52%, rgba(150, 180, 255, 0.06) 57%, transparent 70%);
  filter: blur(22px);
}

/* --------------------------------------------------------------- nav */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(6, 5, 16, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--hairline);
}

.site-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand__dot { color: var(--cyan); }

.nav-toggle .icon-x { display: none; }
.nav-toggle[aria-expanded="true"] .icon-bars { display: none; }
.nav-toggle[aria-expanded="true"] .icon-x { display: block; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--hairline-bright);
  color: var(--text);
  border-radius: var(--radius-sm);
  width: 42px;
  height: 38px;
  font-size: 1.05rem;
  cursor: pointer;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: block;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.nav-links a[aria-current="page"] {
  color: var(--text);
  background: rgba(79, 227, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(79, 227, 255, 0.35);
}

@media (max-width: 780px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0.7rem var(--gutter) 1.1rem;
    background: rgba(6, 5, 16, 0.97);
    border-bottom: 1px solid var(--hairline);
  }
  .nav-links[hidden] { display: none; }
  .nav-links a { padding: 0.75rem 0.9rem; border-radius: var(--radius-sm); }
}

/* --------------------------------------------------------------- hero */

.hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(430px, 76vh, 660px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-bottom: 1px solid var(--hairline);
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 42%;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, var(--space-900) 2%, rgba(5, 4, 15, 0.72) 34%, rgba(5, 4, 15, 0.12) 72%),
    linear-gradient(to right, rgba(5, 4, 15, 0.86) 0%, rgba(5, 4, 15, 0.28) 55%, transparent 85%);
}

.hero__content {
  padding-block: clamp(2.4rem, 7vw, 4.2rem);
  max-width: 42rem;
}

.hero h1 { margin-bottom: 0.35em; }

.hero__name {
  display: block;
  font-size: clamp(3rem, 11vw, 5.6rem);
  letter-spacing: -0.03em;
  background: linear-gradient(96deg, #ffffff 8%, var(--cyan) 48%, var(--violet) 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.79rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 1.1rem;
}
.hero__kicker::before {
  content: "";
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan));
}

.hero__lede {
  font-size: clamp(1.02rem, 2.1vw, 1.2rem);
  color: #dcd7ef;
  max-width: 34rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.6rem;
}

@media (max-width: 700px) {
  .hero__scrim {
    background:
      linear-gradient(to top, var(--space-900) 3%, rgba(5, 4, 15, 0.88) 44%, rgba(5, 4, 15, 0.36) 80%),
      linear-gradient(to right, rgba(5, 4, 15, 0.62), rgba(5, 4, 15, 0.30));
  }
  .hero__media img { object-position: 70% 28%; }
}

/* Compact hero used on interior pages */
.page-head {
  border-bottom: 1px solid var(--hairline);
  padding-block: clamp(2.6rem, 7vw, 4.4rem);
  background:
    radial-gradient(760px 300px at 12% 0%, rgba(168, 117, 255, 0.20), transparent 66%),
    radial-gradient(640px 280px at 88% 10%, rgba(79, 227, 255, 0.14), transparent 64%);
}
.page-head p { color: var(--muted); max-width: 46rem; font-size: 1.06rem; }

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.72rem 1.35rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.96rem;
  text-decoration: none;
  border: 1px solid var(--hairline-bright);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover {
  color: var(--text);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(79, 227, 255, 0.5);
  box-shadow: 0 10px 26px rgba(79, 227, 255, 0.18);
}

.btn--primary {
  background: linear-gradient(100deg, var(--cyan), var(--violet));
  border-color: transparent;
  color: #080a1c;
}
.btn--primary:hover {
  color: #080a1c;
  box-shadow: 0 12px 30px rgba(168, 117, 255, 0.38);
}

.btn--telegram {
  background: #229ed9;
  border-color: #229ed9;
  color: #ffffff;
}
.btn--telegram:hover {
  background: #1c8dc4;
  border-color: #1c8dc4;
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(34, 158, 217, 0.42);
}

/* --------------------------------------------------------------- cards */

.grid {
  display: grid;
  gap: 1.15rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.grid--two { grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); align-items: start; }

.card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(79, 227, 255, 0.38);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.card h3 { margin-bottom: 0.45em; }
.card p { color: var(--muted); font-size: 0.97rem; }
.card ul { color: var(--muted); font-size: 0.95rem; margin-bottom: 0; }

.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 1.14rem;
  margin-bottom: 1rem;
  color: var(--cyan);
  background: rgba(79, 227, 255, 0.12);
  border: 1px solid rgba(79, 227, 255, 0.26);
}
.card__icon--violet { color: var(--violet); background: rgba(168, 117, 255, 0.13); border-color: rgba(168, 117, 255, 0.28); }
.card__icon--gold { color: var(--gold); background: rgba(255, 196, 107, 0.12); border-color: rgba(255, 196, 107, 0.28); }
.card__icon--rose { color: var(--rose); background: rgba(255, 122, 156, 0.12); border-color: rgba(255, 122, 156, 0.28); }

a.card { text-decoration: none; color: inherit; display: block; }
a.card h3 { color: var(--text); }
a.card .card__more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.9rem;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--cyan);
}
a.card:hover .card__more i { transform: translateX(3px); }
a.card .card__more i { transition: transform 0.2s ease; }

/* --------------------------------------------------------------- misc blocks */

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 0.7rem;
}

.lede { font-size: 1.1rem; color: #d9d4ee; max-width: 44rem; }

.prose { max-width: 46rem; color: #ded9f0; }
.prose h2 { margin-top: 1.8em; }
.prose h2:first-child { margin-top: 0; }

.tag-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.1rem; }
.tag {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--hairline);
}

.stat-row {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-top: 2rem;
}
.stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
}
.stat__value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--cyan); }
.stat__label { font-size: 0.86rem; color: var(--dim); }

.callout {
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--gold);
  background: rgba(255, 196, 107, 0.06);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
  color: #e6e0d4;
  font-size: 0.98rem;
}

.divider {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--hairline-bright), transparent);
  margin-block: clamp(2rem, 5vw, 3rem);
}

/* Timeline-ish list used on the workshop page */
.log { list-style: none; padding: 0; margin: 0; }
.log li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.85rem;
  color: var(--muted);
}
.log li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(79, 227, 255, 0.14);
}
.log strong { color: var(--text); }

/* Contact panel */
.contact-panel {
  background: var(--glass-strong);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: clamp(1.6rem, 4vw, 2.6rem);
  box-shadow: var(--shadow);
  text-align: center;
  max-width: 40rem;
  margin-inline: auto;
}
.contact-panel .btn { margin-top: 0.4rem; }

.cta-band {
  background: linear-gradient(115deg, rgba(168, 117, 255, 0.16), rgba(79, 227, 255, 0.10));
  border-block: 1px solid var(--hairline);
}
.cta-band .shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding-block: clamp(2rem, 5vw, 3rem);
}
.cta-band h2 { margin-bottom: 0.25em; }
.cta-band p { color: var(--muted); margin: 0; }

/* --------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--hairline);
  background: rgba(5, 4, 15, 0.72);
  padding-block: 2.2rem;
  font-size: 0.9rem;
  color: var(--dim);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--cyan); }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.1rem; }

/* --------------------------------------------------------------- reveal */

.reveal { transition: opacity 0.6s ease, transform 0.6s ease; }
/* Only hide pre-reveal content when JavaScript is running to bring it back. */
.js .reveal { opacity: 0; transform: translateY(16px); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  /* the starfield stays, main.js simply draws it once and stops */
}

/* --------------------------------------------------------------- 404 */

.notfound {
  min-height: 72vh;
  display: flex;
  align-items: center;
  text-align: center;
}
.notfound .shell { max-width: 40rem; }
.notfound .code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 18vw, 8rem);
  line-height: 1;
  background: linear-gradient(100deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --------------------------------------------------------------- art */

.art {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.art img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow-sm);
}
.art figcaption {
  font-size: 0.82rem;
  color: var(--dim);
  letter-spacing: 0.02em;
}
.art figcaption a { color: var(--muted); }

/* stickers and cutouts: no frame, no plate, shadow follows the artwork */
.art--cutout img {
  border: 0;
  background: none;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
}

/* circular crop, used for the small avatar */
.art--round img {
  border-radius: 50%;
  aspect-ratio: 1;
  object-fit: cover;
}

/* a column that sits beside prose and stops growing on wide screens */
.art-column {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  align-items: stretch;
}
.art-column .art { max-width: 20rem; width: 100%; align-self: center; }
.art-column .art--cutout img { max-height: 24rem; object-fit: contain; }

/* art tucked inside a card, above the heading */
.card > .art {
  margin-bottom: 1.1rem;
  max-width: 15rem;
  margin-inline: auto;
}
.card > .art img { max-height: 14rem; object-fit: contain; }
.card > .art figcaption { text-align: center; }

/* the round avatar keeps its own size regardless of the card width */
.art.art--round { max-width: none; align-items: center; }
.contact-panel .art--round figcaption { text-align: center; }
.art.art--round img {
  width: 11rem;
  height: 11rem;
  max-height: none;
  object-fit: cover;
  border-radius: 50%;
}

/* small sticker floated next to a heading block */
.art--corner {
  float: right;
  width: clamp(6.5rem, 18vw, 9.5rem);
  margin: 0 0 0.9rem 1.1rem;
}
.art--corner figcaption { text-align: center; }

/* sticker that leans over the top edge of the panel it belongs to */
.panel-with-peek { position: relative; }
.panel-with-peek > .art--peek {
  position: absolute;
  top: -3.6rem;
  right: 1.4rem;
  width: 7.5rem;
  margin: 0;
  pointer-events: none;
}
.panel-with-peek > .art--peek figcaption { display: none; }
@media (max-width: 700px) {
  .panel-with-peek > .art--peek { width: 5.5rem; top: -2.7rem; right: 0.9rem; }
}

/* a single wide piece that gets its own row */
.art--wide { max-width: 46rem; margin-inline: auto; }
.art--wide figcaption { text-align: center; }

/* credits block in the footer of a page that shows several pieces */
.credit-note {
  font-size: 0.86rem;
  color: var(--dim);
  margin-top: 1.6rem;
}


/* --------------------------------------------------------------- gallery */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.6rem 1.25rem;
  margin-top: 1.6rem;
}

/* Every tile is the same shape whether the piece is a framed illustration or a
   cut-out sticker, so the grid reads as a grid rather than a pile. */
.gallery .art img,
.gallery .art--cutout img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  padding: 0.7rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  filter: none;
}
.gallery .art figcaption {
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
}

/* --------------------------------------------------------------- embed */

.embed {
  position: relative;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  overflow: hidden;
  height: min(78vh, 900px);
}
.embed iframe {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  border: 0;
}

/* sits behind the frame, so the panel is never an empty void while the
   third-party gallery is still loading */
.embed__standin {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  color: var(--dim);
  font-size: 0.95rem;
}
.embed-fallback {
  margin-top: 1.1rem;
  text-align: center;
}
@media (max-width: 700px) {
  .embed { height: min(70vh, 640px); }
}
