@font-face { font-family: "Switzer"; src: url("/fonts/switzer-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("/fonts/switzer-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("/fonts/switzer-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  color-scheme: dark;
  /* noc a svetlo z okien: farby vzaté zo samotných svetov */
  --bg: #0b0f17;
  --surface: #151c29;
  --surface-2: #1d2636;
  --ink: #e9e8e4;
  --muted: #a8a191;
  --accent: #e8a33d;
  --accent-hover: #f2b65a;
  --accent-ink: #1a1206;
  --field: #e8a33d;
  --field-ink: #1a1206;

  --m: clamp(16px, 2.4vw, 36px);
  --gap: clamp(16px, 2vw, 28px);
  --section: clamp(96px, 13vw, 200px);

  --step-small: clamp(0.875rem, 0.84rem + 0.1vw, 0.9375rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2.5rem, 1.6rem + 3.6vw, 4.75rem);
  --step-hero: min(12.5vw, 200px);

  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Switzer", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.04em; line-height: 0.95; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--m); top: -100px; z-index: 50; background: var(--accent); color: var(--accent-ink); padding: 12px 16px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
.wrap { padding-inline: var(--m); }

/* ---------- tlačidlá ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 52px; padding: 0 26px;
  background: var(--accent); color: var(--accent-ink);
  font: 600 var(--step-body)/1 var(--font); letter-spacing: -0.01em;
  text-decoration: none; border: 0; border-radius: 0; cursor: pointer;
  transition: background-color .2s var(--ease), transform .2s var(--ease);
}
.btn::after { content: "→"; transition: transform .25s var(--ease); }
.btn:hover { background: var(--accent-hover); }
.btn:hover::after { transform: translateX(4px); }
.btn:active { transform: scale(.97); }
.btn-small { min-height: 42px; padding: 0 18px; font-size: var(--step-small); }
.btn-quiet { background: var(--ink); color: var(--bg); }
.btn-quiet:hover { background: #fff; }
.btn-wide { width: 100%; }

/* ---------- horná lišta ---------- */
.bar {
  position: absolute; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; gap: var(--gap);
  padding: 20px var(--m);
}
.wordmark { font-weight: 600; letter-spacing: -0.02em; text-decoration: none; font-size: var(--step-body); margin-right: auto; }
.bar nav { display: flex; gap: clamp(16px, 2.4vw, 36px); }
.bar nav a { text-decoration: none; color: var(--ink); position: relative; padding: 6px 0; }
.bar nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.bar nav a:hover::after, .bar nav a:focus-visible::after { transform: scaleX(1); }

/* ---------- hero: meno stojí, svety sa striedajú ---------- */
.hero { position: relative; height: calc(100svh + 165svh); background: var(--bg); }
.hero-pin {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  display: grid;
  grid-template-columns: 1fr min(34vw, 560px) 1fr;
  grid-template-rows: calc(92px + var(--step-hero) * 1.02 + 28px) auto 1fr auto;
  column-gap: clamp(24px, 3vw, 48px);
  padding: 0 var(--m) 32px;
  background: var(--world-bg, #0e1838);
  transition: background-color .9s var(--ease);
}
.hero-pin[data-world="luna"] { --world-bg: #0e1838; }
.hero-pin[data-world="amarof"] { --world-bg: #22170e; }
.hero-pin[data-world="last-harbor"] { --world-bg: #10283a; }
.hero-pin[data-world="the-founders"] { --world-bg: #0f1c19; }

.hero-title {
  position: absolute; z-index: 3; left: 0; right: 0; top: 92px;
  text-align: center; font-size: var(--step-hero); line-height: 0.9; letter-spacing: -0.05em;
  color: var(--ink); white-space: nowrap;
}
.hero-frame {
  grid-column: 2; grid-row: 1 / -1; position: relative; overflow: hidden;
  margin-top: 172px; margin-bottom: -32px;
  background: #05070b;
}
.hero-frame img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: var(--fx, 50%) 50%;
  opacity: 0; transform: scale(1.08);
  transition: opacity .7s var(--ease), transform 1.4s var(--ease);
}
.hero-frame img.is-on { opacity: 1; transform: scale(1); animation: drift 16s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.09) translateY(-1.5%); } }

.hero-lead {
  grid-column: 1; grid-row: 2; align-self: start; max-width: 25ch;
  font-size: var(--step-lead); line-height: 1.3; font-weight: 500; letter-spacing: -0.015em;
}
.hero-side { grid-column: 3; grid-row: 2 / -1; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; min-width: 0; }
.hero-caption { font-size: var(--step-lead); line-height: 1.3; letter-spacing: -0.015em; color: var(--muted); max-width: 22ch; }
.hero-caption strong { display: block; color: var(--ink); font-weight: 600; }

.go { display: flex; flex-wrap: wrap; gap: 8px; }
.go-addr {
  flex: 1 1 260px; min-width: 0; display: flex; align-items: center;
  min-height: 52px; padding: 0 16px 0 14px; background: rgba(5, 7, 11, .62);
  font-size: var(--step-body); font-weight: 500; cursor: text;
  transition: background-color .2s;
}
.go-addr:focus-within { background: rgba(5, 7, 11, .9); outline: 3px solid var(--accent); outline-offset: 0; }
.go-addr span { color: var(--muted); white-space: nowrap; }
.go input {
  font: inherit; color: var(--accent); background: transparent; border: 0; padding: 0; margin: 0;
  width: 4ch; min-width: 1ch; max-width: 62%; text-align: right; caret-color: var(--accent);
}
.go input:focus { outline: none; }
.go-hint { margin-top: 12px; font-size: var(--step-small); color: var(--muted); }
.go-hint button {
  font: inherit; color: var(--ink); background: none; border: 0; padding: 2px 0; cursor: pointer;
  text-decoration: underline; text-decoration-color: rgba(236, 230, 214, .35); text-underline-offset: .2em;
}
.go-hint button:hover { text-decoration-color: var(--accent); color: var(--accent); }
.go-hint.is-miss { color: var(--accent); }

.hero-worlds { grid-column: 1; grid-row: 4; align-self: end; list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.hero-worlds button {
  font: 500 var(--step-lead)/1.25 var(--font); letter-spacing: -0.015em;
  color: var(--muted); background: none; border: 0; padding: 2px 0; cursor: pointer; text-align: left;
  transition: color .3s var(--ease), transform .3s var(--ease);
}
.hero-worlds button:hover { color: var(--ink); transform: translateX(6px); }
.hero-worlds button[aria-current="true"] { color: var(--ink); }
.hero-worlds button[aria-current="true"]::before { content: ""; display: inline-block; width: .5em; height: .5em; margin-right: .45em; background: var(--accent); vertical-align: .12em; }


/* ---------- projekty ---------- */
.work { padding-top: var(--section); }
.work-head {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gap); align-items: end;
  padding-bottom: clamp(64px, 8vw, 120px);
}
.work-head h2 { grid-column: 1 / 7; font-size: calc(var(--step-head) * 1.6); }
.work-head p { grid-column: 8 / 13; font-size: var(--step-lead); line-height: 1.3; letter-spacing: -0.015em; max-width: 30ch; }

.chapter {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gap); align-items: center;
  padding-block: clamp(72px, 9vw, 140px);
  background: var(--tint, var(--bg));
}
.chapter-img { grid-column: 1 / 8; grid-row: 1; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #05070b; }
.chapter-img img {
  width: 100%; height: 118%; object-fit: cover; object-position: var(--fx, 50%) 50%;
  transform: translate3d(0, var(--py, -8%), 0) scale(1.02);
  transition: scale .8s var(--ease);
  will-change: transform;
}
.chapter-img:hover img { scale: 1.05; }
.chapter-text { grid-column: 9 / 13; grid-row: 1; display: grid; gap: 22px; justify-items: start; }
.chapter-flip .chapter-img { grid-column: 6 / 13; }
.chapter-flip .chapter-text { grid-column: 1 / 5; }
.chapter h3 { font-size: var(--step-head); display: flex; align-items: center; gap: 18px; }
.app-icon { width: 56px; height: 56px; border-radius: 14px; flex: none; }
.app-icon.pixel { image-rendering: pixelated; border-radius: 0; }
.chapter .lead { font-size: var(--step-lead); line-height: 1.3; letter-spacing: -0.015em; font-weight: 500; }
.chapter p { max-width: 46ch; }
.facts { margin: 4px 0 6px; display: grid; gap: 6px; width: 100%; }
.facts div { display: grid; grid-template-columns: 8.5em 1fr; gap: 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* ---------- o mne ---------- */
.about { padding-block: var(--section); }
.about-inner { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gap); align-items: start; }
.about-pin { grid-column: 1 / 6; position: sticky; top: 40px; display: grid; gap: 40px; }
.about-pin h2 { font-size: calc(var(--step-head) * 1.6); }
.about-photo { margin: 0; }
.about-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 30% 50%; }
.about-photo figcaption { margin-top: 12px; font-size: var(--step-small); color: var(--muted); }
.about-body { grid-column: 7 / 13; display: grid; gap: 28px; justify-items: start; padding-top: clamp(0px, 1vw, 12px); }
.statement { font-size: clamp(1.5rem, 1.1rem + 1.1vw, 2rem); line-height: 1.2; letter-spacing: -0.025em; font-weight: 500; max-width: 34ch; margin-bottom: 40px; }
.about-sub { font-size: var(--step-lead); letter-spacing: -0.02em; line-height: 1.2; margin-top: 24px; color: var(--accent); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; width: 100%; }
.timeline li { display: grid; grid-template-columns: 7.5em 1fr; gap: 16px; padding: 20px 22px; background: var(--surface); transition: background-color .25s var(--ease), transform .25s var(--ease); }
.timeline li:hover { background: var(--surface-2); transform: translateX(4px); }
.timeline .when { color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline strong { display: block; font-weight: 600; margin-bottom: 2px; }
.skills { font-size: var(--step-lead); line-height: 1.35; letter-spacing: -0.015em; max-width: 32ch; margin-bottom: 16px; }

/* ---------- kontakt ---------- */
.contact { position: relative; min-height: 100svh; overflow: hidden; background: #05070b; }
.contact-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; transform: scale(1.06); transition: transform 6s var(--ease); }
.contact.in-view .contact-photo { transform: scale(1); }
.contact-card {
  position: relative; z-index: 2; width: min(420px, calc(100% - 2 * var(--m)));
  margin: clamp(48px, 7vw, 96px) 0 0 var(--m);
  padding: 32px; background: var(--surface);
  display: grid; gap: 20px;
}
.contact-card h2 { font-size: var(--step-head); }
.contact-list { margin: 0; display: grid; gap: 8px; }
.contact-list div { display: grid; grid-template-columns: 5.5em 1fr; gap: 12px; }
.contact-list dt { color: var(--muted); }
.contact-list dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- pätička ---------- */
.foot { background: var(--field); color: var(--field-ink); padding: clamp(56px, 7vw, 96px) 0 32px; overflow: hidden; }
.foot a { color: var(--field-ink); }
.foot a:hover { text-decoration-color: var(--field-ink); }
.foot :focus-visible { outline-color: var(--field-ink); }
.foot-name { font-size: min(18.4vw, 340px); line-height: 0.85; letter-spacing: -0.055em; white-space: nowrap; margin-left: -0.04em; }
.foot-row { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gap); margin-top: 72px; align-items: start; }
.foot-places { grid-column: 1 / 7; list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot-places a { font-size: clamp(1.375rem, 1rem + 1.3vw, 2.125rem); font-weight: 600; letter-spacing: -0.03em; text-decoration: none; display: inline-block; transition: transform .25s var(--ease); }
.foot-places a:hover { transform: translateX(8px); text-decoration: underline; }
.foot-links { grid-column: 8 / 13; display: grid; gap: 24px; font-size: var(--step-body); }
.foot .credits { font-size: var(--step-small); line-height: 1.5; }
.foot-last { display: flex; justify-content: space-between; gap: 16px; margin-top: 96px; font-size: var(--step-small); }

/* ---------- pohyb pri vstupe ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0ms); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- tablet ---------- */
@media (max-width: 1024px) {
  .hero-pin { grid-template-columns: 1fr min(40vw, 460px) 1fr; }
  .chapter-img, .chapter-flip .chapter-img { grid-column: 1 / -1; }
  .chapter-text, .chapter-flip .chapter-text { grid-column: 1 / 11; grid-row: 2; margin-top: 40px; }
  .about-pin { grid-column: 1 / 6; }
  .about-body { grid-column: 7 / 13; }
}
@media (max-width: 860px) {
  .bar nav { display: none; }
  .hero { height: calc(100svh + 135svh); }
  .hero-pin {
    grid-template-columns: 1fr;
    grid-template-rows: calc(72px + var(--step-hero) * 0.55) minmax(0, 1fr) auto auto auto;
    row-gap: 16px; padding-bottom: 20px;
  }
  .hero-title { top: 76px; }
  .hero-frame { grid-column: 1; grid-row: 1 / 3; margin: 104px 0 0; }
  .hero-side { display: contents; }
  .hero-caption { grid-row: 4; font-size: var(--step-body); max-width: none; }
  .hero-caption strong { display: inline; margin-right: .3em; }
  .hero-lead { grid-row: 3; grid-column: 1; font-size: 1.125rem; line-height: 1.35; max-width: 40ch; }
  .go { grid-row: 5; }
  .go-hint { display: none; }
  .hero-worlds { display: none; }
  .chapter-text, .chapter-flip .chapter-text { grid-column: 1 / -1; }
  .about-pin, .about-body { grid-column: 1 / -1; position: static; }
  .about-body { margin-top: 48px; }
  .about-photo img { aspect-ratio: 4 / 3; }
  .foot-places, .foot-links { grid-column: 1 / -1; }
  .foot-links { margin-top: 40px; }
}
@media (max-width: 860px) {
  :root { --step-hero: 17vw; }
}
@media (max-width: 560px) {
  .work-head h2, .work-head p { grid-column: 1 / -1; }
  .work-head p { margin-top: 20px; }
  .contact { min-height: 0; display: flex; flex-direction: column; }
  .contact-photo { position: relative; height: 62svh; inset: auto; }
  .contact-card { width: auto; margin: -80px var(--m) var(--m); }
  .timeline li { grid-template-columns: 1fr; gap: 4px; }
  .facts div { grid-template-columns: 7.5em 1fr; }
  .contact-list div { grid-template-columns: 1fr; gap: 0; }
  .contact-card { padding: 24px; }
  .chapter h3 { gap: 14px; }
  .app-icon { width: 44px; height: 44px; border-radius: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .chapter-img img { transform: none; height: 100%; }
  .hero-frame img { transform: none; }
}
