/* ============================================
   Fonts
   ============================================ */
@font-face {
  font-family: 'Newsreader 16pt';
  src: local("Newsreader 16pt SemiBold"), local("Newsreader16pt-SemiBold"), url('static/fonts/Newsreader16pt-SemiBold.woff2') format('woff2');
  font-display: swap;
  font-weight: 100 900;
}

h1, h2,
.hero-title,
.section-title {
  font-family: 'Newsreader 16pt', 'Georgia', 'Roboto', serif;
  font-weight: 600;
  line-height: 1.35;
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: local("IBM Plex Mono"), local("IBMPlexMono-Regular"), url('static/fonts/IBMPlexMono-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  src: local("IBM Plex Mono Italic"), local("IBMPlexMono-Italic"), url('static/fonts/IBMPlexMono-Italic.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: local("IBM Plex Mono Bold"), local("IBMPlexMono-Bold"), url('static/fonts/IBMPlexMono-Bold.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: local("IBM Plex Sans"), local("IBMPlexSans-Regular"), url('static/fonts/IBMPlexSans-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  src: local("IBM Plex Sans Italic"), local("IBMPlexSans-Italic"), url('static/fonts/IBMPlexSans-Italic.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-weight: 450;
  font-style: normal;
  font-display: swap;
  src: local("IBM Plex Sans Text"), local("IBMPlexSans-Text"), url('static/fonts/IBMPlexSans-Text.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: local("IBM Plex Sans Medm"), local("IBMPlexSans-Medm"), url('static/fonts/IBMPlexSans-Medium.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
	src: local("IBM Plex Sans SmBld"), local("IBMPlexSans-SmBld"), url("static/fonts/IBMPlexSans-SemiBold.woff2") format("woff2");
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: local("IBM Plex Sans Bold"), local("IBMPlexSans-Bold"), url('static/fonts/IBMPlexSans-Bold.woff2') format('woff2');
}

/* ============================================
   Reset / Box Model
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ============================================
   CSS Variables
   ============================================ */
:root {
  /* Backgrounds */
  --bg-body:              #f8fafc; /* slate-50  */
  --bg-section-odd:       #ffffff;
  --bg-section-even:      #f1f5f9; /* slate-100 */
  --bg-footer:            #0f172a; /* slate-900 */
  --bg-code:              #e2e8f0; /* slate-200 */

  /* Text */
  --text-body:   #000000;
  --text-muted:  #1a1a1a;
  --text-subtle: #64748b; /* slate-500 */
  --text-faint:  #64748b; /* slate-500 */
  --text-footer: #94a3b8; /* slate-400 */
  --text-on-dark: #ffffff;

  /* Borders */
  --border-spread: #e2e8f0; /* slate-200 */

  /* Accent (orange) */
  --accent:       #FF4F35;
  --accent-hover: #FF896C;

  /* Link */
  --link:         #2563eb; /* blue-600 */
  --link-visited: #7c3aed; /* violet-600 */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-body:              #020617; /* slate-950 */
    --bg-section-odd:       #0f172a; /* slate-900 */
    --bg-section-even:      #1e293b; /* slate-800 */
    --bg-footer:            #020617; /* slate-950 */
    --bg-code:              #1e293b; /* slate-800 */

    --text-body:   #f1f5f9; /* slate-100 */
    --text-muted:  #cbd5e1; /* slate-300 */
    --text-subtle: #94a3b8; /* slate-400 */
    --text-faint:  #64748b; /* slate-500 */
    --text-footer: #64748b; /* slate-500 */

    --border-spread: #334155; /* slate-700 */

    --link:         #60a5fa; /* blue-400 */
    --link-visited: #c084fc; /* purple-400 */
  }
}

/* ============================================
   Body
   ============================================ */
body {
  font-family: 'IBM Plex Sans', 'Segoe UI', 'Roboto', system-ui, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-body);
}

/* ============================================
   Shared container
   ============================================ */
.container {
  max-width: 64rem;      /* max-w-5xl */
  margin-inline: auto;
  padding-inline: 1.5rem; /* px-6 */
}

/* ============================================
   Sections — alternating backgrounds
   ============================================ */
main > section {
  padding-block: 4rem; /* py-24 */
}

main > section:nth-child(odd) {
  background-color: var(--bg-section-odd);
}

main > section:nth-child(even) {
  background-color: var(--bg-section-even);
}

/* Hero: padding lives on the inner container, not the section */
main > section:first-child {
  padding-block: 0;
}

/* Bottom CTA: smaller vertical padding */
main > section:last-child {
  padding-block: 2.5rem; /* py-10 */
}

/* ============================================
   Hero layout
   ============================================ */
.hero-layout {
  padding-block: 1.5rem 6rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4rem;                     /* gap-16 */
}

@media (min-width: 768px) {      /* md */
  .hero-layout {
    flex-direction: row;
  }
}

/* https://metatags.io/?url=https%3A%2F%2Fwasmgroundup.com%2F */

/* from https://scastiel.dev/3dbook/ */
/* book-rotate */

.book-container {
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 600px;
  order: 1;            /* renders after hero-copy on mobile */
  align-self: center;  /* centered horizontally when stacked */
}

@media (min-width: 768px) {
  .book-container {
    order: -1;          /* back to left side on desktop */
    align-self: auto;
  }
}

@keyframes initAnimation {
  0% {
    transform: rotateY(-30deg);
  }
  100% {
    transform: rotateY(0deg);
  }
}

.book {
  width: 200px;
  height: 284px;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateY(0deg);
  transition: 1s ease;
  animation: 1s ease 0s 1 initAnimation;
}

.book-container:hover .book,
.book-container:focus-visible .book {
  transform: rotateY(-30deg);
}

.book > :first-child {
  position: absolute;
  top: 0;
  left: 0;
  background-color: red;
  width: 200px;
  height: 284px;
  transform: translateZ(6px);
  background-color: #ffffff;
  border-radius: 0;
  box-shadow: 5px 5px 20px #666;
}

.book::before {
  position: absolute;
  content: ' ';
  background-color: blue;
  left: 0;
  top: 0;
  width: 12px;
  height: 284px;
  transform: translateX(194px) rotateY(90deg);
  background: #ffffff;
}

.book::after {
  position: absolute;
  top: 0;
  left: 0;
  content: ' ';
  width: 200px;
  height: 284px;
  transform: translateZ(-6px);
  background-color: #ffffff;
  border-radius: 0;
  box-shadow: -10px 0 50px 10px #666;
}
/* /book-rotate */

.hero-copy {
  flex: 1;
}

.hero-title {
  font-size: clamp(1.5rem, 7vw, 2.25rem); /* scales down to stay on one line */
  font-weight: 600;
  line-height: 1.35;   /* slightly looser than leading-tight for wrapping */
  margin-bottom: 1.5rem; /* mb-6 */
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 3rem;   /* text-5xl */
  }
}

.hero-desc {
  color: var(--text-muted);
  font-size: 1.125rem;     /* text-lg */
  line-height: 1.625;      /* leading-relaxed */
  margin-bottom: 2rem;     /* mb-8 */
}

.hero-desc p + p {
  margin-top: 0.75rem;
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem; /* gap-4 */
}

.btn-narrow { display: none; }

@media (max-width: 480px) {
  .btn-wide   { display: none; }
  .btn-narrow { display: inline; }

  .cta-btn { padding-inline: 1rem; }
}

.cta-btn {
  display: inline-block;
  background-color: var(--accent);
  color: var(--text-on-dark);
  font-weight: 700;
  padding: 0.75rem 2rem;      /* py-3 px-8 */
  border-radius: 0.75rem;     /* rounded-xl */
  font-size: 1.125rem;        /* text-lg */
  text-decoration: none;
  transition: background-color 0.15s ease;
  box-shadow: 0 10px 15px -3px rgb(67 20 7 / 0.4),
              0 4px 6px -4px  rgb(67 20 7 / 0.4); /* shadow-orange-900/40 */
}

.cta-btn:visited {
  color: var(--text-on-dark);
}

.cta-btn:hover {
  background-color: var(--accent-hover);
}

.hero-note {
  color: var(--text-subtle);
  font-size: 0.875rem;   /* text-sm */
  margin-top: 1.5rem;    /* mt-6 */
}

/* ============================================
   Cover image
   ============================================ */
.cover-img {
  display: block;
  max-width: 100%;
  transition: filter 0.15s ease;
}

@media (prefers-color-scheme: dark) {
  .cover-img { filter: brightness(0.75); }
}

.cover-grid {
  margin-top: 1.5rem;                      /* mt-6 */
  display: grid;
  grid-template-columns: repeat(3, 1fr);   /* grid-cols-3 */
  gap: 0.25rem;                            /* gap-1 */
  opacity: 0.3;
}

/* ============================================
   3-D book cover (preserved from original)
   ============================================ */
.book {
  position: relative;
  width: 200px;
  height: 284px;
}

.book-front {
  position: absolute;
  inset: 0;
  border-radius: 2px 6px 6px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  backface-visibility: hidden;
}

/* ============================================
   Lists
   ============================================ */
ul, ol {
  padding-left: 2.5rem;
}

ul { list-style-type: disc; }
ol { list-style-type: decimal; }

li + li {
  margin-top: 0.375rem;
}

/* ============================================
   Links
   ============================================ */
a {
  color: var(--link);
}

a:visited {
  color: var(--link-visited);
}

/* ============================================
   Code / pre blocks
   ============================================ */
code {
  font-family: 'IBM Plex Mono', 'Consolas', 'Roboto Mono', monospace;
  font-size: 1em;
  font-weight: 400;
}

h1 code,
h2 code {
  font-size: 0.85em;
}


pre {
  background-color: var(--bg-code);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  white-space: pre-line;
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 0.875rem;
}

/* ============================================
   Section headings
   ============================================ */
.section-title {
  /* font-family: Georgia, serif; */
  font-size: 1.875rem;  /* text-3xl */
  /* font-weight: 700; */
  margin-bottom: 2.5rem; /* mb-10 */
}

.section-title--lg-mb {
  margin-bottom: 3rem;   /* mb-12 */
}

/* ============================================
   Body text blocks
   ============================================ */
.body-text {
  color: var(--text-muted);
  font-size: 1.125rem;   /* text-lg */
  line-height: 1.625;    /* leading-relaxed */
}

.body-text > * + * {
  margin-top: 1.25rem;   /* space-y-5 */
}

/* ============================================
   Page-spread (About section)
   ============================================ */
.ebook-btn {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 2rem; /* mb-8 */
  text-decoration: none;
}

.ebook-img {
  width: 100%;
  height: auto;
  max-width: 480px;
  border-radius: 1rem;                       /* rounded-2xl */
  border: 1px solid var(--border-spread);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1),
              0 2px 4px -2px rgb(0 0 0 / 0.1); /* shadow-md */
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.ebook-btn:hover .ebook-img {
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1),
              0 8px 10px -6px rgb(0 0 0 / 0.1); /* shadow-xl */
  transform: scale(1.01);
}

@media (prefers-color-scheme: dark) {
  .ebook-img { filter: brightness(0.75); }
}

.spread-caption {
  font-size: 0.875rem;   /* text-sm */
  color: var(--text-subtle);
  margin-top: 0.5rem;    /* mt-2 */
  text-align: center;
}

/* ============================================
   Flex-row inner containers (resources, author)
   ============================================ */
.flex-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem; /* gap-10 */
}

@media (min-width: 640px) { /* sm */
  .flex-row {
    flex-direction: row;
  }
}

/* ============================================
   Inline links (resources section)
   ============================================ */
.resources-link {
  color: var(--link);
  text-decoration: underline;
  transition: color 0.15s ease;
}

/* ============================================
   Author section
   ============================================ */
.author-title {
  /* font-family: Georgia, serif; */
  font-size: 1.5rem; /* text-2xl */
  font-weight: 700;
  margin-bottom: 1rem; /* mb-4 */
}

.author-text {
  color: var(--text-muted);
  line-height: 1.625; /* leading-relaxed */
}

/* ============================================
   Bottom CTA row
   ============================================ */
.cta-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem; /* gap-4 */
}

@media (min-width: 640px) {
  .cta-row { flex-direction: row; }
}

.cta-note {
  color: var(--text-muted);
  font-weight: 500; /* font-medium */
}

.cta-group-sm {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem; /* gap-3 */
}

.cta-btn-sm {
  display: inline-block;
  background-color: var(--accent);
  color: var(--text-on-dark);
  font-weight: 600;            /* font-semibold */
  padding: 0.5rem 1.25rem;    /* py-2 px-5 */
  border-radius: 0.5rem;      /* rounded-lg */
  font-size: 0.875rem;        /* text-sm */
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.cta-btn-sm:visited {
  color: var(--text-on-dark);
}

.cta-btn-sm:hover {
  background-color: var(--accent-hover);
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  background-color: var(--bg-footer);
  color: var(--text-footer);
  padding-block: 2.5rem;     /* py-10 */
}

.footer-inner {
  max-width: 64rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;        /* gap-4 */
  font-size: 0.875rem; /* text-sm */
}

@media (min-width: 640px) {
  .footer-inner { flex-direction: row; }
}

.footer-nav {
  display: flex;
  gap: 1.5rem; /* gap-6 */
}

.footer-nav a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-nav a:hover {
  color: var(--text-on-dark);
}
