/* ============================================================
   Karotka Rudykopalsson – design systém
   Teplé tmavé téma, editorský styl
   ============================================================ */

/* --- 1. Proměnné ------------------------------------------ */
:root {
  --font-heading: 'Syne', system-ui, sans-serif;
  --font-serif:   'Fraunces', Georgia, 'Times New Roman', serif;

  /* Teplá tmavá paleta */
  --bg-base:       #0D0A07;
  --bg-surface:    #161008;
  --bg-card:       #1E1509;
  --bg-card-hover: #261C0C;

  --amber:         #F07C1A;
  --amber-dim:     rgba(240, 124, 26, 0.12);
  --amber-border:  rgba(240, 124, 26, 0.22);

  --text-primary:   #F0E4CB;
  --text-secondary: #9A876A;
  --text-muted:     #5E4E36;

  --border-subtle: rgba(240, 160, 60, 0.09);
  --border-card:   rgba(240, 160, 60, 0.13);

  --radius:    0.75rem;
  --radius-sm: 0.5rem;

  /* Přepis PicoCSS proměnných */
  --pico-font-family:       system-ui, -apple-system, 'Segoe UI', sans-serif;
  --pico-line-height:       1.65;
  --pico-border-radius:     var(--radius);
  --pico-background-color:  var(--bg-base);
  --pico-color:             var(--text-primary);
  --pico-primary:           var(--amber);
  --pico-muted-color:       var(--text-secondary);
  --pico-muted-border-color: var(--border-subtle);
}

/* --- 2. Základ -------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100dvh;
}

/* Jemná textura pozadí (SVG šum, žádný HTTP request) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* --- 3. Skip link (přístupnost) --------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1.25rem;
  background: var(--amber);
  color: #0D0A07;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  text-decoration: none;
  z-index: 9999;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0;
}

/* --- 4. Fokus (přístupnost) -------------------------------- */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 3px;
}

a:focus-visible {
  outline-offset: 2px;
}

/* --- 5. Záhlaví ------------------------------------------- */
body > header {
  background: var(--bg-base);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.75rem 0;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* Ambientní záře */
body > header::after {
  content: '';
  position: absolute;
  top: -80%;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 250%;
  background: radial-gradient(ellipse, rgba(240, 124, 26, 0.07) 0%, transparent 65%);
  pointer-events: none;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
  z-index: 1;
}

.header-monogram {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.5rem;
  background: var(--amber);
  color: #0D0A07;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  box-shadow: 0 0 24px rgba(240, 124, 26, 0.28);
}

body > header h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 4vw, 1.9rem);
  font-weight: 800;
  margin: 0;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.header-tagline {
  margin: 0.2rem 0 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* --- 6. Hlavní layout ------------------------------------- */
main.container {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  padding-top: 2.5rem;
  padding-bottom: 3rem;
  position: relative;
  z-index: 1;
}

/* --- 7. Hero sekce ---------------------------------------- */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2.5rem;
  align-items: center;
  background: var(--bg-surface);
  padding: 2.5rem;
  border-radius: calc(var(--radius) * 1.5);
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

/* Dekorativní záře v rohu */
.hero-grid::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 14rem;
  height: 14rem;
  background: radial-gradient(ellipse at top right, rgba(240, 124, 26, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

/* Citát ---------------------------------------------------- */
blockquote {
  border: none;
  padding: 0;
  margin: 0;
  position: relative;
}

blockquote::before {
  content: '\201C';
  font-family: var(--font-serif);
  font-size: 5rem;
  line-height: 0.8;
  color: var(--amber);
  opacity: 0.2;
  display: block;
  margin-bottom: -1.25rem;
  user-select: none;
}

blockquote p {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  font-style: italic;
  font-weight: 300;
  line-height: 1.75;
  color: var(--text-primary);
  margin-bottom: 1rem;
  /* Bez opacity – zachování kontrastu pro WCAG */
}

blockquote cite {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  display: block;
}

/* Hero obrázek --------------------------------------------- */
.hero-image {
  margin: 0;
  flex-shrink: 0;
}

.hero-image img {
  width: clamp(150px, 18vw, 240px);
  height: auto;
  border-radius: var(--radius);
  display: block;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* --- 8. Panel s projekty ---------------------------------- */
.content-panel {
  background: var(--bg-surface);
  padding: 2rem;
  border-radius: calc(var(--radius) * 1.5);
  border: 1px solid var(--border-subtle);
}

.panel-heading {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.panel-heading h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 800;
  margin: 0;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.panel-note {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
  font-style: italic;
}

/* --- 9. Karty projektů ------------------------------------ */
.content-sections {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.content-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.content-card:hover {
  border-color: var(--amber-border);
}

.content-card[open] {
  border-color: var(--amber-border);
  box-shadow: 0 0 0 1px var(--amber-border);
}

.content-card summary {
  list-style: none;
  padding: 1.125rem 1.375rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.content-card summary::-webkit-details-marker {
  display: none;
}

.content-card summary::marker {
  display: none;
}

.content-card summary:hover {
  background: var(--bg-card-hover);
}

.content-card summary:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}

.card-summary-title {
  flex: 1;
  min-width: 0;
  font-family: var(--font-heading);
  font-size: 0.975rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-summary-desc {
  flex: 1;
  min-width: 0;
  display: block;
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Chevron indikátor otevření -------------------------------- */
.details-chevron {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: var(--text-muted);
  position: relative;
  transition: color 0.2s ease;
}

.details-chevron::before,
.details-chevron::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 0.45rem;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.25s ease;
}

.details-chevron::before {
  left: 0.15rem;
  transform: translateY(-50%) rotate(45deg);
}

.details-chevron::after {
  right: 0.15rem;
  transform: translateY(-50%) rotate(-45deg);
}

details[open] .details-chevron {
  color: var(--amber);
}

details[open] .details-chevron::before {
  transform: translateY(-50%) rotate(-45deg);
}

details[open] .details-chevron::after {
  transform: translateY(-50%) rotate(45deg);
}

/* Tělo karty ----------------------------------------------- */
.card-body {
  padding: 1.25rem 1.375rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
  display: block;
  transition: opacity 0.2s ease;
}

.card-body a:hover img {
  opacity: 0.88;
}

.card-body p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.card-body a {
  color: var(--amber);
}

/* --- 10. Status pilly (sémantické barvy) ------------------- */
.status-pill {
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Zelená = aktivní produkce */
.status-active {
  background: rgba(74, 222, 128, 0.1);
  color: #6EE7A0;
  border: 1px solid rgba(74, 222, 128, 0.18);
}

/* Žlutá = prototyp / rozpracováno */
.status-prototype {
  background: rgba(251, 191, 36, 0.1);
  color: #FCD34D;
  border: 1px solid rgba(251, 191, 36, 0.18);
}

/* Modrá = proof-of-concept */
.status-poc {
  background: rgba(147, 197, 253, 0.1);
  color: #93C5FD;
  border: 1px solid rgba(147, 197, 253, 0.18);
}

/* Fialová = testovací */
.status-test {
  background: rgba(192, 132, 252, 0.1);
  color: #C084FC;
  border: 1px solid rgba(192, 132, 252, 0.18);
}

/* Šedá = privátní / interní */
.status-private {
  background: rgba(156, 163, 175, 0.08);
  color: #9CA3AF;
  border: 1px solid rgba(156, 163, 175, 0.14);
}

/* --- 11. Patička ------------------------------------------ */
footer {
  border-top: 1px solid var(--border-subtle);
  padding: 1.5rem 0;
  position: relative;
  z-index: 1;
}

.footer-inner {
  display: flex;
  justify-content: center;
}

.footer-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* --- 12. Animace ------------------------------------------ */
@media (prefers-reduced-motion: no-preference) {
  main > * {
    animation: fadeUp 0.45s ease both;
  }

  main > *:nth-child(2) {
    animation-delay: 0.08s;
  }

  .content-card {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  }

  .content-card:hover {
    transform: translateY(-1px);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- 13. Responzivita ------------------------------------- */
@media (max-width: 640px) {
  .hero-grid {
    grid-template-columns: 1fr;
    padding: 1.75rem;
    gap: 2rem;
  }

  /* Na mobilu obrázek nahoře */
  .hero-image {
    order: -1;
    display: flex;
    justify-content: center;
  }

  .hero-image img {
    width: 160px;
  }

  .header-monogram {
    display: none;
  }
}

@media (max-width: 440px) {
  .content-panel {
    padding: 1.25rem;
  }

  .content-card summary {
    padding: 1rem;
  }

  .card-body {
    padding: 1rem 1rem 1.25rem;
  }

  /* Na velmi úzkých displejích status pill schovat */
  .status-pill {
    display: none;
  }
}

/* --- 14. Tisk --------------------------------------------- */
@media print {
  body::before,
  body > header::after,
  .hero-grid::before,
  .skip-link {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  /* Rozbalit všechny karty při tisku */
  .content-card summary ~ * {
    display: flex !important;
  }

  .details-chevron {
    display: none;
  }

  .status-pill {
    border: 1px solid #ccc;
    color: #333;
    background: none;
  }
}
