/* ============================================================
   PROYECTO FREELANCE — style.css
   ============================================================ */

/* ── Fuentes locales ────────────────────────────────────────── */
@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-SemiBold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-ExtraBold.otf') format('opentype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Royalty';
  src: url('../fonts/Royalty.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:            #0e1529;
  --bg-card:       #131d35;
  --bg-card-hover: #162040;
  --accent:        #ff7200;
  --accent-glow:   rgba(255, 114, 0, 0.18);
  --accent-glow-s: rgba(255, 114, 0, 0.08);
  --text:          #ffffff;
  --text-sec:      #bfc7d5;
  --text-muted:    #7a8499;
  --border:        rgba(255, 114, 0, 0.15);
  --border-subtle: rgba(255, 255, 255, 0.07);
  --font:          'Montserrat', sans-serif;
  --font-script:   'Royalty', cursive;
  --radius:        12px;
  --radius-lg:     20px;
  --transition:    0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-card:   0 4px 32px rgba(0, 0, 0, 0.35);
  --shadow-glow:   0 0 40px rgba(255, 114, 0, 0.15);
  --max-w:         1200px;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Utility ────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

.section-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-sec);
  max-width: 560px;
  margin-top: 0.75rem;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.75rem;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(255, 114, 0, 0.35);
}
.btn-primary:hover {
  background: #ff8a2e;
  box-shadow: 0 6px 28px rgba(255, 114, 0, 0.5);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border-subtle);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 1rem 2.25rem;
  font-size: 1rem;
}

/* ── Header ─────────────────────────────────────────────────── */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0.75rem 0;
  background: #0e1529;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  color: var(--accent);
  line-height: 1;
}
.logo-icon .fa-globe { font-size: 1.9rem; }
.logo-bracket {
  font-family: var(--font);
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1;
}

.logo-name {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.logo-proyecto {
  font-family: var(--font);
  font-weight: 400;
  font-size: 1.35rem;
  color: var(--text);
  line-height: 1;
}
.logo-freelance {
  font-family: 'Royalty', cursive;
  font-size: 2.6rem;
  color: var(--accent);
  line-height: 1;
}

/* Nav */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-sec);
  transition: color var(--transition);
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.header-cta { margin-left: 0.5rem; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  background: none;
  border: none;
  z-index: 1100;
}
.hamburger span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Offcanvas ──────────────────────────────────────────────── */
.offcanvas-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.offcanvas-overlay.open { opacity: 1; visibility: visible; }

.offcanvas {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 75%;
  max-width: 400px;
  background: linear-gradient(160deg, #111b33 0%, #0e1529 100%);
  border-left: 1px solid var(--border-subtle);
  z-index: 1100;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: 5rem 2.5rem 3rem;
  gap: 0.5rem;
}
.offcanvas.open { transform: translateX(0); }

.offcanvas-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  justify-content: center;
}

.offcanvas-nav a {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-sec);
  padding: 0.6rem 0;
  transition: color var(--transition), padding-left var(--transition);
  border-bottom: 1px solid var(--border-subtle);
}
.offcanvas-nav a:last-child { border-bottom: none; }
.offcanvas-nav a:hover { color: var(--accent); padding-left: 0.5rem; }

.offcanvas-cta { margin-top: 2rem; }
.offcanvas-cta .btn { width: 100%; justify-content: center; }

.offcanvas-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1rem;
}
.offcanvas-logo .logo-icon {
  justify-content: center;
  font-size: 2.2rem;
  gap: 0.15rem;
  margin-bottom: 0.1rem;
}
.offcanvas-logo .fa-globe    { font-size: 3rem; }
.offcanvas-logo .logo-bracket { font-size: 2.2rem; }
.offcanvas-logo .logo-proyecto { font-size: 1.5rem; }
.offcanvas-logo .logo-freelance { font-size: 3.2rem; }

/* ── Hero ───────────────────────────────────────────────────── */
#inicio {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 7rem 0 5rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 80% 20%, rgba(255,114,0,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 80% at 0% 80%, rgba(14,21,41,0.6) 0%, transparent 70%),
    linear-gradient(135deg, #0e1529 0%, #0a1020 100%);
  z-index: 0;
}

.hero-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,114,0,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,114,0,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
}

.hero-content { max-width: 560px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: rgba(255,114,0,0.06);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.75rem;
}
.hero-badge-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  color: var(--text);
}
.hero-title .accent { color: var(--accent); }

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-sec);
  margin-bottom: 2.25rem;
  line-height: 1.7;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Hero visual / SVG illustration */
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hero-visual-glow {
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,114,0,0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.code-window {
  width: 100%;
  max-width: 480px;
  background: #0d1526;
  border: 1px solid rgba(255,114,0,0.2);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04) inset;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.code-window-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.code-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.code-dot:nth-child(1) { background: #ff5f57; }
.code-dot:nth-child(2) { background: #febc2e; }
.code-dot:nth-child(3) { background: #28c840; }

.code-tab {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.code-body {
  padding: 1.5rem;
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  line-height: 1.8;
}

.code-line { display: flex; gap: 1rem; }
.code-ln {
  color: #3a4a6a;
  user-select: none;
  min-width: 1.5rem;
  text-align: right;
}
.c-kw  { color: #c792ea; }
.c-fn  { color: #82aaff; }
.c-str { color: #c3e88d; }
.c-acc { color: var(--accent); }
.c-num { color: #f78c6c; }
.c-cm  { color: #546e7a; font-style: italic; }

.code-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1.1s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* floating badges on hero visual */
.hero-badge-float {
  position: absolute;
  background: rgba(13,21,38,0.9);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
  white-space: nowrap;
  box-shadow: var(--shadow-card);
}
.hero-badge-float i { color: var(--accent); }

.badge-top-right { top: 1.5rem; right: -1rem; animation: float 4s ease-in-out infinite; }
.badge-bot-left  { bottom: 1.5rem; left: -1rem; animation: float 4s ease-in-out infinite 2s; }

@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* ── Servicios ──────────────────────────────────────────────── */
#servicios {
  padding: 7rem 0;
  position: relative;
}

.services-header {
  text-align: center;
  margin-bottom: 4rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.service-card:hover {
  border-color: var(--border);
  background: var(--bg-card-hover);
  transform: translateY(-6px);
  box-shadow: var(--shadow-glow), var(--shadow-card);
}
.service-card:hover::before { opacity: 1; }

.service-icon {
  width: 52px;
  height: 52px;
  background: var(--accent-glow-s);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  transition: var(--transition);
}
.service-icon i {
  font-size: 1.35rem;
  color: var(--accent);
}
.service-card:hover .service-icon {
  background: var(--accent-glow);
  border-color: var(--accent);
}

.service-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.service-desc {
  font-size: 0.9rem;
  color: var(--text-sec);
  line-height: 1.7;
}

/* ── Sobre mí ───────────────────────────────────────────────── */
#sobre-mi {
  padding: 7rem 0;
  position: relative;
  overflow: hidden;
}

.about-bg-accent {
  position: absolute;
  right: -200px;
  top: 50%;
  transform: translateY(-50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,114,0,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.about-inner {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  align-items: center;
  gap: 5rem;
}

.about-photo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-photo-ring {
  position: relative;
  width: 280px;
  height: 280px;
}

.about-photo-ring::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 0deg, transparent 180deg, var(--accent) 360deg);
  animation: rotate-ring 8s linear infinite;
  opacity: 0.6;
}

@keyframes rotate-ring {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.about-photo-ring::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--bg);
}

.about-photo {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 3px solid var(--accent);
  box-shadow: 0 0 40px rgba(255,114,0,0.25), 0 16px 48px rgba(0,0,0,0.5);
}

.about-content {}

.about-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.about-name {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.about-role {
  font-size: 1rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.about-divider {
  width: 48px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  margin-bottom: 1.5rem;
}

.about-text {
  font-size: 1rem;
  color: var(--text-sec);
  line-height: 1.8;
  margin-bottom: 2rem;
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.about-tag {
  padding: 0.35rem 0.9rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-sec);
  background: rgba(255,114,0,0.05);
  transition: var(--transition);
}
.about-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Contacto ───────────────────────────────────────────────── */
#contacto {
  padding: 7rem 0;
  position: relative;
  overflow: hidden;
}

.contact-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 70% at 50% 50%, rgba(255,114,0,0.06) 0%, transparent 65%),
    linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%);
}

.contact-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}

.contact-title {
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  color: var(--text);
}
.contact-title .accent { color: var(--accent); }

.contact-desc {
  font-size: 1.05rem;
  color: var(--text-sec);
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.contact-info {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2.75rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.92rem;
  color: var(--text-sec);
  transition: color var(--transition);
}
.contact-item i { color: var(--accent); font-size: 1rem; }
.contact-item:hover { color: var(--text); }

.contact-cta { display: flex; justify-content: center; }

/* ── Footer ─────────────────────────────────────────────────── */
#footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border-subtle);
  background: #0e1529;
}

.footer-inner {
  display: block;
  text-align: center;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  width: 100%;
}
.footer-copy-line1,
.footer-copy-line2 { display: inline; }

/* ── Section divider ────────────────────────────────────────── */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
  margin: 0 2rem;
}

/* ── Scroll to top ──────────────────────────────────────────── */
#scrollTop {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 4px 16px rgba(255,114,0,0.4);
  z-index: 900;
  font-size: 0.9rem;
}
#scrollTop.visible { opacity: 1; transform: translateY(0); }
#scrollTop:hover   { background: #ff8a2e; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .hero-inner { gap: 2.5rem; }
  .services-grid { gap: 1rem; }
}

@media (max-width: 900px) {
  .nav-links, .header-cta { display: none; }
  .hamburger { display: flex; }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-content { max-width: 100%; }
  .hero-desc    { max-width: 100%; }
  .hero-actions { justify-content: center; }
  .hero-visual  { display: none; }

  .services-grid { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }

  .about-inner { grid-template-columns: 1fr; gap: 3rem; text-align: center; }
  .about-photo-wrap { justify-content: center; }
  .about-divider { margin: 0 auto 1.5rem; }
  .about-tags { justify-content: center; }

  .footer-copy { text-align: center; }
  .footer-copy-line1,
  .footer-copy-line2 { display: block; }
}

@media (max-width: 600px) {
  :root { --max-w: 100%; }
  .container { padding: 0 1.25rem; }

  #inicio { padding: 6rem 0 4rem; }
  #servicios, #sobre-mi, #contacto { padding: 5rem 0; }

  .hero-title { font-size: 2.1rem; }
  .about-photo-ring { width: 220px; height: 220px; }

  .contact-info { flex-direction: column; align-items: center; gap: 0.75rem; }

  #scrollTop { bottom: 1.25rem; right: 1.25rem; }
}
