/* ═══════════════════════════════════════════════════
   Gelencser Ádám — Portfólió
   Globális stílusok
═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,400;0,700;0,900;1,400&family=IBM+Plex+Mono:wght@300;400&family=Cormorant+Garamond:ital,wght@1,300;1,400&display=swap');

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
:root {
  --bg:#070707; --white:#e8e4dc; --dim:#aaa;
  --border:#2a2a2a; --surface:#0d0d0d;
}
html { scroll-behavior:smooth; overflow-x:hidden; max-width:100%; }
body { background:var(--bg); color:var(--white); font-family:"IBM Plex Mono",monospace; cursor:none; overflow-x:hidden; max-width:100%; }

/* ── CURSOR ─────────────────────────────────────── */
#cur { width:7px; height:7px; background:var(--white); border-radius:50%; position:fixed; pointer-events:none; z-index:9999; transform:translate(-50%,-50%); transition:width .2s cubic-bezier(.16,1,.3,1),height .2s,background .2s,border .2s; }
#cur.big { width:36px; height:36px; background:transparent; border:1px solid var(--white); }
#cur.big::before, #cur.big::after { content:""; position:absolute; background:var(--white); }
#cur.big::before { width:1px; height:9px; top:50%; left:50%; transform:translate(-50%,-50%); }
#cur.big::after  { height:1px; width:9px;  top:50%; left:50%; transform:translate(-50%,-50%); }
@media (hover:none) { #cur { display:none; } body { cursor:auto; } }

/* ── GRAIN ──────────────────────────────────────── */
#grain { position:fixed; inset:0; z-index:997; pointer-events:none; opacity:.025; background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E"); background-size:256px; }

/* ══════════════════════════════════════════════════
   LIGHTBOX
══════════════════════════════════════════════════ */
#lightbox {
  position: fixed; inset: 0; z-index: 9990;
  background: rgba(7,7,7,.96);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
}
#lightbox.open { opacity: 1; pointer-events: auto; }
#lightbox img {
  max-width: 92vw; max-height: 88vh;
  object-fit: contain;
  outline: 5px solid var(--white);
  box-shadow: 0 40px 120px rgba(0,0,0,.9);
  transform: scale(.92);
  transition: transform .35s cubic-bezier(.16,1,.3,1);
  display: block;
}
#lightbox.open img { transform: scale(1); }
#lb-close {
  position: absolute; top: 16px; right: 20px;
  cursor: pointer !important;
  background: none;
  border: 1px solid rgba(232,228,220,.35);
  color: var(--white);
  font-family: "IBM Plex Mono", monospace;
  font-size: 18px; line-height: 1;
  padding: 5px 12px 7px;
  opacity: .72;
  transition: opacity .2s, border-color .2s;
  z-index: 2;
}
#lb-close:hover { opacity: 1; border-color: var(--white); }
#lb-hint {
  position: absolute; bottom: 18px; left: 50%;
  transform: translateX(-50%);
  font-size: 9px; letter-spacing: .24em; text-transform: uppercase;
  color: rgba(232,228,220,.3); white-space: nowrap;
  pointer-events: none;
}

/* ── HOVER PREVIEW ──────────────────────────────── */
#pv { position:fixed; pointer-events:none; z-index:900; width:320px; height:212px; overflow:hidden; opacity:0; transform:scale(.88) rotate(-1deg); transition:opacity .26s cubic-bezier(.16,1,.3,1),transform .26s cubic-bezier(.16,1,.3,1); }
#pv.on { opacity:1; transform:scale(1) rotate(0); }
#pv img { width:100%; height:100%; object-fit:cover; filter:grayscale(100%) contrast(1.05) brightness(.85); display:block; }
#pv-label { position:absolute; bottom:9px; left:11px; font-size:10px; letter-spacing:.22em; color:rgba(232,228,220,.6); text-transform:uppercase; }
#pv-c1 { position:absolute; top:9px; right:9px; width:17px; height:17px; border-top:1px solid rgba(232,228,220,.3); border-right:1px solid rgba(232,228,220,.3); }
#pv-c2 { position:absolute; bottom:9px; left:9px; width:17px; height:17px; border-bottom:1px solid rgba(232,228,220,.3); border-left:1px solid rgba(232,228,220,.3); }
@media (max-width:768px) {
  #pv { width:calc(100vw - 48px); height:auto; aspect-ratio:3/2; left:24px !important; top:auto !important; bottom:80px; transform:scale(.88); }
  #pv.on { transform:scale(1); }
}

/* ══════════════════════════════════════════════════
   NAV
══════════════════════════════════════════════════ */
nav { position:fixed; top:0; left:0; right:0; z-index:400; display:flex; justify-content:space-between; align-items:center; padding:18px 24px; background:linear-gradient(to bottom,rgba(7,7,7,.92) 0%,transparent 100%); }
.nav-logo { font-family:"Barlow Condensed",sans-serif; font-size:15px; font-weight:700; letter-spacing:.2em; text-transform:uppercase; color:var(--white); text-decoration:none; text-shadow:0 1px 8px rgba(0,0,0,.9); white-space:nowrap; }
.nav-r { display:flex; gap:30px; align-items:center; }
.nav-r a { font-size:11px; letter-spacing:.18em; text-transform:uppercase; color:var(--dim); text-decoration:none; transition:color .2s; text-shadow:0 1px 6px rgba(0,0,0,.9); }
.nav-r a:hover { color:var(--white); }
.avail { display:flex; align-items:center; gap:7px; font-size:11px; letter-spacing:.15em; text-transform:uppercase; color:#888; }
.dot { width:5px; height:5px; border-radius:50%; background:#4a8a4a; animation:blink 2.6s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

.ham { display:none; flex-direction:column; justify-content:center; gap:5px; width:36px; height:36px; cursor:pointer; z-index:410; background:none; border:none; padding:4px; }
.ham span { display:block; width:22px; height:1.5px; background:var(--white); transition:transform .3s,opacity .3s; transform-origin:center; }
.ham.open span:nth-child(1) { transform:translateY(6.5px) rotate(45deg); }
.ham.open span:nth-child(2) { opacity:0; }
.ham.open span:nth-child(3) { transform:translateY(-6.5px) rotate(-45deg); }

.mob-menu { display:none; position:fixed; inset:0; z-index:390; background:rgba(7,7,7,.97); flex-direction:column; align-items:center; justify-content:center; gap:36px; }
.mob-menu.open { display:flex; }
.mob-menu a, .mob-menu .avail { font-size:28px; letter-spacing:.18em; text-transform:uppercase; color:var(--white); text-decoration:none; font-family:"Barlow Condensed",sans-serif; font-weight:700; opacity:.85; transition:opacity .2s; }
.mob-menu a:hover { opacity:1; }
.mob-menu .avail { font-size:13px; color:#666; margin-top:16px; }

@media (max-width:768px) {
  .nav-r { display:none; }
  .ham { display:flex; }
  nav { padding:16px 20px; }
  .nav-logo { font-size:13px; }
}

/* ══════════════════════════════════════════════════
   HERO
══════════════════════════════════════════════════ */
.hero { height:100vh; position:relative; overflow:hidden; max-width:100%; }
#chaos-stage { position:absolute; inset:0; z-index:1; overflow:hidden; }

.fcard {
  position:absolute; left:0; top:0;
  overflow:hidden;
  transform-origin: 0 0;               /* scale from top-left — translate moves the corner */
  will-change: transform;              /* permanent compositor layer — GPU scales texture, no repaint */
  transition: transform 1.1s cubic-bezier(.16,1,.3,1), filter .6s ease, opacity .5s ease;
  cursor: pointer;
  opacity:0;
}
/* outline only on LOADED — no ghost frame from compositor layer at 0,0 */
.fcard.loaded { opacity:.88; outline: 5px solid var(--white); }
.fcard img { display:block; width:100%; height:100%; object-fit:cover; object-position:center; filter:grayscale(100%) contrast(1.06) brightness(.72); transition:filter .55s ease,transform .55s ease; pointer-events:none; user-select:none; }
.fcard:hover { z-index:50; box-shadow:0 24px 64px rgba(0,0,0,.85); }
.fcard:hover img { filter:grayscale(0%) contrast(1.02) brightness(1); transform:scale(1.04); }

#mode-hint { position:absolute; bottom:24px; left:24px; z-index:20; font-size:9px; letter-spacing:.24em; color:rgba(232,228,220,.4); text-transform:uppercase; text-shadow:0 1px 6px rgba(0,0,0,1); pointer-events:none; display:flex; align-items:center; gap:10px; opacity:0; animation:rise .5s .95s ease both; }
.mtrack { width:32px; height:1px; background:rgba(232,228,220,.15); position:relative; overflow:hidden; }
.mtrack::after { content:""; position:absolute; top:0; left:-100%; width:100%; height:100%; background:rgba(232,228,220,.45); animation:run 2.2s ease-in-out infinite; }
@keyframes run { 0%{left:-100%} 50%{left:0} 100%{left:100%} }

.hero-text { position:absolute; left:0; top:0; bottom:0; z-index:20; width:52%; background:transparent; display:flex; flex-direction:column; justify-content:center; padding:0 48px 0 80px; pointer-events:none; transition:opacity .6s ease; }
@media (max-width:768px) { .hero-text { width:100%; padding:0 24px; justify-content:flex-end; padding-bottom:100px; } }

.eyebrow { display:flex; align-items:center; gap:12px; font-size:10px; letter-spacing:.26em; color:rgba(232,228,220,.7); text-transform:uppercase; margin-bottom:20px; text-shadow:0 1px 10px rgba(0,0,0,1),0 0 30px rgba(0,0,0,.8); opacity:0; animation:rise .6s .2s ease both; }
.eyebrow-line { width:20px; height:1px; background:rgba(232,228,220,.3); flex-shrink:0; }
.hero-h { font-family:"Barlow Condensed",sans-serif; font-size:clamp(56px,10.5vw,156px); font-weight:900; line-height:.86; letter-spacing:-.018em; color:var(--white); text-transform:uppercase; text-shadow:0 2px 0 rgba(0,0,0,.7),0 0 20px rgba(0,0,0,1),0 0 52px rgba(0,0,0,.9),0 0 100px rgba(0,0,0,.6); opacity:0; animation:rise .8s .36s ease both; }
.hero-h .outline { -webkit-text-stroke:2px var(--white); color:transparent; text-shadow:0 0 20px rgba(0,0,0,1),0 0 52px rgba(0,0,0,.8); }
.hero-h .light-line { font-weight:700; color:var(--white); }
.hero-sub { margin-top:20px; font-family:"Cormorant Garamond",serif; font-style:italic; font-weight:300; font-size:17px; line-height:1.65; color:rgba(232,228,220,.8); max-width:300px; text-shadow:0 1px 8px rgba(0,0,0,1),0 0 24px rgba(0,0,0,.9); opacity:0; animation:rise .6s .54s ease both; }
@media (max-width:768px) { .hero-sub { display:none; } }
.chips { display:flex; align-items:center; flex-wrap:wrap; gap:8px 0; margin-top:24px; opacity:0; animation:rise .5s .72s ease both; }
.chip { font-size:9px; letter-spacing:.18em; text-transform:uppercase; color:rgba(232,228,220,.55); padding-right:12px; margin-right:12px; border-right:1px solid rgba(232,228,220,.2); text-shadow:0 1px 6px rgba(0,0,0,1); }
.chip:last-child { border-right:none; }
@keyframes rise { from{opacity:0;transform:translateY(14px)} to{opacity:1;transform:translateY(0)} }

/* ══════════════════════════════════════════════════
   MARQUEE
══════════════════════════════════════════════════ */
.marquee-wrap { border-top:1px solid var(--border); border-bottom:1px solid var(--border); overflow:hidden; padding:11px 0; background:var(--surface); }
.marquee-track { display:flex; width:max-content; animation:mroll 28s linear infinite; }
.mi { font-size:9px; letter-spacing:.24em; color:#555; text-transform:uppercase; white-space:nowrap; padding:0 20px; display:flex; align-items:center; gap:20px; }
.ms { width:3px; height:3px; background:#555; border-radius:50%; flex-shrink:0; }
@keyframes mroll { 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }

/* ══════════════════════════════════════════════════
   GALÉRIÁK
══════════════════════════════════════════════════ */
.works { padding:48px 0 72px; }
.works-hd { display:flex; align-items:baseline; gap:14px; padding:0 24px; margin-bottom:24px; }
@media (min-width:769px) { .works-hd { padding:0 44px 0 96px; } }
.wlabel { font-size:11px; letter-spacing:.26em; color:#666; text-transform:uppercase; }
.wcount { font-size:11px; color:#444; letter-spacing:.12em; }

.proj { display:grid; grid-template-columns:48px 1fr max-content; align-items:center; padding:0 24px; border-top:1px solid var(--border); cursor:none; position:relative; min-height:68px; overflow:hidden; text-decoration:none; color:inherit; }
@media (min-width:769px) { .proj { grid-template-columns:88px 1fr max-content; padding:0 44px; min-height:78px; } }
.proj:last-child { border-bottom:1px solid var(--border); }
.proj::before { content:""; position:absolute; inset:0; background:var(--white); transform:scaleX(0); transform-origin:left; transition:transform .38s cubic-bezier(.16,1,.3,1); }
.proj:hover::before { transform:scaleX(1); }
.proj>* { position:relative; z-index:1; }
.pnum { font-size:10px; color:#777; letter-spacing:.2em; transition:color .22s; }
.pmid { display:flex; flex-direction:column; gap:3px; padding:14px 0; }
.ptitle { font-family:"Barlow Condensed",sans-serif; font-size:clamp(28px,5vw,40px); font-weight:700; text-transform:uppercase; letter-spacing:-.01em; color:var(--white); line-height:1; transition:color .22s; }
.ptags { display:flex; gap:10px; }
.ptag { font-size:9px; letter-spacing:.16em; color:#777; text-transform:uppercase; transition:color .22s; }
.pcnt { font-size:10px; letter-spacing:.14em; color:#888; transition:color .22s; align-self:center; white-space:nowrap; padding-left:8px; }
.proj:hover .pnum,.proj:hover .ptitle,.proj:hover .pcnt { color:#070707; }
.proj:hover .ptag { color:#444; }
.parr { position:absolute; right:24px; top:50%; transform:translateY(-50%) translateX(10px); font-size:16px; color:#080808; opacity:0; transition:opacity .2s,transform .28s cubic-bezier(.16,1,.3,1); z-index:2; }
@media (min-width:769px) { .parr { right:44px; } }
.proj:hover .parr { opacity:1; transform:translateY(-50%) translateX(0); }

/* ══════════════════════════════════════════════════
   ABOUT
══════════════════════════════════════════════════ */
#about { border-top:1px solid var(--border); display:grid; grid-template-columns:1fr; min-height:auto; }
@media (min-width:769px) { #about { grid-template-columns:52px 1fr 1fr; min-height:56vh; } }
.arail { display:none; }
@media (min-width:769px) { .arail { display:flex; border-right:1px solid var(--border); flex-direction:column; align-items:center; justify-content:flex-end; padding-bottom:36px; } }
.arail .v-text { font-size:9px; letter-spacing:.3em; color:#555; text-transform:uppercase; writing-mode:vertical-rl; transform:rotate(180deg); }
.aleft { padding:48px 24px; display:flex; flex-direction:column; justify-content:space-between; }
@media (min-width:769px) { .aleft { padding:88px 56px; } }
.ahead { font-family:"Barlow Condensed",sans-serif; font-size:clamp(44px,6vw,84px); font-weight:700; text-transform:uppercase; letter-spacing:-.015em; line-height:.88; color:var(--white); }
.aidx { font-size:10px; letter-spacing:.24em; color:#777; text-transform:uppercase; margin-top:24px; }
.port-wrap { position:relative; margin-top:32px; }
.port { display:block; width:100%; max-width:240px; aspect-ratio:3/4; object-fit:cover; object-position:top center; filter:grayscale(100%) contrast(1.05) brightness(.86); }
@media (min-width:769px) { .port { max-width:280px; } }
.port-frame { position:absolute; bottom:-8px; right:-8px; width:calc(100% - 18px); max-width:calc(240px - 18px); aspect-ratio:3/4; border:1px solid #2a2a2a; pointer-events:none; }
@media (min-width:769px) { .port-frame { max-width:calc(280px - 18px); } }
.aright { padding:32px 24px 48px; display:flex; flex-direction:column; justify-content:flex-start; border-top:1px solid var(--border); }
@media (min-width:769px) { .aright { padding:88px 56px; justify-content:flex-end; border-top:none; border-left:1px solid var(--border); } }
.abio { font-family:"Cormorant Garamond",serif; font-style:italic; font-weight:300; font-size:18px; line-height:1.74; color:#aaa; max-width:420px; }
.abio p+p { margin-top:14px; }
.acta { display:inline-flex; align-items:center; gap:10px; margin-top:32px; text-decoration:none; font-size:11px; letter-spacing:.24em; color:var(--white); text-transform:uppercase; border-bottom:1px solid #444; padding-bottom:4px; transition:border-color .2s; }
.acta:hover { border-color:var(--white); }

/* ══════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════ */
footer { border-top:1px solid var(--border); display:flex; flex-direction:column; gap:12px; align-items:flex-start; padding:20px 24px; }
@media (min-width:769px) { footer { flex-direction:row; justify-content:space-between; align-items:center; padding:24px 44px; gap:0; } }
.fname { font-family:"Barlow Condensed",sans-serif; font-size:13px; font-weight:700; letter-spacing:.2em; text-transform:uppercase; color:#888; }
.flinks { display:flex; gap:20px; flex-wrap:wrap; }
.flinks a { font-size:10px; letter-spacing:.2em; color:#888; text-decoration:none; text-transform:uppercase; transition:color .2s; }
.flinks a:hover { color:var(--white); }
.fcopy { font-size:9px; letter-spacing:.16em; color:#444; }

/* ══════════════════════════════════════════════════
   GALLERY PAGE
══════════════════════════════════════════════════ */
.gallery-page { min-height: 100vh; padding-top: 80px; }

.gallery-header {
  padding: 48px 44px 40px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px;
}
@media (max-width:768px) { .gallery-header { padding: 32px 24px 28px; flex-direction: column; align-items: flex-start; gap: 16px; } }

.gallery-back {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--dim); text-decoration: none;
  transition: color .2s;
}
.gallery-back:hover { color: var(--white); }
.gallery-back svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.5; }

.gallery-meta { display: flex; flex-direction: column; gap: 8px; }
.gallery-title {
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(40px, 6vw, 72px); font-weight: 900;
  text-transform: uppercase; letter-spacing: -.015em; line-height: 1;
  color: var(--white);
}
.gallery-count { font-size: 10px; letter-spacing: .24em; color: #666; text-transform: uppercase; }

/* Masonry grid */
.gallery-grid {
  columns: 3; column-gap: 2px;
  padding: 2px;
}
@media (max-width: 1100px) { .gallery-grid { columns: 2; } }
@media (max-width: 600px)  { .gallery-grid { columns: 1; } }

.gallery-item {
  break-inside: avoid;
  display: block;
  position: relative;
  overflow: hidden;
  margin-bottom: 2px;
  cursor: pointer;
  outline: 5px solid var(--white);
}
.gallery-item img {
  display: block; width: 100%; height: auto;
  filter: grayscale(100%) contrast(1.05) brightness(.78);
  transition: filter .5s ease, transform .5s ease;
  user-select: none;
}
.gallery-item:hover img {
  filter: grayscale(0%) contrast(1.02) brightness(1);
  transform: scale(1.02);
}
.gallery-item-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(7,7,7,.5) 0%, transparent 50%);
  opacity: 0; transition: opacity .35s ease;
}
.gallery-item:hover .gallery-item-overlay { opacity: 1; }

/* Gallery lightbox — felulirja a hero lightbox-ot ha kell */
.gallery-page #lightbox img { outline: none; box-shadow: none; }

/* ══════════════════════════════════════════════════
   AUTH PAGES (Login / Register)
══════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 80px 24px 40px;
}
.auth-box {
  width: 100%; max-width: 420px;
  border: 1px solid var(--border);
  padding: 48px 44px;
  background: var(--surface);
}
@media (max-width: 500px) { .auth-box { padding: 36px 24px; } }

.auth-eyebrow {
  display: flex; align-items: center; gap: 10px; margin-bottom: 24px;
  font-size: 10px; letter-spacing: .26em; color: #555; text-transform: uppercase;
}
.auth-eyebrow-line { width: 18px; height: 1px; background: #333; }

.auth-title {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 44px; font-weight: 900; text-transform: uppercase;
  letter-spacing: -.015em; line-height: .9;
  color: var(--white); margin-bottom: 36px;
}

.auth-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.auth-label { font-size: 9px; letter-spacing: .22em; text-transform: uppercase; color: #666; }
.auth-input {
  background: var(--bg); border: 1px solid var(--border);
  color: var(--white); font-family: "IBM Plex Mono", monospace; font-size: 13px;
  padding: 12px 14px; outline: none; width: 100%;
  transition: border-color .2s;
}
.auth-input:focus { border-color: #555; }
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 100px var(--bg) inset;
  -webkit-text-fill-color: var(--white);
}

.auth-checkbox-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 28px; cursor: pointer;
}
.auth-checkbox-row input[type=checkbox] {
  width: 14px; height: 14px;
  accent-color: var(--white);
  cursor: pointer;
}
.auth-checkbox-label { font-size: 10px; letter-spacing: .14em; color: #666; text-transform: uppercase; }

.auth-submit {
  width: 100%; padding: 14px;
  background: var(--white); color: var(--bg);
  font-family: "Barlow Condensed", sans-serif; font-size: 16px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  border: none; cursor: pointer;
  transition: background .2s, color .2s;
  margin-bottom: 28px;
}
.auth-submit:hover { background: #ccc; }

.auth-links { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border); padding-top: 20px; }
.auth-links a {
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: #666; text-decoration: none; transition: color .2s;
}
.auth-links a:hover { color: var(--white); }

.auth-error {
  background: rgba(180,60,60,.12); border: 1px solid rgba(180,60,60,.3);
  color: #e07070; font-size: 10px; letter-spacing: .12em;
  padding: 10px 14px; margin-bottom: 18px;
}

.auth-validation { font-size: 9px; letter-spacing: .12em; color: #e07070; margin-top: 2px; }
