/* jvcByte Templates — same theme as the portfolio (jvcbyte.dev).
   Colour and type tokens mirrored from jvcbyte.dev/css/index.css. */

:root {
  /* Layrus Labs palette and type — the same tokens layrus.com uses. */
  --bg: #D9D6C9;              /* warm beige */
  --surface: #E3DFD3;
  --raised: #EFEBDF;
  --footer-bg: #CFCBBD;

  --ink: #241A12;             /* dark cocoa */
  --ink-2: rgba(36, 26, 18, 0.74);
  --ink-3: rgba(36, 26, 18, 0.56);
  --ink-4: rgba(36, 26, 18, 0.38);

  --accent: #0F6B43;          /* forest green */
  --accent-hover: #0B5636;
  --on-accent: #EFEBDF;
  --terracotta: #B46E3A;

  --border: rgba(36, 26, 18, 0.16);
  --border-strong: rgba(36, 26, 18, 0.34);
  --rule: rgba(36, 26, 18, 0.16);

  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-nav: 'Inter', system-ui, sans-serif;

  --page-pad: clamp(20px, 5vw, 64px);
  --max: 1240px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--page-pad);
}

/* ── nav ─────────────────────────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(217, 214, 201, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-nav .wrap {
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 7px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
  padding-block: 2px;
}

.brand-word {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-family: var(--font-nav);
  font-size: 8px;
  font-weight: 600;
  /* the tagline is set in caps, so the trailing letter-space is trimmed to
     stop it running wider than the wordmark above it */
  letter-spacing: 0.22em;
  margin-right: -0.22em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--ink-4);
}

.nav-links {
  display: flex;
  gap: 30px;
  margin-left: auto;
}

.nav-links a {
  font-family: var(--font-nav);
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--ink-2);
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.nav-links a:hover { color: var(--ink); border-color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-nav);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 11px 22px;
  text-decoration: none;
  border-radius: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--ink);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--ink); }

.btn .arrow { transition: transform 0.15s; }
.btn:hover .arrow { transform: translateX(3px); }

/* ── hero ────────────────────────────────────────────────────────────────── */
.hero { padding: clamp(56px, 9vw, 104px) 0 clamp(40px, 6vw, 68px); }

.eyebrow {
  font-family: var(--font-nav);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 20px;
}

.hero h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2.3rem, 5.6vw, 3.9rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 16ch;
}

.hero .lede {
  margin-top: 24px;
  max-width: 54ch;
  font-size: 1.03rem;
  color: var(--ink-2);
}

.hero-actions { margin-top: 32px; display: flex; gap: 14px; flex-wrap: wrap; }

.stats {
  display: flex;
  gap: clamp(28px, 6vw, 72px);
  margin-top: clamp(44px, 7vw, 72px);
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}

.stat { display: flex; flex-direction: column; gap: 4px; }

.stat b {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  line-height: 1;
  color: var(--ink);
}

.stat small {
  font-family: var(--font-nav);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
}

/* ── sections ────────────────────────────────────────────────────────────── */
.section { padding: clamp(48px, 7vw, 88px) 0; }

/* the hero already carries its own rhythm — don't double the gap below it */
.hero + .section { padding-top: clamp(16px, 3vw, 36px); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.8rem, 3.6vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
}

.section-head p {
  max-width: 38ch;
  color: var(--ink-2);
  font-size: 0.95rem;
}

/* ── category cards (hub) ────────────────────────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.cat-card {
  display: flex;
  flex-direction: column;
  min-height: 230px;
  padding: 28px 26px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  border-radius: 0;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

a.cat-card:hover {
  border-color: var(--border-strong);
  background: var(--raised);
  transform: translateY(-3px);
}

.cat-num {
  font-family: var(--font-nav);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink-4);
  margin-bottom: 18px;
}

.cat-name {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 10px;
}

.cat-tagline {
  color: var(--ink-2);
  font-size: 0.92rem;
  line-height: 1.55;
  flex: 1;
}

.cat-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  font-family: var(--font-nav);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.cat-foot .bar { flex: 1; height: 2px; background: var(--border); }

a.cat-card .cat-foot .bar { background: var(--accent); }
a.cat-card:hover .cat-foot .bar { background: var(--accent); }

.cat-foot .arrow { color: var(--ink); font-size: 1rem; }

.cat-card.is-soon { opacity: 0.55; }
.cat-card.is-soon .soon { color: var(--ink-3); }

/* ── template cards (category pages) ─────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 26px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}

.card:hover { border-color: var(--border-strong); background: var(--raised); }

.card-media {
  position: relative;
  height: 230px;
  background: var(--raised);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.card-media iframe {
  width: 200%;
  height: 200%;
  transform: scale(0.5);
  transform-origin: top left;
  pointer-events: none;
  border: none;
}

.card-hit { position: absolute; inset: 0; z-index: 1; }

/* pick-this-template action, visible over the preview on hover */
.card-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.card:hover .card-overlay,
.card:focus-within .card-overlay { opacity: 1; pointer-events: auto; }

.card-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-nav);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 0;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  transform: translateY(6px);
  transition: transform 0.2s ease, background 0.15s;
}

.card:hover .card-pick { transform: translateY(0); }
.card-pick:hover { background: var(--accent-hover); }

/* Touch devices have no hover, so surface the pick action there — anchored to
   the bottom of the preview rather than as a separate button in the card body. */
@media (hover: none) {
  .card-overlay {
    opacity: 1;
    pointer-events: auto;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0) 55%);
    align-items: flex-end;
    padding: 14px;
  }
  .card-pick { transform: none; }
}

.card-body { padding: 22px 24px 20px; display: flex; flex-direction: column; flex: 1; }

.card-tag {
  font-family: var(--font-nav);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 8px;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--ink-2);
  line-height: 1.55;
  flex: 1;
}

.card-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
}

.card-link {
  font-family: var(--font-nav);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}

.card-link:hover { color: var(--accent); text-decoration: underline; }

.card-rule { flex: 1; height: 2px; background: var(--accent); opacity: 0.55; }

.card[data-accent="1"] .card-rule { opacity: 0.32; }
.card[data-accent="2"] .card-rule { opacity: 0.2; }

/* ── page header (category page) ─────────────────────────────────────────── */
.page-head { padding: clamp(40px, 6vw, 68px) 0 36px; }

.back {
  display: inline-block;
  margin-bottom: 18px;
  font-family: var(--font-nav);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-decoration: none;
}

.back:hover { color: var(--ink); }

.page-head h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.page-head .lede { margin-top: 16px; max-width: 56ch; color: var(--ink-2); }

.count {
  margin-top: 18px;
  font-family: var(--font-nav);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.empty { color: var(--ink-3); padding: 40px 0 80px; }

/* ── footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  margin-top: auto;
  background: var(--footer-bg);
  border-top: 1px solid var(--border);
  padding: 44px 0 32px;
}

.site-footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand { display: flex; flex-direction: column; gap: 7px; }

.footer-word {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.1;
}

.footer-tag {
  font-family: var(--font-nav);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.22em;
  margin-right: -0.22em;
  text-transform: uppercase;
  color: var(--ink-4);
  line-height: 1;
}

.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }

.footer-links a {
  font-family: var(--font-nav);
  color: var(--ink-2);
  font-size: 0.88rem;
  text-decoration: none;
}

.footer-links a:hover { color: var(--ink); }

.legal {
  width: 100%;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--ink-4);
}

/* ── responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .site-nav .wrap { flex-wrap: wrap; gap: 14px; padding-block: 14px; }
  .nav-links { order: 3; width: 100%; margin-left: 0; gap: 22px; }
  .site-nav .btn-primary { margin-left: auto; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .grid, .cat-grid { grid-template-columns: 1fr; }
  .stats { gap: 32px; flex-wrap: wrap; }
}


/* ── Layrus brand lockup ─────────────────────────────────────────────────── */
/* The wordmark is the traced logotype from layrus.com, not a typeface that
   resembles it, so the two sites carry the same mark and the same letters. */
@font-face {
  font-family: 'Layrus Display';
  src: url('../fonts/layrus-display-bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

.brand { display: flex; flex-direction: row; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-text { display: flex; flex-direction: column; gap: 4px; }
.brand-word {
  font-family: 'Layrus Display', var(--font-heading);
  font-weight: 700;
  font-size: 1.06rem;
  line-height: 1;
  color: var(--accent);
}
.brand-sub {
  font-family: var(--font-nav);
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  margin-right: 0;
  text-transform: uppercase;
  line-height: 1;
  color: var(--ink-3);
}

.footer-brand { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.footer-mark { width: 26px; height: 26px; flex: none; }
.footer-text { display: flex; flex-direction: column; gap: 3px; }
.footer-word {
  font-family: 'Layrus Display', var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--accent);
}
.footer-tag {
  font-family: var(--font-nav);
  font-size: 0.54rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--ink-3);
}
