/* =============================================================
   ZADIO EOOD - host-root catalog page styles
   Served at: https://zadio.bg/assets/css/styles.css
   Scope: ONLY the host catalog page at https://zadio.bg/.
          Per-app sites have their own stylesheet under
          website/assets/css/styles.css.
   Hand-written, no framework, no build step.
   ============================================================= */

/* 1. Design tokens ------------------------------------------------- */
:root {
  --brand-primary: #ff7a3d;
  --brand-accent:  #22d3ee;

  /* Dark theme (default) */
  --bg:           #0b0f1a;
  --bg-elev-1:    #131826;
  --bg-elev-2:    #1a2030;
  --fg:           #e6ecf5;
  --fg-muted:     #aab2c5;
  --border:       #2a3146;
  --border-hi:    #3a4565;

  --type-xs:   clamp(0.75rem, 0.7rem + 0.2vw, 0.85rem);
  --type-sm:   clamp(0.85rem, 0.8rem + 0.3vw, 0.95rem);
  --type-base: clamp(1rem,    0.95rem + 0.3vw, 1.1rem);
  --type-lg:   clamp(1.15rem, 1rem + 0.6vw,    1.35rem);
  --type-xl:   clamp(1.35rem, 1.15rem + 1vw,   1.75rem);
  --type-2xl:  clamp(1.7rem,  1.4rem + 1.5vw,  2.4rem);
  --type-3xl:  clamp(2.2rem,  1.8rem + 2vw,    3.4rem);
  --type-hero: clamp(2.4rem,  2rem + 2.5vw,    3.6rem);

  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  --radius-sm:   6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-pill: 999px;

  --shadow-1: 0 1px 2px rgba(0,0,0,.25), 0 2px 8px rgba(0,0,0,.18);
  --shadow-2: 0 4px 16px rgba(0,0,0,.28), 0 12px 32px rgba(0,0,0,.22);

  --card-max: 600px;
  --container-max: 1100px;
  --container-narrow: 720px;
  --container-px: clamp(1rem, 4vw, 2rem);

  --ease: cubic-bezier(.2, .8, .2, 1);
  --duration-fast: 120ms;
  --duration-base: 200ms;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg:        #ffffff;
    --bg-elev-1: #ffffff;
    --bg-elev-2: #f4f6fa;
    --fg:        #0b0f1a;
    --fg-muted:  #4b5670;
    --border:    #d8dee9;   /* light-gray border per spec */
    --border-hi: #c2cad9;
  }
}

/* 2. Reset + base -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif,
               "Apple Color Emoji", "Segoe UI Emoji";
  font-size: var(--type-base);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a { color: var(--brand-primary); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }

/* 3. Accessibility primitives -------------------------------------- */
.sr-only {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-elev-2);
  color: var(--fg);
  border-radius: var(--radius-md);
  z-index: 100;
  transition: top var(--duration-base) var(--ease);
}
.skip-link:focus { top: 8px; }

:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 3px;
  border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 4. Typography ---------------------------------------------------- */
h1, h2, h3 {
  margin: 0 0 var(--space-4);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--fg);
}
h1 { font-size: var(--type-hero); letter-spacing: -0.02em; }
h2 { font-size: var(--type-2xl); }
h3 { font-size: var(--type-xl); }

p { margin: 0 0 var(--space-4); }
.muted { color: var(--fg-muted); }

/* 5. Layout -------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--container-px);
}
.container--narrow { max-width: var(--container-narrow); }
.container--card   { max-width: var(--card-max); }

section { padding-block: var(--space-12); }

/* 6. Header / footer ---------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  color: var(--fg);
  letter-spacing: 0.04em;
}
.brand:hover { text-decoration: none; }

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-8);
  text-align: center;
}
.site-footer p { margin: 0 0 var(--space-2); }
.site-footer p:last-child { margin-bottom: 0; }

/* 7. Hero --------------------------------------------------------- */
.hero {
  padding-block: var(--space-16) var(--space-8);
}
.hero__grid {
  display: flex;
  align-items: flex-start;
  gap: var(--space-10);
  justify-content: center;
}
.hero__logo {
  flex: 0 0 auto;
}
.hero__logo img {
  width: clamp(135px, 15vw, 210px);
  height: auto;
  border-radius: var(--radius-lg);
}
.hero__text {
  flex: 0 1 auto;
  max-width: 32ch;
}
.hero h1 {
  margin-bottom: var(--space-4);
  font-size: calc(var(--type-hero) * 0.7);
}
.hero .lead {
  font-size: var(--type-lg);
  color: var(--fg-muted);
  margin-bottom: 0;
}

/* Stack vertically on narrow screens */
@media (max-width: 640px) {
  .hero__grid {
    flex-direction: column;
    text-align: center;
  }
  .hero__logo img {
    width: 150px;
  }
  .hero__text {
    max-width: 100%;
  }
}

/* 8. App-card list ------------------------------------------------ */
/*
 * Per spec:
 *   - card width ~600px
 *   - light-gray outer border, no internal borders
 *   - newest app at the TOP of the list (DOM order = visual order)
 *
 * Layout: icon on the left (vertically centred), body on the right
 * with 3 stacked rows: name -> description -> link row
 * (website link + Google Play badge + optional Apple Store badge).
 */
.app-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: var(--card-max);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.more-apps-teaser {
  text-align: center;
  color: var(--fg-muted);
  font-style: italic;
  margin-top: var(--space-8);
  margin-bottom: 0;
}

.app-card {
  display: flex;
  gap: var(--space-5);
  padding: var(--space-5);
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  align-items: center;
  transition: border-color var(--duration-fast) var(--ease),
              box-shadow var(--duration-fast) var(--ease),
              transform var(--duration-base) var(--ease);
}
.app-card:hover,
.app-card:focus-within {
  border-color: var(--border-hi);
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}

.app-card__icon-link {
  flex: 0 0 auto;
  display: block;
  border-radius: var(--radius-lg);
}
.app-card__icon-link:hover { text-decoration: none; }

.app-card__icon {
  width: 96px;
  height: 96px;
  border-radius: 18px;
  background: var(--bg-elev-2);
  display: block;
}

.app-card__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-card__name {
  margin: 0 0 var(--space-2);
  font-size: var(--type-xl);
  line-height: 1.2;
}
.app-card__name a {
  color: var(--fg);
  text-decoration: none;
}
.app-card__name a:hover,
.app-card__name a:focus-visible {
  color: var(--brand-primary);
  text-decoration: underline;
}

/* App purpose - a one-line "what is this app for?" tagline that lives
   between the title and the description. Reads as a subtitle: same
   full-strength foreground colour as the title (so the title-block
   groups visually) but a lighter weight (500 vs 700), one size step
   smaller (base vs xl), and italicised so it does not compete with
   the h3 for optical weight. */
.app-card__purpose {
  margin: 0 0 var(--space-3);
  font-size: var(--type-base);
  font-weight: 500;
  font-style: italic;
  color: var(--fg);
  line-height: 1.35;
}

.app-card__desc {
  margin: 0 0 var(--space-4);
  font-size: var(--type-sm);
  color: var(--fg-muted);
  line-height: 1.5;
}

.app-card__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  margin-top: auto;
}

.app-card__site-link {
  font-size: var(--type-sm);
  font-weight: 600;
  color: var(--brand-primary);
  white-space: nowrap;
}
.app-card__site-link:hover,
.app-card__site-link:focus-visible {
  text-decoration: underline;
}

/* Store-badge anchors: bare (no gradient, no border, no shadow) per the
 * official Google Play / App Store brand guidelines, which forbid
 * altering the artwork. Only motion / focus feedback on the anchor. */
.play-badge,
.app-store-badge {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border-radius: 8px;
  transition: transform var(--duration-fast) var(--ease);
}
.play-badge:hover,
.app-store-badge:hover {
  transform: translateY(-1px);
  text-decoration: none;
}
.play-badge:active,
.app-store-badge:active {
  transform: translateY(0);
}
.play-badge img,
.app-store-badge img {
  height: 40px;
  width: auto;
  display: block;
}
@media (forced-colors: active) {
  .play-badge,
  .app-store-badge { outline: 1px solid CanvasText; }
}

/* Mobile: stack icon above body */
@media (max-width: 480px) {
  .app-card {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: var(--space-4);
  }
  .app-card__icon { width: 80px; height: 80px; }
}
