/* Young Knights — site styles, rooted in KnightOS tokens */

:root {
  /* Young Knights overrides — bolder, athletic */
  --yk-ink: 224 71% 4%;          /* near-black */
  --yk-ink-2: 220 40% 10%;
  --yk-off: 220 14% 96%;
  --yk-line: 220 13% 88%;
  --yk-blue: 217 91% 60%;
  --yk-blue-deep: 224 76% 48%;
  --yk-gold: 45 93% 47%;         /* kept for 5-star ratings only */
  --yk-red: 0 84% 50%;           /* Knight Fitness primary red */
  --yk-red-deep: 0 74% 42%;
  --yk-flame: 18 95% 55%;
  --yk-green: 160 84% 39%;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: hsl(var(--yk-off));
  color: hsl(var(--yk-ink));
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.display { font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; letter-spacing: -0.025em; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* Grain / noise overlay (very subtle) */
.grain::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800; font-size: 15px; letter-spacing: 0.02em;
  padding: 16px 24px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, background .15s, border-color .15s, box-shadow .2s;
  text-decoration: none;
}
.btn-primary {
  background: hsl(var(--yk-red));
  color: white;
  box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 8px 24px -8px hsl(var(--yk-red) / .6);
}
.btn-primary:hover { background: hsl(var(--yk-red-deep)); }
.btn-ghost-dark {
  background: transparent; color: white;
  border-color: rgba(255,255,255,.25);
}
.btn-ghost-dark:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.5); }
.btn-dark {
  background: hsl(var(--yk-ink)); color: white;
}
.btn-dark:hover { background: hsl(var(--yk-ink-2)); }
.btn-outline {
  background: white; color: hsl(var(--yk-ink));
  border: 1.5px solid hsl(var(--yk-ink));
}
.btn-outline:hover { background: hsl(var(--yk-ink)); color: white; }
.btn-sm { padding: 10px 16px; font-size: 13px; }
.btn-lg { padding: 20px 32px; font-size: 17px; }

/* Arrow shift on hover */
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(3px); }

/* Container */
.container { max-width: 1280px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.container-tight { max-width: 1080px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* Hero */
.hero {
  position: relative; overflow: hidden; color: white;
  background: hsl(var(--yk-ink));
  isolation: isolate;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(1000px 500px at 90% -10%, hsl(var(--yk-red) / .28), transparent 60%),
    radial-gradient(900px 600px at -10% 100%, hsl(var(--yk-red) / .15), transparent 60%),
    linear-gradient(180deg, hsl(224 71% 4%) 0%, hsl(220 40% 8%) 100%);
}
.hero-grid { position: absolute; inset: 0; z-index: 1; opacity: .35;
  background-image: linear-gradient(hsl(0 0% 100% / .04) 1px, transparent 1px),
                    linear-gradient(90deg, hsl(0 0% 100% / .04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 40%, black 40%, transparent 90%);
}

/* Big display headline */
.h-display {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800; letter-spacing: -0.035em;
  line-height: 0.92;
}

/* Marker highlight — red underline stroke */
.mark {
  background-image: linear-gradient(180deg, transparent 0 55%, hsl(var(--yk-red) / .9) 55% 92%, transparent 92% 100%);
  padding: 0 0.08em;
  color: inherit;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.mark-stroke {
  color: hsl(var(--yk-red));
  font-style: italic;
}

/* Section */
section { position: relative; }
.section-pad { padding: 96px 0; }
.section-pad-sm { padding: 64px 0; }

/* Card */
.card {
  background: white;
  border: 1px solid hsl(var(--yk-line));
  border-radius: 16px;
}
.card-dark {
  background: hsl(var(--yk-ink-2));
  border: 1px solid hsl(0 0% 100% / .08);
  border-radius: 16px;
  color: white;
}

/* Chip */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  border: 1px solid hsl(var(--yk-line));
  background: white;
}
.chip-dark {
  border-color: hsl(0 0% 100% / .15);
  background: hsl(0 0% 100% / .06);
  color: white;
}
.chip-gold {
  background: hsl(var(--yk-gold) / .15);
  border-color: hsl(var(--yk-gold) / .4);
  color: hsl(45 95% 30%);
}

/* Blog */
.blog-header {
  padding: 120px 0 80px;
  background:
    radial-gradient(800px 400px at 80% 0%, hsl(var(--yk-red) / .18), transparent 60%),
    linear-gradient(180deg, hsl(var(--yk-ink)) 0%, hsl(220 40% 8%) 100%);
  color: white;
}
.blog-header h1, .blog-header .h-display { color: white; }
.blog-card {
  background: white;
  border: 1px solid hsl(var(--yk-line));
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  grid-template-rows: 200px 1fr;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  text-decoration: none;
  color: inherit;
}
.blog-card:hover {
  transform: translateY(-4px);
  border-color: hsl(var(--yk-ink) / .3);
  box-shadow: 0 24px 40px -16px rgba(0,0,0,.15);
}
.blog-card-img {
  background-size: cover; background-position: center;
  position: relative;
}
.blog-card-tag {
  position: absolute; top: 14px; left: 14px;
  background: white; color: hsl(var(--yk-ink));
  font-size: 11px; font-weight: 800; letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 10px; border-radius: 6px;
}
.blog-card-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 10px; }
.blog-card-meta {
  font-size: 12px; color: hsl(var(--yk-ink) / .55);
  font-weight: 600; letter-spacing: 0.02em;
  display: flex; gap: 10px; align-items: center;
}
.blog-card h3 {
  margin: 0; font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2;
}
.blog-card p {
  margin: 0; font-size: 15px; line-height: 1.55;
  color: hsl(var(--yk-ink) / .7);
}
.blog-card-read {
  margin-top: auto; padding-top: 8px;
  font-size: 13px; font-weight: 700; color: hsl(var(--yk-red));
  display: inline-flex; gap: 6px; align-items: center;
}

/* Article page */
.article-hero {
  padding: 140px 0 64px;
  background: white;
  border-bottom: 1px solid hsl(var(--yk-line));
}
.article-hero .kicker {
  font-size: 12px; font-weight: 800; letter-spacing: 0.18em;
  text-transform: uppercase; color: hsl(var(--yk-red));
  margin-bottom: 20px;
}
.article-hero h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.05;
  margin: 0 0 24px; max-width: 860px;
}
.article-hero .byline {
  display: flex; gap: 14px; align-items: center;
  font-size: 14px; color: hsl(var(--yk-ink) / .6);
}
.article-hero .byline strong { color: hsl(var(--yk-ink)); font-weight: 700; }
.article-hero .avatar {
  width: 44px; height: 44px; border-radius: 999px;
  background-size: cover; background-position: center 20%;
  border: 2px solid white;
  box-shadow: 0 0 0 1px hsl(var(--yk-line));
}

.article-body {
  max-width: 720px; margin: 0 auto;
  padding: 64px 24px 96px;
  font-size: 18px; line-height: 1.75;
  color: hsl(var(--yk-ink) / .9);
}
.article-body > * + * { margin-top: 1.25em; }
.article-body h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 28px; font-weight: 800; letter-spacing: -0.02em;
  line-height: 1.2;
  margin-top: 2em; margin-bottom: 0.6em;
  color: hsl(var(--yk-ink));
}
.article-body h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 22px; font-weight: 800; letter-spacing: -0.015em;
  margin-top: 1.8em; margin-bottom: 0.4em;
  color: hsl(var(--yk-ink));
}
.article-body ul, .article-body ol { padding-left: 1.3em; }
.article-body li { margin-bottom: 0.5em; }
.article-body li::marker { color: hsl(var(--yk-red)); font-weight: 800; }
.article-body strong { color: hsl(var(--yk-ink)); font-weight: 700; }
.article-body a {
  color: hsl(var(--yk-red)); font-weight: 600;
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 2px;
}
.article-body blockquote {
  border-left: 4px solid hsl(var(--yk-red));
  padding: 4px 0 4px 24px;
  margin: 1.8em 0;
  font-style: italic;
  font-size: 22px; line-height: 1.5;
  color: hsl(var(--yk-ink));
}
.article-body .callout {
  background: hsl(var(--yk-off));
  border-radius: 14px;
  padding: 24px 28px;
  margin: 2em 0;
  font-size: 16px;
  border-left: 4px solid hsl(var(--yk-red));
}
.article-body .callout strong { display: block; margin-bottom: 6px; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: hsl(var(--yk-red)); }
.article-body figure { margin: 2em 0; }
.article-body figure img {
  width: 100%; border-radius: 14px; display: block;
  border: 1px solid hsl(var(--yk-line));
}
.article-body figcaption {
  font-size: 13px; color: hsl(var(--yk-ink) / .55);
  text-align: center; margin-top: 10px;
}

.article-cta {
  background: hsl(var(--yk-ink));
  color: white;
  padding: 80px 24px;
  text-align: center;
}
.article-cta h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800; letter-spacing: -0.02em; line-height: 1.1;
  margin: 0 0 16px;
}
.article-cta p {
  font-size: 17px; color: hsl(0 0% 100% / .75);
  max-width: 560px; margin: 0 auto 32px;
  line-height: 1.6;
}

.article-related {
  padding: 72px 0 96px;
  background: hsl(var(--yk-off));
}

.blog-topbar {
  position: sticky; top: 0; z-index: 50;
  background: white;
  border-bottom: 1px solid hsl(var(--yk-line));
}
.blog-topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  max-width: 1280px; margin: 0 auto;
  gap: 12px;
}
.blog-topbar-inner a[href*="get-started"] { white-space: nowrap; }
.blog-topbar a.back-home {
  color: hsl(var(--yk-ink) / .7);
  font-size: 13px; font-weight: 700;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.blog-topbar a.back-home:hover { color: hsl(var(--yk-ink)); }

/* Placeholder photo with overlay text */
.photo {
  position: relative; overflow: hidden;
  background: hsl(220 30% 12%);
  border-radius: 16px;
  color: white;
}
.photo-label {
  position: absolute; bottom: 14px; left: 14px; right: 14px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 7px 12px; border-radius: 6px;
  background: hsl(0 0% 0% / .65); backdrop-filter: blur(6px);
  color: white;
  display: inline-block; width: fit-content;
  max-width: calc(100% - 28px);
}

/* Logo mark */
.yk-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 10px;
  background: linear-gradient(135deg, hsl(var(--yk-gold)), hsl(36 100% 50%));
  color: hsl(var(--yk-ink));
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800;
  font-size: 20px; letter-spacing: -0.04em;
  box-shadow: 0 4px 12px -4px hsl(var(--yk-gold) / .5);
}

/* Marquee */
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee {
  display: flex; gap: 64px; width: max-content;
  animation: marquee 40s linear infinite;
}

/* Fade-in on scroll */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease-out, transform .7s ease-out; }
.reveal.in { opacity: 1; transform: none; }

/* Form */
.input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1.5px solid hsl(var(--yk-line));
  background: white;
  font-family: inherit; font-size: 15px;
  transition: border-color .15s;
}
.input:focus { outline: none; border-color: hsl(var(--yk-red)); box-shadow: 0 0 0 3px hsl(var(--yk-red) / .15); }
.input-dark {
  background: hsl(0 0% 100% / .05);
  border-color: hsl(0 0% 100% / .15);
  color: white;
}
.input-dark::placeholder { color: hsl(0 0% 100% / .5); }
.input-dark:focus { border-color: hsl(var(--yk-red)); box-shadow: 0 0 0 3px hsl(var(--yk-red) / .25); }

label.field { display: flex; flex-direction: column; gap: 6px; }
label.field > span {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: hsl(var(--yk-ink) / .6);
}
label.field.dark > span { color: hsl(0 0% 100% / .6); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: hsl(224 71% 4% / .7);
  backdrop-filter: blur(8px);
  display: grid; place-items: center;
  padding: 24px;
  animation: fadeIn .2s ease-out;
}
.modal {
  background: white; border-radius: 20px;
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  animation: popIn .25s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.95) translateY(10px); } to { opacity: 1; transform: none; } }

/* Utility */
.divider { height: 1px; background: hsl(var(--yk-line)); }
.kicker-line {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
  color: hsl(var(--yk-red-deep));
}
.kicker-line::before {
  content: ""; width: 24px; height: 2px; background: hsl(var(--yk-red-deep));
}
.kicker-dark { color: hsl(var(--yk-red)); }
.kicker-dark::before { background: hsl(var(--yk-red)); }

/* Sticky CTA bar (mobile) */
.sticky-cta {
  position: fixed; bottom: 16px; left: 16px; right: 16px; z-index: 50;
  display: none;
}
@media (max-width: 720px) {
  .sticky-cta { display: flex; }
  .section-pad { padding: 64px 0; }
  .h-display-xl { font-size: clamp(44px, 11vw, 80px) !important; }
}

/* Tweak panel */
.tweaks {
  position: fixed; right: 16px; bottom: 16px; z-index: 90;
  background: white; border: 1px solid hsl(var(--yk-line));
  border-radius: 14px; padding: 14px;
  box-shadow: 0 20px 40px -12px rgb(0 0 0 / .2);
  width: 260px;
  font-size: 13px;
}
.tweaks h4 {
  margin: 0 0 8px; font-size: 11px; font-weight: 800; letter-spacing: 0.14em;
  text-transform: uppercase; color: hsl(var(--yk-ink) / .55);
}
.tweak-row { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.tweak-chip {
  padding: 6px 10px; border-radius: 8px; border: 1px solid hsl(var(--yk-line));
  background: white; cursor: pointer; font-size: 12px; font-weight: 600;
}
.tweak-chip.on { background: hsl(var(--yk-ink)); color: white; border-color: hsl(var(--yk-ink)); }

/* Theme variants via data attributes */
[data-accent="gold"] { --yk-accent: var(--yk-gold); }
[data-accent="blue"] { --yk-accent: var(--yk-blue); }
[data-accent="flame"] { --yk-accent: var(--yk-flame); }
[data-accent="green"] { --yk-accent: var(--yk-green); }

/* Mobile: hide redundant CTAs */
@media (max-width: 768px) {
  .hide-cta-on-mobile { display: none !important; }
  .two-col, .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}
