/* Rua dos Bytes — shared design system (neon-pop rebrand, #247)
   Electric cyan + magenta, dark-first with neon glow. Light is a toned-down
   "neon on white" variant. Self-hosted variable fonts. */

@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk-latin-wght.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---- Design tokens: DARK is the default (dark-first) -------------------- */
:root {
  --bg:          #0a0a12;
  --surface:     #14162b;
  --ink:         #eaf6ff;
  --muted:       #9aa7c7;
  --accent:      #00e5ff;   /* cyan — links, fills, decoration */
  --accent-text: #00e5ff;   /* cyan reads great as text on dark */
  --accent-2:    #ff2d9b;   /* magenta — decoration, top-lines */
  --accent-2-text:#ff5cb0;  /* magenta as tag text on dark */
  --btn-text:    #06070f;   /* near-black text on cyan fills */
  --border:      #262a45;

  --glow-cyan:    0 0 22px rgba(0, 229, 255, .45);
  --glow-magenta: 0 0 22px rgba(255, 45, 155, .40);
  --hero-glow:    0 0 32px rgba(0, 229, 255, .28);
  --shadow:       0 1px 2px rgba(0,0,0,.4), 0 14px 34px -14px rgba(0,0,0,.7);
  --shadow-lift:  0 2px 4px rgba(0,0,0,.5), 0 24px 52px -16px rgba(0,0,0,.85);

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;

  --maxw: 1120px;
  --radius: 16px;
  --radius-sm: 10px;
}

/* Toned-down light variant (opt-in via the toggle) */
:root[data-theme="light"] {
  --bg:          #f3f6fc;
  --surface:     #ffffff;
  --ink:         #0d1120;
  --muted:       #55607a;
  --accent:      #12cdeb;   /* bright cyan for fills */
  --accent-text: #0e7490;   /* deeper cyan for legible link text */
  --accent-2:    #ff2d9b;
  --accent-2-text:#c01f77;
  --btn-text:    #06070f;
  --border:      #e2e7f2;

  --glow-cyan:    0 0 14px rgba(18, 205, 235, .35);
  --glow-magenta: 0 0 14px rgba(255, 45, 155, .28);
  --hero-glow:    none;
  --shadow:       0 1px 2px rgba(13,17,32,.05), 0 12px 32px -12px rgba(13,17,32,.16);
  --shadow-lift:  0 2px 4px rgba(13,17,32,.07), 0 22px 48px -16px rgba(13,17,32,.22);
}

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

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

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .3s ease, color .3s ease;
}

/* subtle neon aura behind the page top, dark mode only */
body::before {
  content: "";
  position: fixed;
  inset: -20% -20% auto -20%;
  height: 60vh;
  background:
    radial-gradient(60% 60% at 20% 0%, rgba(0,229,255,.10), transparent 70%),
    radial-gradient(50% 50% at 85% 5%, rgba(255,45,155,.10), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
:root[data-theme="light"] body::before { opacity: .5; }

.container { position: relative; z-index: 1; }

a { color: var(--accent-text); }

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--btn-text);
  padding: .65rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
  font-weight: 700;
}
.skip-link:focus { left: 0; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

/* ---- Site header -------------------------------------------------------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-block: .5rem 1.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  color: var(--ink);
}
.brand:hover .brand-name { color: var(--accent-text); }
.brand-mark {
  width: 38px; height: 38px;
  flex: 0 0 auto;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface);
  box-shadow: var(--glow-cyan);
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: -.02em;
  transition: color .2s ease;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}
.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: .95rem;
  padding: .5rem .85rem;
  border-radius: 999px;
  transition: color .2s ease, background-color .2s ease;
}
.nav-link:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }

.ctl {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .85rem;
  padding: .45rem .7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease, transform .1s ease;
}
.ctl:hover { border-color: var(--accent); box-shadow: var(--glow-cyan); }
.ctl:active { transform: translateY(1px); }
.ctl svg { width: 16px; height: 16px; display: block; }

/* theme icons: dark base shows the sun (switch → light); light shows the moon */
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }

/* ---- Hero --------------------------------------------------------------- */
.hero {
  padding-block: clamp(1rem, 5vw, 3rem) clamp(2rem, 6vw, 3.5rem);
  max-width: 46ch;
}
.hero .eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 1rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -.03em;
  margin-bottom: 1rem;
  text-shadow: var(--hero-glow);
}
.hero .lead {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--muted);
  max-width: 42ch;
}

/* ---- Section heading ---------------------------------------------------- */
.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -.02em;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* ---- Projects grid ------------------------------------------------------ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px rgba(0,229,255,.5);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift), var(--glow-cyan);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
}
.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -.02em;
}
.card-domain {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--muted);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  border: 1px solid var(--border);
  padding: .18rem .5rem;
  border-radius: 6px;
  white-space: nowrap;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1rem;
}
.tag {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--accent-2-text);
  background: color-mix(in srgb, var(--accent-2) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-2) 30%, transparent);
  padding: .22rem .6rem;
  border-radius: 999px;
}

.card-desc {
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.features {
  list-style: none;
  margin-bottom: 1.5rem;
  display: grid;
  gap: .5rem;
}
.features li {
  position: relative;
  padding-left: 1.6rem;
  font-size: .95rem;
}
.features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .5em;
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(0,229,255,.7);
  transform: rotate(45deg);
}

.btn {
  align-self: flex-start;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--accent);
  color: var(--btn-text);
  text-decoration: none;
  font-weight: 700;
  font-size: .95rem;
  padding: .7rem 1.4rem;
  border-radius: 999px;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
  box-shadow: var(--glow-cyan);
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 0 30px rgba(0,229,255,.6); }
.btn svg { width: 15px; height: 15px; transition: transform .2s ease; }
.btn:hover svg { transform: translate(2px, -2px); }

/* ---- About page --------------------------------------------------------- */
.prose {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 3rem);
  box-shadow: var(--shadow);
}
.prose h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 4vw, 2rem);
  letter-spacing: -.02em;
  margin-bottom: 1.25rem;
}
.prose h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -.01em;
  margin: 2.25rem 0 1rem;
}
.prose p { color: var(--muted); margin-bottom: 1.25rem; }
.prose strong { color: var(--ink); font-weight: 600; }

.callout {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-left: 3px solid var(--accent);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.callout p { margin: 0; color: var(--ink); }

.booths {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 1.75rem 0;
}
.booth {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.35rem;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.booth:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: var(--glow-cyan); }
.booth h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: .3rem;
}
.booth .niche { color: var(--accent-2-text); font-weight: 700; font-size: .82rem; margin-bottom: .6rem; }
.booth p { font-size: .92rem; margin: 0; }

.philosophy {
  background: color-mix(in srgb, var(--accent-2) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-2) 22%, transparent);
  border-radius: var(--radius-sm);
  padding: clamp(1.5rem, 3vw, 2rem);
  margin: 2rem 0;
}
.philosophy h3 { color: var(--accent-2-text); margin-top: 0; }
.philosophy ul { margin: 1rem 0 0; padding-left: 1.3rem; color: var(--muted); }
.philosophy li { margin-bottom: .5rem; }

/* ---- Footer ------------------------------------------------------------- */
.site-footer {
  margin-top: clamp(3rem, 8vw, 5rem);
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .92rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent-text); }

/* ---- Motion / responsiveness ------------------------------------------- */
@media (max-width: 560px) {
  .site-header { padding-bottom: 1.25rem; }
  .header-controls { width: 100%; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .card:hover, .booth:hover, .btn:hover { transform: none; }
}
