/* ============================================================
   JÓZSA DÁVID — Personal Site
   Premium design system · 2026
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400;1,600&family=Inter:wght@300;400&family=DM+Mono:wght@300;400&display=swap');

/* ── Theme tokens ──────────────────────────────────────────── */

/* Default: dark (index, writing) */
:root {
  --bg:           #080806;
  --bg-2:         #111110;
  --bg-3:         #1a1a18;
  --text:         #e8e3d8;
  --text-dim:     #8a8680;
  --text-muted:   #484642;
  --accent:       #c4a96a;
  --accent-2:     #7a6840;
  --border:       #1e1e1c;
  --border-2:     #2c2c28;

  --nav-text:     var(--text);
  --nav-text-dim: var(--text-dim);
  --nav-bg-solid: rgba(8,8,6,0.95);

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --font-label:   'DM Mono', 'Courier New', monospace;

  --nav-h:        58px;
  --gutter:       clamp(1.5rem, 5vw, 4.5rem);
  --max-w:        1340px;
  --ease:         cubic-bezier(0.16, 1, 0.3, 1);
  --ease-std:     cubic-bezier(0.4, 0, 0.2, 1);
}

/* Nolka: white world */
body.theme-nolka {
  --bg:           #f5f2ed;
  --bg-2:         #ebe7e0;
  --bg-3:         #e0dbd3;
  --text:         #0d0c0a;
  --text-dim:     #5c5a56;
  --text-muted:   #b0ada8;
  --accent:       #1e1e1c;
  --accent-2:     #8a8880;
  --border:       #d8d4cc;
  --border-2:     #c8c4bc;

  --nav-text:     #0d0c0a;
  --nav-text-dim: #5c5a56;
  --nav-bg-solid: rgba(245,242,237,0.96);
}

/* Kibo: pure black world */
body.theme-kibo {
  --bg:           #020202;
  --bg-2:         #090908;
  --bg-3:         #121210;
  --text:         #f0ece5;
  --text-dim:     #787672;
  --text-muted:   #363634;
  --accent:       #cac6be;
  --accent-2:     #4a4846;
  --border:       #161614;
  --border-2:     #222220;

  --nav-text:     #f0ece5;
  --nav-text-dim: #787672;
  --nav-bg-solid: rgba(2,2,2,0.97);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  min-height: 100svh;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a   { color: inherit; text-decoration: none; }

/* ── Navigation ────────────────────────────────────────────── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  transition: background 0.35s var(--ease-std), border-color 0.35s;
  border-bottom: 1px solid transparent;
}

.site-nav.scrolled {
  background: var(--nav-bg-solid);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--border);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--nav-text);
  transition: opacity 0.2s;
}
.nav-logo:hover { opacity: 0.55; }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 2.75rem);
}

.nav-links a {
  font-family: var(--font-label);
  font-size: 0.66rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--nav-text-dim);
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--nav-text);
  transition: width 0.3s var(--ease);
}
.nav-links a:hover        { color: var(--nav-text); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active       { color: var(--nav-text); }
.nav-links a.active::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 1px;
  background: var(--nav-text);
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── Utilities ─────────────────────────────────────────────── */
.label {
  display: inline-block;
  font-family: var(--font-label);
  font-size: 0.62rem;
  font-weight: 300;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.label--accent { color: var(--accent); }

.rule { width: 100%; height: 1px; background: var(--border); }

/* ── Contact block (shared across all pages) ───────────────── */
.contact-block {
  padding: clamp(4.5rem, 9vw, 8rem) var(--gutter);
  text-align: center;
  border-top: 1px solid var(--border);
}
.contact-block__label { display: block; margin-bottom: 1.5rem; }
.contact-block__heading {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 300;
  font-style: italic;
  color: var(--text);
  line-height: 1.05;
  margin-bottom: 0.75rem;
}
.contact-block__sub {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin: 0 auto 2.5rem;
  max-width: 46ch;
  line-height: 1.8;
}
.contact-block__email {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.8vw, 1.3rem);
  font-style: italic;
  color: var(--accent);
  display: inline-block;
  position: relative;
  transition: color 0.25s;
}
.contact-block__email::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.contact-block__email:hover { color: var(--text); }
.contact-block__email:hover::after { transform: scaleX(1); }

/* ── Footer (shared) ───────────────────────────────────────── */
.site-footer {
  padding: 1.75rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  gap: 1.5rem;
}
.site-footer__copy {
  font-family: var(--font-label);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}
.site-footer__links { display: flex; gap: 2rem; }
.site-footer__links a {
  font-family: var(--font-label);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.2s;
}
.site-footer__links a:hover { color: var(--text-dim); }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-label);
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.72rem 1.4rem;
  border: 1px solid;
  transition: all 0.22s var(--ease-std);
  cursor: pointer;
}
.btn--primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.btn--primary:hover { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn--ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border-2);
}
.btn--ghost:hover { color: var(--text); border-color: var(--text-dim); }

/* ── Custom cursor ─────────────────────────────────────────── */
@media (pointer: fine) {
  * { cursor: none !important; }
}

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  will-change: transform;
}

.cursor-dot {
  width: 5px; height: 5px;
  background: var(--text);
  mix-blend-mode: difference;
  transition: width 0.18s var(--ease), height 0.18s var(--ease);
  z-index: 10000;
}

.cursor-ring {
  width: 26px; height: 26px;
  border: 1px solid var(--text-dim);
  opacity: 0.5;
  transition:
    width  0.38s var(--ease),
    height 0.38s var(--ease),
    opacity 0.3s,
    border-color 0.3s;
}

/* Theme-specific ring color */
body.theme-nolka .cursor-ring  { border-color: #5c5a56; }
body.theme-kibo  .cursor-ring  { border-color: #787672; }

/* Hover state */
.cursor-dot.is-hover           { width: 3px; height: 3px; }
.cursor-ring.is-hover          { width: 46px; height: 46px; opacity: 0.8; border-color: var(--accent); }

/* Click state */
.cursor-dot.is-click           { width: 3px; height: 3px; }
.cursor-ring.is-click          { width: 18px; height: 18px; opacity: 1; }

/* ── Film grain overlay ─────────────────────────────────────── */
.film-grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-repeat: repeat;
  background-size: 256px 256px;
  opacity: 0.55;
}

/* ── Scroll reveals ─────────────────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transition:
    opacity  0.7s var(--ease),
    transform 0.7s var(--ease);
}

[data-reveal="up"],
[data-reveal] {
  transform: translateY(22px);
}

[data-reveal="left"] {
  transform: translateX(-22px);
}

[data-reveal="scale"] {
  transform: scale(0.97);
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 700px) {
  :root { --nav-h: 52px; }

  .nav-links {
    display: none;
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    background: var(--nav-bg-solid);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    z-index: 190;
  }
  .nav-links.open { display: flex; }
  .nav-links a    { font-size: 0.8rem; letter-spacing: 0.28em; }
  .nav-toggle     { display: flex; }

  .site-footer { flex-direction: column; text-align: center; }
}
