/* ==========================================================================
   Styles — Agape Labs Demos (Notebook)
   ========================================================================== */

/* --- Lined paper background --- */
body {
  font-family: var(--font-serif);
  color: var(--ink);
  background-color: var(--paper);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent calc(var(--line-height) - 1px),
    var(--rule-color) calc(var(--line-height) - 1px),
    var(--rule-color) var(--line-height)
  );
  background-size: 100% var(--line-height);
  font-size: var(--text-base);
  line-height: var(--line-height);
}

/* --- Layout --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* --- Navigation --- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent calc(var(--line-height) - 1px),
    var(--rule-color) calc(var(--line-height) - 1px),
    var(--rule-color) var(--line-height)
  );
  background-size: 100% var(--line-height);
  border-bottom: 1px solid var(--rule-color);
  padding: 0.5rem 0;
  transition: box-shadow 0.2s ease;
}

.site-nav.scrolled {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .site-nav.scrolled {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.nav__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav__logo-link {
  display: flex;
  align-items: center;
}

.nav__logo-link img {
  height: 120px;
  width: auto;
  mix-blend-mode: multiply;
}

[data-theme="dark"] .nav__logo-link img {
  mix-blend-mode: normal;
  filter: invert(1) hue-rotate(180deg) brightness(1.1);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle {
  padding: 0.4rem;
  color: var(--ink-light);
  opacity: 0.6;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
}

.theme-toggle:hover {
  opacity: 1;
}

/* --- Hero --- */
.hero {
  background-color: var(--paper-cover);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent calc(var(--line-height) - 1px),
    var(--rule-color) calc(var(--line-height) - 1px),
    var(--rule-color) var(--line-height)
  );
  background-size: 100% var(--line-height);
  padding: 6rem 0 5rem;
}

.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 2rem + 3vw, 4rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}

.hero__subtitle {
  font-family: var(--font-serif);
  color: var(--ink-light);
  max-width: 600px;
  line-height: 1.7;
  margin-top: 1rem;
}

/* --- Section --- */
.section {
  padding: 5rem 0;
}

.section__header {
  margin-bottom: 3rem;
}

.section__label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.75rem;
  position: relative;
}

.section__label::before {
  content: '';
  position: absolute;
  inset: -0.2rem -0.6rem;
  background: rgba(255, 218, 50, 0.28);
  border: 1px solid rgba(200, 168, 0, 0.18);
  transform: rotate(-0.6deg);
  z-index: -1;
  pointer-events: none;
}

.section__title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 1.5rem + 1.5vw, 2.8rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.section__subtitle {
  font-family: var(--font-serif);
  color: var(--ink-light);
  max-width: 600px;
  line-height: 1.7;
}

/* --- Highlight --- */
.highlight {
  background: linear-gradient(
    104deg,
    rgba(255, 215, 40, 0) 0.9%,
    rgba(255, 215, 40, 0.75) 2.4%,
    rgba(255, 215, 40, 0.6) 5.8%,
    rgba(255, 215, 40, 0.75) 93%,
    rgba(255, 215, 40, 0.4) 96%,
    rgba(255, 215, 40, 0) 98%
  );
  padding: 0.1em 0.35em;
  margin: -0.1em -0.15em;
  border-radius: 0.8em 0.3em;
}

/* --- Grid --- */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

/* --- Demo Cards --- */
.card {
  background: var(--paper-cover);
  border: 1px solid var(--rule-color);
  padding: 1.5rem;
  position: relative;
  border-top: 3px solid var(--accent);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* Dog-ear corner */
.card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 1.5rem 1.5rem 0 0;
  border-color: var(--paper) transparent transparent transparent;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1.5rem;
  height: 1.5rem;
  background: linear-gradient(
    315deg,
    var(--rule-color) 0%,
    var(--rule-color) 50%,
    transparent 50%
  );
}

.card__icon {
  width: 32px;
  height: 32px;
  color: var(--accent);
  margin-bottom: 1rem;
}

.card__icon svg {
  width: 100%;
  height: 100%;
}

.card__title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  color: var(--ink);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.card__text {
  font-family: var(--font-serif);
  color: var(--ink-light);
  line-height: 1.7;
  font-size: var(--text-base);
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.card__tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  border: 1px dashed var(--accent);
  padding: 0.15rem 0.5rem;
  opacity: 0.8;
}

.card__link {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--font-serif);
  color: var(--accent);
  text-decoration: none;
  font-size: var(--text-sm);
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.card__link:hover {
  border-bottom-color: var(--accent);
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--rule-color);
  background-color: var(--paper-cover);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent calc(var(--line-height) - 1px),
    var(--rule-color) calc(var(--line-height) - 1px),
    var(--rule-color) var(--line-height)
  );
  background-size: 100% var(--line-height);
  padding: 3rem 0 2rem;
}

.footer__bottom {
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink-light);
}

.footer__bottom a {
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.footer__bottom a:hover {
  border-bottom-color: var(--accent);
}

/* --- Reveal animation --- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .grid--3 {
    grid-template-columns: 1fr;
  }

  .grid--2 {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 4rem 0 3rem;
  }

  .section {
    padding: 3rem 0;
  }
}
