/* ============================================================
   Pixel Realm Studios — design tokens
   ============================================================ */
:root {
  /* Color */
  --bg:        #FAF8FF;
  --surface:   #F1ECFB;
  --line:      #E3DAF5;
  --ink:       #221C33;
  --ink-soft:  #665F7A;
  --violet:    #6B3FD6;
  --violet-deep: #4C2A9E;
  --blue:      #3E7CE0;
  --white:     #FFFFFF;

  /* Type */
  --font-head: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;

  /* Layout */
  --maxw: 1120px;
  --gutter: 24px;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--ink);
  margin: 0 0 0.5em;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1.08; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.15; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; max-width: 62ch; }
p.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 46ch; }

.muted { color: var(--ink-soft); }

::selection { background: var(--violet); color: var(--white); }

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

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

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn-primary {
  background: var(--violet);
  color: var(--white);
}
.btn-primary:hover { background: var(--violet-deep); }
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--violet); color: var(--violet); }

/* ---------------- Pixel motif ---------------- */
.pixel-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--violet);
  margin-right: 10px;
  flex: none;
  transform: translateY(-1px);
}
.pixel-scatter {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}
.pixel-scatter span {
  position: absolute;
  display: block;
  border-radius: 2px;
}

/* ---------------- Header / Nav ---------------- */
header.site {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 248, 255, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  min-width: 0;
  flex: 1 1 auto;
}
.brand img { height: 34px; width: auto; flex: none; }
.brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-links {
  display: flex;
  gap: 34px;
  font-size: 0.95rem;
  font-weight: 500;
}
.nav-links a { color: var(--ink-soft); position: relative; padding: 4px 0; }
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--violet); }
.nav-cta { display: flex; align-items: center; gap: 18px; flex: none; }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex: none;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-cta .btn-primary { display: none; }
  .nav.open .nav-links {
    display: flex;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 20px var(--gutter) 28px;
    gap: 18px;
    border-bottom: 1px solid var(--line);
  }
}

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 88px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-actions { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.hero-stats div strong {
  display: block;
  font-family: var(--font-head);
  font-size: 1.6rem;
  color: var(--violet-deep);
}
.hero-stats div span { font-size: 0.85rem; color: var(--ink-soft); }

.hero-art {
  position: relative;
  width: 100%;
}
.hero-art .field {
  position: relative;
  width: 100%;
  /* Every child of .field is absolutely positioned, so nothing here
     contributes intrinsic height. padding-top:100% forces a real,
     reliable 1:1 box (classic aspect-ratio hack) instead of depending
     on content or the `aspect-ratio` property inside a grid track,
     which can collapse to 0 height and let the icons float over
     whatever content follows. */
  padding-top: 100%;
}
.orb {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #E8DFFB 0%, var(--surface) 55%, transparent 78%);
}
.icon-chip {
  position: absolute;
  width: 96px;
  height: 96px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 18px 40px -14px rgba(76, 42, 158, 0.35);
  border: 1px solid var(--white);
}
.icon-chip img { width: 100%; height: 100%; object-fit: cover; }
.icon-chip.c1 { top: 4%;  left: 8%;  width: 78px; height: 78px; }
.icon-chip.c2 { top: 12%; right: 2%; width: 108px; height: 108px; }
.icon-chip.c3 { bottom: 10%; left: 0%; width: 88px; height: 88px; }
.icon-chip.c4 { bottom: 0%; right: 14%; width: 92px; height: 92px; }
.logo-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 46%;
  z-index: 1;
  filter: drop-shadow(0 20px 30px rgba(76,42,158,0.25));
}

/* ---------------- Sections generic ---------------- */
section { padding: 88px 0; }
.section-head { max-width: 640px; margin-bottom: 48px; }
.eyebrow-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--violet);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 14px;
}
.eyebrow-line .pixel-dot { margin-right: 0; }

.section-alt { background: var(--surface); }

/* ---------------- About ---------------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 64px;
  align-items: start;
}
.about-list { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 18px; }
.about-list li { display: flex; gap: 12px; align-items: flex-start; }
.about-list li p { margin: 0; color: var(--ink-soft); }
.about-list li strong { display: block; color: var(--ink); font-family: var(--font-head); font-weight: 600; }

/* ---------------- Services ---------------- */
.services-list {
  display: grid;
  border-top: 1px solid var(--line);
}
.service-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}
.service-row h3 { margin: 0; font-size: 1.15rem; }
.service-row p { margin: 0; color: var(--ink-soft); max-width: 58ch; }
@media (max-width: 720px) {
  .service-row { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------------- Portfolio ---------------- */
.app-block {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 56px;
  align-items: center;
  padding: 56px 0;
  border-bottom: 1px solid var(--line);
}
.app-block:last-child { border-bottom: none; }
.app-block.reverse .app-copy { order: 2; }
.app-block.reverse .app-visual { order: 1; }

.app-heading { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.app-heading img {
  width: 58px; height: 58px; border-radius: 16px;
  box-shadow: 0 10px 24px -10px rgba(76,42,158,0.4);
}
.app-heading h3 { margin: 0; font-size: 1.5rem; }
.app-heading span { display:block; font-size: 0.85rem; color: var(--ink-soft); margin-top:2px; }

.app-copy p { color: var(--ink-soft); }
.feature-list { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.95rem; color: var(--ink); }

.howto {
  margin-top: 26px;
  padding: 20px 22px;
  background: var(--surface);
  border-radius: var(--radius);
}
.howto h4 { margin: 0 0 12px; font-size: 0.95rem; text-transform: none; color: var(--violet-deep); }
.howto ol { margin: 0; padding-left: 20px; color: var(--ink-soft); font-size: 0.92rem; display: grid; gap: 6px; }

.screens-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  row-gap: 20px;
  justify-content: center;
}
.screen-slot {
  width: 128px;
  flex: 0 0 auto;
  aspect-ratio: 9 / 19.5;
  border-radius: 20px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 20px 40px -20px rgba(76,42,158,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  position: relative;
}
.screen-slot::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
}
.screen-slot span {
  font-size: 0.72rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* ---------------- Contact ---------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}
.contact-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
}
.contact-item { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.contact-item:last-child { border-bottom: none; }
.contact-item strong { display: block; font-size: 0.85rem; color: var(--ink-soft); font-weight: 500; }
.contact-item span { font-size: 1.02rem; }

form.contact-form { display: grid; gap: 16px; }
form.contact-form label { font-size: 0.85rem; color: var(--ink-soft); display: block; margin-bottom: 6px; }
form.contact-form input,
form.contact-form textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
}
form.contact-form textarea { resize: vertical; min-height: 110px; }
form.contact-form input:focus,
form.contact-form textarea:focus { border-color: var(--violet); }

/* ---------------- Footer ---------------- */
footer.site {
  border-top: 1px solid var(--line);
  padding: 44px 0;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 600; }
.footer-brand img { height: 26px; }
.footer-links { display: flex; gap: 24px; font-size: 0.9rem; color: var(--ink-soft); }
.footer-links a:hover { color: var(--violet); }
.footer-copy { font-size: 0.82rem; color: var(--ink-soft); margin-top: 18px; }

/* ---------------- Legal pages ---------------- */
.legal-hero { padding: 72px 0 40px; border-bottom: 1px solid var(--line); }
.legal-hero p.lede { margin-top: 10px; }
.legal-body { padding: 56px 0 96px; }
.legal-body h2 { margin-top: 2.2em; font-size: 1.35rem; }
.legal-body h2:first-child { margin-top: 0; }
.legal-body p, .legal-body li { color: var(--ink-soft); }
.legal-body ul { padding-left: 20px; }
.legal-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding: 20px 0 0;
}
.legal-toc a {
  font-size: 0.88rem;
  color: var(--ink-soft);
  border-bottom: 1px dotted var(--line);
}
.legal-toc a:hover { color: var(--violet); }
.updated-badge {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--violet-deep);
  background: var(--surface);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { max-width: 420px; margin: 0 auto; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .app-block, .app-block.reverse { grid-template-columns: 1fr; }
  .app-block.reverse .app-copy,
  .app-block.reverse .app-visual { order: initial; }
  .app-visual { order: -1; }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .screen-slot { width: 100px; }
  .hero-stats { gap: 24px; row-gap: 18px; flex-wrap: wrap; }
}

@media (max-width: 640px) {
  :root { --gutter: 18px; }

  section { padding: 56px 0; }
  .hero { padding: 64px 0 56px; }
  .section-head { margin-bottom: 32px; }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  p.lede { font-size: 1.02rem; }

  .nav { height: 66px; }
  .brand { font-size: 0.95rem; }
  .brand img { height: 28px; }
  .nav.open .nav-links { top: 66px; }

  .hero-art { max-width: 280px; }
  .icon-chip { border-radius: 18px; }
  .icon-chip.c1 { width: 56px; height: 56px; }
  .icon-chip.c2 { width: 78px; height: 78px; }
  .icon-chip.c3 { width: 62px; height: 62px; }
  .icon-chip.c4 { width: 66px; height: 66px; }

  .hero-stats { gap: 20px; margin-top: 36px; padding-top: 20px; }
  .hero-stats div strong { font-size: 1.3rem; }

  .app-block { padding: 40px 0; gap: 32px; }
  .app-heading img { width: 48px; height: 48px; }
  .app-heading h3 { font-size: 1.25rem; }

  .howto { padding: 16px 18px; }

  .contact-card { padding: 24px; }
  form.contact-form textarea { min-height: 96px; }

  .footer-row { flex-direction: column; align-items: flex-start; }
  .footer-links { gap: 16px; flex-wrap: wrap; }
}

@media (max-width: 380px) {
  .screen-slot { width: 84px; }
  .hero-stats { gap: 16px; }
  .hero-stats div strong { font-size: 1.15rem; }
  .hero-art { max-width: 240px; }
}
