/* ============================================================
   ADVANCEDFLOW — Portafolio
   Paleta tomada del logo:
     navy  #0F3A66   (palabra "Advanced")
     azul  #1B82C7   (palabra "Flow")
     cyan  #29A3DC   (el símbolo / swoosh)
   Tipografías: Playfair Display (wordmark + títulos), Inter (UI).
   ============================================================ */

:root {
  --navy: #0F3A66;
  --navy-deep: #0A2949;
  --blue: #1B82C7;
  --blue-light: #2FA0DA;

  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-alt: #eef3f9;
  --border: #dde5f0;
  --border-hi: #c3d2e5;

  --text: #0e2440;
  --text-dim: #4d6480;
  --text-faint: #7b8da3;

  --radius: 14px;
  --maxw: 1160px;
  --shadow: 0 1px 2px rgba(15, 58, 102, .05), 0 8px 24px rgba(15, 58, 102, .06);
  --shadow-hi: 0 2px 4px rgba(15, 58, 102, .07), 0 16px 40px rgba(15, 58, 102, .12);

  --serif: "Playfair Display", "Georgia", "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(41, 163, 220, .16), transparent 62%),
    radial-gradient(760px 420px at 92% -4%, rgba(15, 58, 102, .10), transparent 62%);
  pointer-events: none;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Logo / wordmark ---------- */

.logo-img { height: 34px; width: auto; display: block; }

.wordmark {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--serif);
  font-weight: 800;
  letter-spacing: -.015em;
  line-height: 1;
  white-space: nowrap;
}

/* Sin esto, el display:flex de arriba le gana al [hidden] del navegador
   y el wordmark de respaldo se vería junto al logo oficial. */
.wordmark[hidden] { display: none; }

.wordmark .af-mark { width: 1.35em; height: 1.35em; flex: none; }

.wordmark--inline {
  display: inline-flex;
  gap: 0;
  font-size: .95rem;
  vertical-align: -1px;
}
.wordmark .adv { color: var(--navy); }
.wordmark .flow { color: var(--blue); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, .82);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}

.site-header .wordmark { font-size: 1.32rem; }

.header-tag {
  font-family: var(--sans);
  color: var(--text-faint);
  font-size: .8rem;
  letter-spacing: .11em;
  text-transform: uppercase;
  font-weight: 500;
  padding-left: 14px;
  margin-left: 4px;
  border-left: 1px solid var(--border-hi);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-count {
  color: var(--text-faint);
  font-size: .84rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- Selector de idioma ---------- */

.lang-switch {
  display: flex;
  gap: 2px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
}

.lang {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}

.lang:hover { color: var(--navy); }

.lang[aria-pressed="true"] {
  background: var(--surface);
  color: var(--navy);
  box-shadow: 0 1px 3px rgba(15, 58, 102, .14);
}

.brand-lockup { display: flex; align-items: center; }

/* ---------- Hero ---------- */

.hero { padding: 82px 0 46px; }

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5.6vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: -.025em;
  font-weight: 800;
  max-width: 19ch;
  color: var(--navy);
}

.hero h1 .grad {
  background: linear-gradient(100deg, var(--blue), var(--blue-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  margin-top: 20px;
  color: var(--text-dim);
  font-size: 1.06rem;
  max-width: 62ch;
}

.hero p strong { color: var(--navy); font-weight: 600; }

.hero-stats {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.stat {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 13px 20px;
  min-width: 116px;
  box-shadow: var(--shadow);
}

.stat b {
  display: block;
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.stat span {
  color: var(--text-faint);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 600;
}

/* ---------- Controls ---------- */

.controls {
  position: sticky;
  top: 68px;
  z-index: 15;
  background: rgba(246, 248, 252, .9);
  backdrop-filter: blur(12px);
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 4px;
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: .9rem;
  font-weight: 550;
  padding: 7px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
}

.tab:hover { color: var(--navy); }

.tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--navy);
  box-shadow: 0 1px 3px rgba(15, 58, 102, .12);
}

.tab .n {
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
  font-size: .82em;
}

.search {
  flex: 1 1 220px;
  min-width: 180px;
  position: relative;
}

.search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  font-size: .9rem;
  padding: 10px 14px 10px 37px;
  border-radius: 11px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.search input::placeholder { color: var(--text-faint); }

.search input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(27, 130, 199, .14);
}

.search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-faint);
  pointer-events: none;
}

/* ---------- Sections & grid ---------- */

main { padding-bottom: 90px; }

.section { padding-top: 48px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-head h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: -.02em;
  font-weight: 800;
  color: var(--navy);
}

.section-head .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  align-self: center;
}

.section-head .dot.software { background: var(--navy); }
.section-head .dot.web { background: var(--blue-light); }

.section-head .meta {
  color: var(--text-faint);
  font-size: .85rem;
  margin-left: auto;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}

/* ---------- Card ---------- */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--blue), var(--blue-light));
  opacity: 0;
  transition: opacity .18s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hi);
  box-shadow: var(--shadow-hi);
}

.card:hover::before { opacity: 1; }

.card.is-clickable { cursor: pointer; }

.card.is-clickable:hover h3 { color: var(--blue); }

/* Capa invisible que cubre toda la tarjeta y abre el sitio del proyecto. */
.card-cover {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--radius);
}

.card-cover:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -3px;
}

/* Los links del pie quedan por encima para seguir siendo clickeables aparte. */
.card-foot .links { position: relative; z-index: 2; }

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -.015em;
  color: var(--navy);
}

.card .tagline {
  color: var(--text-dim);
  font-size: .88rem;
  margin-top: 4px;
}

.card .desc {
  color: var(--text-dim);
  font-size: .88rem;
  margin-top: 14px;
  flex: 1;
}

.badge {
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}

.badge.produccion { color: #167a4a; border-color: #b7e2cc; background: #eafaf1; }
.badge.desarrollo { color: #9a6300; border-color: #f2ddb0; background: #fdf6e6; }
.badge.mvp        { color: var(--blue); border-color: #bcdff3; background: #eaf5fc; }
.badge.pausado    { color: #64748b; border-color: #dbe2ea; background: #f2f5f9; }

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.chip {
  font-size: .74rem;
  color: var(--navy);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px 9px;
  font-weight: 500;
}

.card-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: .8rem;
  color: var(--text-faint);
}

.card-foot .links {
  margin-left: auto;
  display: flex;
  gap: 12px;
}

.card-foot a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-foot a:hover { text-decoration: underline; }

/* ---------- Empty state ---------- */

.empty {
  border: 1px dashed var(--border-hi);
  border-radius: var(--radius);
  padding: 52px 24px;
  text-align: center;
  color: var(--text-faint);
  font-size: .92rem;
  background: var(--surface);
}

.hidden { display: none !important; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
  color: var(--text-faint);
  font-size: .84rem;
  background: var(--surface);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.site-footer code {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: .92em;
  color: var(--navy);
}

@media (max-width: 640px) {
  .hero { padding: 54px 0 32px; }
  .header-tag, .header-count { display: none; }
  .site-header .wordmark { font-size: 1.15rem; }
  .grid { grid-template-columns: 1fr; }
}
