/* IMBoka landing – "kladdebok": ruled grid paper, two workbooks on the desk */

:root {
  --paper: #fafbfc;
  --grid-line: #dde5ec;
  --ink: #1c2b3a;
  --ink-soft: #52657a;
  --marker: #ffd84d;
  --ikm-cover: #c8452e;
  --ikm-spine: #8f2f1e;
  --itk-cover: #24568f;
  --itk-spine: #173c66;
  --cover-text: #fdfaf5;

  --font-serif: "IBM Plex Serif", Georgia, serif;
  --font-sans: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html { height: 100%; }

body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: var(--paper);
  /* 5 mm ruled grid, like a Norwegian kladdebok */
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-font-smoothing: antialiased;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.1rem clamp(1.25rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--grid-line);
  background: color-mix(in srgb, var(--paper) 85%, transparent);
}

.topbar__site {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.topbar__tag {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ---------- hero ---------- */

main {
  flex: 1;
  width: min(64rem, 100%);
  margin-inline: auto;
  padding: clamp(2.5rem, 7vh, 5rem) clamp(1.25rem, 4vw, 2.5rem) 2rem;
}

.hero {
  max-width: 34rem;
  margin-bottom: clamp(2.5rem, 6vh, 4rem);
}

.hero__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(3rem, 9vw, 4.75rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1.1rem;
}

/* highlighter stroke behind the wordmark */
.mark {
  background: linear-gradient(104deg,
    transparent 0.5%,
    var(--marker) 3%,
    color-mix(in srgb, var(--marker) 82%, #f0a) 96%,
    transparent 99%);
  background-size: 100% 46%;
  background-position: 0 78%;
  background-repeat: no-repeat;
  padding-inline: 0.08em;
}

.hero__lead {
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  line-height: 1.6;
  color: var(--ink-soft);
}

.hero__lead strong { color: var(--ink); font-weight: 500; }

.hero__hint {
  margin-top: 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ---------- the two books ---------- */

.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: clamp(1.25rem, 3vw, 2rem);
  align-items: stretch;
}

.book {
  position: relative;
  display: flex;
  min-height: clamp(19rem, 42vh, 24rem);
  border-radius: 6px 12px 12px 6px;
  text-decoration: none;
  color: var(--cover-text);
  box-shadow:
    0 1px 2px rgba(28, 43, 58, 0.25),
    0 10px 24px -12px rgba(28, 43, 58, 0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}

.book--ikm { background: var(--ikm-cover); }
.book--itk { background: var(--itk-cover); }

.book__spine {
  flex: 0 0 1.1rem;
  border-right: 1px solid rgba(0, 0, 0, 0.18);
}

.book--ikm .book__spine { background: var(--ikm-spine); }
.book--itk .book__spine { background: var(--itk-spine); }

.book__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: clamp(1.4rem, 3vw, 2rem);
}

.book__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: auto;
}

.book__code {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
}

.book__level {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid rgba(253, 250, 245, 0.55);
  border-radius: 999px;
  white-space: nowrap;
}

.book__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.2vw, 1.9rem);
  line-height: 1.2;
  text-wrap: balance;
  margin-top: 2.5rem;
  margin-bottom: 0.7rem;
}

.book__desc {
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(253, 250, 245, 0.85);
  margin-bottom: 1.6rem;
}

.book__open {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-top: 1px solid rgba(253, 250, 245, 0.35);
  padding-top: 1rem;
}

.book__arrow { transition: transform 0.25s ease; }

/* hover: lift the book off the desk */
@media (hover: hover) {
  .book:hover {
    transform: translateY(-6px) rotate(-0.6deg);
    box-shadow:
      0 2px 4px rgba(28, 43, 58, 0.2),
      0 22px 40px -14px rgba(28, 43, 58, 0.5);
  }
  .book:hover .book__arrow { transform: translateX(5px); }
}

.book:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

/* ---------- footer ---------- */

.footer {
  padding: 1.4rem clamp(1.25rem, 4vw, 2.5rem);
  border-top: 1px solid var(--grid-line);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ---------- load-in ---------- */

.js .hero,
.js .book {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.6s ease forwards;
}

.js .book--ikm { animation-delay: 0.12s; }
.js .book--itk { animation-delay: 0.22s; }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .js .hero,
  .js .book {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .book,
  .book__arrow { transition: none; }
}
