/* CyberOps.Team landing page. Same design system as blog.cyberops.team:
   grey textured background with drifting diagonal bands, black type, the brand
   wordmark with a blinking underscore, light theme by default with a dark option. */

/* ─── Fonts (self-hosted) ─────────────────────────────────── */
/* The brand typeface, B Biger Over (assets/fonts/bBigerOver.woff2, with the .ttf as a fallback).
   Orbitron (SIL Open Font Licence) stands in only if it can't load. */
@font-face { font-family: "B Biger Over"; font-weight: 400 900; font-display: block; src: url("../fonts/bBigerOver.woff2") format("woff2"), url("../fonts/bBigerOver.ttf") format("truetype"); }
@font-face { font-family: "Orbitron"; font-weight: 500; font-display: block; src: url("../fonts/orbitron-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Orbitron"; font-weight: 900; font-display: block; src: url("../fonts/orbitron-latin-900-normal.woff2") format("woff2"); }

/* ─── Colours: light (default) and dark ───────────────────── */
:root {
  color-scheme: light;
  --bg: #E6E6E6;
  --streak: #EBEBEB;
  --surface: #F2F2F2;
  --ring: #FFFFFF;
  --heading: #000000;
  --text: #1A1A1A;
  --muted: #5C5C5C;
  --font-brand: "B Biger Over", "Orbitron", "Arial Black", system-ui, sans-serif;
  --font-body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141414;
  --streak: #191919;
  --surface: #1E1E1E;
  --ring: #2C2C2C;
  --heading: #FFFFFF;
  --text: #E2E2E2;
  --muted: #9A9A9A;
}

/* ─── Base ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
  background-color: var(--bg); color: var(--text);
  font: 400 1rem/1.5 var(--font-body);
  overflow-x: hidden;
}
.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; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
ul { list-style: none; margin: 0; padding: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--heading); outline-offset: 4px; }

/* ─── Background: fine grain + diagonal bands drifting right to left ─── */
/* The bands repeat every 100vmax along the diagonal, so sliding the layer left by one
   repeat (100vmax x 1.4142) loops seamlessly. */
body::before {
  content: ""; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: -2; pointer-events: none;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body::after {
  content: ""; position: fixed; top: 0; bottom: 0; left: 0; z-index: -1; pointer-events: none;
  width: calc(100vw + 141.4214vmax);
  background-image: repeating-linear-gradient(135deg,
    transparent 0 18vmax, var(--streak) 18vmax 34vmax, transparent 34vmax 52vmax,
    var(--streak) 52vmax 61vmax, transparent 61vmax 100vmax);
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  will-change: transform;
  animation: bands-drift 120s linear infinite, fade-in 2.2s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes bands-drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-141.4214vmax, 0, 0); } }

/* ─── Centre column: logo, project buttons, social rings ───── */
.hero {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 4.5rem 1.25rem 3rem;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
}

.logo {
  margin: 0; color: var(--heading);
  font-family: var(--font-brand); font-weight: 900; line-height: 1;
  font-size: clamp(1.5rem, 8.2vw, 4.35rem); font-size: clamp(1.5rem, min(8.2vw, 13vh), 4.35rem); letter-spacing: 0.01em; white-space: nowrap;
}
.blink { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
/* The brand font draws "_" below the line; lift it so its bottom sits level with the bottom of the M.
   (A GIF version of the wordmark is kept in assets/img/logo-light.gif and logo-dark.gif.) */
.logo .blink { position: relative; top: -0.1182em; }

/* Project buttons */
.projects { margin-top: clamp(1.75rem, 4vw, 2.5rem); }
.projects ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1rem; }
.project {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.9rem; padding: 0.6rem 0.75rem;
  font-family: var(--font-brand); font-weight: 900; font-size: 1.05rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--heading); text-decoration: underline transparent 2px; text-underline-offset: 0.45em;
  -webkit-tap-highlight-color: transparent;
  transition: text-decoration-color 0.2s ease, transform 0.2s ease;
}
.project:hover, .project:focus-visible { text-decoration-color: currentColor; }
.project:active { transform: scale(0.97); }

/* Social rings, as on the original landing page */
.social { margin-top: clamp(1.75rem, 4vw, 2.5rem); }
.social ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; }
.social a {
  display: grid; place-items: center; width: 4.2rem; height: 4.2rem; border-radius: 50%;
  border: 1px solid var(--ring); color: var(--heading); text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.social a:hover, .social a:focus-visible { background-color: rgba(255, 255, 255, 0.3); transform: scale(1.08); }
:root[data-theme="dark"] .social a:hover, :root[data-theme="dark"] .social a:focus-visible { background-color: var(--surface); }
.social a:active { transform: scale(0.96); }
.social svg { width: 1.5rem; height: 1.5rem; fill: currentColor; }
.social svg.icon-x { width: 1.65rem; height: 1.65rem; }

/* ─── Light/dark toggle (top right) ───────────────────────── */
.theme-toggle {
  position: absolute; z-index: 2;
  top: max(1rem, env(safe-area-inset-top)); right: max(1rem, env(safe-area-inset-right));
  display: grid; place-items: center; width: 2.4rem; height: 2.4rem; padding: 0;
  border: 1px solid var(--ring); border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.3s ease, background-color 0.3s ease;
}
.theme-toggle:hover, .theme-toggle:focus-visible { color: var(--heading); background: var(--surface); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* ─── Footer ──────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 0.85rem 1.25rem;
  padding-bottom: max(0.85rem, env(safe-area-inset-bottom));
}
.footer p {
  margin: 0; color: var(--heading);
  font-family: var(--font-brand); font-weight: 500; font-size: 0.8rem; letter-spacing: 0.06em;
}

/* ─── Load sequence: background, logo, buttons, social links, then footer and toggle ───
   Each element fades in on one gentle curve while gliding into place on a longer, softer one,
   over a short distance. Stages overlap so the whole thing flows. Only opacity, transform and
   clip-path are animated, which browsers run smoothly on the graphics chip. */
:root {
  --fade: cubic-bezier(0.4, 0, 0.2, 1);
  --glide: cubic-bezier(0.19, 1, 0.22, 1);
}
@keyframes fade-in { from { opacity: 0; } }
/* The logo starts at 1% rather than 0% opacity: it looks the same, but lets browsers count it as the page's
   main content (Largest Contentful Paint), which search engines measure. */
@keyframes fade-in-logo { from { opacity: 0.01; } }
@keyframes glide { from { transform: translate3d(0, 8px, 0); } }
@keyframes glide-logo { from { transform: translate3d(0, 12px, 0); } }
/* Button labels rise out of an invisible mask instead of fading, so the text is always at full contrast */
@keyframes rise-reveal { from { clip-path: inset(100% 0 0 0); transform: translate3d(0, 10px, 0); } to { clip-path: inset(0 0 0 0); transform: translate3d(0, 0, 0); } }
/* The footer wipes up into view (rather than fading), so its text is always at full contrast */
@keyframes reveal-up { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }

.logo, .projects li, .social li, .theme-toggle { -webkit-backface-visibility: hidden; backface-visibility: hidden; }

.logo { animation: fade-in-logo 1.8s var(--fade) 0.8s both, glide-logo 2.6s var(--glide) 0.8s both; }

.projects li { animation: rise-reveal 2s var(--glide) both; }
.projects li:nth-child(1) { animation-delay: 1.8s; }
.projects li:nth-child(2) { animation-delay: 1.95s; }
.projects li:nth-child(3) { animation-delay: 2.1s; }
.projects li:nth-child(4) { animation-delay: 2.25s; }

.social li { animation-name: fade-in, glide; animation-duration: 1.6s, 2.4s; animation-timing-function: var(--fade), var(--glide); animation-fill-mode: both; }
.social li:nth-child(1) { animation-delay: 2.8s; }
.social li:nth-child(2) { animation-delay: 2.95s; }
.social li:nth-child(3) { animation-delay: 3.1s; }

.theme-toggle { animation: fade-in 1.8s var(--fade) 4.1s both; }
/* the blinking underscore starts once the logo has settled */
.logo .blink { animation-delay: 3s; }
.footer { animation: reveal-up 1.8s var(--glide) 4.1s both; }


/* ─── Small screens ───────────────────────────────────────── */
@media (max-width: 480px) {
  .projects ul { gap: 0.25rem 0.5rem; }
  .social a { width: 3.4rem; height: 3.4rem; }
  .social svg { width: 1.25rem; height: 1.25rem; }
  .social svg.icon-x { width: 1.4rem; height: 1.4rem; }
}
@media (max-width: 360px) {
  .projects ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; max-width: 16rem; }
  .projects li, .project { width: 100%; }
  .social ul { gap: 0.45rem; flex-wrap: nowrap; }
  .social a { width: 3rem; height: 3rem; }
  .social svg { width: 1.1rem; height: 1.1rem; }
  .social svg.icon-x { width: 1.25rem; height: 1.25rem; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .hero { padding-top: 1rem; padding-bottom: 1rem; padding-right: 4rem; padding-left: 4rem; }
  .projects, .social { margin-top: 0.75rem; }
  .project { min-height: 2.5rem; padding-top: 0.4rem; padding-bottom: 0.4rem; }
  .social a { width: 3rem; height: 3rem; }
  .social svg { width: 1.1rem; height: 1.1rem; }
  .social svg.icon-x { width: 1.25rem; height: 1.25rem; }
}

/* ─── Visitors who prefer less motion: everything appears at once, nothing moves ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ─── Printing ────────────────────────────────────────────── */
@media print {
  body::before, body::after, .theme-toggle { display: none; }
}
