/* =========================================================
   dieopaz – shared stylesheet (used by every page)
   Dark "deep space" theme: warm fire vs. cool quantum accents.
   ========================================================= */

:root {
  color-scheme: dark;

  /* colours */
  --bg: #05060d;
  --bg-2: #0a0d1a;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #eef1f8;
  --muted: #a6aec2;
  --dim: #737c94;
  --fire: #ff8a3d;
  --fire-hot: #ffd27a;
  --ember: #ff5a1f;
  --quantum: #6ee7ff;
  --violet: #a78bfa;
  --wood: #c98a55;
  --ok: #8be9a8;
  --bad: #ff8a7a;

  /* type */
  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* layout */
  --max: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 18px;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* faint deep-field texture behind the whole page */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background: url('../img/deep-field.webp') center / cover no-repeat;
  opacity: 0.1;
  pointer-events: none;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 15% 85%, rgba(167, 139, 250, 0.06), transparent 70%),
    radial-gradient(50% 40% at 85% 70%, rgba(110, 231, 255, 0.05), transparent 70%);
  pointer-events: none;
}

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

a {
  color: var(--quantum);
  text-underline-offset: 3px;
}
a:hover {
  color: #fff;
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 16px;
}

/* ---------- header ---------- */
.site-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}
.brand__mark {
  width: 40px;
  height: 40px;
}
.brand__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(5, 6, 13, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lang-switch__btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 6px 14px;
  min-width: 44px;
  min-height: 32px;
  background: transparent;
  color: var(--muted);
  font: 600 0.8rem/1 var(--font-display);
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.lang-switch__btn:hover {
  color: var(--text);
}
.lang-switch__btn[aria-pressed='true'] {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: max(660px, 100svh);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(96px, 13vh, 130px) var(--gutter) 0;
}

.hero__backdrop {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(75% 50% at 50% 28%, rgba(5, 6, 13, 0.9) 20%, transparent 80%),
    url('../img/cosmic-cliffs.webp') center 35% / cover no-repeat;
  opacity: 0.6;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 28%, #000 62%, transparent 92%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 28%, #000 62%, transparent 92%);
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  cursor: pointer;
}

.hero__ground {
  position: absolute;
  inset: auto 0 0 0;
  height: 14%;
  z-index: -1;
  background: linear-gradient(to bottom, transparent, var(--bg) 85%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border: 1px solid rgba(110, 231, 255, 0.25);
  border-radius: 999px;
  background: rgba(110, 231, 255, 0.06);
  color: var(--quantum);
  font: 500 0.75rem/1.2 var(--font-display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.eyebrow__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--quantum);
  box-shadow: 0 0 10px var(--quantum);
  animation: pulse 2.4s ease-in-out infinite;
}

.hero__title {
  font-size: clamp(2.2rem, 5.8vw, 4.2rem);
  font-weight: 600;
  background: linear-gradient(180deg, #ffffff 35%, #ffd9a8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-wrap: balance;
}
/* "Die Opaz" on the first line, "technika és tudomány" on the second */
.hero__title-brand,
.hero__title-sub {
  display: block;
}

.hero__lead {
  max-width: 780px;
  color: #c9cfdd;
  font-size: clamp(0.98rem, 1.4vw, 1.08rem);
  text-shadow: 0 1px 12px rgba(5, 6, 13, 0.9), 0 0 2px rgba(5, 6, 13, 0.8);
  text-wrap: pretty;
}


/* ---------- sections ---------- */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(56px, 9vw, 96px) var(--gutter) 0;
}
.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 28px;
}
.section__title {
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  font-weight: 600;
  margin-bottom: 28px;
}
.section__head .section__title {
  margin-bottom: 0;
}
.section__lead {
  color: var(--muted);
}

/* ---------- interactive page tiles ---------- */
/* auto-fill keeps a single tile at normal width; new tiles flow in next to it */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 16px;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.tile:hover {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 1px rgba(110, 231, 255, 0.08), 0 18px 50px -20px rgba(110, 231, 255, 0.25);
}
/* tile pictures are 5:3 snapshots of the pages themselves (800 × 480) */
.tile__media {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 3;
  object-fit: cover;
  background: var(--bg-2);
}
.tile__body {
  padding: 20px 22px 24px;
}
.tile__title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.tile__text {
  color: var(--muted);
  font-size: 0.95rem;
}
/* a tile that links to an existing interactive page */
a.tile {
  color: inherit;
  text-decoration: none;
}
a.tile:hover .tile__title {
  color: var(--fire-hot);
}

.badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(5, 6, 13, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text);
  font: 500 0.72rem/1.3 var(--font-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- footer ---------- */
/* Everything below the hero is a "second screen": together with the footer it is at least
   one viewport tall, so scrolled to the very bottom the hero is just out of view.
   layout.js sets --footer-h; without JS the screen is a bit taller, never shorter. */
.screen {
  min-height: calc(100svh - var(--footer-h, 0px));
  padding-bottom: clamp(56px, 9vw, 96px);
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px var(--gutter) 32px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  color: var(--dim);
  font-size: 0.82rem;
}
.site-footer__credits a {
  margin-left: 6px;
}

/* ---------- credits page (forrasok/) ---------- */
.credits {
  padding-top: 72px; /* room for the absolutely positioned header */
}
.credits .section {
  padding-top: clamp(32px, 5vw, 48px);
}
.credits__intro .section__title {
  margin-bottom: 12px;
}
.credits__last {
  padding-bottom: clamp(56px, 9vw, 96px);
}
.credits__heading {
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
  font-weight: 600;
  margin: 0 0 10px;
}
.credits__text,
.credits__plain {
  color: var(--muted);
  max-width: 72ch;
}
.credits__list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.credit {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.credit__thumb {
  flex: none;
  width: 96px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
}
.credit__title {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.credit__meta {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.credits__plain {
  margin: 0;
  padding-left: 1.2em;
}
.credits__plain li + li {
  margin-top: 6px;
}
.credits__back {
  margin-top: 32px;
}

/* ---------- motion ---------- */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.75);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- small screens ---------- */
@media (max-width: 560px) {
  .site-header {
    padding-top: 14px;
  }
  .hero {
    min-height: max(620px, 100svh);
  }
  .eyebrow {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
  }
  .credit__thumb {
    width: 72px;
    height: 48px;
  }
}
