:root {
  --accent: #ff7a3d; /* koi orange */
  --display: "Anton", Impact, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace; /* small technical text */
  --gutter: clamp(16px, 4vw, 48px);

  /* Theme colors — changed by JS as you scroll */
  --bg: #0e1a1a;
  --fg: #f3ead8;
  --muted: #8fa39b;
  --line: rgba(243, 234, 216, 0.12);
  --on-accent: #0e1a1a; /* text on top of the accent color */
  --water: #163a33; /* tint over gallery images deep in the "pond" */
}

/* Section tints (koi pond: deep water greens) — the background shader fades between these */
body[data-theme="night"] { --bg: #0e1a1a; --fg: #f3ead8; --muted: #8fa39b; --line: rgba(243,234,216,.12); }
body[data-theme="deep"]  { --bg: #12241f; --fg: #f3ead8; --muted: #93a89f; --line: rgba(243,234,216,.14); }
body[data-theme="ink"]   { --bg: #0f1e1c; --fg: #f3ead8; --muted: #8fa39b; --line: rgba(243,234,216,.12); }

* { box-sizing: border-box; margin: 0; padding: 0; }
html.lenis, html.lenis body { height: auto; }

/* Hide the page scrollbar (scrolling still works) */
html { scrollbar-width: none; }           /* Firefox */
html::-webkit-scrollbar { display: none; } /* Chrome, Edge, Safari */
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  justify-content: center; /* menu + language switch centered */
  align-items: center;
  padding: 18px var(--gutter);
  mix-blend-mode: difference;
  color: #fff;
}
.topbar-right { display: flex; align-items: center; gap: clamp(16px, 3.5vw, 40px); }
.topbar nav { display: flex; gap: clamp(12px, 3vw, 32px); }

/* HUN / ENG switch */
.lang {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.lang span { opacity: 0.4; }
.lang button {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 4px 2px;
  cursor: pointer;
  opacity: 0.45;
}
.lang button:hover { opacity: 0.8; }
.lang button[aria-pressed="true"] { opacity: 1; }
.topbar nav a {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
}
.topbar nav .line {  /* underline, animated on hover by Motion */
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
}

/* ---------- Animated topographic background (bg.js) ---------- */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ---------- Shared ---------- */
section { padding: clamp(80px, 14vh, 160px) var(--gutter); position: relative; }

.section-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3rem, 11vw, 9rem);
  line-height: 0.9;
  text-transform: uppercase;
  margin-bottom: clamp(40px, 8vh, 90px);
}
.section-title em { text-transform: none; font-size: 1.05em; }

/* Hidden until Motion reveals them (only when JS + Motion are running) */
.motion .reveal { opacity: 0; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 1.2rem;
}
.hero-name {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.25rem, 11vw, 10rem);
  line-height: 1.05; /* tall enough for the full letters (overflow hides them only while they slide in) */
  display: flex;
  overflow: hidden;
  padding: 0.04em 0;
}
.hero-name span {
  display: inline-block;
}
.motion .hero-name span { transform: translateY(105%); }

.hero-sub { font-size: max(12px, calc(clamp(1.1rem, 2.4vw, 1.6rem) - 10px)); } /* 10px smaller than before */
.hero-sub em { font-size: 1.2em; }

.scroll-hint {
  position: absolute;
  bottom: 28px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ---------- Contour divider (drawn by contour.js) ---------- */
.contour { position: relative; }
.contour canvas {
  display: block;
  width: 100%;
  height: clamp(140px, 22vh, 220px);
}

/* ---------- Works: fly-through gallery ---------- */
.works { padding: 0; height: 100vh; }

/* The page stops here while you fly through the images (see script.js) */
.gallery-sticky {
  position: relative;
  height: 100vh;
  overflow: hidden;
  perspective-origin: 50% 50%;  /* perspective is set from JS to match the screen size */
  /* soft glow in the middle = the far end of the tunnel */
  background: radial-gradient(ellipse 60% 45% at 50% 50%, rgba(255, 122, 61, 0.08), transparent 70%);
}
.gallery-title {  /* big "WORKS" intro text, zoomed + faded from script.js */
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.25rem, 11vw, 10rem);
  line-height: 0.85;
  pointer-events: none;
  will-change: transform, opacity;
}
.gallery-world {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  pointer-events: none; /* the 3D stage itself sits "in front" of the images, so let clicks pass through */
}
.gallery-world figure {
  cursor: zoom-in; /* click to open in the lightbox */
  pointer-events: auto;
  --depth: 0; /* 0 = in front of you, 1 = deep under water (set from script.js) */
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 10px;
  visibility: hidden;
  will-change: transform, opacity;
}
.gallery-world img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  /* seen through water: blurrier, duller and darker the deeper it is */
  filter: blur(calc(var(--depth) * 6px)) saturate(calc(1 - var(--depth) * 0.6)) brightness(calc(1 - var(--depth) * 0.3));
}
/* green water tint on top, fading away as the image swims up to you */
.gallery-world figure::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--water);
  opacity: calc(var(--depth) * 0.6);
  pointer-events: none;
}

.gallery-info {
  position: absolute;
  left: var(--gutter);
  bottom: 28px;
  z-index: 1;
  display: flex;
  gap: 18px;
  align-items: baseline;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.gallery-caption { color: var(--fg); }
.gallery-hint { opacity: 0.75; white-space: nowrap; }
.gallery-hint i { margin-right: 4px; }
.hint-tap { display: none; }
@media (hover: none) { /* touch screens say "tap" instead of "click" */
  .hint-click { display: none; }
  .hint-tap { display: inline; }
}
@media (max-width: 700px) {
  .gallery-info { flex-wrap: wrap; row-gap: 8px; right: var(--gutter); bottom: 44px; }
  .gallery-hint { flex-basis: 100%; }
}
.gallery-bar {
  position: absolute;
  right: var(--gutter);
  bottom: 34px;
  z-index: 1;
  width: 120px;
  height: 2px;
  background: var(--line);
}
.gallery-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
}

/* ---------- Projects: pinned while the title zooms away and the cards come up ---------- */
.projects { padding: 0; height: 260vh; }  /* extra height = scroll distance for the animation */
.projects-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 0 var(--gutter);
}
.projects-title {  /* big "Projects" intro text, zoomed + faded from script.js (same look as "Works") */
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.25rem, 11vw, 10rem);
  line-height: 0.85;
  pointer-events: none;
  will-change: transform, opacity;
}
.project-list { width: 100%; max-width: 520px; display: grid; gap: 20px; }
.project-card {
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(14, 26, 26, 0.55);
  backdrop-filter: blur(6px);
  will-change: transform, opacity;
}
.project-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}
.project-card h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 1.05;
  text-transform: uppercase;
  margin: 10px 0 12px;
}
.project-card p { color: var(--muted); line-height: 1.6; margin-bottom: 22px; }
.project-links { display: flex; flex-wrap: wrap; gap: 10px; }
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s;
}
.project-link:hover { background: var(--accent); color: var(--on-accent); }
.project-link.ghost { border-color: var(--line); color: var(--fg); }  /* quieter second button */
.project-link.ghost:hover { border-color: var(--fg); background: transparent; color: var(--fg); }
.project-link .fa-arrow-right { font-size: 0.8rem; transition: transform 0.2s; }
.project-link:hover .fa-arrow-right { transform: translateX(3px); }

/* ---------- Specs + Connections: compact & centered ---------- */
.specs, .connect { text-align: center; }
.specs .section-title, .connect .section-title {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  margin-bottom: 28px;
}
.spec-list, .link-list {
  max-width: 460px;
  margin: 0 auto;
  text-align: left;
}

.spec-list { border-top: 1px solid var(--line); }
.spec-list div {
  display: flex;
  justify-content: space-between;
  align-items: center; /* label sits in the middle, also next to two-line values */
  gap: 1rem;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}
.spec-list dt {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.spec-list dd {
  font-weight: 600;
  font-size: 1rem;
  text-align: right;
}

.link-list { list-style: none; border-top: 1px solid var(--line); }
.link-list a {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
}
.link-list .fill {  /* green hover fill, animated by Motion */
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: bottom;
}
.link-list i { font-size: 1.1rem; width: 1.4em; text-align: center; }
.link-list span:not(.fill) { font-weight: 600; font-size: 1rem; flex: 1; }
.link-list .arrow { font-size: 0.85rem; opacity: 0; }
.link-list .handle {  /* your username on each site (Discord's swaps to "Copied!" when clicked) */
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.8rem;
  color: inherit;
  opacity: 0.7;
}

.footer {
  display: flex;
  justify-content: space-between;
  max-width: 460px;
  margin: 60px auto 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer a:hover { color: var(--accent); }

/* ---------- Mobile ---------- */
@media (max-width: 700px) {
  .topbar nav a { font-size: 0.68rem; letter-spacing: 0.04em; }
  .lang { font-size: 0.66rem; }
}

/* ---------- JetBrains Mono for the small technical text ---------- */
.topbar nav a,
.lang,
.scroll-hint,
.gallery-info,
.spec-list dt,
.footer {
  font-family: var(--mono);
  font-weight: 500;
}

/* ---------- Lightbox (lightbox.js) ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
}
.lightbox[hidden] { display: none; }
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  cursor: zoom-out;
}
.lightbox-img {
  position: relative;
  max-width: min(92vw, 1400px);
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
  transform-origin: 0 0; /* needed for the fly-in/out animation */
}
.lightbox-ui button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  color: var(--fg);
  font-size: 1rem;
  cursor: pointer;
}
.lightbox-ui button:hover { border-color: var(--accent); color: var(--accent); }
.lightbox-close { top: 20px; right: var(--gutter); }
.lightbox-prev { left: var(--gutter); top: 50%; translate: 0 -50%; }
.lightbox-next { right: var(--gutter); top: 50%; translate: 0 -50%; }
.lightbox-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  display: flex;
  justify-content: center;
  gap: 18px;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.lightbox-caption { color: var(--fg); }
@media (max-width: 700px) {
  .lightbox-img { max-width: 94vw; max-height: 72vh; }
  .lightbox-prev, .lightbox-next { top: auto; bottom: 64px; translate: none; }
}
