/* ==========================================================================
   Scriptify — home page
   ========================================================================== */

.home main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.btn.big {
  padding: 15px 26px;
  font-size: 1.05rem;
  border-radius: 14px;
}
.btn.primary.big {
  box-shadow: 0 14px 28px -10px color-mix(in srgb, var(--accent) 80%, transparent);
}
.btn.ghost.big {
  color: var(--ink);
  border-color: var(--line-strong);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow span {
  width: 34px;
  height: 1px;
  background: var(--gold);
}
.eyebrow.center::after {
  content: '';
  width: 34px;
  height: 1px;
  background: var(--gold);
}

/* ---------- hero ---------- */
.h-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 56px;
  align-items: center;
  padding: 64px 0 40px;
}
.h-copy h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.5rem, 5.4vw, 4.2rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
}
.h-copy h1 em {
  font-style: italic;
  color: var(--accent-text);
  font-weight: 500;
}
.lede {
  margin-top: 22px;
  max-width: 52ch;
  font-size: 1.12rem;
  line-height: 1.65;
  color: var(--muted);
}
.h-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.h-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  color: var(--muted);
}
.h-points li::before {
  content: '✦';
  margin-right: 8px;
  color: var(--gold);
  font-size: 0.75em;
}

/* paper mock-up */
.h-stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: 24px 12px 40px;
  container-type: inline-size;
  overflow: clip;
}
.h-stage::before {
  content: '';
  position: absolute;
  inset: 4% 2% 2%;
  border-radius: 40px;
  background: radial-gradient(60% 60% at 50% 45%, var(--gold-soft), transparent 70%);
  filter: blur(8px);
}
.sheet-back,
.sheet-front {
  --pen: #1a2a7a;
  --w: min(380px, 76cqw); /* paper width; everything on the sheet is a fraction of it */
  border-radius: 6px;
}
.sheet-back {
  position: absolute;
  width: var(--w);
  aspect-ratio: 0.72;
  background: #f4efe2;
  transform: rotate(7deg) translate(calc(var(--w) * 0.06), 6px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 24px 40px -14px rgba(0, 0, 0, 0.35);
}
.sheet-front {
  position: relative;
  width: var(--w);
  aspect-ratio: 0.72;
  background-color: #fffdf6;
  transform: rotate(-3.5deg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 30px 50px -14px rgba(0, 0, 0, 0.4);
  animation: floaty 7s ease-in-out infinite;
  overflow: hidden;
}
.sheet-front::before {
  /* ruled lines start at the red top line – no line above it */
  content: '';
  position: absolute;
  inset: calc(var(--w) * 0.1474) 0 0 0;
  background-image: linear-gradient(to bottom, rgba(80, 100, 160, 0.34) 1.5px, transparent 1.5px);
  background-size: 100% calc(var(--w) * 0.0895);
}
.sheet-front::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0) 60%);
  pointer-events: none;
}
.s-margin {
  position: absolute;
  left: 13%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(222, 92, 118, 0.7);
}
.s-top {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--w) * 0.1421);
  height: 2px;
  background: rgba(222, 92, 118, 0.7);
}
.s-text {
  position: absolute;
  left: 17%;
  right: 6%;
  top: calc(var(--w) * 0.0526);
  color: var(--pen);
  font-family: 'Homemade Apple', 'Caveat', cursive;
  font-size: calc(var(--w) * 0.0395);
  line-height: calc(var(--w) * 0.0895);
}
.s-text p {
  margin: 0;
}
.s-head {
  display: flex;
  justify-content: space-between;
  font-family: 'Caveat', cursive;
  font-size: calc(var(--w) * 0.0526);
}
.s-text p:nth-child(2) {
  margin-top: calc(var(--w) * 0.0947);
}
.s-math {
  height: calc(var(--w) * 0.1789);
  display: flex;
  align-items: center;
}
.s-math .mbi {
  font-family: 'Caveat', cursive;
  font-size: calc(var(--w) * 0.0579);
}
.s-math .mi-static {
  font-family: 'Caveat', cursive;
  font-size: calc(var(--w) * 0.0526);
}
.s-math .mi,
.s-math .mbi {
  color: var(--pen);
}
.s-pen {
  position: absolute;
  right: 8%;
  bottom: 9%;
  width: calc(var(--w) * 0.142);
  color: #26304f;
  transform: rotate(38deg);
  filter: drop-shadow(0 8px 6px rgba(0, 0, 0, 0.3));
  animation: writing 3.6s ease-in-out infinite;
}
@keyframes floaty {
  0%,
  100% {
    transform: rotate(-3.5deg) translateY(0);
  }
  50% {
    transform: rotate(-3deg) translateY(-8px);
  }
}
@keyframes writing {
  0%,
  100% {
    transform: rotate(38deg) translate(0, 0);
  }
  50% {
    transform: rotate(34deg) translate(-14px, -6px);
  }
}

/* ornament */
.orn {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 420px;
  margin: 24px auto 8px;
  color: var(--gold);
}
.orn span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.orn span:last-child {
  background: linear-gradient(270deg, transparent, var(--gold));
}
.orn i {
  font-style: normal;
  font-size: 0.9rem;
}

/* ---------- sections ---------- */
.h-section {
  padding: 56px 0 24px;
}
.h-head {
  text-align: center;
  margin-bottom: 36px;
}
.h-head .eyebrow {
  margin-bottom: 14px;
}
.h-head h2,
.h-final h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.h-head .sub {
  margin-top: 8px;
  color: var(--muted);
}

.h-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.h-card {
  position: relative;
  padding: 26px 24px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
}
.h-card::before {
  content: '';
  position: absolute;
  left: 24px;
  right: 24px;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  opacity: 0.8;
}
.h-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}
.h-card .ico {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.h-card .ico .i {
  width: 22px;
  height: 22px;
}
.h-card .ico.math {
  font-family: var(--font-display);
  font-size: 1.5rem;
}
.h-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.18rem;
}
.h-card p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* font strip */
.font-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.font-strip span {
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1.3;
  box-shadow: var(--shadow-sm);
}

/* steps */
.h-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: s;
}
.h-steps li {
  padding: 8px 8px 8px 0;
  text-align: center;
}
.h-steps b {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.25rem;
}
.h-steps h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.15rem;
}
.h-steps p {
  max-width: 30ch;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.94rem;
}
.h-steps code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.82rem;
}

/* final call to action */
.h-final {
  margin: 56px 0 40px;
  padding: 56px 24px;
  text-align: center;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: radial-gradient(70% 120% at 50% 0%, var(--gold-soft), var(--surface) 70%);
  box-shadow: var(--shadow);
}
.h-final p {
  margin: 10px 0 26px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .h-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding-top: 36px;
  }
  .h-grid,
  .h-steps {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 999px) {
  .home main {
    padding: 0 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sheet-front,
  .s-pen {
    animation: none;
  }
}

/* ---------- FAQ ---------- */
.h-faq {
  max-width: 820px;
  margin: 0 auto;
  display: grid;
  gap: 10px;
}
.h-faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s;
}
.h-faq details[open] {
  border-color: var(--line-strong);
}
.h-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.h-faq summary::-webkit-details-marker {
  display: none;
}
.h-faq summary::after {
  content: '';
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.h-faq details[open] summary::after {
  transform: rotate(-135deg);
}
.h-faq details p {
  padding: 0 20px 18px;
  color: var(--muted);
  line-height: 1.65;
}
.h-faq code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.82rem;
}

/* ---------- About ---------- */
.h-about {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}
.h-about p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
}
.h-about p + p {
  margin-top: 12px;
}
.h-about a {
  color: var(--accent-text);
  font-weight: 500;
}
#features,
#faq,
#about {
  scroll-margin-top: 16px;
}
html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media (max-width: 520px) {
  .h-hero {
    padding-top: 24px;
  }
  .h-cta .btn {
    flex: 1 1 100%;
  }
  .font-strip span {
    padding: 9px 16px;
    font-size: 1.1rem !important;
  }
  .h-final {
    padding: 40px 18px;
    border-radius: 22px;
  }
  .h-section {
    padding-top: 40px;
  }
  .h-faq summary {
    padding: 14px 16px;
  }
  .h-faq details p {
    padding: 0 16px 16px;
  }
}
