/* =========================================================
   Cadú Software S.L. — cadu.info
   ========================================================= */

:root {
  --bg:           #080c15;
  --bg-raised:    #0f1623;
  --bg-card:      #111827;
  --bg-card-hover:#161f33;
  --border:       #1a2540;
  --border-strong:#243354;
  --text:         #c8d3e8;
  --text-dim:     #5d7399;
  --text-bright:  #eef2fb;
  --accent:       #4f8ef7;
  --accent-dim:   #1d4ed8;
  --accent-glow:  rgba(79, 142, 247, 0.12);
  --teal:         #2dd4bf;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --content-w: 900px;
  --radius: 10px;
  --radius-sm: 6px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Animated gradient orbs ── */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.55;
}

.bg-orb-1 {
  width: 700px;
  height: 700px;
  top: -200px;
  left: -150px;
  background: radial-gradient(circle, #1a3a8f 0%, #0d1f5e 50%, transparent 75%);
  animation: drift1 32s ease-in-out infinite;
}

.bg-orb-2 {
  width: 600px;
  height: 600px;
  bottom: -150px;
  right: -100px;
  background: radial-gradient(circle, #0d5a6e 0%, #073d4e 50%, transparent 75%);
  animation: drift2 38s ease-in-out infinite;
}

.bg-orb-3 {
  width: 400px;
  height: 400px;
  top: 50%;
  left: 60%;
  background: radial-gradient(circle, #2a1060 0%, transparent 70%);
  animation: drift3 28s ease-in-out infinite;
  opacity: 0.35;
}

@keyframes drift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(60px, 80px) scale(1.05); }
  66%       { transform: translate(-40px, 40px) scale(0.97); }
}
@keyframes drift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40%       { transform: translate(-70px, -50px) scale(1.08); }
  70%       { transform: translate(30px, -80px) scale(0.95); }
}
@keyframes drift3 {
  0%, 100% { transform: translate(0, 0); }
  50%       { transform: translate(-120px, 60px); }
}

a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
img { max-width: 100%; display: block; }
ul { padding-left: 1.3em; }

h1, h2, h3, h4 {
  font-family: var(--font);
  color: var(--text-bright);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1.2em; }

.container {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 32px;
}

/* =================== NAV =================== */

.sitenav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(8, 12, 21, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.sitenav-inner {
  max-width: var(--content-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 60px;
}

.sitenav-brand {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.sitenav-brand:hover { color: var(--accent); text-decoration: none; }
.sitenav-brand span { color: var(--accent); }

.sitenav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.sitenav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}
.sitenav-links a:hover,
.sitenav-links a.is-active { color: var(--text-bright); background: rgba(255,255,255,0.05); text-decoration: none; }
.sitenav-links a.is-active { color: var(--accent); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text);
}

@media (max-width: 640px) {
  .sitenav-links { display: none; flex-direction: column; gap: 2px; }
  .sitenav-links.is-open {
    display: flex;
    position: absolute;
    top: 60px; left: 0; right: 0;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    z-index: 99;
  }
  .sitenav-links a { width: 100%; padding: 10px 14px; }
  .nav-toggle { display: block; }
}

/* =================== HERO + ENTRANCE ANIMATIONS =================== */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 32px 80px;
  text-align: center;
}

.hero-inner {
  max-width: var(--content-w);
  margin: 0 auto;
  width: 100%;
}

/* Entrance — each child staggers in via a class applied on load */
.hero-eyebrow,
.hero-name,
.hero-tagline,
.hero-cta,
.scroll-cue {
  opacity: 0;
  transform: translateY(24px);
}

.hero-enter .hero-eyebrow  { animation: fadeUp 0.7s ease 0.1s forwards; }
.hero-enter .hero-name     { animation: fadeUp 0.7s ease 0.25s forwards; }
.hero-enter .hero-tagline  { animation: fadeUp 0.7s ease 0.4s forwards; }
.hero-enter .hero-cta      { animation: fadeUp 0.7s ease 0.55s forwards; }
.hero-enter .scroll-cue    { animation: fadeUp 0.7s ease 0.75s forwards; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.hero-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(79, 142, 247, 0.22);
  border-radius: 999px;
  padding: 5px 16px;
  margin-bottom: 28px;
}

.hero-name {
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--text-bright);
  /* text gradient */
  background: linear-gradient(135deg, #eef2fb 30%, #4f8ef7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: clamp(19px, 2.8vw, 24px);
  font-weight: 400;
  color: var(--text-dim);
  max-width: 580px;
  margin: 0 auto 40px;
  line-height: 1.55;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: var(--radius);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  box-shadow: 0 0 0 0 rgba(79, 142, 247, 0);
}
.hero-cta:hover, .hero-cta:focus-visible {
  background: #3b7de8;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(79, 142, 247, 0.35);
}

.scroll-cue {
  margin-top: 64px;
  display: flex;
  justify-content: center;
}
.scroll-cue a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.scroll-cue svg { animation: bob 2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* =================== SECTIONS =================== */

section {
  padding: 100px 0;
  border-top: 1px solid var(--border);
}

/* Scroll reveal — base state */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* Staggered card children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.stagger-children.is-visible > *:nth-child(1) { opacity: 1; transform: none; transition-delay: 0ms; }
.stagger-children.is-visible > *:nth-child(2) { opacity: 1; transform: none; transition-delay: 80ms; }
.stagger-children.is-visible > *:nth-child(3) { opacity: 1; transform: none; transition-delay: 160ms; }
.stagger-children.is-visible > *:nth-child(4) { opacity: 1; transform: none; transition-delay: 240ms; }
.stagger-children.is-visible > *:nth-child(5) { opacity: 1; transform: none; transition-delay: 320ms; }
.stagger-children.is-visible > *:nth-child(6) { opacity: 1; transform: none; transition-delay: 400ms; }
.stagger-children.is-visible > *:nth-child(7) { opacity: 1; transform: none; transition-delay: 480ms; }
.stagger-children.is-visible > *:nth-child(8) { opacity: 1; transform: none; transition-delay: 560ms; }

.section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

section > .container > h2 {
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-lead {
  font-size: 19px;
  color: var(--text-dim);
  max-width: 620px;
  margin-bottom: 48px;
}

/* =================== ABOUT =================== */

.about-intro {
  font-size: 19px;
  color: var(--text-dim);
  max-width: 720px;
  margin-bottom: 48px;
  line-height: 1.75;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 580px) { .about-grid { grid-template-columns: 1fr; } }

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  transition: border-color 0.25s, background 0.25s, transform 0.25s, box-shadow 0.25s;
}
.about-card:hover {
  border-color: rgba(79, 142, 247, 0.4);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.3), 0 0 0 1px rgba(79,142,247,0.1);
}

.about-card-icon { font-size: 24px; margin-bottom: 14px; }
.about-card h3 { font-size: 17px; font-weight: 700; color: var(--text-bright); margin-bottom: 8px; }
.about-card p  { font-size: 15px; color: var(--text-dim); margin: 0; line-height: 1.6; }

/* =================== PROJECTS =================== */

.section-lead { font-size: 19px; color: var(--text-dim); margin-bottom: 40px; }

.project-cats { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.project-cat-label {
  font-size: 13px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-dim);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 14px;
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 36px;
}
@media (max-width: 580px) { .project-grid { grid-template-columns: 1fr; } }

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s, background 0.25s, transform 0.25s, box-shadow 0.25s;
}
.project-card:hover {
  border-color: rgba(79, 142, 247, 0.45);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.3), 0 0 0 1px rgba(79,142,247,0.1);
}
.project-card h3 { font-size: 15px; font-weight: 700; color: var(--text-bright); margin-bottom: 8px; line-height: 1.4; }
.project-card p  { font-size: 14.5px; color: var(--text-dim); margin-bottom: 14px; line-height: 1.6; flex: 1; }

.project-tech { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tech-tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent);
  background: var(--accent-glow);
  border-radius: 4px;
  padding: 2px 7px;
}

/* =================== QUALITY =================== */

.quality-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}
@media (max-width: 580px) { .quality-grid { grid-template-columns: 1fr; } }

.quality-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.quality-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.quality-card h3 { font-size: 18px; font-weight: 700; color: var(--text-bright); margin-bottom: 10px; }
.quality-card p  { font-size: 16px; color: var(--text-dim); margin: 0; line-height: 1.65; }

.practices-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
@media (max-width: 580px) { .practices-list { grid-template-columns: 1fr; } }

.practices-list li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 16px; color: var(--text-dim); line-height: 1.5;
}
.practices-list li::before {
  content: ""; flex-shrink: 0;
  width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent); margin-top: 9px;
}

/* =================== CONTACT =================== */

.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 640px) { .contact-wrapper { grid-template-columns: 1fr; gap: 28px; } }

.contact-blurb { font-size: 19px; color: var(--text-dim); line-height: 1.7; margin: 0; }

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  display: flex; flex-direction: column; gap: 20px;
}

.contact-item { display: flex; flex-direction: column; gap: 4px; }
.contact-item-label {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim);
}
.contact-item a { font-size: 17px; color: var(--text-bright); font-weight: 500; }
.contact-item a:hover { color: var(--accent); }

/* =================== FOOTER =================== */

footer.site-footer {
  padding: 40px 0 52px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer-social { display: flex; justify-content: center; gap: 12px; margin-bottom: 16px; }
.footer-social a {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: 50%; color: var(--text-dim);
  transition: color 0.15s, border-color 0.15s;
}
.footer-social a:hover, .footer-social a:focus-visible {
  color: var(--accent); border-color: var(--accent); text-decoration: none;
}

.footer-copy { font-size: 14px; color: var(--text-dim); }

/* =================== RESPONSIVE =================== */

@media (max-width: 640px) {
  body { font-size: 16px; }
  section { padding: 72px 0; }
  .hero { padding-top: 96px; }
  .container { padding: 0 20px; }
  .sitenav-inner { padding: 0 20px; }
}
