/* =====================================================================
   1. TOKENS – change the look here
   ===================================================================== */
:root {
  color-scheme: dark;

  --bg: #1a1918;          /* page background */
  --surface: #222120;     /* inputs on focus, photo placeholders */
  --line: #2f2d2a;        /* thin rules */
  --text: #d6d1c9;        /* body text – soft, not pure white */
  --heading: #e6e1da;     /* titles */
  --muted: #8a857e;       /* secondary text */
  --open: #9bc99c;        /* "collabs open" dot */
  --closed: #6a6560;      /* "collabs closed" dot */
  --error: #d99485;

  --font: "Hanken Grotesk", system-ui, sans-serif;

  --max: 76rem;           /* page width */
  --narrow: 46rem;        /* width of text pages (cons, collabs) */
  --pad: clamp(1.25rem, 4vw, 3rem);
  --gap: 8px;             /* gap between photos */
}

/* =====================================================================
   2. BASE
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
a:hover { color: var(--heading); text-decoration-color: currentColor; }
p { margin: 0 0 1em; }
h1, h2 { margin: 0; color: var(--heading); font-weight: 300; letter-spacing: -0.015em; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
[hidden] { display: none !important; }

.dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: var(--open); flex: none; }
.is-closed .dot { background: var(--closed); }

.button {
  display: inline-block; cursor: pointer;
  font: 500 1rem var(--font); text-decoration: none;
  background: var(--text); color: var(--bg);
  border: 0; border-radius: 3px; padding: .8rem 1.35rem;
}
.button:hover { background: var(--heading); color: var(--bg); }
.button:disabled { opacity: .6; cursor: progress; }

/* =====================================================================
   3. HEADER + FOOTER
   ===================================================================== */
.header-inner, .footer-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--pad);
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap;
}
.site-header { padding: 1.75rem 0; }
.logo { font-weight: 500; font-size: 1.6rem; line-height: 1.2; letter-spacing: -.01em; text-decoration: none; color: var(--heading); }
.nav { display: flex; gap: .4rem 1.75rem; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--muted); display: inline-flex; align-items: center; gap: .45rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--heading); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--muted); }

.site-footer { margin-top: auto; padding: 2.5rem 0 2.75rem; color: var(--muted); font-size: .9rem; }
.footer-inner { padding-top: 1.75rem; background: linear-gradient(var(--line), var(--line)) content-box top / 100% 1px no-repeat; }
.site-footer p { margin: 0; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem 1.25rem; }

/* =====================================================================
   4. PAGE FRAME
   ===================================================================== */
.page { width: 100%; max-width: var(--max); margin: 0 auto; padding: clamp(1.5rem, 5vw, 4rem) var(--pad) clamp(3rem, 7vw, 6rem); }
.page-narrow { max-width: calc(var(--narrow) + 2 * var(--pad)); }
.page-title { font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1.05; margin-bottom: 1.5rem; }
.sub-title { font-size: 1.6rem; margin: 3rem 0 1.25rem; }
.page-title + .status + .sub-title { margin-top: 2.5rem; }
.contact-note { margin: 2.25rem 0 1.5rem; }
.is-open .when-closed, .is-closed .when-open { display: none; }
.rules-note { color: var(--muted); margin: -.25rem 0 1.5rem; }
.lead { color: var(--muted); font-size: 1.15rem; max-width: 56ch; margin-bottom: 2.25rem; }

/* =====================================================================
   5. HOME – intro text, collab sign, photo cards
   ===================================================================== */
.home {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem); align-items: center;
  min-height: calc(100vh - 12rem);
}
.home-intro {
  font-size: clamp(2.1rem, 4.4vw, 3.6rem); line-height: 1.14; letter-spacing: -0.025em;
  max-width: 18ch; margin-bottom: 2.75rem;
}

/* The sign (cedulka): a small tag with a punched hole */
.sign {
  display: inline-flex; align-items: center; gap: 1rem;
  padding: 1rem 1.4rem 1rem 1.1rem;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface);
  text-decoration: none; max-width: 26rem;
  transition: border-color .2s;
}
.sign:hover { border-color: #4a4641; color: inherit; }
.sign-hole { width: .7rem; height: .7rem; border-radius: 50%; background: var(--bg); box-shadow: inset 0 1px 2px rgba(0,0,0,.6); flex: none; }
.sign-body { display: flex; flex-direction: column; gap: .2rem; padding-left: 1rem; border-left: 1px dashed var(--line); }
.sign-title { display: flex; align-items: center; gap: .55rem; font-weight: 500; font-size: 1.1rem; color: var(--heading); }
.sign-note { color: var(--muted); font-size: .95rem; line-height: 1.45; }
.is-open .sign { border-color: color-mix(in srgb, var(--open) 35%, var(--line)); }

/* The cards: three photos fanned out like a hand of playing cards.
   Change --rot (rotation) and --x / --y (shift) per card to rearrange them. */
.cards {
  position: relative;
  width: min(100%, 30rem); aspect-ratio: 1 / 1.05; justify-self: center;
}
.card {
  --rot: 0deg; --x: 0%; --y: 0%;
  position: absolute; left: 50%; top: 50%;
  width: 50%; aspect-ratio: 5 / 7;
  border-radius: 12px; overflow: hidden;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 18px 40px -12px rgba(0,0,0,.65);
  outline: 1px solid rgba(255,255,255,.07); outline-offset: -1px;
  transform: translate(-50%, -50%) translate(var(--x), var(--y)) rotate(var(--rot));
  transform-origin: 50% 85%;
  transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
.card img { width: 100%; height: 100%; object-fit: cover; }
/* card-1 = the first featured photo, in front; 2 and 3 peek out behind it */
.card-1 { --rot: -2deg;  --x: 0%;    --y: -3%; z-index: 3; }
.card-2 { --rot: -13deg; --x: -30%;  --y: 5%;  z-index: 1; }
.card-3 { --rot: 11deg;  --x: 30%;   --y: 5%;  z-index: 2; }
/* on hover the hand spreads a little */
.cards:hover .card-2 { --rot: -17deg; --x: -38%; }
.cards:hover .card-3 { --rot: 15deg;  --x: 38%; }
.card:focus-visible { outline: 2px solid var(--text); }

/* Collab status block */
.status-title { display: flex; align-items: center; gap: .6rem; font-weight: 500; color: var(--heading); margin-bottom: .3rem; }
.status-note { color: var(--muted); max-width: 48ch; margin-bottom: .6rem; }
.status-page { margin-bottom: 0; padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: 3px; }
.status-page .status-note { margin: 0; }

/* =====================================================================
   6. WORK (photo grid + lightbox)
   ===================================================================== */
/* photos in rows of 3 (2 on phones), every row the same height;
   portrait tiles are 4:5, photos with wide: true take 2 places (cropped to fit) */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); grid-auto-flow: row dense; }
.tile { position: relative; margin: 0; }
.tile.is-wide { grid-column: span 2; }
.tile-btn { display: block; width: 100%; padding: 0; border: 0; background: var(--surface); cursor: zoom-in; }
.tile-btn img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
/* wide tile: as tall as the photos next to it, image fills it (cropped) */
.tile.is-wide { display: flex; flex-direction: column; }
.tile.is-wide .tile-btn { position: relative; flex: 1 0 auto; aspect-ratio: 5 / 3; }
.tile.is-wide .tile-btn img { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; }

.caption { display: flex; flex-direction: column; font-size: .88rem; line-height: 1.4; }
.caption-char { color: var(--heading); }
.caption-by { color: var(--muted); }

@media (hover: hover) {   /* with a mouse: caption appears over the photo on hover */
  .tile .caption {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 2.5rem .9rem .8rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, .65));
    opacity: 0; transition: opacity .2s; pointer-events: none;
  }
  .tile .caption a { pointer-events: auto; }
  .tile:hover .caption, .tile:focus-within .caption { opacity: 1; }
  .tile .caption-by { color: #cfc9c1; }
}
@media (hover: none) {    /* on touch: caption under the photo */
  .tile .caption { padding: .45rem .2rem .9rem; }
}

.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0;
  padding: 3.5rem 5.5rem 1.5rem; border: 0; background: rgba(16, 15, 14, .97); color: var(--text);
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: transparent; }
.lb-figure { margin: 0; display: flex; flex-direction: column; max-height: 100%; }
.lb-figure img { max-height: calc(100vh - 8.5rem); width: auto; max-width: 100%; object-fit: contain; }
.lb-figure .caption { margin-top: .75rem; }
.lb-btn { position: absolute; background: none; border: 0; cursor: pointer; color: var(--muted); font: 400 .95rem var(--font); padding: .6rem .8rem; }
.lb-btn:hover { color: var(--heading); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: .75rem; top: 50%; translate: 0 -50%; }
.lb-next { right: .75rem; top: 50%; translate: 0 -50%; }

/* =====================================================================
   7. CONS
   ===================================================================== */
.cons { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.con { display: grid; grid-template-columns: 11rem minmax(0, 1fr) auto; gap: 1.5rem; align-items: baseline; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.con p { margin: 0; }
.con-date { color: var(--heading); font-variant-numeric: tabular-nums; }
.con-name { color: var(--heading); font-weight: 500; }
.con-city { color: var(--muted); margin-left: .5rem; }
.con-attendance { color: var(--muted); font-size: .95rem; text-align: right; }
.con-maybe .con-date, .con-maybe .con-name { color: var(--muted); font-weight: 400; }
.cons-empty { padding: 1.25rem 0; color: var(--muted); }

/* =====================================================================
   8. COLLABS (steps + form)
   ===================================================================== */
.steps { margin: 0 0 3rem; padding-left: 1.4rem; color: var(--text); }
.steps li { margin-bottom: .35rem; padding-left: .3rem; }
.steps li::marker { color: var(--muted); }

.rules { margin: 0 0 1rem; padding-left: 1.6rem; color: var(--text); }
.rules li { margin-bottom: .85rem; padding-left: .4rem; max-width: 62ch; }
.rules li::marker { color: var(--muted); }
.rules strong { color: var(--heading); font-weight: 500; }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem 1.5rem; }
.field { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.wide { grid-column: 1 / -1; }
.field label { font-size: .95rem; }
.opt { color: var(--muted); margin-left: .3rem; font-size: .88rem; }
.form input:not([type="checkbox"]), .form select, .form textarea {
  width: 100%; font: inherit; color: var(--heading);
  background: transparent; border: 1px solid var(--line); border-radius: 3px; padding: .7rem .8rem;
}
.form input::placeholder, .form textarea::placeholder { color: #5e5a55; }
.form input:hover, .form select:hover, .form textarea:hover { border-color: #45423e; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--muted); background: var(--surface); }
.form select { appearance: none; padding-right: 2.2rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(-45deg, transparent 50%, var(--muted) 50%);
  background-position: calc(100% - 1.15rem) 55%, calc(100% - .85rem) 55%; background-size: .3rem .3rem; background-repeat: no-repeat; }
.form select option { background: var(--bg); }
.form textarea { resize: vertical; min-height: 8rem; }
.form [aria-invalid] { border-color: var(--error) !important; }
.check { flex-direction: row; align-items: flex-start; gap: .75rem; }
.check input { width: 1.05rem; height: 1.05rem; margin: .25rem 0 0; accent-color: var(--text); flex: none; }
.check label { color: var(--muted); }
.check input[aria-invalid] + label { color: var(--error); }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: .5rem; }
.form-status { margin: 0; flex: 1 1 18rem; }
.form-status.is-ok { color: var(--open); }
.form-status.is-error { color: var(--error); }
.hp { position: absolute; left: -9999px; }

/* =====================================================================
   9. ABOUT
   ===================================================================== */
.about { display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.about-photo { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--surface); }
.about-text p { max-width: 60ch; }
.about-more { margin-top: 2rem; color: var(--muted); }
.facts { margin: 2rem 0 0; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.contacts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.contacts a { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; align-items: baseline; padding: .7rem 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.contact-label { color: var(--muted); }
.contact-value { color: var(--heading); overflow-wrap: anywhere; }
.contacts a:hover .contact-value { text-decoration: underline; }

/* =====================================================================
   10. SMALLER SCREENS
   ===================================================================== */
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .about-photo { max-width: 20rem; }
}
@media (max-width: 680px) {   /* phones: cards go under the text */
  .home { grid-template-columns: 1fr; min-height: 0; }
  .cards { width: min(100%, 24rem); margin-top: 1rem; }
}
@media (max-width: 600px) {
  .site-header { padding: 1.25rem 0; }
  .header-inner { flex-direction: column; gap: .6rem; }
  .logo { font-size: 1.4rem; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form { grid-template-columns: 1fr; }
  .con { grid-template-columns: 1fr; gap: .1rem; }
  .con-attendance { text-align: left; }
  .facts div, .contacts a { grid-template-columns: 1fr; gap: 0; }
  .footer-inner { flex-direction: column; }
  .lightbox { padding: 3.5rem .75rem 4rem; }
  .lb-prev, .lb-next { top: auto; bottom: .75rem; translate: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------------------------------------------------------------------
   COOKIE NOTICE (bottom bar, also on phones)
   --------------------------------------------------------------------- */
.cookie-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 1rem var(--pad) calc(1rem + env(safe-area-inset-bottom));
}
.cookie-inner { max-width: var(--max); margin: 0 auto; display: flex; align-items: center; gap: 1rem 1.5rem; }
.cookie-text { margin: 0; flex: 1; color: var(--muted); font-size: .95rem; }
.cookie-ok { flex: none; padding: .6rem 1.2rem; }
@media (max-width: 600px) {
  .cookie-inner { flex-direction: column; align-items: stretch; }
  .cookie-ok { width: 100%; padding: .8rem 1rem; }
}
