/* ============================================================
   COMPONENTS — frankgp.com
   Clases reutilizables (botones, badges, tags, terminal window,
   timeline, headers de sección, etc). Carga theme.css primero
   (define las variables de color/tipografía que estas clases usan).
   Referencia visual: /styleguide.html
============================================================ */

/* ---------- reset base ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}
a {
  color: inherit;
  text-decoration: none;
}
ul {
  list-style: none;
}
img {
  max-width: 100%;
  display: block;
}
h1,
h2,
h3 {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ---------- layout ---------- */
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

/* ---------- section header ---------- */
section {
  padding: 74px 0;
  border-top: 1px solid var(--border-soft);
}
.eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--cyan);
  text-transform: lowercase;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "//";
  color: var(--text-faint);
}
.sec-title {
  font-size: clamp(24px, 3vw, 32px);
  margin-bottom: 8px;
}
.sec-sub {
  color: var(--text-dim);
  font-size: 15.5px;
  margin-bottom: 40px;
  max-width: 560px;
}

/* ---------- buttons ---------- */
.btn {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  padding: 13px 20px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn-primary {
  background: var(--brand-green);
  color: #03150e;
}
.btn-primary:hover {
  background: #57e6ac;
}
.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}
.btn-lg {
  padding: 15px 26px;
  font-size: 15px;
}

/* ---------- badges / pills / tags ---------- */
.badge {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 5px;
}
.badge-live {
  background: var(--green-dim);
  color: var(--green);
}
.badge-cyan {
  background: var(--cyan-dim);
  color: var(--cyan);
}
.badge-amber {
  background: var(--amber-dim);
  color: var(--amber);
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid var(--green-border);
  padding: 6px 12px;
  border-radius: 999px;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.5);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(61, 220, 151, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(61, 220, 151, 0);
  }
}
.tag {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 6px;
  font-family: var(--mono);
  display: inline-block;
}

/* ---------- generic elevated card ---------- */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14.5px;
  margin-bottom: 6px;
}
.card-desc {
  font-size: 13.5px;
  color: var(--text-dim);
}

/* ---------- terminal window ---------- */
.terminal {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: var(--bg-elev-2);
  border-bottom: 1px solid var(--border);
}
.term-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.term-bar span:nth-child(1) {
  background: #ff5f56;
}
.term-bar span:nth-child(2) {
  background: #ffbd2e;
}
.term-bar span:nth-child(3) {
  background: #27c93f;
}
.term-title {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
}
.term-body {
  padding: 22px 20px 26px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.9;
}
.term-line {
  color: var(--text-dim);
}
.term-prompt {
  color: var(--green);
}
.term-out {
  color: var(--text);
}
.term-cyan {
  color: var(--cyan);
}
.cursor {
  display: inline-block;
  width: 7px;
  height: 15px;
  background: var(--cyan);
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ---------- timeline ---------- */
.timeline {
  display: flex;
  flex-direction: column;
  border-left: 2px solid var(--border);
  margin-left: 6px;
}
.tl-item {
  position: relative;
  padding: 0 0 34px 30px;
}
.tl-item:last-child {
  padding-bottom: 0;
}
.tl-item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--cyan);
}
.tl-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cyan);
  margin-bottom: 5px;
  letter-spacing: 0.02em;
}
.tl-role {
  font-family: var(--mono);
  font-size: 15.5px;
  font-weight: 700;
  margin-bottom: 3px;
}
.tl-org {
  font-size: 13.5px;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.tl-desc {
  font-size: 14px;
  color: var(--text-dim);
  max-width: 640px;
}

/* ---------- theme toggle ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  flex-shrink: 0;
  transition:
    color 0.15s ease,
    border-color 0.15s ease;
}
.theme-toggle:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}
.theme-toggle svg {
  width: 16px;
  height: 16px;
}
.theme-toggle .icon-moon {
  display: none;
}
:root[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}
:root[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .icon-sun {
    display: none;
  }
  :root:not([data-theme="dark"]) .theme-toggle .icon-moon {
    display: block;
  }
}

/* ---------- language toggle ---------- */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    color 0.15s ease,
    border-color 0.15s ease;
}
.lang-toggle:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}

/* ---------- icon link (github/linkedin/etc in header) ---------- */
.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  flex-shrink: 0;
  transition:
    color 0.15s ease,
    border-color 0.15s ease;
}
.icon-link:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}
.icon-link svg {
  width: 16px;
  height: 16px;
}

/* ---------- page nav select (flotante, esquina inferior derecha) ---------- */
.page-nav-select {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-dim);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  appearance: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%2395a3b3' stroke-width='1.5'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 26px;
}
.page-nav-select:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}
.page-nav-select option {
  background: var(--bg-elev);
  color: var(--text);
}

/* ---------- accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
