/* ==========================================================================
   Digital Bricks — AI Literacy Download Page (Ultra-Minimal Edition)
   ========================================================================== */

:root {
  --bg: #030306;
  --surface: #14141a;
  --surface-hover: #1e1e29;

  --txt-100: #eafaff;
  --txt-70: rgba(234, 250, 255, 0.72);
  --txt-50: rgba(234, 250, 255, 0.50);

  --cyan: #11f2fd;
  --purple: #b676f3;

  --grad-text: linear-gradient(90deg, #11f2fd 0%, #b676f3 100%);
  --grad-cta: linear-gradient(-90deg, #b676f3 0%, #00a2ea 100%);
  --grad-cta-hover: linear-gradient(-90deg, #a263e3 0%, #008ccf 100%);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html,
body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--txt-100);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

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

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
  border-radius: 0.5rem;
}

[hidden] {
  display: none !important;
}

/* Subtle Background Glow */
.ambient-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
}

.ambient-glow--cyan {
  width: 38rem;
  height: 26rem;
  top: -8rem;
  left: calc(50% - 30rem);
  background: radial-gradient(circle, rgba(17, 242, 253, 0.12) 0%, transparent 72%);
}

.ambient-glow--purple {
  width: 40rem;
  height: 28rem;
  top: 0;
  right: calc(50% - 32rem);
  background: radial-gradient(circle, rgba(182, 118, 243, 0.13) 0%, transparent 72%);
}

/* Layout Shell */
.page-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.75rem 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Minimal Header */
.site-header {
  display: flex;
  align-items: center;
}

.brand-logo {
  display: inline-flex;
  transition: opacity 0.2s ease;
}

.brand-logo:hover {
  opacity: 0.88;
}

.brand-logo svg {
  width: 11.5rem;
  height: auto;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(2rem, 4.2vh, 3.25rem);
  padding: 1rem 0;
}

/* Hero */
.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.eyebrow {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 1rem;
}

.hero-headline {
  font-size: clamp(3.25rem, 6.8vw, 5.75rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.05em;
  color: var(--txt-100);
  margin-bottom: 2rem;
}

.text-gradient {
  background-image: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  max-width: 44rem;
  font-size: clamp(1.15rem, 1.5vw, 1.4rem);
  font-weight: 400;
  line-height: 1.48;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--txt-70);
  margin-bottom: 2rem;
}

/* Primary CTA */
.cta-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.15rem 2.75rem;
  border-radius: 1rem;
  background-image: var(--grad-cta);
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  white-space: nowrap;
  box-shadow:
    0 14px 36px -8px rgba(0, 162, 234, 0.42),
    0 8px 24px -8px rgba(182, 118, 243, 0.36);
  transition: transform 0.22s var(--ease), box-shadow 0.22s ease;
}

.btn-primary:hover {
  background-image: var(--grad-cta-hover);
  transform: translateY(-2px);
  box-shadow:
    0 18px 42px -6px rgba(0, 162, 234, 0.5),
    0 10px 28px -6px rgba(182, 118, 243, 0.44);
}

.btn-primary.is-attention-pulse {
  animation: cta-glow 2.2s ease-in-out 2;
}

@keyframes cta-glow {
  0%, 100% { box-shadow: 0 14px 36px -8px rgba(0, 162, 234, 0.42), 0 0 0 0 rgba(17, 242, 253, 0); }
  50%      { box-shadow: 0 18px 42px -6px rgba(0, 162, 234, 0.55), 0 0 0 6px rgba(17, 242, 253, 0.2); }
}

.download-message {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--txt-50);
  letter-spacing: -0.015em;
}

.download-fallback-note {
  margin-top: 0.35rem;
  font-size: 0.95rem;
  color: #e2c4ff;
}

/* Two Simple Visual Previews */
.resources-section {
  width: 100%;
  max-width: 48rem;
}

.resources-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

.resource-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.95rem;
}

.doc-preview {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 1.15rem;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(234, 250, 255, 0.12);
  box-shadow: 0 18px 44px -16px rgba(0, 0, 0, 0.8);
  transition: transform 0.3s var(--ease), border-color 0.3s ease;
}

.doc-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.4s var(--ease);
}

.doc-preview:hover {
  transform: translateY(-4px);
  border-color: rgba(17, 242, 253, 0.45);
}

.doc-preview:hover img {
  transform: scale(1.03);
}

.resource-download-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--txt-100);
  transition: color 0.2s ease;
}

.resource-download-link:hover,
.resource-download-link:active,
.resource-download-link:focus,
.resource-download-link.is-downloaded {
  color: #ffffff;
  opacity: 0.9;
}

/* Minimal Footer */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  padding-top: 0.75rem;
  font-size: 1.05rem;
}

.footer-note {
  color: var(--txt-50);
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--txt-100);
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--cyan);
}

.footer-link svg {
  transition: transform 0.2s var(--ease);
}

.footer-link:hover svg {
  transform: translateX(3px);
}

/* Smooth Entrance */
.reveal {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  animation: reveal-up 0.6s var(--ease) forwards;
}

.reveal--1 { animation-delay: 0.03s; }
.reveal--2 { animation-delay: 0.08s; }
.reveal--3 { animation-delay: 0.13s; }
.reveal--4 { animation-delay: 0.18s; }
.reveal--5 { animation-delay: 0.24s; }
.reveal--6 { animation-delay: 0.30s; }

@keyframes reveal-up {
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* Preview Modal */
.preview-modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  background: transparent;
  color: #ffffff;
  border: none;
  padding: 1.5rem;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.preview-modal[open] {
  display: flex;
}

.preview-modal::backdrop {
  background: rgba(3, 3, 6, 0.85);
  backdrop-filter: blur(10px);
}

.preview-modal-backdrop {
  position: fixed;
  inset: 0;
}

.preview-modal-panel {
  position: relative;
  z-index: 1;
  width: min(64rem, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  border-radius: 1.25rem;
  background: #12121a;
  border: 1px solid rgba(234, 250, 255, 0.14);
  overflow: hidden;
}

.preview-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.35rem;
  border-bottom: 1px solid rgba(234, 250, 255, 0.08);
}

.preview-modal-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #ffffff;
}

.preview-modal-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.preview-modal-download {
  padding: 0.55rem 1.1rem;
  border-radius: 0.65rem;
  background-image: var(--grad-cta);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
}

.preview-modal-close {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: rgba(234, 250, 255, 0.10);
}

.preview-modal-stage {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  background: #07070c;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.preview-modal-stage.is-slide-mode {
  align-items: center;
}

.preview-stage-img {
  max-width: 100%;
  height: auto;
  border-radius: 0.6rem;
}

.preview-modal-stage.is-slide-mode .preview-stage-img {
  max-height: calc(88vh - 10rem);
  width: auto;
}

.preview-modal-stage.is-sheet-mode .preview-stage-img {
  width: min(44rem, 100%);
}

.preview-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.35rem;
  border-top: 1px solid rgba(234, 250, 255, 0.08);
}

.slide-nav-btn {
  padding: 0.55rem 1.1rem;
  border-radius: 0.6rem;
  background: var(--surface-hover);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  min-height: 2.6rem;
  white-space: nowrap;
}

.slide-nav-btn:hover:not(:disabled) {
  background: #2b2b3a;
  color: #ffffff;
}

.slide-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.slide-counter {
  font-size: 0.95rem;
  color: #ffffff;
  opacity: 0.85;
}

/* Mobile & Small Phones */
@media screen and (max-width: 680px) {
  .page-shell {
    padding: 1.25rem 1.25rem 2.25rem;
    justify-content: flex-start;
    gap: 1.75rem;
  }

  .site-header {
    justify-content: center;
  }

  .brand-logo svg {
    width: 10rem;
  }

  .main-content {
    justify-content: flex-start;
    gap: 2.25rem;
    padding: 0.5rem 0 0;
  }

  .hero-headline {
    font-size: clamp(2.65rem, 12vw, 3.4rem);
    margin-bottom: 1.4rem;
  }

  .cta-block {
    width: 100%;
    gap: 0.75rem;
  }

  .btn-primary {
    width: 100%;
    min-height: 3.4rem;
    padding: 0.95rem 1.25rem;
    font-size: 1.08rem;
  }

  .download-message {
    font-size: 0.95rem;
  }

  .resources-row {
    grid-template-columns: 1fr;
    gap: 1.65rem;
  }

  .doc-preview {
    aspect-ratio: 16 / 10;
    border-radius: 1rem;
  }

  .resource-download-link {
    font-size: 1.08rem;
    min-height: 2.75rem;
    padding: 0.25rem 0.5rem;
  }

  .preview-modal {
    padding: 0.5rem;
  }

  .preview-modal-panel {
    max-height: 92dvh;
    border-radius: 1rem;
  }

  .preview-modal-header {
    padding: 0.75rem 0.9rem;
    gap: 0.5rem;
  }

  .preview-modal-title {
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .preview-modal-download {
    padding: 0.45rem 0.85rem;
    font-size: 0.88rem;
  }

  .preview-modal-stage {
    padding: 0.75rem;
  }

  .preview-modal-footer {
    padding: 0.7rem 0.9rem;
  }

  .slide-nav-btn {
    padding: 0.5rem 0.9rem;
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
