/* nck.cz rozcestník. Barvy sdílí s link.nck.cz (apps/links/src/admin/static.ts). Bez externích zdrojů. */

:root {
  --bg: #eef0ed;
  --surface: #fbfcfb;
  --ink: #1c2220;
  --muted: #5f6763;
  --faint: #8a918d;
  --rule: #d5dad6;
  --rule-strong: #b9c0bb;
  --accent: #1d5a84;
  --accent-soft: #dde9f2;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141816;
    --surface: #1b201e;
    --ink: #e6eae8;
    --muted: #a1a9a5;
    --faint: #78807c;
    --rule: #313835;
    --rule-strong: #47504c;
    --accent: #86b6da;
    --accent-soft: #1f3140;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 var(--sans);
}

a { color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1, h2, p { margin: 0; }

.page {
  max-width: 74rem;
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2.5rem) 2rem;
  display: flex;
  flex-direction: column;
}

/* Hlavička: znak nck a přihlášení */

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.mark {
  display: block;
  width: clamp(9.5rem, 40vw, 19rem);
  line-height: 0;
}

.wordmark {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.wordmark .letters {
  fill: none;
  stroke: var(--ink);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Tečka po chybějícím „i“ z nick dopadne na místo jako první. */
.wordmark .tittle {
  fill: var(--accent);
  transform-box: fill-box;
  transform-origin: center;
  animation: settle 0.9s cubic-bezier(0.3, 1.5, 0.5, 1) 0.2s both;
}

@keyframes settle {
  from { transform: translateY(-140%); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.login {
  flex: none;
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.login:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lead {
  margin-top: clamp(1.25rem, 3vw, 2rem);
  max-width: 40ch;
  color: var(--muted);
  font-size: clamp(1.25rem, 2.6vw, 1.625rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* Dlaždice projektů */

.tiles {
  list-style: none;
  margin: clamp(2.5rem, 7vw, 4.5rem) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: clamp(0.875rem, 2vw, 1.25rem);
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: clamp(15rem, 30vw, 19rem);
  padding: clamp(1.5rem, 3vw, 2rem);
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: var(--surface);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}

/* Dlaždice najedou postupně po dopadu tečky. */
.tile:nth-child(1) { animation-delay: 0.45s; }
.tile:nth-child(2) { animation-delay: 0.55s; }
.tile:nth-child(3) { animation-delay: 0.65s; }
.tile:nth-child(n + 4) { animation-delay: 0.75s; }

@keyframes rise {
  from { transform: translateY(14px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.tile h2 {
  margin-top: 1.5rem;
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.tile p {
  margin-top: 0.5rem;
  max-width: 34ch;
  color: var(--muted);
}

.tile .state {
  margin-top: auto;
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 600;
}

/* Plná tečka = projekt běží, prázdný kroužek = připravujeme. */
.tile .state::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}

/* Odkaz v názvu pokryje celou dlaždici. */
.tile h2 a {
  color: inherit;
  text-decoration: none;
}

.tile h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.tile h2 a:focus-visible { outline: none; }
.tile h2 a:focus-visible::after {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.tile:has(a):hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 14px 30px -18px color-mix(in srgb, var(--accent) 55%, transparent);
}
.tile:has(a):hover .state { text-decoration: underline; text-underline-offset: 3px; }
.tile:has(a):active { transform: translateY(-1px); }

.tile--soon {
  border-style: dashed;
  border-color: var(--rule-strong);
  background: transparent;
}

.tile--soon .state {
  color: var(--muted);
  font-weight: 500;
}

.tile--soon .state::before {
  background: transparent;
  border: 1.5px solid currentColor;
}

/* Ikony dlaždic. Při najetí na dlaždici se modrý prvek pohne. */

.glyph {
  width: 3.5rem;
  height: 3.5rem;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.glyph .fill { fill: var(--surface); }
.glyph .dot { fill: var(--ink); stroke: none; }
.glyph .ink { stroke: var(--accent); }
.glyph .ink.dot { fill: var(--accent); }

.glyph .ink {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.35s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.glyph path.ink {
  stroke-dasharray: 200;
}
.tile:has(a):hover .glyph circle.ink { transform: scale(1.35); }
.tile:has(a):hover .glyph path.ink { animation: redraw 0.7s ease; }

@keyframes redraw {
  from { stroke-dashoffset: 200; }
  to { stroke-dashoffset: 0; }
}

.tile--soon .glyph { stroke: var(--faint); }
.tile--soon .glyph .fill { fill: var(--bg); }
.tile--soon .glyph .dot { fill: var(--faint); }
.tile--soon .glyph .ink { stroke: var(--faint); }
.tile--soon .glyph .ink.dot { fill: var(--faint); }

/* Patička */

.foot {
  margin-top: auto;
  padding-top: 3rem;
  color: var(--muted);
  font-size: 0.875rem;
}

/* 404 */

.missing {
  margin-top: clamp(2.5rem, 8vw, 5rem);
  max-width: 34rem;
}

.missing h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.missing p {
  margin-top: 0.75rem;
  color: var(--muted);
}

.missing a {
  display: inline-block;
  margin-top: 1.5rem;
  font-weight: 600;
  text-underline-offset: 3px;
}

/* Omezený pohyb (např. vypnuté animační efekty ve Windows): nic se neposouvá ani nezvětšuje,
   tečka a dlaždice jen naběhnou průhledností a dlaždice dál reagují rámečkem, stínem a překreslením ikony. */
@keyframes appear {
  from { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .wordmark .tittle { animation-name: appear; animation-timing-function: ease; }
  .tile { animation-name: appear; animation-timing-function: ease; }
  .tile,
  .glyph .ink { transition: border-color 0.25s ease, box-shadow 0.25s ease; }
  .tile:has(a):hover,
  .tile:has(a):active,
  .tile:has(a):hover .glyph circle.ink { transform: none; }
}
