/* =========================================================
   M365 Agent Templates — landing page styles
   Light, soft-pastel design matching the design mockup
   ========================================================= */

:root {
  /* Surfaces */
  --bg: #fafbfd;
  --bg-soft: #f3f4fb;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --border: #e6e8ef;
  --border-strong: #d7dae3;

  /* Text */
  --text: #1a1f36;
  --text-soft: #4a5168;
  --text-dim: #6b7280;
  --muted: #9aa1b0;

  /* Brand */
  --blue: #2563ff;
  --blue-2: #00b3ff;
  --purple: #8b5cff;
  --pink: #ff6bb5;
  --pink-2: #ff8a3d;

  /* Tag colors */
  --tag-declarative-bg: #eaf1ff;
  --tag-declarative-fg: #1e5bff;
  --tag-prompt-bg: #fff1e8;
  --tag-prompt-fg: #e7682b;
  --tag-skill-bg: #eaf6ff;
  --tag-skill-fg: #1c8fff;
  --tag-course-bg: #fff3df;
  --tag-course-fg: #b86c00;
  --tag-handson-bg: #f3eaff;
  --tag-handson-fg: #7c3aed;
  --tag-plugin-bg: #ece9ff;
  --tag-plugin-fg: #5b53c7;

  /* Pastel card backgrounds */
  --card-pink: #ffe6ec;
  --card-yellow: #fff4d6;
  --card-blue: #e8effd;

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(20, 27, 64, 0.04);
  --shadow-sm: 0 4px 14px rgba(20, 27, 64, 0.05);
  --shadow: 0 12px 32px rgba(20, 27, 64, 0.07);
  --shadow-lg: 0 28px 70px rgba(20, 27, 64, 0.10);

  --maxw: 1200px;

  --font-sans: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--blue);
  color: #fff;
  padding: 10px 14px;
  border-radius: 0 0 8px 0;
  z-index: 1000;
}
.skip-link:focus {
  left: 0;
}

/* ============== Header ============== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(230, 232, 239, 0.7);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  width: 28px;
  height: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  flex-shrink: 0;
}
.brand-logo span {
  display: block;
  border-radius: 1px;
}
.brand-logo span:nth-child(1) { background: #f25022; }
.brand-logo span:nth-child(2) { background: #7fba00; }
.brand-logo span:nth-child(3) { background: #00a4ef; }
.brand-logo span:nth-child(4) { background: #ffb900; }

.brand-text {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand-text em {
  font-style: normal;
  color: var(--blue);
  font-weight: 700;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 36px;
}
.primary-nav a {
  color: var(--text-soft);
  font-weight: 500;
  font-size: 15px;
}
.primary-nav a:hover {
  color: var(--text);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ============== Hero ============== */
.hero {
  position: relative;
  padding: 24px 0 32px;
  background:
    radial-gradient(900px 480px at 75% 0%, rgba(139, 92, 255, 0.10), transparent 60%),
    radial-gradient(700px 360px at 5% 30%, rgba(37, 99, 255, 0.08), transparent 60%),
    linear-gradient(180deg, #f6f7fc 0%, #fafbfd 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 32px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  background: #e9ecfb;
  color: #3a4dbb;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(34px, 5.2vw, 60px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  font-weight: 800;
  color: var(--text);
}

.gradient-text {
  background: linear-gradient(90deg, #2b7fff 0%, #00b3ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .lead {
  font-size: 17px;
  color: var(--text-dim);
  margin: 0 0 28px;
  max-width: 52ch;
}

/* Hero CTA pill */
.cta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px;
  box-shadow: var(--shadow-sm);
}
.cta-pill .pill-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text-soft);
  transition: background 0.15s ease, color 0.15s ease;
}
.cta-pill .pill-item:hover {
  background: var(--bg-soft);
  color: var(--text);
}
.cta-pill .pill-item .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
  flex-shrink: 0;
}
.cta-pill .pill-item.is-emoji {
  font-size: 16px;
}
.cta-pill .pill-divider {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d7dae3;
  margin: 0 2px;
  flex-shrink: 0;
}

/* Hero visual */
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-visual img,
.hero-visual .hero-placeholder {
  width: 100%;
  max-width: 440px;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  /* trim transparent padding of generated illustration */
  margin: -40px 0;
}
.hero-visual .hero-placeholder { margin: 0; }
.hero-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 30% 30%, rgba(139, 92, 255, 0.18), transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(0, 179, 255, 0.18), transparent 60%),
    #f3f4fb;
  border-radius: var(--radius-lg);
  font-size: 96px;
  color: var(--muted);
}

/* ============== Filter / Search Bar ============== */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 8px 0 24px;
}

.filter-tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-tab {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.filter-tab:hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.filter-tab.is-active {
  background: #14b8d4;
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(20, 184, 212, 0.30);
}

.search {
  position: relative;
  flex: 1 1 280px;
  max-width: 360px;
}
.search input {
  width: 100%;
  height: 44px;
  padding: 0 44px 0 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search input::placeholder {
  color: var(--muted);
}
.search input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 255, 0.12);
}
.search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

/* ============== Template Grid ============== */
.templates {
  padding: 4px 0 56px;
}
.template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.template-grid[aria-busy="true"] {
  grid-template-columns: 1fr;
}
.template-loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-dim);
  font-size: 14.5px;
  padding: 28px 0;
  margin: 0;
}

.template-card {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 22px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow-xs);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.template-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}
.template-card[hidden] {
  display: none;
}

.template-icon {
  width: 132px;
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f6f7fc 0%, #eef0f8 100%);
  border-radius: 20px;
  overflow: hidden;
}
.template-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.template-icon.placeholder {
  font-size: 64px;
  color: var(--muted);
}

.template-body {
  min-width: 0;
}
.template-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.template-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tag[data-tag="agent"]   { background: var(--tag-declarative-bg); color: var(--tag-declarative-fg); }
.tag[data-tag="prompt"]  { background: var(--tag-prompt-bg);      color: var(--tag-prompt-fg); }
.tag[data-tag="skill"]   { background: var(--tag-skill-bg);       color: var(--tag-skill-fg); }
.tag[data-tag="course"]  { background: var(--tag-course-bg);      color: var(--tag-course-fg); }
.tag[data-tag="handson"] { background: var(--tag-handson-bg);     color: var(--tag-handson-fg); }
.tag[data-tag="plugin"]  { background: var(--tag-plugin-bg);      color: var(--tag-plugin-fg); }

.template-desc {
  margin: 0 0 16px;
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.55;
}

.downloads-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.download-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-soft);
  font-weight: 500;
  margin-bottom: 8px;
  transition: background 0.15s ease;
}
.download-row:last-child {
  margin-bottom: 0;
}
.download-row:hover {
  background: #ebeefa;
}
.download-row .file-type {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-soft);
}

/* ============== Download All CTA ============== */
.download-all {
  display: flex;
  justify-content: center;
  padding: 16px 0 48px;
}
.download-all .btn-mega {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(90deg, #a55bff 0%, #ff6bb5 100%);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.005em;
  padding: 18px 40px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: 0 16px 36px rgba(165, 91, 255, 0.30);
  transition: transform 0.12s ease, box-shadow 0.18s ease, filter 0.15s ease;
}
.download-all .btn-mega:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 22px 48px rgba(165, 91, 255, 0.36);
}
.download-all .btn-mega svg {
  width: 20px;
  height: 20px;
}

/* ============== Feedback Cards ============== */
.feedback {
  padding: 16px 0 80px;
}
.feedback-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.feedback-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px 26px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.18s ease;
}
.feedback-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.feedback-card.bug      { background: var(--card-pink); }
.feedback-card.feature  { background: var(--card-yellow); }
.feedback-card.question { background: var(--card-blue); }

.feedback-emoji {
  font-size: 36px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.08));
}
.feedback-body {
  flex: 1;
  min-width: 0;
}
.feedback-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 4px;
}
.feedback-title small {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.005em;
}
.feedback-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.5;
}
.feedback-arrow {
  font-size: 22px;
  color: var(--text-soft);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.feedback-card:hover .feedback-arrow {
  transform: translateX(4px);
}

/* ============== Footer ============== */
.site-footer {
  padding: 28px 0 44px;
  border-top: 1px solid var(--border);
  background: #fff;
}
.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13.5px;
  color: var(--text-dim);
}
.footer-grid nav {
  display: flex;
  gap: 22px;
}
.footer-grid nav a {
  color: var(--text-soft);
}
.footer-grid nav a:hover {
  color: var(--text);
}

/* ============== No-results state ============== */
.no-results {
  display: none;
  text-align: center;
  padding: 80px 24px;
  color: var(--text-dim);
}
.no-results.is-visible { display: block; }
.no-results strong {
  display: block;
  color: var(--text);
  font-size: 18px;
  margin-bottom: 6px;
}

/* ============== Responsive ============== */
@media (max-width: 1024px) {
  .hero {
    padding: 36px 0 56px;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: center;
  }
  .hero-visual {
    order: -1;
  }
  .hero-visual img,
  .hero-visual .hero-placeholder {
    max-width: 300px;
  }
  .hero .eyebrow { margin-bottom: 16px; }
  .hero .lead { margin-left: auto; margin-right: auto; }
  .cta-pill { margin: 0 auto; }
}

@media (max-width: 820px) {
  .template-grid {
    grid-template-columns: 1fr;
  }
  .feedback-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .primary-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .primary-nav a {
    padding: 14px 28px;
    border-top: 1px solid var(--border);
  }
  .primary-nav a:first-child { border-top: none; }

  .hero { padding: 32px 0 48px; }
  .hero h1 { font-size: 34px; }
  .cta-pill { width: 100%; flex-wrap: wrap; }

  .template-card {
    grid-template-columns: 92px 1fr;
    gap: 16px;
    padding: 18px;
  }
  .template-icon {
    width: 92px;
    height: 92px;
    border-radius: 16px;
  }

  .filter-bar { gap: 12px; }
  .search { max-width: 100%; }

  .download-all .btn-mega {
    width: 100%;
    justify-content: center;
    padding: 16px 24px;
    font-size: 15px;
  }

  .feedback-card { padding: 18px 20px; }
}

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