/* =========================================================
   style.css — Release 9 UI Polish & Visual Upgrade
   Includes:
   - Consistent design system
   - Mobile-first layout
   - Reusable buttons and cards
   - Refined spacing and hierarchy
   - Navigation polish
   - Hover/focus micro-interactions
   - Accessible reveal behavior support
   ========================================================= */

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

html {
  font-size: 100%;
}

html:focus-within {
  scroll-behavior: smooth;
}

/* ---- Design system ---- */
:root {
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;

  --radius: 12px;
  --radius-pill: 999px;

  --primary: #0b3d91;
  --primary-hover: #082f6f;
  --text: #111;
  --muted: #444;
  --background: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f5f7ff;
  --border: #ddd;
  --focus: 3px solid #111;
}

/* ---- Base ---- */
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--background);
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-3);
}

section {
  margin-bottom: var(--space-4);
}

/* ---- Header / Nav / Footer ---- */
header {
  border-bottom: 1px solid var(--border);
  background: var(--background);
}

nav {
  max-width: 900px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

nav a {
  display: inline-block;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-pill);
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

nav a:hover,
nav a:focus-visible {
  background: var(--surface-soft);
}

nav a[aria-current="page"] {
  background: #e6eeff;
  font-weight: 700;
}

footer {
  border-top: 1px solid var(--border);
  margin-top: var(--space-4);
  padding: 1rem 1.25rem;
  color: #222;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Typography ---- */
h1,
h2,
h3,
h4 {
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

h1 {
  font-size: 2rem;
  margin-top: 0.5rem;
}

h2 {
  font-size: 1.5rem;
  margin-top: 0;
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 1rem;
}

ul,
ol {
  margin: 0 0 1rem 1.25rem;
  padding: 0;
}

.lead {
  font-size: 1.05rem;
  color: var(--muted);
}

.accent {
  background: #e6eeff;
  padding: 0.1rem 0.35rem;
  border-radius: 0.4rem;
}

/* ---- Links ---- */
a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

/* ---- Images / media ---- */
img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
}

iframe {
  max-width: 100%;
  border: 0;
  border-radius: var(--radius);
}

/* ---- Reusable content sections ---- */
.content-section,
.interactive-story {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
}

.hero {
  padding-top: var(--space-2);
}

/* ---- Buttons ---- */
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--primary);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

button:hover,
.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: #e6eeff;
}

/* ---- Forms ---- */
label {
  display: inline-block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  max-width: 650px;
  padding: 0.6rem 0.75rem;
  border: 2px solid #999;
  border-radius: 0.6rem;
  font: inherit;
  color: var(--text);
  background: #fff;
}

/* ---- Focus states ---- */
a:focus,
button:focus,
input:focus,
textarea:focus {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: var(--focus);
  outline-offset: 3px;
}

/* ---- Cards ---- */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.card__img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
}

.card__body {
  padding: var(--space-3);
}

.card__title {
  margin: 0 0 var(--space-1);
}

.card__text {
  margin: 0 0 var(--space-2);
  color: var(--muted);
}

.card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-2);
}

/* ---- Utility ---- */
.hidden {
  display: none;
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ---- Tablet / desktop ---- */
@media (min-width: 768px) {
  main {
    padding: var(--space-4);
  }

  nav ul {
    gap: 1rem;
  }

  h1 {
    font-size: 2.4rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
/* Showcase Page Layout */

.showcase-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 1rem;
}

.showcase-card {
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 1rem;
  background: #fff;
}

.showcase-card img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 0.75rem 0 1rem;
}

.showcase-card h3 {
  margin-top: 0;
}

@media (min-width: 768px) {
  .showcase-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
