/* ============================================================
   Escher Workshop — landing (redesign)
   Slezská univerzita v Opavě · Matematický ústav
   Vínová + zlatá · energický, editoriální, 3D hero
   ============================================================ */

:root {
  color-scheme: light;

  /* značka */
  --wine: #9b1d3a;
  --wine-mid: #821730;
  --wine-deep: #5e1224;
  --wine-ink: #3a0b17;
  --gold: #bd9024;
  --gold-bright: #e2bf52;
  --gold-soft: #f0e3b4;

  /* akcenty (z původní palety, jen pro detaily) */
  --blue: #3a5d96;
  --green: #2f8079;
  --purple: #6a5a86;

  /* neutrály */
  --ink: #241a14;
  --ink-soft: #5c5249;
  --ink-faint: #8a8073;
  --paper: #f6efe2;
  --paper-2: #fbf6ec;
  --panel: #fffdf8;
  --line: #e6dcc8;
  --line-strong: #d8cbb1;

  --maxw: 1200px;
  --pad: clamp(20px, 5vw, 64px);

  --font-display: "Bricolage Grotesque", "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

::selection { background: var(--gold-soft); color: var(--wine-ink); }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 300;
  background: var(--wine);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
  text-decoration: none;
  font-weight: 700;
}
.skip-link:focus { left: 0; }

/* ---------------- Buttons ---------------- */
.btn {
  --bg: var(--wine);
  --fg: #fff;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .005em;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .25s var(--ease), background .2s, color .2s;
}
.btn-lg { padding: 16px 30px; font-size: 16.5px; }

.btn-primary {
  background: var(--wine);
  color: #fff;
  box-shadow: 0 12px 26px -10px rgba(155, 29, 58, .65);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -10px rgba(155, 29, 58, .7); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: var(--wine-ink);
  box-shadow: 0 12px 26px -10px rgba(189, 144, 36, .7);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -10px rgba(189, 144, 36, .8); }

.btn-ghost {
  background: transparent;
  color: var(--wine-deep);
  border-color: rgba(94, 18, 36, .28);
}
.btn-ghost:hover { background: rgba(155, 29, 58, .06); border-color: var(--wine); transform: translateY(-2px); }

.btn .arr { transition: transform .2s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* ---------------- Brand lockup ---------------- */
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.cube-mark { width: 34px; height: 34px; flex: none; display: block; }
.brand-text { display: grid; line-height: 1.1; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -.01em;
  color: var(--wine-deep);
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------------- Nav ---------------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.site-nav.scrolled { border-bottom-color: var(--line); }
.nav-inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 14px var(--pad);
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.nav-links a {
  position: relative;
  text-decoration: none;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink-soft);
  padding: 8px 12px;
  border-radius: 8px;
  transition: color .2s, background .2s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 4px;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s var(--ease);
}
.nav-links a:hover { color: var(--wine-deep); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-cta { margin-left: 8px; }

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  align-items: stretch;
  min-height: min(86vh, 760px);
}
.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(40px, 7vh, 96px) clamp(28px, 4vw, 56px) clamp(40px, 7vh, 96px) var(--pad);
  max-width: 660px;
  margin-left: auto;
  width: 100%;
}
.kicker {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--wine);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.kicker::before {
  content: "";
  width: 26px; height: 2px;
  background: var(--gold);
  display: inline-block;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(54px, 8.5vw, 104px);
  line-height: .92;
  letter-spacing: -.035em;
  color: var(--wine-deep);
  margin-bottom: 24px;
}
.hero h1 .em { color: var(--gold); font-style: normal; }
.lead {
  font-size: clamp(16.5px, 1.45vw, 19.5px);
  color: var(--ink-soft);
  max-width: 46ch;
  margin-bottom: 32px;
}
.lead strong { color: var(--ink); font-weight: 700; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.hero-note {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: .01em;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.hero-note span { display: inline-flex; align-items: center; gap: 7px; }
.hero-note span::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }

/* Hero study */
.hero-stage {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: clamp(32px, 5vw, 74px) var(--pad);
  background: var(--paper);
}
.hero-stage::before {
  content: "";
  display: none;
}
.study-sheet {
  position: relative;
  width: min(100%, 640px);
  aspect-ratio: 1.06;
  border: 1px solid rgba(216, 203, 177, .84);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(251, 246, 236, .92), rgba(246, 239, 226, .96)),
    var(--paper);
  box-shadow:
    0 28px 70px rgba(92, 82, 73, .13),
    0 12px 32px rgba(189, 144, 36, .08),
    0 2px 0 rgba(255, 255, 255, .7) inset;
  transform: rotate(-1.35deg);
  isolation: isolate;
}
.study-sheet::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(155, 29, 58, .12);
  border-radius: 18px;
  pointer-events: none;
  z-index: 2;
}
.study-sheet::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 253, 248, .5), transparent 34%),
    radial-gradient(circle at 74% 78%, rgba(189, 144, 36, .08), transparent 40%);
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 1;
}
.tile-study {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}
.ghost-tiles path {
  fill: var(--wine);
  opacity: .08;
  stroke: var(--wine-deep);
  stroke-width: 2;
}
.axis-lines path,
.axis-lines circle {
  fill: none;
  stroke: rgba(94, 18, 36, .26);
  stroke-width: 2;
  stroke-dasharray: 10 12;
}
.main-tile-shadow {
  fill: rgba(94, 18, 36, .18);
  transform: translate(12px, 18px);
}
.main-tile {
  fill: #fffdf8;
  stroke: var(--wine-deep);
  stroke-width: 8;
  stroke-linejoin: round;
}
.tile-cut {
  fill: none;
  stroke: var(--gold);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tile-points circle {
  fill: var(--wine);
  stroke: #fffdf8;
  stroke-width: 4;
}
.study-legend path {
  stroke: rgba(92, 82, 73, .34);
  stroke-width: 5;
  stroke-linecap: round;
}
.study-legend circle { fill: var(--gold); }
.sheet-rule {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 3;
  display: flex;
  gap: 8px;
}
.sheet-rule span {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--wine-deep);
  padding: 5px 9px;
  border: 1px solid rgba(155, 29, 58, .18);
  background: rgba(255, 253, 248, .68);
  border-radius: 4px;
}
.sheet-caption {
  position: absolute;
  left: 30px;
  bottom: 24px;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .03em;
  color: rgba(92, 82, 73, .72);
}

/* ---------------- Section scaffolding ---------------- */
.section { padding: clamp(72px, 11vh, 130px) 0; }
.section-tint {
  background:
    linear-gradient(180deg, var(--paper-2), var(--paper));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section-dark {
  background:
    radial-gradient(90% 120% at 85% 0%, rgba(189, 144, 36, .26), transparent 55%),
    linear-gradient(155deg, var(--wine-deep), var(--wine-ink) 70%);
  color: #fff;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}
.eyebrow .idx { color: var(--wine); }
.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 60px); }
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.02;
  letter-spacing: -.025em;
  color: var(--wine-deep);
  margin-top: 16px;
}
.section-dark .section-head h2 { color: #fff; }
.section-sub {
  margin-top: 18px;
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--ink-soft);
  max-width: 56ch;
}

/* ---------------- O projektu (editorial) ---------------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
.about-prose p {
  font-size: clamp(16.5px, 1.4vw, 19px);
  color: var(--ink-soft);
  margin-bottom: 20px;
  max-width: 60ch;
}
.about-prose strong { color: var(--ink); font-weight: 700; }
.about-prose em { font-style: italic; color: var(--wine); }
.prose-source { font-size: 14px; color: var(--ink-faint); }
.prose-source a { color: var(--wine); text-underline-offset: 3px; }

.pullquote {
  position: sticky;
  top: 110px;
  border-left: 3px solid var(--gold);
  padding: 6px 0 6px 26px;
}
.pullquote blockquote {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.18;
  letter-spacing: -.02em;
  color: var(--wine-deep);
}
.pullquote cite {
  display: block;
  margin-top: 16px;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .02em;
  color: var(--ink-faint);
}

/* ---------------- Pojmy (editorial list, NE karty) ---------------- */
.concepts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: clamp(32px, 6vw, 80px);
}
.concepts li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: start;
  padding: 30px 0;
  border-top: 1px solid var(--line-strong);
}
/* spodní hranice jen u posledních dvou */
.concepts li:nth-last-child(-n+2) { border-bottom: 1px solid var(--line-strong); }
.concept-idx {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  padding-top: 6px;
}
.concept-body h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(21px, 2.1vw, 27px);
  letter-spacing: -.015em;
  color: var(--wine-deep);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.concept-body h3 .glyph { width: 26px; height: 26px; flex: none; color: var(--wine); }
.concept-body p { font-size: 15.5px; color: var(--ink-soft); max-width: 42ch; }

/* ---------------- Techniky (feature strip) ---------------- */
.techs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.tech {
  padding: clamp(20px, 2.4vw, 36px) clamp(20px, 2.6vw, 40px);
  border-left: 1px solid var(--line-strong);
  transition: background .25s;
}
.tech:first-child { border-left: 0; padding-left: 0; }
.tech:last-child { padding-right: 0; }
.tech:hover { background: rgba(189, 144, 36, .05); }
.tech-svg {
  width: clamp(92px, 9vw, 120px);
  height: auto;
  margin-bottom: 20px;
}
.tech h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 1.9vw, 25px);
  letter-spacing: -.015em;
  color: var(--wine-deep);
  margin-bottom: 12px;
}
.tech .tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  margin-left: 4px;
}
.tech p { font-size: 15px; color: var(--ink-soft); }
.tech p strong { color: var(--ink); }
.tech-foot {
  margin-top: clamp(36px, 5vw, 56px);
  padding-top: 28px;
  border-top: 1px solid var(--line-strong);
  font-size: clamp(15px, 1.4vw, 18px);
  color: var(--ink-soft);
  max-width: 70ch;
}
.tech-foot strong { color: var(--wine-deep); font-family: var(--font-mono); font-weight: 700; }

/* ---------------- Jak to funguje (timeline) ---------------- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 860px;
  counter-reset: step;
}
.steps li {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(20px, 3vw, 40px);
  padding: 0 0 clamp(36px, 5vw, 56px);
}
.steps li:last-child { padding-bottom: 0; }
.step-num {
  position: relative;
  z-index: 1;
  width: clamp(56px, 6vw, 76px);
  height: clamp(56px, 6vw, 76px);
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(22px, 2.6vw, 30px);
  color: #fff;
  background: rgba(255, 255, 255, .08);
  border: 1.5px solid rgba(240, 227, 180, .4);
}
.steps li::before {
  /* spojnice */
  content: "";
  position: absolute;
  left: calc(clamp(56px, 6vw, 76px) / 2);
  top: clamp(56px, 6vw, 76px);
  bottom: 8px;
  width: 2px;
  background: linear-gradient(rgba(240, 227, 180, .5), rgba(240, 227, 180, .05));
  transform: translateX(-50%);
}
.steps li:last-child::before { display: none; }
.step-body { padding-top: clamp(8px, 1.4vw, 16px); }
.step-body h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 2vw, 26px);
  letter-spacing: -.015em;
  color: #fff;
  margin-bottom: 8px;
}
.step-body p { font-size: 15.5px; color: rgba(255, 245, 232, .76); max-width: 52ch; }
.step-body strong { color: var(--gold-bright); font-weight: 700; }

/* ---------------- CTA ---------------- */
.cta-band {
  background:
    radial-gradient(80% 140% at 12% 0%, rgba(189, 144, 36, .3), transparent 55%),
    linear-gradient(135deg, var(--wine), var(--wine-deep));
  color: #fff;
  padding: clamp(56px, 9vh, 96px) 0;
}
.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  flex-wrap: wrap;
}
.cta-band h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1;
  letter-spacing: -.025em;
  margin-bottom: 12px;
}
.cta-band p { color: rgba(255, 245, 232, .82); font-size: clamp(16px, 1.5vw, 19px); max-width: 44ch; }

/* ---------------- Footer ---------------- */
.site-foot {
  background: var(--wine-ink);
  color: rgba(255, 245, 232, .8);
  padding: 56px 0 40px;
}
.foot-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}
.foot-brand { display: grid; gap: 14px; max-width: 360px; }
.foot-brand .brand-name { color: var(--gold-soft); }
.foot-brand .brand-sub { color: rgba(240, 227, 180, .6); }
.foot-brand p { font-size: 14px; line-height: 1.55; color: rgba(255, 245, 232, .72); }
.foot-meta { display: grid; gap: 12px; justify-items: end; text-align: right; }
.foot-meta a { color: #fff; text-decoration: none; font-weight: 600; font-size: 14.5px; }
.foot-meta a:hover { color: var(--gold-bright); }
.foot-credit { font-family: var(--font-mono); font-size: 12px; color: rgba(255, 245, 232, .5); margin-top: 6px; }
.foot-credit a { color: var(--gold-soft); }

/* ---------------- Reveal on scroll ---------------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 940px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-stage { order: 2; min-height: 420px; padding-block: 32px 46px; }
  .hero-copy { order: 1; max-width: none; margin-left: 0; padding-bottom: 36px; }
  .study-sheet { width: min(88vw, 600px); }
  .about-grid { grid-template-columns: 1fr; }
  .pullquote { position: static; }
  .concepts { grid-template-columns: 1fr; }
  .concepts li { border-top: 1px solid var(--line-strong); }
  .concepts li:nth-last-child(-n+2) { border-bottom: 0; }
  .concepts li:last-child { border-bottom: 1px solid var(--line-strong); }
  .techs { grid-template-columns: 1fr; }
  .tech { border-left: 0; border-top: 1px solid var(--line-strong); padding-left: 0; padding-right: 0; }
  .tech:first-child { border-top: 0; }
  .nav-links { display: none; }
}
@media (max-width: 560px) {
  .hero h1 { font-size: clamp(44px, 15vw, 64px); }
  .hero-stage { min-height: 360px; }
  .study-sheet { width: min(92vw, 430px); border-radius: 18px; }
  .sheet-rule { top: 18px; right: 20px; }
  .sheet-rule span { font-size: 10px; padding: 4px 7px; }
  .sheet-caption { left: 22px; bottom: 18px; font-size: 10.5px; }
  .cta-inner { flex-direction: column; align-items: flex-start; }
  .foot-inner { flex-direction: column; }
  .foot-meta { justify-items: start; text-align: left; }
}
