/* ============================================================
   BASE.CSS — közös alapok és változók (theme-független)
   A téma-fájlok ezeket a változókat írják felül.
   ============================================================ */

/* ---------- CSS RESET ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

/* ---------- ALAPÉRTELMEZETT TÉMA-VÁLTOZÓK ----------
   Ezeket felülírja: theme-gevirtz.css vagy theme-42bit.css
   ---------------------------------------------------- */
:root {
  /* Színek */
  --color-bg: #000;
  --color-bg-soft: #0a0a0a;
  --color-text: #fff;
  --color-text-muted: rgba(255, 255, 255, 0.55);
  --color-text-faint: rgba(255, 255, 255, 0.35);
  --color-border: rgba(255, 255, 255, 0.08);
  --color-accent: #fff;

  /* Tipográfia */
  --font-display: serif;
  --font-body: serif;
  --font-mono: ui-monospace, monospace;

  /* Méretek (clamp-pel skálázva mobil → desktop) */
  --fs-display: clamp(1.5rem, 1.2rem + 1.4vw, 2rem);
  --fs-h1: clamp(1.25rem, 1rem + 1vw, 1.625rem);
  --fs-h2: clamp(1rem, 0.9rem + 0.6vw, 1.25rem);
  --fs-body: clamp(0.875rem, 0.84rem + 0.2vw, 0.95rem);
  --fs-small: 0.75rem;
  --fs-tiny: 0.6875rem;

  /* Letter spacing */
  --tracking-display: 0.18em;
  --tracking-nav: 0.16em;
  --tracking-tight: 0.04em;

  /* Spacing */
  --space-page-x: clamp(1.25rem, 4vw, 3rem);
  --space-section: clamp(2rem, 6vw, 5rem);

  /* Header */
  --header-height: 5.5rem;
  --header-height-mobile: 4.5rem;

  /* Animáció */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 180ms;
  --t-med: 360ms;
  --t-slow: 700ms;

  /* Grid */
  --grid-gap: 0;
  --grid-cols-desktop: 3;
  --grid-cols-tablet: 2;
  --grid-cols-mobile: 1;
}

/* ---------- KÖZÖS LAYOUT ---------- */
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-main {
  flex: 1;
}

/* ---------- HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  height: var(--header-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--space-page-x);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-med) var(--ease-out);
}

.site-header.is-scrolled {
  border-bottom-color: var(--color-border);
}

/* Bal oldali nav (desktop) */
.nav-primary {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-primary a {
  font-family: var(--font-display);
  font-size: var(--fs-small);
  letter-spacing: var(--tracking-nav);
  text-transform: uppercase;
  color: var(--color-text-muted);
  transition: color var(--t-fast) var(--ease-out);
  padding: 0.25rem 0;
  position: relative;
}

.nav-primary a:hover,
.nav-primary a[aria-current="page"] {
  color: var(--color-text);
}

/* Hero brand a header közepén */
.brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-display);
  letter-spacing: var(--tracking-display);
  color: var(--color-text);
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-tagline {
  font-family: var(--font-display);
  font-size: var(--fs-tiny);
  letter-spacing: var(--tracking-nav);
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-style: italic;
}

/* Jobb oldali nav (desktop) — social + lang */
.nav-utility {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  justify-content: flex-end;
}

.nav-utility a,
.nav-utility button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  color: var(--color-text-muted);
  transition: color var(--t-fast) var(--ease-out), opacity var(--t-fast) var(--ease-out);
}

.nav-utility a:hover {
  color: var(--color-text);
}

.nav-utility .icon-disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.nav-utility .icon-disabled:hover {
  color: var(--color-text-muted);
}

.nav-utility svg {
  width: 1.125rem;
  height: 1.125rem;
}

/* Hamburger gomb (mobil) */
.nav-toggle {
  display: none;
  width: 1.75rem;
  height: 1.75rem;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  z-index: 101;
}

.nav-toggle svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* ---------- MOBIL OVERLAY MENÜ ---------- */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-1rem);
  transition: opacity var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out);
}

.nav-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-overlay a {
  font-family: var(--font-display);
  font-size: 1.125rem;
  letter-spacing: var(--tracking-nav);
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 0.5rem 0;
}

.nav-overlay a[aria-current="page"] {
  color: var(--color-text);
}

.nav-overlay-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}

.nav-overlay-close svg {
  width: 1.5rem;
  height: 1.5rem;
}

.nav-overlay-utility {
  position: absolute;
  bottom: 2.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-overlay-utility a,
.nav-overlay-utility button {
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-overlay-utility svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* ---------- PROJECT GRID (placeholder hely) ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols-desktop), 1fr);
  gap: var(--grid-gap);
}

.project-card {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-bg-soft);
  cursor: pointer;
  outline: none;
}

.project-card:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

.project-card__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter var(--t-med) var(--ease-out), transform var(--t-slow) var(--ease-out);
}

.project-card:hover .project-card__media {
  filter: grayscale(1);
  transform: scale(1.02);
}

.project-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 100%);
  opacity: 0;
  transition: opacity var(--t-med) var(--ease-out);
}

.project-card:hover .project-card__overlay,
.project-card:focus-visible .project-card__overlay {
  opacity: 1;
}

.project-card__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-h2);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
  text-align: center;
  text-transform: uppercase;
  max-width: 80%;
}

.project-card__category {
  font-family: var(--font-display);
  font-size: var(--fs-tiny);
  letter-spacing: var(--tracking-nav);
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
  display: block;
}

/* ---------- FOOTER ---------- */
.site-footer {
  padding: var(--space-section) var(--space-page-x);
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--fs-tiny);
  letter-spacing: var(--tracking-nav);
  text-transform: uppercase;
  color: var(--color-text-faint);
}

/* ---------- BACK TO TOP ---------- */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-med) var(--ease-out), background var(--t-fast) var(--ease-out);
  z-index: 50;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  background: rgba(255, 255, 255, 0.16);
}

.back-to-top svg {
  width: 1rem;
  height: 1rem;
}

/* ---------- ACCESSIBILITY ---------- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.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;
}

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