/* ==========================================================================
   jambax.co.uk — site styles (hand-written; no frameworks)
   ========================================================================== */

/* ---------- Fonts (Titillium Web, SIL Open Font License — see /assets/fonts/OFL.txt) ---------- */
@font-face { font-family: "Titillium Web"; font-style: normal; font-weight: 300; font-display: swap; src: url(/assets/fonts/titillium-web-300.woff2) format("woff2"); }
@font-face { font-family: "Titillium Web"; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/titillium-web-400.woff2) format("woff2"); }
@font-face { font-family: "Titillium Web"; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/titillium-web-600.woff2) format("woff2"); }
@font-face { font-family: "Titillium Web"; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/titillium-web-700.woff2) format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  --bg: #0a0a0a;
  --bg-raised: #141414;
  --tile: #2b2b2b;
  --text: #fff;
  --text-muted: rgba(255, 255, 255, .5);
  --line: rgba(235, 235, 235, .9);
  --accent: #e57530;
  --danger: #d9304f;
  --skew: -5deg;
  --nav-h: 60px;
  --container: 1170px;
  --gutter: 15px;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --font: "Titillium Web", "Segoe UI", Arial, sans-serif;
  --mono: Consolas, "SFMono-Regular", Menlo, "Liberation Mono", monospace;
  /* No `color-scheme: dark` here: it makes browsers paint an opaque background behind embedded iframes (Steam/YouTube). */
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/20px var(--font);
  letter-spacing: .06em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
p { margin: 10px 0; }
/* The old theme asked for weight 500, which Titillium doesn't have, so headings rendered at 400. */
h1, h2, h3, h4, h5, h6 { font-weight: 400; margin: 10px 0; }
h1 { font-size: 36px; line-height: 40px; }
h2 { font-size: 30px; line-height: 33px; margin: 40px 0 25px; }
h3 { font-size: 24px; line-height: 26px; margin: 20px 0 0; }
h4 { font-size: 18px; line-height: 20px; }
h5 { font-size: 14px; line-height: 15px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
strong { font-weight: 700; }
.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -.125em; flex: none; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
/* Page bodies use the full 1170px (the header/banner text sits in 1140px). */
@media (min-width: 1200px) { .page-content.container:not(.post) { padding-left: 0; padding-right: 0; } }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg);
  transition: opacity .5s ease, visibility .5s;
}
.preloader img { width: 160px; opacity: .25; }
.preloader-spinner {
  width: 160px; height: 24px; margin-top: 4px;
  border-radius: 50%;
  border-bottom: 2px solid var(--accent);
  animation: preloader-spin 1s linear infinite;
  opacity: .8;
}
@keyframes preloader-spin { from { transform: rotateY(0) ; } to { transform: rotateY(360deg); } }
.is-loaded .preloader { opacity: 0; visibility: hidden; }
html:not(.js) .preloader { display: none; }

/* ---------- Navbar ---------- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(10, 10, 10, .4);
  transition: height .3s, background-color .3s;
}
/* Shrinks to 40px (logo 50px -> 30px) once the page is scrolled past 100px. */
.navbar.is-small { height: 40px; background: rgba(10, 10, 10, .94); }
.navbar-inner { display: flex; align-items: center; height: 100%; }
.navbar-brand { display: flex; align-items: center; flex: none; }
.navbar-brand img { width: 50px; height: auto; transition: width .3s; }
.navbar.is-small .navbar-brand img { width: 30px; }
.navbar-menu { display: flex; flex: 1; justify-content: space-between; height: 100%; }
.nav { display: flex; list-style: none; margin: 0; padding: 0; height: 100%; }
.nav li { height: 100%; margin-left: 30px; }
.nav a {
  position: relative; display: flex; align-items: center; height: 100%;
  font-size: 13px; text-transform: uppercase; text-decoration: none;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: #fff;
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav a:hover::after, .nav .active a::after { transform: scaleX(1); }
.navbar-toggle { display: none; }

@media (max-width: 767px) {
  .navbar-inner { justify-content: space-between; }
  .navbar-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 10px; order: -1;
    background: none; border: 0; cursor: pointer;
  }
  .navbar-toggle span { display: block; height: 2px; background: #fff; transition: transform .3s, opacity .3s; }
  .nav-open .navbar-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-open .navbar-toggle span:nth-child(2) { opacity: 0; }
  .nav-open .navbar-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .navbar-brand { margin: 0; }
  .navbar-menu {
    position: fixed; top: 0; left: 0; bottom: 0; width: 260px; height: auto;
    flex-direction: column; justify-content: flex-start;
    padding-top: var(--nav-h);
    background: rgba(10, 10, 10, .97);
    transform: translateX(-100%);
    transition: transform .35s var(--ease);
    z-index: -1;
  }
  .nav-open .navbar-menu { transform: none; }
  .nav { flex-direction: column; height: auto; }
  .nav li { height: auto; margin-left: 0; }
  .nav a { height: 48px; padding: 0 24px; }
  .nav a::after { left: 24px; right: auto; width: 30px; bottom: 8px; }
  .navbar-backdrop { position: fixed; inset: 0; z-index: 99; background: rgba(0, 0, 0, .6); }
}

/* ---------- Banner (parallax header) ---------- */
.banner {
  position: relative; overflow: hidden;
  display: flex; align-items: center;
  height: 350px; padding-top: var(--nav-h);
  background: var(--tile);
  text-align: center;
}
.banner-large { height: 550px; }
/* Dimmed to 70% over the dark tile colour. JS makes the image taller than the banner
   (like the old site's parallax) and scrolls it at 40% of page speed. */
.banner-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: .7; will-change: transform; }
.banner-image img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.banner-info { position: relative; width: 100%; will-change: transform, opacity; }
.banner-title {
  margin: 0 0 40px;
  font-size: 50px; line-height: 55px; font-weight: 400;
  text-transform: uppercase;
}
h2.banner-title { margin-bottom: 25px; }
.banner-subtitle { margin: 10px 0; font-size: 18px; font-weight: 700; line-height: 20px; }
.banner-subtitle-lg { font-size: 24px; line-height: 26px; }
.banner-subtitle-plain { font-weight: 400; }
.banner-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 40px; }
.banner-buttons .btn { gap: 4px; }
.banner-buttons .icon { width: 1.125em; height: 1em; }
@media (max-width: 767px) {
  .banner-title { font-size: 34px; line-height: 38px; }
  .banner-subtitle { font-size: 15px; }
  .banner-buttons { justify-content: center; }
}

/* ---------- Buttons (skewed outline) ---------- */
.btn {
  position: relative; z-index: 0;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 30px;
  color: #fff; text-decoration: none; line-height: 20px;
  background: none; border: 0; cursor: pointer;
  transition: color .3s;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border: 2px solid #fff;
  transform: skewX(var(--skew));
  transition: background-color .3s, border-color .3s;
}
.btn:hover { color: var(--bg); }
.btn:hover::before { background: #fff; }
.btn-danger::before { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { color: #fff; }
.btn-danger:hover::before { background: #b8213d; border-color: #b8213d; }
.btn-accent::before { background: var(--accent); border-color: var(--accent); }

/* ---------- Angled images (signature skewed tiles) ---------- */
.angled-img { position: relative; display: block; text-decoration: none; }
.angled-img .img {
  display: block; overflow: hidden;
  background: var(--tile);
  transform: skewX(var(--skew));
}
/* Images sit slightly dimmed and brighten on hover (no zoom). */
.angled-img img {
  width: 100%;
  opacity: .7;
  transform: skewX(calc(var(--skew) * -1)) scale(1.07);
  transition: opacity .3s;
}
.angled-img:hover img { opacity: .9; }
.media-icon {
  position: absolute; left: 50%; top: 50%;
  width: 50px; height: 50px; margin: -25px 0 0 -25px;
  font-size: 50px; line-height: 1;
  opacity: .2;
  transition: opacity .3s;
  pointer-events: none;
}
.media-icon .icon { display: block; width: 50px; height: 50px; }
.angled-img:hover .media-icon { opacity: .8; }

/* ---------- Sections & layout ---------- */
.page-content { padding-top: 40px; padding-bottom: 80px; }
.page-content-full { padding-top: 0; }
.section + .section { margin-top: 70px; }
/* Heading with a full-width rule 25px below it, as on the old site. */
.section-title {
  margin: 0 0 10px; padding-bottom: 25px;
  font-size: 30px; line-height: 33px; font-weight: 400;
  border-bottom: 1px solid var(--line);
}
.layout-sidebar { display: grid; grid-template-columns: minmax(0, 870fr) minmax(0, 270fr); gap: 30px; }
@media (max-width: 991px) { .layout-sidebar { grid-template-columns: 1fr; } }

.grid { display: grid; gap: 0 30px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1199px) { .grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 991px)  { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575px)  { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.grid-media .angled-img img { aspect-ratio: 16 / 9; object-fit: cover; }
.card-title { margin: 40px 0 10px; font-size: 14px; line-height: 15px; font-weight: 400; }
.card-title-lg { font-size: 18px; line-height: 20px; }
.card-caption { margin: 10px 0 0; }

/* ---------- Post list (home / categories) ---------- */
.post-list { padding-top: 50px; }
.post-item { display: grid; grid-template-columns: minmax(0, 270fr) minmax(0, 570fr); gap: 30px; margin-bottom: 60px; }
.post-item-image { margin: 0 7.5px; }
.post-item-title { margin: 0; font-size: 30px; line-height: 33px; font-weight: 400; }
.post-item-title a { text-decoration: none; transition: color .3s; }
.post-item-title a:hover { color: var(--accent); }
.post-item-header .date { display: block; margin-top: 8px; text-align: right; }
.post-item .btn { margin: 10px 0 0 10px; }
.date { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
@media (max-width: 767px) {
  .post-item { grid-template-columns: 1fr; gap: 15px; }
  .post-item-title { font-size: 24px; line-height: 28px; }
}

/* ---------- Sidebar ---------- */
.side-block { margin-bottom: 30px; }
.block-title {
  position: relative; z-index: 0;
  margin: 0 0 10px; padding: 10px 18px;
  font-size: 18px; line-height: 20px; font-weight: 400;
}
.block-title::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(255, 255, 255, .1);
  transform: skewX(var(--skew));
}
.block-body { padding: 0 18px; }
.block-body a { transition: color .3s; }
.block-body a:hover { color: var(--accent); }
.cat-list, .cat-list ul { list-style: none; margin: 0; padding: 0; }
.cat-list { margin: 10px 0; }
.cat-list li { padding: 4px 0; }
.cat-list ul { padding-left: 40px; }

/* ---------- Snippets grid ---------- */
.snippet-grid { margin-top: 21px; }
.snippet-card { display: block; margin-bottom: 30px; text-decoration: none; text-align: center; }
.snippet-info { display: block; }
.snippet-title {
  position: relative; display: block;
  margin: 18px 0 30px;
  font-size: 24px; line-height: 26px;
  transition: color .3s;
}
.snippet-title::after {
  content: ""; position: absolute; left: 15%; right: 15%; bottom: -15px; height: 1px;
  background: rgba(255, 255, 255, .2);
}
.snippet-info .date { display: block; margin-top: 8px; }
.snippet-card:hover .snippet-title { color: var(--accent); }
.snippet-card:hover img { opacity: .9; }

/* ---------- Single post ---------- */
.page-content.post { padding-top: 60px; }
.post-body { max-width: 100%; }
.post-body ul { padding-left: 40px; margin: 0 0 10px; }
.post-body a { color: #fff; text-decoration: underline; text-decoration-color: rgba(229, 117, 48, .7); text-underline-offset: 2px; }
.post-body a:hover { color: var(--accent); }
.post-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px;
  margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .15);
}
.post-meta .date { font-size: 13px; }
.post-terms { display: flex; flex-wrap: wrap; gap: 8px; }
.term {
  position: relative; z-index: 0; padding: 2px 12px; font-size: 12px; text-decoration: none;
}
.term::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(255, 255, 255, .1); transform: skewX(var(--skew)); transition: background .3s; }
a.term:hover::before { background: var(--accent); }
.post-tags .term { color: var(--text-muted); }
.post-nav { display: flex; justify-content: space-between; gap: 20px; margin-top: 30px; }
.post-nav .btn { font-size: 13px; }
@media (max-width: 575px) { .post-nav { flex-direction: column; } }

/* Inline code */
:not(pre) > code {
  font-family: var(--mono); font-size: .92em; letter-spacing: 0;
  padding: 1px 5px; background: rgba(255, 255, 255, .1); border-radius: 3px;
}

/* Code blocks (Rouge output with line-number table) */
.highlighter-rouge { margin: 0 0 20px; }
.highlight {
  background: #1d1f23;
  border-left: 3px solid var(--accent);
  overflow-x: auto;
  font-family: var(--mono); font-size: 12px; line-height: 1.4; letter-spacing: 0;
  tab-size: 4; -moz-tab-size: 4;
}
.highlight pre { margin: 0; padding: 0; font: inherit; background: none; white-space: pre; }
pre.highlight { padding: 0; }
.highlight .rouge-table { border-collapse: collapse; margin: 0; width: 100%; }
.highlight .rouge-table td { padding: 12px 0; vertical-align: top; }
.highlight .rouge-gutter {
  width: 1%; padding: 12px 14px !important; text-align: right; user-select: none;
  color: #5c6370; background: #191b1e; border-right: 1px solid #2a2d33;
}
.highlight .rouge-code { padding-left: 16px !important; padding-right: 16px !important; }
.highlight table pre { padding: 0; }
.highlight code { font: inherit; background: none; padding: 0; }

/* Syntax colours (dark, Enlighter-like) */
.highlight { color: #c8ccd4; }
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .cd { color: #7f848e; font-style: italic; }
.highlight .cp, .highlight .cpf { color: #c678dd; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kv { color: #c678dd; }
.highlight .kt, .highlight .kc { color: #e5c07b; }
.highlight .nf, .highlight .fm { color: #61afef; }
.highlight .nc, .highlight .nn, .highlight .nl { color: #e5c07b; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sc, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .dl { color: #98c379; }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .il, .highlight .mo, .highlight .mb { color: #d19a66; }
.highlight .o, .highlight .ow { color: #56b6c2; }
.highlight .p { color: #abb2bf; }
.highlight .nb, .highlight .bp { color: #e06c75; }
.highlight .err { color: inherit; background: none; }

/* ---------- Carousel ---------- */
/* Infinite strip of angled tiles; JS sets --per-view and moves the track with transforms.
   70px of the neighbouring tiles peek out at each edge under fading arrow strips. */
.carousel { position: relative; overflow: hidden; --per-view: 4; --edge: 70px; }
.carousel-track {
  display: flex; align-items: flex-start;
  padding: 0 var(--edge);
  will-change: transform;
}
.carousel-track.is-animating { transition: transform .6s cubic-bezier(.25, .8, .3, 1); }
.carousel-item { flex: 0 0 calc(100% / var(--per-view)); }
.carousel-item img { -webkit-user-drag: none; user-select: none; }
html:not(.js) .carousel-track { overflow-x: auto; }
@media (max-width: 991px) { .carousel { --per-view: 3; } }
@media (max-width: 767px) { .carousel { --per-view: 2; } }
@media (max-width: 532px) { .carousel { --per-view: 1; } }

.carousel-btn {
  position: absolute; top: 0; bottom: 0; z-index: 2;
  width: var(--edge); padding: 0;
  color: #333; cursor: pointer; border: 0;
  opacity: 1;
  transition: opacity .3s;
}
.carousel-btn .icon { position: absolute; top: 50%; width: 20%; height: auto; aspect-ratio: 1; transform: translateY(-50%); opacity: 0; transition: opacity .3s; }
.carousel-btn:hover { opacity: .8; }
.carousel-btn:hover .icon { opacity: .5; }
.carousel-prev { left: 0; background: linear-gradient(to right, #0a0a0a, rgba(10, 10, 10, 0)); }
.carousel-prev .icon { left: 20%; }
.carousel-next { right: 0; background: linear-gradient(to left, #0a0a0a, rgba(10, 10, 10, 0)); }
.carousel-next .icon { right: 20%; }

/* ---------- Satellite Command feature ---------- */
.feature-box {
  display: grid; grid-template-columns: minmax(0, 230fr) minmax(0, 750fr); gap: 30px; align-items: start;
  margin: 10px 50px 0; padding: 0 15px 10px;
}
.feature-text hr { margin: 10px 0; }
@media (max-width: 767px) { .feature-box { grid-template-columns: 1fr; margin: 30px 0 0; padding: 0; } .feature-logo { max-width: 200px; margin: 0 auto; } }
.steam-widget { display: flex; justify-content: center; margin: 10px 0 0; }
.trailer-title { margin: 65px 0 25px; text-align: center; }
.video-full { width: 100%; max-width: 1280px; margin: 0 auto; }
.steam-widget iframe { max-width: 100%; border: 0; background: transparent; color-scheme: normal; }
.video-embed iframe { color-scheme: normal; }
.video-embed { position: relative; aspect-ratio: 16 / 9; background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: start; margin-top: -40px; }
.contact-links { margin: 0; padding-left: 40px; }
.contact-links h3 { margin: 20px 0 0; }
.contact-links a { color: var(--accent); text-decoration: none; transition: color .3s; }
.contact-links a:hover { color: #fff; }
.cv h2 { margin: 40px 0 25px; text-align: center; }
.cv-download { display: block; width: 180px; margin: 0 auto; }
.cv-download img { width: 180px; }
@media (max-width: 767px) { .contact { grid-template-columns: 1fr; } }

.not-found { padding: 20px 0 40px; }
.not-found .btn { margin: 10px; }

/* ---------- Footer ---------- */
.site-footer { padding: 30px 10px; background: rgba(10, 10, 10, .7); text-align: center; }
.site-footer p { margin: 10px 0; }

/* ---------- Lightbox ---------- */
.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: transparent; color: #fff;
}
.lightbox::backdrop { background: rgba(5, 5, 5, .92); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; animation: lb-in .3s ease; }
@keyframes lb-in { from { opacity: 0; } }
.lightbox-stage { display: flex; align-items: center; justify-content: center; width: min(92vw, 1400px); height: 86vh; }
.lightbox-stage img { max-width: 100%; max-height: 100%; object-fit: contain; animation: lb-zoom .35s var(--ease); }
.lightbox-stage .video-embed { width: 100%; max-height: 100%; animation: lb-zoom .35s var(--ease); }
@keyframes lb-zoom { from { opacity: 0; transform: scale(.94); } }
.lightbox button {
  position: absolute; z-index: 2; display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; padding: 0;
  color: #fff; font-size: 24px; cursor: pointer;
  background: rgba(255, 255, 255, .08); border: 0;
  transition: background .3s;
}
.lightbox button:hover { background: var(--accent); }
.lightbox-close { top: 16px; right: 16px; }
.lightbox-prev { left: 16px; top: 50%; margin-top: -24px; }
.lightbox-next { right: 16px; top: 50%; margin-top: -24px; }
.lightbox.is-single .lightbox-prev, .lightbox.is-single .lightbox-next { display: none; }

/* ---------- Reveal-on-scroll ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s var(--ease); }
.js [data-reveal="flip"] { transform: perspective(400px) rotateY(90deg); transition: opacity .6s ease, transform .9s var(--ease); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
