/* =====================================================================
   Kron Studios — Web3 Frontend Agency
   Design system + component styles (mobile-first)
   ===================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Surfaces */
  --bg: #010f3d;
  --bg-deep: #020617;
  --panel: #0b1330;
  --panel-2: #0d1738;
  --card: #0d1426;
  --hairline: rgba(148, 173, 255, 0.14);
  --hairline-strong: rgba(148, 173, 255, 0.24);

  /* Text (contrast-checked against navy surfaces for WCAG AA) */
  --text: #f8fafc;
  --text-soft: #d6def0;
  --text-muted: #a9b6d4;

  /* Brand accents */
  --cyan: #22d3ee;
  --cyan-bright: #67e8f9;
  --purple: #a855f7;
  --gradient: linear-gradient(135deg, #22d3ee 0%, #a855f7 100%);
  --gradient-soft: linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(168, 85, 247, 0.16));

  /* Radii */
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  /* Shadows / glow */
  --glow: 0 24px 80px rgba(14, 165, 233, 0.12);
  --glow-strong: 0 30px 90px rgba(99, 102, 241, 0.28);

  /* Spacing scale */
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4.5rem;
  --space-8: 6.5rem;

  /* Layout */
  --maxw: 1180px;
  --gutter: clamp(1.15rem, 4vw, 2.5rem);

  /* Fonts */
  --font-display: "Orbitron", system-ui, sans-serif;
  --font-head: "Rajdhani", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-soft);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 620px at 82% -8%, rgba(168, 85, 247, 0.20), transparent 60%),
    radial-gradient(1000px 640px at 6% 4%, rgba(34, 211, 238, 0.16), transparent 58%),
    linear-gradient(180deg, #010f3d 0%, #020a24 60%, #01040f 100%);
  background-attachment: fixed;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

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

ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--cyan-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Utilities ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: -60px;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--cyan);
  color: #021018;
  font-weight: 700;
  padding: 0.6rem 1.1rem;
  border-radius: var(--r-pill);
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  padding: 0.85rem 1.5rem;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  will-change: transform;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { transform: translateY(-2px); }

.btn--primary {
  background: var(--gradient);
  color: #041018;
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 12px 34px rgba(34, 211, 238, 0.28);
}
.btn--primary:hover { box-shadow: 0 18px 44px rgba(168, 85, 247, 0.36); }

.btn--ghost {
  background: rgba(15, 23, 42, 0.6);
  color: var(--text);
  border-color: var(--hairline-strong);
}
.btn--ghost:hover { border-color: var(--cyan); color: var(--cyan-bright); }

.btn--lg { padding: 1rem 1.9rem; font-size: 1rem; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(2, 8, 30, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.site-header.is-scrolled {
  background: rgba(2, 8, 30, 0.85);
  border-bottom-color: var(--hairline);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: 0.02em;
  color: var(--text);
}
.brand__mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--gradient);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.55);
  flex: none;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 2rem);
}
.nav__links a {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.18s ease;
}
.nav__links a:hover { color: var(--text); }
.nav__actions { display: flex; align-items: center; gap: 0.75rem; }

/* CTA shown only inside the mobile menu; desktop uses the nav__actions button */
.nav__cta { display: none; }

.nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(148, 173, 255, 0.45);
  border-radius: 12px;
  background: rgba(13, 20, 38, 0.92);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.nav__toggle span {
  position: relative;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav__toggle span::before,
.nav__toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease;
}
.nav__toggle span::before { top: -6px; }
.nav__toggle span::after { top: 6px; }
.nav__toggle[aria-expanded="true"] span { background: transparent; }
.nav__toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Section rhythm ---------- */
.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section__head { max-width: 720px; margin-bottom: clamp(2rem, 5vw, 3.25rem); }
.section__head .eyebrow { margin-bottom: 0.9rem; }

h1, h2 { font-family: var(--font-display); font-weight: 700; color: var(--text); }
.h1 {
  font-size: clamp(2.2rem, 6vw, 3.9rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
}
.h2 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
}
.lead { font-size: clamp(1rem, 2vw, 1.15rem); color: var(--text-muted); line-height: 1.7; }

.grad-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(3.5rem, 9vw, 7rem); }
.hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.45rem 0.85rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline);
  background: var(--gradient-soft);
  color: var(--cyan-bright);
}
.chip--muted { color: var(--text-muted); background: rgba(148, 163, 184, 0.08); }
.hero__title { max-width: 16ch; margin-bottom: 1.35rem; }
.hero__copy { max-width: 60ch; margin-bottom: 2rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 2.5rem; }

.hero__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--hairline);
}
.hero__trust li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.hero__trust svg { width: 18px; height: 18px; color: var(--cyan); flex: none; }

/* ---------- Card grid (services / stack support) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.75rem;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--glow);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--hairline-strong);
  box-shadow: var(--glow-strong);
}
.card__icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.22);
  color: var(--cyan-bright);
  flex: none;
}
.card__icon svg { width: 24px; height: 24px; }
.card__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--text);
}
.card__body { font-size: 0.94rem; color: var(--text-muted); line-height: 1.6; margin: 0; }
.card--wide { grid-column: span 2; }

/* ---------- Process steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
  counter-reset: step;
}
.step {
  position: relative;
  padding: 2rem 1.75rem;
  background: linear-gradient(180deg, rgba(13, 20, 38, 0.9), rgba(9, 14, 30, 0.9));
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.step::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--gradient);
  opacity: 0.8;
}
.step__num {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 3rem;
  line-height: 1;
  color: var(--cyan-bright);
  margin-bottom: 0.75rem;
}
.step:nth-child(2) .step__num { color: var(--purple); }
.step:nth-child(3) .step__num { color: var(--cyan); }
.step__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.55rem;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 0.6rem;
}
.step__body { font-size: 0.94rem; color: var(--text-muted); margin: 0; }

/* ---------- Expertise ---------- */
.expertise {
  background:
    linear-gradient(180deg, rgba(10, 16, 40, 0.65), rgba(6, 10, 28, 0.65));
  border-block: 1px solid var(--hairline);
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.75rem 2.25rem;
}
.feature { display: flex; flex-direction: column; gap: 0.6rem; }
.feature__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--gradient-soft);
  color: var(--cyan-bright);
  margin-bottom: 0.4rem;
}
.feature__icon svg { width: 22px; height: 22px; }
.feature h3 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
}
.feature p { font-size: 0.94rem; color: var(--text-muted); margin: 0; }

/* ---------- Stack ---------- */
.stack-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 1rem;
  margin-bottom: 2.25rem;
}
.tile {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.15rem 1.35rem;
  background: rgba(13, 20, 38, 0.7);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.tile:hover { border-color: var(--hairline-strong); transform: translateY(-2px); }
.tile__dot {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex: none;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.35);
}
.tile--angular .tile__dot { background: linear-gradient(135deg, #dd0031, #c3002f); box-shadow: 0 0 16px rgba(221, 0, 49, 0.45); }
.tile--react .tile__dot { background: linear-gradient(135deg, #61dafb, #22d3ee); }
.tile--web3 .tile__dot { background: var(--gradient); }
.tile p { font-size: 0.92rem; font-weight: 600; color: var(--text-soft); margin: 0; }

.stack-libs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 1.5rem;
  padding: 1.75rem;
  margin-bottom: 2.25rem;
  background: rgba(9, 14, 30, 0.6);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
}
.lib-col__title {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.9rem;
}
.tech-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tech {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-soft);
  padding: 0.4rem 0.75rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline);
  background: rgba(148, 163, 184, 0.06);
}
.tech--accent {
  color: var(--cyan-bright);
  border-color: rgba(34, 211, 238, 0.35);
  background: var(--gradient-soft);
}

/* Screen-reader-only text */
.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;
}

/* ---------- Contact footer ---------- */
.contact {
  text-align: center;
  padding-block: clamp(4rem, 10vw, 7rem);
  border-top: 1px solid var(--hairline);
  background: radial-gradient(700px 320px at 50% 0%, rgba(168, 85, 247, 0.18), transparent 70%);
}
.contact__inner { max-width: 720px; margin-inline: auto; }
.contact h2 { margin-bottom: 1.1rem; }
.contact .lead { margin-bottom: 2rem; }
.contact__cta { display: inline-flex; }
.footer-meta {
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------- Decorative Ethereum token (scroll-driven) ---------- */
.bg-token {
  position: fixed;
  top: 50%;
  left: 50%;
  width: clamp(220px, 26vw, 380px);
  height: auto;
  opacity: 0.12;
  color: var(--cyan);
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  will-change: transform;
}
.site-header, main, .contact { position: relative; z-index: 1; }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive: tablet/mobile nav ---------- */
@media (max-width: 860px) {
  .nav__toggle { display: inline-flex; }
  .nav__links,
  .nav .btn { display: none; }

  .nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.25rem;
    background: rgba(3, 9, 30, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--hairline);
  }
  .nav__links.is-open { display: flex; }
  .nav__cta { display: block; width: 100%; }
  .nav__links a:not(.btn) {
    width: 100%;
    padding: 0.85rem 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--hairline);
  }
  .nav__links .btn {
    display: inline-flex;
    margin-top: 1rem;
    width: 100%;
    justify-content: center;
  }
  .card--wide { grid-column: span 1; }
}

@media (max-width: 520px) {
  .hero__actions .btn { width: 100%; justify-content: center; }
  .bg-token { display: none; }
}

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