/* ==========================================================================
   AppTrick Design System — "Playful Brutalist"
   Confident, eclectic, a little irreverent. Hard shadows, warm base.
   ========================================================================== */

/* ---------- Fonts ---------- */
/* Bricolage Grotesque: chunky geometric display | Outfit: clean geometric body | JetBrains Mono: labels */

/* ---------- Custom Properties ---------- */
:root {
  /* Palette */
  --cream:             #FBF8F3;
  --cream-dark:        #F0EBE1;
  --ink:               #141421;
  --ink-light:         #3D3D56;
  --ink-muted:         #8E8E9F;
  --terracotta:        #D94F2B;
  --terracotta-hover:  #B8401F;
  --terracotta-soft:   rgba(217, 79, 43, 0.08);
  --border-hard:       #141421;
  --border-soft:       #E0D9CC;
  --white:             #FFFFFF;

  /* App accents */
  --accent-ciekawostki:     #2E7D32;
  --accent-hippo:           #E67E22;
  --accent-planner:         #C13584;

  /* Typography */
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body:    'Outfit', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* Spacing (4px base) */
  --s1:  0.25rem;   /* 4 */
  --s2:  0.5rem;    /* 8 */
  --s3:  0.75rem;   /* 12 */
  --s4:  1rem;      /* 16 */
  --s5:  1.25rem;   /* 20 */
  --s6:  1.5rem;    /* 24 */
  --s8:  2rem;      /* 32 */
  --s10: 2.5rem;    /* 40 */
  --s12: 3rem;      /* 48 */
  --s16: 4rem;      /* 64 */
  --s20: 5rem;      /* 80 */
  --s24: 6rem;      /* 96 */
  --s32: 8rem;      /* 128 */

  /* Radii — tighter */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-full: 9999px;

  /* Hard offset shadows */
  --shadow-offset:  4px 4px 0 var(--ink);
  --shadow-hover:   6px 6px 0 var(--ink);
  --shadow-press:   0px 0px 0 var(--ink);

  /* Transitions */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
}

p {
  color: var(--ink-light);
  margin-bottom: var(--s4);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--terracotta);
  text-decoration: none;
  transition: color 0.2s var(--ease-out);
}

a:hover {
  color: var(--terracotta-hover);
}

strong {
  color: var(--ink);
  font-weight: 600;
}

ul, ol {
  color: var(--ink-light);
  padding-left: var(--s6);
  margin-bottom: var(--s4);
}

li {
  margin-bottom: var(--s2);
}

/* ---------- Layout ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--s8);
}

.container--sm {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--s8);
}

.container--md {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 var(--s8);
}

/* ---------- Site Header ---------- */
.site-header {
  padding: var(--s6) var(--s8);
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 100;
  border-bottom: 2px solid var(--ink);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--s3);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.3s var(--ease-spring);
}

.logo:hover {
  transform: scale(1.02);
  color: var(--ink);
}

.logo__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

.logo__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo__text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* Desktop nav */
.site-nav {
  display: flex;
  gap: var(--s8);
}

.site-nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  transition: color 0.2s var(--ease-out);
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--terracotta);
  transition: width 0.3s var(--ease-out);
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav a:hover::after {
  width: 100%;
}

/* Hamburger toggle */
.nav-toggle {
  display: none;
}

.nav-toggle-label {
  display: none;
  cursor: pointer;
  width: 32px;
  height: 24px;
  position: relative;
  z-index: 101;
}

.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  position: absolute;
  transition: all 0.3s var(--ease-out);
}

.nav-toggle-label span {
  top: 50%;
  transform: translateY(-50%);
}

.nav-toggle-label span::before {
  content: '';
  top: -8px;
}

.nav-toggle-label span::after {
  content: '';
  top: 8px;
}

/* Hamburger animation */
.nav-toggle:checked + .nav-toggle-label span {
  background: transparent;
}

.nav-toggle:checked + .nav-toggle-label span::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle:checked + .nav-toggle-label span::after {
  top: 0;
  transform: rotate(-45deg);
}

/* ---------- Site Footer ---------- */
.site-footer {
  margin-top: var(--s24);
  padding: var(--s12) var(--s8);
  border-top: 2px solid var(--ink);
}

.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s8);
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.footer__brand .logo__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: 2px 2px 0 var(--ink);
}

.footer__brand span {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.footer__links {
  display: flex;
  gap: var(--s6);
}

.footer__links a {
  color: var(--ink-muted);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer__links a:hover {
  color: var(--ink);
}

.footer__copy {
  color: var(--ink-muted);
  font-size: 0.85rem;
}

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  padding: var(--s8);
  box-shadow: var(--shadow-offset);
  transition: all 0.2s var(--ease-out);
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translate(-2px, -2px);
}

.card:active {
  box-shadow: var(--shadow-press);
  transform: translate(4px, 4px);
}

.card--link {
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
}

.card--link:hover {
  color: inherit;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s4) var(--s8);
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid var(--ink);
  transition: all 0.15s var(--ease-out);
  position: relative;
}

.btn--primary {
  background: var(--terracotta);
  color: var(--white);
  box-shadow: var(--shadow-offset);
}

.btn--primary:hover {
  background: var(--terracotta-hover);
  color: var(--white);
  box-shadow: var(--shadow-hover);
  transform: translate(-2px, -2px);
}

.btn--primary:active {
  box-shadow: var(--shadow-press);
  transform: translate(4px, 4px);
}

.btn--outline {
  background: transparent;
  color: var(--ink);
  box-shadow: var(--shadow-offset);
}

.btn--outline:hover {
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow-hover);
  transform: translate(-2px, -2px);
}

.btn--outline:active {
  box-shadow: var(--shadow-press);
  transform: translate(4px, 4px);
}

/* White button variant (for dark backgrounds) */
.btn--white {
  background: var(--white);
  color: var(--ink);
  border-color: var(--ink);
  box-shadow: 4px 4px 0 rgba(255,255,255,0.3);
}

.btn--white:hover {
  background: var(--cream);
  color: var(--ink);
  box-shadow: 6px 6px 0 rgba(255,255,255,0.3);
  transform: translate(-2px, -2px);
}

.btn--white:active {
  box-shadow: 0px 0px 0 rgba(255,255,255,0.3);
  transform: translate(4px, 4px);
}

/* ---------- Tags / Badges ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: var(--s1) var(--s3);
  background: var(--cream-dark);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--r-full);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.tag--accent {
  background: var(--terracotta-soft);
  color: var(--terracotta);
  border-color: var(--terracotta);
}

.tag--ios {
  background: rgba(0, 122, 255, 0.08);
  color: #007AFF;
  border-color: #007AFF;
}

.tag--coming-soon {
  background: var(--cream-dark);
  color: var(--ink-muted);
  border-color: var(--ink-muted);
}

/* ---------- Highlight Box (Legal pages) ---------- */
.highlight-box {
  background: var(--white);
  border: 2px solid var(--ink);
  border-left: 4px solid var(--terracotta);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: var(--s6);
  margin: var(--s6) 0;
  box-shadow: var(--shadow-offset);
}

.highlight-box h3 {
  margin-bottom: var(--s3);
  font-size: 1.1rem;
}

.highlight-box p:last-child {
  margin-bottom: 0;
}

/* ---------- Tables (Legal pages) ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--s6) 0;
  font-size: 0.95rem;
  border: 2px solid var(--ink);
}

th, td {
  text-align: left;
  padding: var(--s3) var(--s4);
  border-bottom: 2px solid var(--border-soft);
  color: var(--ink-light);
}

th {
  color: var(--ink);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--cream-dark);
}

tr:hover td {
  background: rgba(251, 248, 243, 0.5);
}

/* ---------- FAQ Accordion ---------- */
.faq-item {
  border-bottom: 2px solid var(--border-soft);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item summary {
  padding: var(--s5) 0;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.05rem;
  transition: color 0.2s;
}

.faq-item summary:hover {
  color: var(--terracotta);
}

.faq-item summary::after {
  content: '+';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--ink);
  border-radius: var(--r-sm);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  flex-shrink: 0;
  margin-left: var(--s4);
  transition: all 0.3s var(--ease-out);
  line-height: 1;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
  background: var(--ink);
  color: var(--white);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item .faq-answer {
  padding-bottom: var(--s5);
  color: var(--ink-light);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ---------- Section Utilities ---------- */
.section {
  padding: var(--s16) 0;
}

.section--alt {
  background: var(--white);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--terracotta);
  margin-bottom: var(--s3);
  display: inline-block;
}

.section-title {
  margin-bottom: var(--s3);
}

.section-subtitle {
  color: var(--ink-muted);
  font-size: 1.1rem;
  max-width: 500px;
}

.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ---------- App Icon ---------- */
.app-icon {
  border-radius: 22%;
  overflow: hidden;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-offset);
  transition: all 0.3s var(--ease-spring);
}

.app-icon:hover {
  box-shadow: var(--shadow-hover);
  transform: translate(-2px, -2px) scale(1.02);
}

.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-icon--sm  { width: 56px;  height: 56px; }
.app-icon--md  { width: 88px;  height: 88px; }
.app-icon--lg  { width: 160px; height: 160px; }
.app-icon--xl  { width: 240px; height: 240px; border-radius: 48px; }

/* ---------- Store Badge ---------- */
.store-badge {
  display: inline-block;
  transition: all 0.15s var(--ease-out);
}

.store-badge:hover {
  transform: translate(-2px, -2px);
}

.store-badge:active {
  transform: translate(2px, 2px);
}

.store-badge img {
  height: 48px;
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.anim-fadeInUp {
  animation: fadeInUp 0.6s var(--ease-out) both;
}

.anim-delay-1 { animation-delay: 0.1s; }
.anim-delay-2 { animation-delay: 0.2s; }
.anim-delay-3 { animation-delay: 0.3s; }
.anim-delay-4 { animation-delay: 0.4s; }
.anim-delay-5 { animation-delay: 0.5s; }

/* Scroll reveal — elements start hidden, JS adds .is-visible */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Legal Page Layout ---------- */
.legal-page h1 {
  margin-bottom: var(--s2);
}

.legal-page .last-updated {
  color: var(--ink-muted);
  font-size: 0.9rem;
  margin-bottom: var(--s12);
}

.legal-page h2 {
  font-size: 1.4rem;
  margin-top: var(--s10);
  margin-bottom: var(--s4);
  padding-top: var(--s4);
  border-top: 2px solid var(--border-soft);
}

.legal-page h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.legal-page h3 {
  font-size: 1.15rem;
  margin-top: var(--s6);
  margin-bottom: var(--s3);
  color: var(--ink-light);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  /* Show hamburger */
  .nav-toggle-label {
    display: block;
  }

  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    background: var(--cream);
    border-left: 2px solid var(--ink);
    flex-direction: column;
    padding: var(--s32) var(--s8) var(--s8);
    gap: var(--s6);
    transform: translateX(100%);
    transition: transform 0.3s var(--ease-out);
    z-index: 100;
  }

  .site-nav a {
    font-size: 1.1rem;
    color: var(--ink);
  }

  .site-nav a::after {
    display: none;
  }

  .nav-toggle:checked ~ .site-nav {
    transform: translateX(0);
  }

  /* Overlay when nav open */
  .nav-toggle:checked ~ .nav-overlay {
    display: block;
  }

  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 33, 0.4);
    z-index: 99;
  }

  /* Layout adjustments */
  .container,
  .container--sm,
  .container--md {
    padding: 0 var(--s5);
  }

  .site-header {
    padding: var(--s4) var(--s5);
  }

  .section {
    padding: var(--s10) 0;
  }

  .site-footer {
    margin-top: var(--s12);
    padding: var(--s8) var(--s5);
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }

  .footer__links {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--s4);
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }
}

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

  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
