/* Troy: The Malware Fight – page styles (no framework) */

@font-face {
  font-family: "TroyPixel";
  src: url("fonts/font.woff") format("woff");
  font-display: swap;
}

:root {
  --bg: #111a28;
  --bg-2: #172336;
  --panel: #1c2b42;
  --panel-2: #22344f;
  --line: #2e4567;
  --text: #e8eef7;
  --muted: #9fb2cb;
  --blue: #2c9cf0;
  --blue-2: #7cc6ff;
  --red: #e5323b;
  --circuit: #7f9a7b;
  --shadow: 0 16px 40px rgba(0, 0, 0, .45);
  --radius: 14px;
  --pixel: "TroyPixel", "Courier New", monospace;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; line-height: 1.2; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 32px; } }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--blue); color: #fff; padding: 10px 16px; border-radius: 8px;
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--blue-2); outline-offset: 3px; }

/* Buttons */
.btn, .icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--pixel); color: #fff; text-decoration: none; cursor: pointer;
  background: var(--blue); border: 2px solid var(--blue-2); border-radius: 6px;
  box-shadow: 0 4px 0 #13507f;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn { padding: 8px 22px; min-height: 44px; font-size: 1rem; }
.icon-btn { width: 48px; height: 48px; padding: 0; font-family: var(--body); font-size: 1.3rem; font-weight: 700; }
.btn:hover, .icon-btn:hover { background: #3eaaf7; transform: translateY(-2px); }
.btn:active, .icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #13507f; }

.store-badge {
  display: inline-flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 18px 0 14px;
  background: #000; color: #fff; text-decoration: none;
  border: 1px solid #a6a6a6; border-radius: 9px;
  transition: transform .15s ease;
}
.store-badge img { width: 32px; height: auto; }
.store-badge span { display: flex; flex-direction: column; line-height: 1.05; font-weight: 600; font-size: 1.45rem; letter-spacing: .01em; }
.store-badge small { font-size: .62rem; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.store-badge:hover { transform: translateY(-2px); }

/* The Google Play image has ~14px of empty space around the badge; pull it in. */
.play-badge { display: inline-block; margin: -14px; transition: transform .15s ease; }
.play-badge:hover { transform: translateY(-2px); }
.play-badge img { width: 216px; }

.text-link { display: inline-block; margin-top: 18px; color: var(--blue-2); font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* Top bar */
.topbar { background: rgba(17, 26, 40, .92); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; }
.brand__home { width: 24px; height: 24px; fill: var(--blue-2); }
.socials { display: flex; gap: 6px; }
.socials a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #fff; transition: background .15s ease; }
.socials a:hover { background: var(--panel-2); }
.socials img, .socials svg { width: 22px; height: 22px; }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  padding: 56px 0 80px;
  background:
    linear-gradient(180deg, rgba(17, 26, 40, .55), rgba(17, 26, 40, .92) 85%, var(--bg)),
    url("images/troy/circuit-bg.webp") center / cover;
}
.hero__inner { display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) { .hero__inner { grid-template-columns: 1.15fr .85fr; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 18px; padding: 6px 12px;
  background: rgba(44, 156, 240, .12); border: 1px solid rgba(124, 198, 255, .35); border-radius: 999px;
  color: var(--blue-2); font-size: .85rem; font-weight: 600; letter-spacing: .04em;
}
.eyebrow__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--red); animation: blink 1.4s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }

.logo { font-family: var(--pixel); text-transform: uppercase; }
.logo__top { display: block; font-size: clamp(4rem, 15vw, 7.5rem); line-height: .95; text-shadow: 0 6px 0 rgba(0, 0, 0, .35); }
.logo__bottom {
  display: inline-block; margin-top: 12px; padding-top: 12px;
  border-top: 3px solid #fff;
  font-size: clamp(1.25rem, 4.6vw, 2.15rem); letter-spacing: .04em;
}
.hero__lead { margin: 22px 0 28px; max-width: 32em; color: #cdd9e8; font-size: 1.15rem; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; }

.hero__art { position: relative; justify-self: center; width: min(100%, 360px); }
.capsule {
  border: 3px solid #000; border-radius: 6px; overflow: hidden;
  box-shadow: 0 0 0 6px var(--panel-2), 0 0 60px rgba(44, 156, 240, .35), var(--shadow);
  transform: rotate(2deg);
}
.capsule img { width: 100%; image-rendering: pixelated; }
@media (max-width: 899px) {
  .hero__art { width: min(78%, 300px); }
}

/* Sections */
.section { padding: 80px 0; }
.section--alt {
  background:
    radial-gradient(circle at 1px 1px, rgba(127, 154, 123, .14) 1px, transparent 1.5px) 0 0 / 22px 22px,
    var(--bg-2);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.section__title { font-family: var(--pixel); font-size: clamp(1.8rem, 5vw, 2.6rem); text-transform: uppercase; }
.section__lead { margin: 8px 0 0; color: var(--muted); }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 16px; }

/* Story */
.story__inner { max-width: 760px; }
.story__inner .section__title { margin-bottom: 18px; }
.story p { margin: 0 0 16px; color: #cdd9e8; font-size: 1.125rem; }
.story p:first-of-type { color: var(--text); font-size: 1.3rem; font-weight: 600; }

/* Mission steps */
.steps {
  list-style: none; margin: 36px 0 0; padding: 0;
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
.step {
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease;
}
.step:hover { transform: translateY(-4px); border-color: var(--blue); }
.step img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
.step__body { padding: 16px 18px 20px; }
.step__count { margin: 0; font-family: var(--pixel); color: var(--blue-2); font-size: .95rem; }
.step__bar { display: block; height: 6px; margin: 8px 0 12px; border-radius: 2px; background: #0b1220; overflow: hidden; }
.step__bar span { display: block; height: 100%; width: calc(var(--p) / 7 * 100%); background: linear-gradient(90deg, var(--blue), var(--blue-2)); }
.step h3 { font-family: var(--pixel); font-size: 1.35rem; }
.step p:last-child { margin: 6px 0 0; color: var(--muted); }

.step--boss { border-color: rgba(229, 50, 59, .55); }
.step--boss:hover { border-color: var(--red); }
.step--boss .step__count { color: #ff7a80; }
.step--boss .step__bar span { background: linear-gradient(90deg, #a3161d, var(--red)); }
@media (min-width: 1000px) {
  .step--boss { grid-column: 1 / -1; flex-direction: row; }
  .step--boss img { width: 55%; aspect-ratio: 2 / 1; }
  .step--boss .step__body { align-self: center; padding: 24px 32px; }
  .step--boss h3 { font-size: 1.9rem; }
}

.mission__end {
  margin: 36px auto 0; max-width: 40em; text-align: center;
  font-family: var(--pixel); font-size: 1.2rem; color: var(--blue-2);
}

/* Screenshot strip */
.scroller-nav { display: none; gap: 10px; }
@media (min-width: 720px) { .scroller-nav { display: flex; } }
.shots {
  list-style: none; margin: 28px 0 0; padding: 6px 16px 18px;
  display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-padding: 0 16px; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
@media (min-width: 1160px) {
  .shots { padding-left: calc((100vw - 1160px) / 2 + 32px); scroll-padding-left: calc((100vw - 1160px) / 2 + 32px); }
}
.shots li { flex: 0 0 min(84vw, 520px); scroll-snap-align: start; }
.shots button {
  display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 10px;
  background: none; cursor: zoom-in; overflow: hidden; box-shadow: var(--shadow);
}
.shots img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .3s ease; }
.shots button:hover img { transform: scale(1.03); }

/* Videos */
.videos { display: grid; gap: 24px; margin-top: 28px; }
@media (min-width: 900px) { .videos { grid-template-columns: 1fr 1fr; } }
.video {
  position: relative; aspect-ratio: 16 / 9;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #000;
  box-shadow: var(--shadow);
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video__poster { position: absolute; inset: 0; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.video__poster img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.7); }
.video__play {
  position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px;
  border-radius: 50%; background: var(--red);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .9), 0 0 40px rgba(229, 50, 59, .6);
  transition: transform .15s ease;
}
.video__play::after {
  content: ""; position: absolute; left: 32px; top: 24px;
  border-style: solid; border-width: 18px 0 18px 28px; border-color: transparent transparent transparent #fff;
}
.video__poster:hover .video__play { transform: scale(1.08); }
.video__label {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  padding: 6px 12px; border-radius: 6px; background: rgba(11, 18, 32, .8);
  color: #fff; font-family: var(--pixel); font-size: .95rem; white-space: nowrap;
}
@media (max-width: 480px) {
  .video__play { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
  .video__play::after { left: 24px; top: 17px; border-width: 15px 0 15px 22px; }
}

/* Closing */
.cta {
  text-align: center;
  background:
    linear-gradient(180deg, rgba(17, 26, 40, .9), rgba(17, 26, 40, .75)),
    url("images/troy/circuit-bg.webp") center / cover;
}
.cta__inner { display: flex; flex-direction: column; align-items: center; }
.cta__inner > img { width: 96px; height: 96px; border-radius: 18px; border: 3px solid #000; box-shadow: 0 0 0 4px var(--panel-2), var(--shadow); image-rendering: pixelated; }
.cta__title { margin-top: 22px; font-family: var(--pixel); font-size: clamp(1.8rem, 5vw, 2.6rem); text-transform: uppercase; }
.cta p { margin: 8px 0 28px; color: var(--muted); }
.cta .hero__actions { justify-content: center; }

/* Footer */
.footer { background: #0b1220; border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.footer p { margin: 0; }
.footer__links { display: flex; gap: 22px; }
.footer__links a { text-decoration: none; font-weight: 600; color: var(--text); padding: 6px 0; }
.footer__links a:hover { text-decoration: underline; }

/* Cookie notice */
.cookie {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50;
  max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px 14px 20px; box-shadow: var(--shadow);
}
.cookie p { margin: 0; font-size: .92rem; color: #cdd9e8; }
@media (max-width: 480px) { .cookie { flex-direction: column; align-items: stretch; text-align: center; } }

/* Lightbox */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0; }
.lightbox::backdrop { background: rgba(5, 9, 16, .92); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: min(92vw, 1280px); max-height: 84vh; border-radius: 8px; border: 1px solid var(--line); }
.lightbox__close { position: fixed; top: 16px; right: 16px; }
.lightbox__prev, .lightbox__next { position: fixed; top: 50%; margin-top: -24px; }
.lightbox__prev { left: 16px; }
.lightbox__next { right: 16px; }
@media (max-width: 720px) {
  .lightbox__prev, .lightbox__next { top: auto; bottom: 20px; margin: 0; }
  .lightbox__prev { left: calc(50% - 60px); }
  .lightbox__next { right: calc(50% - 60px); }
}

/* Back to top */
.to-top { position: fixed; right: 16px; bottom: 16px; z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .12s ease; }
.to-top.is-visible { opacity: 1; pointer-events: auto; }
body.has-cookie .to-top { bottom: 120px; }
