/* =====================================================
   Miqie.dev — Global Stylesheet
   -----------------------------------------------------
   Structure:
   01) Design Tokens
   02) Base / Resets
   03) Hero (video bg, overlays, scroll hint)
   04) Features (cards grid)
   05) Profile + Quote + CTA
   06) Portfolio (section, cards, CTA, bg gif)
   07) Footer (site-footer)
   08) Preloader
   09) Motion & Media Queries (reduced motion)
   10) Browser-specific tweaks (iOS media controls)
   ===================================================== */

/* ================ 01) Design Tokens ================= */
:root{
  /* Colors */
  --bg: #0a0a0a;           /* near-black */
  --surface: #0f0f0f;      /* cards */
  --text: #f2f2f2;         /* main text */
  --muted: #b9b9b9;        /* secondary text */
  --border: #1a1a1a;       /* hairline borders */
  --accent: #c084fc;       /* electric purple */

  /* Typography & spacing */
  --h1: clamp(40px, 9vw, 96px);
  --h2: clamp(22px, 4.2vw, 36px);
  --h3: clamp(18px, 3.4vw, 22px);
  --body: clamp(15px, 2.7vw, 18px);
  --space: clamp(14px, 3vw, 28px);
  --space-lg: clamp(24px, 5vw, 64px);
  --radius: 18px;
  --radius-pill: 999px;
  --shadow: 0 2px 24px rgba(0,0,0,.35);
}

/* ================= 02) Base / Resets ================ */
html, body{ height:100%; }
body{
  margin:0; background:var(--bg); color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  font-size: var(--body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, video{ max-width:100%; height:auto; display:block; }
a{ color:inherit; text-decoration:none; }
.container{ width:min(1200px, 92vw); margin-inline:auto; }
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* =================== 03) HERO ======================= */
.hero{
  position:relative; min-height:100svh; height:100svh; display:grid; place-items:center;
  padding: calc(var(--space-lg) + env(safe-area-inset-top)) var(--space) var(--space);
  text-align:center; isolation:isolate; overflow:hidden; box-sizing:border-box;
  background:#000 url('/poster.jpg') center/cover no-repeat; /* fallback poster */
}
/* remove filter, keep transform-only for GPU layer */
.hero video{
  position:absolute; inset:-2px; width:100%; height:100%; object-fit:cover;
  /* filter: contrast(1.05) saturate(0.85) brightness(0.8); */ /* remove */
  will-change: transform; transform: translateZ(0); transform-origin:center;
  pointer-events:none; opacity:1; transition:none;
}

/* Dark overlay */
.hero::after{
  content:""; position:absolute; inset:-2px; z-index:0; pointer-events:none;
  background:
    radial-gradient(120% 80% at 50% 30%, rgba(0,0,0,0.10) 0%, rgba(0,0,0,0.55) 60%, rgba(0,0,0,0.78) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.25), rgba(0,0,0,0.55));
}
/* Subtle scanlines */
.hero::before{
  content:""; position:absolute; inset:-2px; z-index:0; pointer-events:none;
  background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 100% 2px; opacity:.10;
}
.hero-content{ position:relative; z-index:1; }
.brand{ font-size: var(--h1); letter-spacing: 1px; font-weight: 800; line-height:0.95; text-shadow: 0 0 12px rgba(255,255,255,.22), 0 0 36px rgba(255,255,255,.16), 0 2px 24px rgba(0,0,0,.35); }
@media (min-width:1024px){ .brand{ font-size: clamp(72px, 12vw, 132px); } }
@media (max-width: 767px){ .brand{ font-size: clamp(56px, 18vw, 96px); } }

.tags{ margin-top: var(--space); display:flex; gap:12px; flex-wrap:wrap; justify-content:center; isolation: isolate; contain: paint;  }
.tag{
  position: relative;
  padding:8px 14px;
  border:1px solid #ffffff33;
  border-radius: var(--radius-pill);
  /* backdrop-filter: blur(4px); */ /* REMOVE: causes flicker with video */
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;

  background: rgba(0,0,0,.35);              /* subtle glass base */
  box-shadow: inset 0 0 0 1px #00000055;
  transition: box-shadow .18s ease, border-color .18s ease,
              background-color .18s ease, color .18s ease;
  will-change: opacity;                      /* we do NOT animate transform here */
  backface-visibility: hidden;
  overflow: hidden;                          /* for the ::before sheen */
}
.tags .break{ flex-basis:100%; height:0; }
.tag::before{
  content:"";
  position:absolute; inset:0; pointer-events:none;
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02) 38%, transparent 60%);
  opacity:.8;
}
/* Hover look (also used for auto glow) */
.tag.is-lit{
  color:#fff; border-color:#ffffff66; background:#ffffff1a;
  box-shadow: 0 4px 32px rgba(0,0,0,.35), 0 0 0 1px #ffffff22 inset, 0 0 24px rgba(192,132,252,.28);
  transform: none; /* IMPORTANT: do not fight with GSAP transforms */
}

/* Scroll hint (arrow) */
.scroll-hint{ position:absolute; z-index:3; left:50%; transform: translateX(-50%); bottom:96px; background:transparent; border:none; padding:0; display:inline-flex; align-items:center; justify-content:center; pointer-events:auto; cursor:pointer; color:#fff; appearance:none; -webkit-appearance:none; animation: floaty 1.8s ease-in-out infinite alternate; }
.scroll-hint .arrow{ width: clamp(36px, 6vw, 72px); height: clamp(36px, 6vw, 72px); display:block; color:#fff; filter: drop-shadow(0 2px 8px rgba(0,0,0,.45)); }
@media (min-width:1024px){ .scroll-hint{ bottom: clamp(160px, 16vh, 280px); } }
@media (max-width: 767px){ .scroll-hint{ bottom:72px; } .scroll-hint .arrow{ width: clamp(56px, 14vw, 96px); height: clamp(56px, 14vw, 96px); } }
@keyframes floaty{ from{ transform: translateX(-50%) translateY(0); } to{ transform: translateX(-50%) translateY(-10px); } }

/* ================ 04) Features (cards) ============== */
.features{ padding: var(--space-lg) 0; }
.grid{ display:grid; gap: var(--space); grid-template-columns: 1fr; }
@media (min-width:768px){ .grid{ grid-template-columns: repeat(2, 1fr); } }
@media (min-width:1024px){ .grid{ grid-template-columns: repeat(3, 1fr); } }
.card{ background: var(--surface); border:1px solid var(--border); border-radius: var(--radius); padding: var(--space); box-shadow: var(--shadow); transition: transform .2s ease, filter .2s ease, background-color .2s ease, box-shadow .2s ease, border-color .2s ease; will-change: transform; }
.icon{ width:28px; height:28px; color: var(--accent); opacity:.95; }
.card h3{ font-size: var(--h2); margin: 10px 0 6px; }
.card p{ color: var(--muted); line-height:1.6; }
/* Desktop hover effects */
@media (hover:hover) and (pointer:fine){
  .grid:is(:hover, :focus-within) .card:not(:hover){ filter: blur(2px) brightness(.96); }
  .grid .card:hover{ transform: translateY(-6px); background: color-mix(in srgb, var(--surface) 45%, #000 55%); box-shadow: 0 16px 48px rgba(0,0,0,.48); border-color:#1f1f1f; }
}

/* ========== 05) Profile + Quote + CTA =============== */
.profile{ padding: var(--space-lg) 0 var(--space); text-align:center; }
.portrait{ width: clamp(120px, 35vw, 200px); aspect-ratio:1/1; object-fit:cover; border-radius:50%; margin-inline:auto; border:1px solid var(--border); box-shadow: var(--shadow); }
.handle{ margin-top:10px; font-size: clamp(16px, 2.6vw, 22px); font-weight:700; letter-spacing:.3px; opacity:.95; }
.quote{ max-width: 27ch; margin: clamp(2px, 0.6vw, 6px) auto 0; font-size: clamp(16px, 2.6vw, 22px); color: var(--text); opacity:.95; }
    .cta{
      display:inline-flex; align-items:center; justify-content:center;
      padding:.8rem 1.6rem;
      border-radius:12px;
      font-weight:600;
      text-decoration:none;
      border:2px solid var(--accent);
      background:transparent;
      color:var(--accent);
      transition: all .25s ease;
    }

    .cta:hover{
      background:var(--accent);
      color:var(--bg);
      transform:translateY(-2px) scale(1.02);
      box-shadow:0 6px 20px rgba(192,132,252,.4);
    }.cta:focus-visible{ outline:2px solid #fff; outline-offset:2px; }

.profile .cta{ margin-top: clamp(18px, 3.2vw, 36px); }

/* ======= 06) Portfolio (section, cards, bg) ========= */
.portfolio{ position:relative; margin-top:56px; background:#0a0b10; border-top:0 solid rgba(255,255,255,.08); padding:clamp(32px,6vw,72px) 0 clamp(48px,8vw,88px); isolation:isolate; overflow:hidden; }
.portfolio .section-inner{ width:min(1200px, 92vw); margin-inline:auto; padding:0 var(--space); position:relative; z-index:1; }
.portfolio .section-head{ text-align:center; }
.portfolio .section-head h2{ margin:0 0 6px; font-size: clamp(1.6rem, 4vw, 2.2rem); }
.portfolio .section-head p{ margin:0; color: var(--muted); }
.portfolio-grid{ display:grid; gap:16px; grid-template-columns: repeat(2, minmax(0,1fr)); margin-top:18px; }
@media (max-width:900px){ .portfolio-grid{ grid-template-columns:1fr; } }
.project-card{ border:1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); border-radius:18px; overflow:hidden; display:flex; flex-direction:column; transition: transform .18s ease, box-shadow .18s ease; }
.project-card .media{ display:block; aspect-ratio:16/9; background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); }
.project-card .media img{ width:100%; height:100%; object-fit:cover; display:block; }
.project-body{ padding:16px; display:grid; gap:8px; }
.project-body h3{ margin:0; font-size:1.12rem; }
.project-body p{ margin:0; color:#d7d7de; }
.project-meta{ font-size:.9rem; color: var(--muted); }
.project-actions{ margin-top:6px; display:flex; gap:10px; }
.project-card:hover{ transform: translateY(-2px); box-shadow: 0 20px 40px rgba(0,0,0,.35); }

/* Portfolio CTA button */
.portfolio-cta{ display:flex; justify-content:center; margin-top: clamp(28px, 5vw, 56px); }
.portfolio-cta .btn-portfolio{ display:inline-flex; align-items:center; gap:10px; padding:12px 18px; border-radius: var(--radius-pill); color:#fff; background: rgba(255,255,255,0.05); border:1px solid #ffffff22; box-shadow: 0 8px 24px rgba(0,0,0,.28), inset 0 0 0 1px rgba(255,255,255,0.06); transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease; }
.portfolio-cta .btn-portfolio:hover{ transform: translateY(-2px); background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, #ffffff22); box-shadow: 0 14px 36px rgba(0,0,0,.38), 0 0 36px color-mix(in srgb, var(--accent) 35%, transparent); }
.portfolio-cta .btn-portfolio:active{ transform: translateY(-1px); }
.portfolio-cta .btn-portfolio:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
.portfolio-cta .btn-portfolio svg{ width:18px; height:18px; opacity:.9; }

/* Portfolio background GIF/video */
.portfolio .bg-video{ position:absolute; inset:-10%; width:120%; height:120%; object-fit:cover; filter: blur(20px) brightness(0.1) saturate(0.9); transform: scale(1.6); z-index:0; pointer-events:none; }

/* ===== 07) CTA arrows + label font (hero CTA) ======= */
.cta-label{ font-family: 'Poppins', Inter, 'Segoe UI', ui-sans-serif, system-ui, sans-serif; font-weight:700; letter-spacing:.4px; }
.cta .cta-arrow{ width:14px; height:14px; color: var(--accent); opacity:.95; display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; }
.cta .cta-left{ animation: arrowInLeft 2.2s ease-in-out infinite; }
.cta .cta-right{ animation: arrowInRight 2.2s ease-in-out infinite; }
.cta:hover .cta-arrow{ filter: brightness(1.15); }
@keyframes arrowInLeft{ 0%,100%{ transform: translateX(-2px); } 50%{ transform: translateX(3px); } }
@keyframes arrowInRight{ 0%,100%{ transform: translateX(2px); } 50%{ transform: translateX(-3px); } }
/* ensure right arrow points inward */
.cta .cta-right svg{ transform:none; }

/* ================== 07) Footer ====================== */
.site-footer{ margin-top:0; background: linear-gradient(180deg, #080808 0%, #020202 70%); border-top:1px solid #ffffff12; color:var(--muted); }
.site-footer a{ color:var(--muted); }
.site-footer a:hover{ color:#fff; }

.ft-grid{ display:grid; gap:var(--space); padding:var(--space) 0; max-width:min(1200px,92vw); margin:0 auto; }
@media (min-width:768px){ .ft-grid{ grid-template-columns:1.2fr .8fr .9fr; } }

.ft-logo{ font-size:1.25rem; margin:0 0 6px; color:#fff; text-align:center; }
.ft-bio{ margin:0 0 10px; text-align:center; }
.ft-social{ display:flex; justify-content:center; gap:8px; }
.ft-social a{ display:inline-flex; width:36px; height:36px; align-items:center; justify-content:center; border:1px solid #ffffff22; border-radius:12px; margin-right:8px; transition:transform .18s ease, border-color .18s ease, background-color .18s ease; }
.ft-social a:hover{ transform:translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, #ffffff22); background: color-mix(in srgb, var(--accent) 15%, transparent); }

.ft-links h4, .ft-contact h4{ margin:0 0 8px; color:#fff; font-size:1rem; text-align:center; }
.ft-links ul, .ft-contact-list{ margin:0; padding:0; list-style:none; display:grid; gap:8px; justify-items:center; }

/* icons in contact list */
.ft-contact-list li a, .ft-contact-list li span{ display:inline-flex; align-items:center; gap:8px; }
.ft-contact-list svg{ width:18px; height:18px; color:var(--muted); }

.ft-bottom{ margin-top:var(--space); border-top:1px solid var(--border); padding:12px 0 calc(12px + env(safe-area-inset-bottom)); }
.ft-bottom .container{ display:flex; align-items:center; justify-content:center; gap:12px; text-align:center; }

/* Footer layout: brand above, then 2 cols on small screens */
.ft-brand, .ft-links, .ft-contact{ text-align:center; }
@media (max-width:1023px){
  .ft-grid{ display:grid; grid-template-columns: 1fr 1fr; grid-template-areas:
    'brand brand'
    'pages contact'; }
  .ft-brand{ grid-area: brand; }
  .ft-links{ grid-area: pages; }
  .ft-contact{ grid-area: contact; }
}
/* Vertically center Contact against Pages */
.ft-contact{ display:flex; flex-direction:column; justify-content:center; }

/* =================== 08) Preloader ================== */
.preloader{ position:fixed; inset:0; background: var(--bg); display:grid; place-items:center; z-index:10000; transition: opacity .35s ease, visibility .35s ease; }
.preloader.is-done{ opacity:0; visibility:hidden; pointer-events:none; }
.preloader-inner{ display:flex; align-items:center; gap:12px; padding:10px 14px; border-radius:14px; background: rgba(255,255,255,0.03); border:1px solid #ffffff15; box-shadow: 0 10px 28px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.04) inset; }
.preloader .ring{ width:22px; height:22px; border-radius:50%; border:2px solid #2a2a2a; border-top-color: var(--accent); animation: spin .9s linear infinite; }
.preloader-text{ color: var(--muted); }
@keyframes spin{ to{ transform: rotate(360deg); } }

/* ====== 09) Motion / Reduced Motion Queries ========= */
@media (prefers-reduced-motion: reduce){
  .scroll-hint{ animation:none; }
  .portfolio .bg-video{ position:absolute; inset:-25%; width:150%; height:150%; object-fit:cover; object-position:70% center; filter: blur(30px) brightness(0.38) saturate(0.85) contrast(1.05); transform: scale(1.45); z-index:0; pointer-events:none; }
  .hero{ background:#000 url('/poster.jpg') center/cover no-repeat; }
}

/* ====== 10) iOS media controls (hide overlays) ====== */
.hero video::-webkit-media-controls,
.hero video::-webkit-media-controls-enclosure,
.hero video::-webkit-media-controls-panel,
.hero video::-webkit-media-controls-start-playback-button{ display:none !important; -webkit-appearance:none; }
.hero video::-webkit-media-controls-overlay-play-button,
.hero video::-webkit-media-controls-play-button{ display:none !important; -webkit-appearance:none; }

/* ===== Footer: Discord kontakt — čistá ikona + hover jako e‑mail ===== */
/* Zarovnání řádku stejně jako e‑mail */
.ft-contact-list .dc-contact{ display:inline-flex; align-items:center; gap:8px; }

/* Ikona bez podkladu, velikost shodná s ostatními ikonami ve footeru */
.ft-contact-list .dc-contact .dc-logo{ width:18px; height:18px; color: var(--muted); }

/* Textový handle vypadá a chová se jako odkaz (e‑mail) */
.site-footer .copy-handle{
  cursor:pointer; background:none; border:0; padding:0; color: var(--muted); font:inherit;
}
/* HOVER = stejné jako e‑mail: zesvětlení na #fff */
.site-footer .copy-handle:hover,
.site-footer .copy-handle:focus-visible{ color:#fff; text-decoration:none; }

/* Pokud máš v CSS staré .dc-badge/.dc-icon, smaž je nebo přebij: */
.dc-badge{ display:none !important; background:none !important; box-shadow:none !important; }

