/* ============================================
   Betelgeuse Software — design tokens
   ============================================ */
:root {
  --bg-deep: #0a1626;
  --bg-panel: #101f34;
  --bg-panel-2: #142a45;
  --navy: #16324f;
  --amber-1: #ffb020;
  --amber-2: #e8720c;
  --text-main: #f2efe6;
  --text-muted: #8fa3b8;
  --line: rgba(255, 255, 255, 0.08);

  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --container: 1160px;
}

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

body {
  margin: 0;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
  text-decoration: none;
}
ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ============================================
   Starfield background
   ============================================ */
#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

main,
.site-header,
.site-footer {
  position: relative;
  z-index: 1;
}

/* ============================================
   Typography helpers
   ============================================ */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--amber-1);
  margin: 0 0 12px;
  padding-left: 4px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.2;
  margin: 0 0 20px;
  max-width: 20ch;
}

.section-note {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  border-left: 2px solid var(--amber-2);
  padding-left: 12px;
  margin-top: -8px;
}

.grad-text {
  background: linear-gradient(100deg, var(--amber-1), var(--amber-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}
.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(100deg, var(--amber-1), var(--amber-2));
  color: #17130a;
  box-shadow: 0 8px 24px -8px rgba(232, 114, 12, 0.6);
}
.btn-primary:hover {
  box-shadow: 0 12px 28px -8px rgba(232, 114, 12, 0.75);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text-main);
}
.btn-ghost:hover {
  border-color: var(--amber-1);
}

.btn-small {
  padding: 9px 18px;
  font-size: 0.85rem;
}

/* ============================================
   Header
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(10, 22, 38, 0.7);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 32px;
  height: 32px;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.brand-name em {
  font-style: normal;
  color: var(--amber-1);
  font-weight: 500;
}

.main-nav {
  display: flex;
  gap: 28px;
}
.main-nav a {
  font-size: 0.9rem;
  color: #c9d1d9;
  position: relative;
  padding: 4px 0;
  transition: color 0.15s ease;
}
.main-nav a:hover {
  color: var(--amber-1);
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--amber-1);
  transition: width 0.2s ease;
}
.main-nav a:hover::after {
  width: 100%;
}

.nav-cta {
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  width: 100%;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
}

/* ============================================
   Hero
   ============================================ */
.hero {
  position: relative;
  padding: 100px 0 140px;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 22px;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 46ch;
  margin: 0 0 34px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}
.hero-glow {
  position: absolute;
  width: 380px;
  height: 380px;
  background: radial-gradient(
    circle,
    rgba(255, 176, 32, 0.16),
    transparent 65%
  );
  filter: blur(10px);
  animation: pulse-glow 5s ease-in-out infinite;
}
.hero-star {
  position: relative;
  width: min(340px, 70%);
  filter: drop-shadow(0 0 40px rgba(255, 176, 32, 0.22));
  animation: float-star 6s ease-in-out infinite;
}

@keyframes float-star {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-14px);
  }
}
@keyframes pulse-glow {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

.hero-trail {
  position: absolute;
  right: -10%;
  top: 20%;
  width: 60%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--amber-2) 40%,
    var(--amber-1)
  );
  opacity: 0.25;
  transform: rotate(-18deg);
  pointer-events: none;
}

/* ============================================
   Services
   ============================================ */
.services {
  padding: 100px 0;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.service-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px;
  position: relative;
  overflow: hidden;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}
.service-card:hover {
  border-color: rgba(255, 176, 32, 0.4);
  transform: translateY(-4px);
}
.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, var(--amber-1), transparent 70%);
  opacity: 0.15;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
.card-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--amber-1);
  display: block;
  margin-bottom: 14px;
}
.service-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 10px;
}
.service-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* ============================================
   About
   ============================================ */
.about {
  padding: 100px 0;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(255, 255, 255, 0.02),
    transparent
  );
}
.about-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 60px;
  align-items: start;
}
.about-copy p {
  color: var(--text-muted);
}

.about-points {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 8px;
}
.about-points li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-main);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber-1), var(--amber-2));
  flex-shrink: 0;
}

/* ============================================
   Portfolio
   ============================================ */
.portfolio {
  padding: 100px 0;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.portfolio-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}
.portfolio-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 176, 32, 0.4);
}
.portfolio-thumb {
  height: 150px;
  background: linear-gradient(135deg, var(--bg-panel-2), var(--navy));
  display: flex;
  align-items: center;
  justify-content: center;
}
.thumb-image {
  background: #f4f2ec;
  padding: 20px;
}
.thumb-image img {
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
.thumb-soon {
  background: repeating-linear-gradient(
    135deg,
    var(--bg-panel-2),
    var(--bg-panel-2) 10px,
    var(--navy) 10px,
    var(--navy) 20px
  );
}
.thumb-soon span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  color: var(--amber-1);
  background: rgba(10, 22, 38, 0.85);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 176, 32, 0.4);
}

/* BetelScope: thumb con brillo radial propio */
.thumb-scope {
  background:
    radial-gradient(
      circle at 50% 35%,
      rgba(255, 176, 32, 0.22),
      transparent 45%
    ),
    linear-gradient(135deg, var(--bg-panel-2), var(--navy));
}
.thumb-scope span,
.thumb-cuenty span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  color: var(--amber-1);
  background: rgba(10, 22, 38, 0.85);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 176, 32, 0.4);
}

/* Cuenty: thumb con trama diagonal y tinte propio */
.thumb-cuenty {
  background:
    linear-gradient(135deg, rgba(255, 176, 32, 0.12), transparent 45%),
    repeating-linear-gradient(
      135deg,
      var(--bg-panel-2),
      var(--bg-panel-2) 10px,
      var(--navy) 10px,
      var(--navy) 20px
    );
}

.portfolio-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 20px 22px 8px;
}
.portfolio-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 22px 22px;
}

.portfolio-link {
  display: inline-flex;
  margin: 0 22px 22px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--amber-1);
  border-bottom: 1px solid rgba(255, 176, 32, 0.45);
  transition:
    color 0.15s ease,
    border-color 0.15s ease;
}
.portfolio-link:hover {
  color: var(--amber-2);
  border-color: var(--amber-2);
}

/* ============================================
   Contact
   ============================================ */
.contact {
  padding: 100px 0 120px;
}

.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.contact-copy p {
  color: var(--text-muted);
}

.contact-methods {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 30px 0 16px;
}
.contact-method {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 20px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.15s ease;
}
.contact-method:hover {
  border-color: rgba(255, 176, 32, 0.4);
}
.contact-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--amber-1);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px;
}
.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.contact-form input,
.contact-form textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-main);
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--amber-1);
}
.contact-form button {
  align-self: flex-start;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.footer-mark {
  width: 22px;
  height: 22px;
  opacity: 0.8;
}

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

/* ============================================
   Focus visibility (accessibility)
   ============================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--amber-1);
  outline-offset: 2px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
  .hero-inner,
  .about-inner,
  .contact-inner {
    grid-template-columns: 1fr;
  }
  .hero-visual {
    order: -1;
    min-height: 220px;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .portfolio-grid {
    grid-template-columns: 1fr;
  }
  .main-nav {
    display: none;
  }
}

@media (max-width: 720px) {
  .main-nav {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 22, 38, 0.98);
    border-bottom: 1px solid var(--line);
    padding: 20px 24px;
    gap: 16px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition:
      opacity 0.2s ease,
      transform 0.2s ease;
  }
  .main-nav.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .nav-toggle {
    display: flex;
  }
  .nav-cta {
    display: none;
  }
}
