@font-face {
  font-family: "Inter";
  src:
    url("/fonts/inter-var-latin.woff2") format("woff2 supports variations"),
    url("/fonts/inter-var-latin.woff2") format("woff2-variations");
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 100% 100%;
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "GeistMono";
  src: url("/fonts/GeistMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --m-bg: #faf9f7;
  --m-surface: #f2f0ec;
  --m-hover: rgba(20, 20, 19, 0.038);
  --m-fg: #141413;
  --m-fg-2: #57554f;
  --m-fg-3: #8a8780;
  --m-fg-4: #a6a39b;
  --m-border: rgba(20, 20, 19, 0.08);
  --m-border-subtle: rgba(20, 20, 19, 0.048);
  --m-grain-opacity: 0.024;
}

html[data-theme="dark"] {
  --m-bg: #111110;
  --m-surface: #191917;
  --m-hover: rgba(240, 238, 232, 0.052);
  --m-fg: #f0eee8;
  --m-fg-2: #a6a39b;
  --m-fg-3: #75726b;
  --m-fg-4: #5c5a54;
  --m-border: rgba(240, 238, 232, 0.09);
  --m-border-subtle: rgba(240, 238, 232, 0.055);
  --m-grain-opacity: 0.032;
}

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

html {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "PingFang SC",
    "Hiragino Sans GB",
    "Noto Sans SC",
    "Microsoft YaHei",
    sans-serif;
  scrollbar-gutter: stable;
  background-color: var(--m-bg);
  color: var(--m-fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--m-bg);
  color: var(--m-fg);
  transition:
    background-color 280ms cubic-bezier(0.22, 1, 0.36, 1),
    color 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

::selection {
  background: var(--m-fg);
  color: var(--m-bg);
}

:focus-visible {
  outline: 1px solid var(--m-fg-3);
  outline-offset: 3px;
  border-radius: 3px;
}

a {
  color: inherit;
  text-decoration: none;
}

.mono {
  font-family: "GeistMono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

/* Tactile fine paper / matte stone grain overlay */
.backdrop-grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: var(--m-grain-opacity);
}

.backdrop-glow {
  position: fixed;
  inset: 0 0 auto 0;
  height: 14rem;
  z-index: 0;
  pointer-events: none;
  opacity: 0.3;
  background: radial-gradient(60% 100% at 50% 0%, rgba(160, 155, 145, 0.12) 0%, transparent 100%);
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translate3d(0, 6px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.enter {
  animation: enter 0.42s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.delay-1 {
  animation-delay: 40ms;
}

.delay-2 {
  animation-delay: 80ms;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 600px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 56px 24px 72px;
  display: flex;
  flex-direction: column;
}

@media (min-width: 640px) {
  .page {
    padding-top: 80px;
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 56px;
  font-size: 13px;
  line-height: 1;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--m-fg-3);
  transition: color 180ms ease;
}

.brand-link:hover {
  color: var(--m-fg);
}

.brand-link svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  transition: transform 160ms ease;
}

.brand-link.back:hover svg {
  transform: translateX(-2px);
}

.brand-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--m-fg);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.quiet-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--m-fg-3);
  transition: color 180ms ease;
}

.quiet-link:hover {
  color: var(--m-fg);
}

.quiet-link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -4px;
  left: 0;
  height: 1px;
  background-color: currentColor;
  opacity: 0;
  transform: scaleX(0.35);
  transform-origin: center;
  transition:
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 200ms ease;
}

.quiet-link:hover::after {
  opacity: 0.38;
  transform: scaleX(1);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--m-fg-3);
  cursor: pointer;
  transition:
    color 180ms ease,
    transform 180ms ease;
}

.theme-toggle:hover {
  color: var(--m-fg);
  transform: scale(1.06);
}

.theme-toggle:active {
  transform: scale(0.92);
}

.theme-toggle svg {
  width: 13px;
  height: 13px;
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] .theme-toggle svg {
  transform: rotate(180deg);
}

main {
  flex: 1;
}

.hero {
  margin-bottom: 40px;
}

.hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
}

.hero h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--m-fg);
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--m-fg-4);
}

.hero-desc {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.85;
  color: var(--m-fg-2);
}

/* Template showcase grid (identical 683x768 artwork proportion) */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.product-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 683 / 768;
  overflow: hidden;
  border-radius: 14px;
  background-color: #f4f3f0;
  transition: box-shadow 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover {
  box-shadow: 0 12px 32px -16px rgba(0, 0, 0, 0.1);
}

.product-card:active {
  opacity: 0.96;
}

.product-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.product-card:hover img {
  transform: scale(1.018);
}

.product-card-overlay {
  position: absolute;
  inset: 0 0 auto 0;
  padding: 20px;
}

@media (min-width: 640px) {
  .product-card-overlay {
    padding: 22px;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.badge-paid {
  background: #141413;
  color: #faf9f7;
}

.badge-free {
  background: rgba(255, 255, 255, 0.84);
  color: #45433e;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(4px);
}

.product-title {
  margin: 12px 0 0;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: #141413;
}

.product-cta {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: #6b6862;
  transition: color 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .product-cta {
  color: #141413;
}

.product-cta svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .product-cta svg {
  transform: translate(2px, -2px);
}

.card-ring {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  transition: box-shadow 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .card-ring {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.11);
}

/* Product details / pricing facts strip */
.facts-section {
  margin-top: 44px;
  border-top: 1px solid var(--m-border);
  padding-top: 28px;
}

.facts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .facts-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
  }
}

.fact-title {
  margin: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--m-fg);
}

.fact-body {
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--m-fg-3);
}

/* Legal pages */
.meta-strip {
  margin: 28px 0 0;
  padding: 16px 0;
  border-top: 1px solid var(--m-border);
  border-bottom: 1px solid var(--m-border);
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px 24px;
  font-size: 12.5px;
}

@media (min-width: 640px) {
  .meta-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.meta-strip dt {
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--m-fg-4);
}

.meta-strip dd {
  margin: 4px 0 0;
  color: var(--m-fg);
}

.inline-link {
  color: var(--m-fg);
  text-decoration: underline;
  text-decoration-color: var(--m-fg-4);
  text-underline-offset: 4px;
  transition: text-decoration-color 160ms ease;
}

.inline-link:hover {
  text-decoration-color: var(--m-fg);
}

.legal-sections {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.legal-section h2 {
  margin: 0 0 10px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--m-fg);
}

.legal-index {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--m-fg-4);
}

.legal-section p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.85;
  color: var(--m-fg-2);
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-section ul {
  margin: 8px 0 12px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legal-section li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.85;
  color: var(--m-fg-2);
}

.legal-section li::before {
  content: "";
  width: 4px;
  height: 4px;
  margin-top: 11px;
  border-radius: 9999px;
  background-color: var(--m-fg-4);
  flex-shrink: 0;
}

/* Single-row minimal footer */
.site-footer {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--m-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  font-size: 12px;
  line-height: 1;
  color: var(--m-fg-3);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.footer-copy {
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--m-fg-4);
}
