/* =====================================================================
   Atherbyte Studio — styles.css

   Contents
     1. Design tokens (colours, fonts, sizes)  <- change the look here
     2. Base
     3. Layout helpers
     4. Header and navigation (incl. mobile menu)
     5. Buttons and links
     6. Hero
     7. Section headings
     8. Game / portfolio cards
     9. About
    10. Services
    11. Testimonials
    12. Contact
    13. Footer
    14. Motion (animations, reduced-motion support)
   ===================================================================== */


/* ---------- 1. Design tokens ---------- */
:root {
  --bg: #0B0B0F;
  --surface: #15151D;
  --surface-2: #1B1B27;
  --text: #F5F5F7;
  --muted: #A9A9BA;
  --line: rgba(255, 255, 255, 0.09);

  --accent: #885CFF;        /* brand purple */
  --accent-deep: #6A3BF2;   /* deeper violet, used in gradients */
  --accent-soft: #B79CFF;   /* light lilac, used for small text on dark */
  --accent-hot: #D66BFF;    /* pink-violet highlight, used sparingly */

  /* System fonts: nothing to download, so the site loads fast. */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --radius: 18px;
  --header-h: 68px;
  --wrap: 1120px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}


/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

/* The "hidden" attribute must always win over any display rule below. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3 { margin: 0; }
p { margin: 0 0 1em; }

a { color: var(--accent-soft); text-underline-offset: 3px; }
a:hover { color: #fff; }

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

::selection { background: rgba(136, 92, 255, 0.45); color: #fff; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent-deep);
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }


/* ---------- 3. Layout helpers ---------- */
.container {
  width: 100%;
  max-width: calc(var(--wrap) + 48px);
  margin-inline: auto;
  padding-inline: 20px;
}
@media (min-width: 700px) {
  .container { padding-inline: 24px; }
}

.section {
  padding-block: clamp(64px, 9vw, 120px);
  scroll-margin-top: var(--header-h);
}

/* A very soft change of surface to separate neighbouring sections. */
.section-alt {
  background: linear-gradient(180deg, rgba(21, 21, 29, 0.7), rgba(21, 21, 29, 0) 85%);
  border-top: 1px solid var(--line);
}


/* ---------- 4. Header and navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);              /* solid, so the logo image blends cleanly */
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
  flex-wrap: wrap;                    /* lets the menu wrap when JavaScript is off */
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.brand:hover { color: var(--text); }
.brand img {
  width: 40px;
  height: 40px;
  /* Keeps the brighter of image / page, so the logo's black background disappears. */
  mix-blend-mode: lighten;
}
.brand-name span { color: var(--accent-soft); font-weight: 500; }

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-list a {
  position: relative;
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.18s, background-color 0.18s;
}
.nav-list a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-list a[aria-current="true"] { color: var(--text); }
.nav-list a[aria-current="true"]::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 5px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hot));
}

/* Menu button: only shown when JavaScript is available and the screen is narrow. */
.nav-toggle { display: none; }

@media (max-width: 819px) {
  .js .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 46px;
    height: 46px;
    padding: 0;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.18s, border-color 0.18s;
  }
  .js .nav-toggle:hover { border-color: rgba(136, 92, 255, 0.6); }
  .nav-toggle .bar {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.25s var(--ease), opacity 0.2s;
  }
  .nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Collapsed menu panel (JavaScript on). Without JavaScript the list just wraps under the logo. */
  .js .site-nav {
    display: none;
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    padding: 8px 20px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -20px rgba(0, 0, 0, 0.8);
  }
  .js .site-nav.is-open { display: block; }
  .js .nav-list { flex-direction: column; gap: 0; }
  .js .nav-list a { padding: 14px 12px; font-size: 1.05rem; border-radius: 12px; }
  .js .nav-list a[aria-current="true"]::after { left: 12px; right: auto; width: 24px; bottom: 8px; }
}

@media (min-width: 820px) {
  .nav-list a { padding-inline: 16px; }
}


/* ---------- 5. Buttons and links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 50px;
  padding: 0 1.6rem;
  border: 1px solid transparent;
  border-radius: 12px;
  font: 650 1rem/1 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s, background 0.18s, border-color 0.18s, color 0.18s;
}
.btn:active { transform: translateY(0) scale(0.99); }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #7B4DFF, #6A3BF2);
  box-shadow: 0 8px 28px -10px rgba(136, 92, 255, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-primary:hover {
  color: #fff;
  background: linear-gradient(135deg, #7F52FF, #7144F5);
  box-shadow: 0 14px 36px -10px rgba(136, 92, 255, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.btn-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.18);
}
.btn-secondary:hover {
  color: #fff;
  background: rgba(136, 92, 255, 0.12);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* A small arrow after the label of buttons/links that use .has-arrow or .link-arrow */
.has-arrow::after,
.link-arrow::after {
  content: "\2192";
  content: "\2192" / "";
  transition: transform 0.18s var(--ease);
}
.has-arrow:hover::after,
.link-arrow:hover::after { transform: translateX(4px); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent-soft);
  font-weight: 600;
  text-decoration: none;
}
.link-arrow:hover { color: #fff; }


/* ---------- 6. Hero ---------- */
/* The glow and the faint grid are plain background layers on the section itself
   (no extra elements), which keeps the page light. */
.hero {
  scroll-margin-top: var(--header-h);   /* so "Home" lands at the very top, not under the sticky bar */
  padding: clamp(36px, 7vw, 96px) 0 clamp(56px, 8vw, 112px);
  background:
    linear-gradient(to bottom, rgba(11, 11, 15, 0) 72%, var(--bg) 100%),
    radial-gradient(60% 55% at 78% 32%, rgba(136, 92, 255, 0.24), transparent 70%),
    radial-gradient(42% 42% at 8% 0%, rgba(106, 59, 242, 0.18), transparent 70%),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 56px 56px,
    var(--bg);
}

.hero-grid {
  display: grid;
  gap: 28px;
  align-items: center;
  grid-template-columns: minmax(0, 1fr);
}

.hero-logo {
  order: -1;                           /* logo first on phones */
  justify-self: center;
  width: min(250px, 64vw);
}
.hero-logo img {
  width: 100%;
  /* Hides the logo's black background against the page (see the .brand img note). */
  mix-blend-mode: lighten;
}

.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(2.15rem, 5.4vw, 3.9rem);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.grad {
  color: var(--accent-soft);
  background: linear-gradient(100deg, #B79CFF 0%, #885CFF 55%, #D66BFF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  max-width: 54ch;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.6vw, 1.15rem);
}

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

@media (min-width: 560px) {
  .hero-actions .btn { flex: 0 0 auto; }
}

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 56px; }
  .hero-logo { order: 0; width: min(520px, 100%); justify-self: end; }
}


/* ---------- 7. Section headings ---------- */
.section-head { margin-bottom: clamp(32px, 5vw, 56px); }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  color: var(--accent-soft);
  font: 600 0.75rem/1 var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--accent);
}

.section-title {
  margin-bottom: 16px;
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.section-lead {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.06rem;
}


/* ---------- 8. Game / portfolio cards ---------- */
.game-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.game-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}
.game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(136, 92, 255, 0.55);
  box-shadow: 0 22px 50px -22px rgba(136, 92, 255, 0.6);
}

.game-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0E0E16;
  border-bottom: 1px solid var(--line);
}
.game-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.game-card:hover .game-media img { transform: scale(1.04); }

.game-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
}

.chip {
  align-self: flex-start;
  padding: 6px 11px;
  color: var(--accent-soft);
  font: 600 0.7rem/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid rgba(183, 156, 255, 0.32);
  border-radius: 999px;
}

.game-title { font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.01em; }
.game-desc { margin: 0; color: var(--muted); }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}
.tag-list li {
  padding: 5px 10px;
  color: var(--muted);
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.045);
  border-radius: 8px;
}

.game-actions { margin-top: auto; padding-top: 12px; }


/* ---------- 9. About ---------- */
.about-grid {
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(0, 1fr);
}
.about-second { margin-top: 1em; }

.focus-list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  align-content: start;
}
.focus-item {
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 14px;
}
.focus-item h3 { margin-bottom: 6px; font-size: 1.1rem; }
.focus-item p { margin: 0; color: var(--muted); }

@media (min-width: 900px) {
  .about-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 64px; align-items: center; }
}


/* ---------- 10. Services ---------- */
.service-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
}

.service-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}
.service-card:hover {
  transform: translateY(-4px);
  border-color: rgba(136, 92, 255, 0.5);
  box-shadow: 0 20px 44px -24px rgba(136, 92, 255, 0.55);
}

.service-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 8px;
  color: var(--accent-soft);
  background: rgba(136, 92, 255, 0.12);
  border: 1px solid rgba(136, 92, 255, 0.28);
  border-radius: 14px;
}
.service-card h3 { font-size: 1.15rem; line-height: 1.3; }
.service-card p { margin: 0; color: var(--muted); }
.service-inquiry { margin-top: auto; padding-top: 10px; }


/* ---------- 11. Testimonials (only shown when real ones are added) ---------- */
.testimonial-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.testimonial {
  margin: 0;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.testimonial blockquote { margin: 0 0 16px; font-size: 1.05rem; }
.testimonial figcaption { color: var(--muted); font-size: 0.9rem; }
.testimonial strong { color: var(--text); }


/* ---------- 12. Contact ---------- */
.contact-card {
  position: relative;
  padding: clamp(28px, 6vw, 64px);
  background:
    radial-gradient(70% 90% at 100% 0%, rgba(136, 92, 255, 0.2), transparent 70%),
    var(--surface);
  border: 1px solid rgba(136, 92, 255, 0.28);
  border-radius: 24px;
}

.contact-state { margin-top: 28px; }
.contact-note { max-width: 60ch; margin: 0 0 20px; color: var(--muted); }
.contact-note strong { color: var(--text); }
.contact-email { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }

.contact-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.contact-actions .btn { flex: 1 1 200px; }
@media (min-width: 560px) { .contact-actions .btn { flex: 0 0 auto; } }

.copy-status { min-height: 1.5em; margin: 0; color: var(--accent-soft); font-size: 0.92rem; }

.contact-social { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.social-label { margin: 0 0 12px; color: var(--muted); font-size: 0.9rem; }
.social-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.social-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.93rem;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.18s, background-color 0.18s;
}
.social-list a:hover { border-color: var(--accent); background: rgba(136, 92, 255, 0.12); color: #fff; }


/* ---------- 13. Footer ---------- */
.site-footer {
  padding-top: 56px;
  background: #08080B;
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  gap: 36px;
  grid-template-columns: minmax(0, 1fr);
}
.footer-brand p { max-width: 36ch; margin: 16px 0 0; color: var(--muted); font-size: 0.95rem; }

.footer-heading {
  margin: 0 0 14px;
  color: var(--accent-soft);
  font: 600 0.72rem/1 var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.footer-links { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.footer-links a {
  display: inline-block;
  padding: 6px 0;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.18s;
}
.footer-links a:hover { color: var(--text); }

.footer-bottom {
  margin-top: 44px;
  padding-block: 24px;
  border-top: 1px solid var(--line);
}
.footer-bottom p { margin: 0; color: var(--muted); font-size: 0.88rem; }

@media (min-width: 760px) {
  .footer-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); }
}


/* ---------- 14. Motion ---------- */
/* Every animation lives inside this block, so people who ask their device for
   reduced motion get a calm, still page with all content visible. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* Hero: pure CSS, plays once on load. */
  .hero-copy > *,
  .hero-logo img {
    animation: rise 0.8s var(--ease) both;
  }
  .hero-copy > :nth-child(2) { animation-delay: 0.07s; }
  .hero-copy > :nth-child(3) { animation-delay: 0.14s; }
  .hero-copy > :nth-child(4) { animation-delay: 0.21s; }
  .hero-logo img { animation-delay: 0.1s; }

  /* Sections further down: main.js adds "reveal-ready" to <html> only when it is
     running, so if the script ever fails the content simply stays visible. */
  html.reveal-ready .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s ease, transform 0.7s var(--ease);
    transition-delay: var(--reveal-delay, 0s);
  }
  html.reveal-ready .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .game-card:hover,
  .service-card:hover,
  .btn:hover { transform: none; }
  .game-card:hover .game-media img { transform: none; }
}
