/* =============================================
   IAGO CASAS — PORTFOLIO STYLES
   iagocasas.dev
   ============================================= */

/* --- RESET & VARIABLES --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #080808;
  --bg-card:   #111111;
  --bg-input:  #161616;
  --fg:        #f0ece4;
  --fg-dim:    #7a7169;
  --accent:    #c8f04a;  /* electric lime */
  --accent2:   #ff6b35;
  --border:    rgba(255,255,255,0.07);
  --font-head: 'Bebas Neue', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --font-serif:'Playfair Display', serif;
  --r:         8px;
  --transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  cursor: none;
}

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

/* --- CUSTOM CURSOR --- */
.cursor {
  position: fixed; z-index: 9999;
  width: 36px; height: 36px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease, width 0.2s ease, height 0.2s ease, opacity 0.2s ease;
  mix-blend-mode: difference;
}
.cursor-dot {
  position: fixed; z-index: 9999;
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
}
body:has(a:hover) .cursor,
body:has(button:hover) .cursor { width: 60px; height: 60px; opacity: 0.6; }

/* --- SCROLLBAR --- */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* --- UTILITY --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.section { padding: 8rem 0; }
.section-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 1rem;
}
.section-title {
  font-family: var(--font-head);
  font-size: clamp(3.5rem, 7vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
  margin-bottom: 4rem;
}
mark {
  background: none;
  color: var(--accent);
  -webkit-text-stroke: 0;
}
.section-header { margin-bottom: 0; }

/* --- REVEAL ANIMATION --- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s var(--transition), transform 0.7s var(--transition);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* --- BUTTONS --- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  padding: 0.85rem 2rem;
  border-radius: 2px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.08);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}
.btn:hover::before { transform: translateX(0); }
.btn--primary {
  background: var(--accent);
  color: var(--bg);
  font-weight: 500;
}
.btn--ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
}
.btn--full { width: 100%; justify-content: center; }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(200, 240, 74, 0.25); }

/* =============================================
   NAV
   ============================================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.5rem 2.5rem;
  transition: background 0.4s ease, padding 0.3s ease;
}
.nav.scrolled {
  background: rgba(8,8,8,0.92);
  backdrop-filter: blur(20px);
  padding: 1rem 2.5rem;
  border-bottom: 1px solid var(--border);
}
.nav__logo {
  font-family: var(--font-head);
  font-size: 1.6rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.nav__links {
  display: flex; gap: 2.5rem;
}
.nav__link {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-dim);
  transition: color 0.2s;
  position: relative;
}
.nav__link::after {
  content: '';
  position: absolute; bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.nav__link:hover { color: var(--fg); }
.nav__link:hover::after { width: 100%; }

.nav__burger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.nav__burger span {
  display: block; width: 24px; height: 1.5px;
  background: var(--fg);
  transition: var(--transition);
}

/* Mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 99;
  background: rgba(8,8,8,0.97);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.mobile-menu.open { opacity: 1; pointer-events: all; }
.mobile-menu ul { display: flex; flex-direction: column; gap: 2rem; text-align: center; }
.mobile-link {
  font-family: var(--font-head);
  font-size: 3.5rem;
  color: var(--fg-dim);
  transition: color 0.2s;
}
.mobile-link:hover { color: var(--accent); }

/* =============================================
   HERO
   ============================================= */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  position: relative;
  overflow: hidden;
  padding: 6rem 2.5rem 4rem;
}

/* Noise texture */
.hero__noise {
  position: absolute; inset: 0; z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* Grid */
.hero__grid {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero__content {
  position: relative; z-index: 1;
  max-width: 900px;
}

.hero__label {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  color: var(--fg-dim);
  margin-bottom: 2rem;
}
.dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 240, 74, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(200, 240, 74, 0); }
}

.hero__name {
  font-family: var(--font-head);
  font-size: clamp(6rem, 18vw, 16rem);
  line-height: 0.88;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
}
.line { display: block; }
.line--stroke {
  -webkit-text-stroke: 2px var(--fg);
  color: transparent;
}

.hero__title {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: var(--fg-dim);
  margin-bottom: 2.5rem;
  font-style: italic;
}
.hero__title em { color: var(--fg); font-style: italic; }

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

.hero__scroll {
  position: absolute; bottom: 2.5rem; left: 2.5rem;
  display: flex; align-items: center; gap: 1rem;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--fg-dim);
  text-transform: uppercase;
}
.hero__scroll-line {
  width: 40px; height: 1px;
  background: var(--fg-dim);
  animation: scrollLine 2s infinite;
}
@keyframes scrollLine {
  0% { width: 0; opacity: 0; }
  50% { width: 40px; opacity: 1; }
  100% { width: 0; opacity: 0; }
}

.hero__counter {
  position: absolute; bottom: 2.5rem; right: 2.5rem;
  display: flex; gap: 2.5rem;
}
.counter-item { text-align: right; }
.counter-num {
  display: block;
  font-family: var(--font-head);
  font-size: 2.5rem;
  color: var(--accent);
  line-height: 1;
}
.counter-label {
  font-size: 0.65rem;
  color: var(--fg-dim);
  letter-spacing: 0.1em;
}

/* =============================================
   MARQUEE
   ============================================= */
.marquee-wrap {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 0;
  background: #0d0d0d;
}
.marquee {
  display: flex;
  animation: marquee 20s linear infinite;
  white-space: nowrap;
}
.marquee span {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--fg-dim);
  text-transform: uppercase;
  padding-right: 1rem;
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* =============================================
   ABOUT
   ============================================= */
.about {
  background: #0c0c0c;
}
.about__layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: start;
}
.about__img-wrap {
  position: relative;
  margin-top: 2rem;
  width: fit-content;
}
.about__img-placeholder {
  width: 280px; height: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.about__img-placeholder::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(200,240,74,0.06), transparent);
}
.placeholder-initials {
  font-family: var(--font-head);
  font-size: 5rem;
  color: var(--accent);
  opacity: 0.5;
}
.about__img-deco {
  position: absolute;
  bottom: -15px; right: -15px;
  width: 100%; height: 100%;
  border: 1px solid var(--accent);
  opacity: 0.25;
  z-index: -1;
}
.about__bio {
  font-size: 1rem;
  color: var(--fg-dim);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}
.about__bio strong { color: var(--fg); font-weight: 500; }
.about__facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.fact {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--fg-dim);
  padding: 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.fact__icon { font-size: 1rem; }

/* =============================================
   PROJECTS
   ============================================= */
.projects__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5px;
  background: var(--border);
  border: 1px solid var(--border);
}
.project-card {
  position: relative;
  padding: 2.5rem;
  background: var(--bg);
  overflow: hidden;
  transition: background var(--transition);
}
.project-card:hover { background: var(--bg-card); }
.project-card:hover .project-card__bg { transform: scale(1.05); opacity: 0.06; }
.project-card__bg {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 30%, var(--accent), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}
.project-card__num {
  font-family: var(--font-head);
  font-size: 5rem;
  color: var(--border);
  line-height: 1;
  margin-bottom: 1rem;
  transition: color 0.3s;
}
.project-card:hover .project-card__num { color: rgba(200,240,74,0.1); }
.project-card__tags {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin-bottom: 1rem;
}
.tag {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(200,240,74,0.08);
  border: 1px solid rgba(200,240,74,0.2);
  padding: 0.25rem 0.6rem;
  border-radius: 2px;
}
.project-card__title {
  font-family: var(--font-head);
  font-size: 1.8rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.8rem;
  line-height: 1.1;
}
.project-card__desc {
  font-size: 0.82rem;
  color: var(--fg-dim);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}
.project-card__links { display: flex; gap: 1.2rem; align-items: center; }
.project-link {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  transition: opacity 0.2s;
}
.project-link:hover { opacity: 0.7; }
.project-link--ghost {
  color: var(--fg-dim);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
}

/* =============================================
   SKILLS
   ============================================= */
.skills { background: #0c0c0c; }
.skills__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
}
.skill-group__title {
  font-family: var(--font-head);
  font-size: 1.3rem;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.skill-list { display: flex; flex-direction: column; gap: 1.2rem; }
.skill-item {}
.skill-name {
  display: block;
  font-size: 0.8rem;
  color: var(--fg-dim);
  margin-bottom: 0.4rem;
}
.skill-bar {
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.skill-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  width: 0;
  transition: width 1.2s var(--transition);
}

/* =============================================
   CONTACT
   ============================================= */
.contact__layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 6rem;
  align-items: start;
}
.contact__email {
  display: block;
  font-family: var(--font-head);
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  color: var(--accent);
  margin-bottom: 2rem;
  word-break: break-all;
  transition: opacity 0.2s;
}
.contact__email:hover { opacity: 0.7; }
.contact__social { display: flex; gap: 1rem; }
.social-link {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  color: var(--fg-dim);
  transition: var(--transition);
  border-radius: var(--r);
}
.social-link svg { width: 18px; height: 18px; }
.social-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-3px);
}

/* Form */
.contact-form { display: flex; flex-direction: column; gap: 1.2rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.form-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--r);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--fg-dim); opacity: 0.5; }
.form-textarea { resize: vertical; min-height: 140px; }
.form-status {
  padding: 0.75rem 1rem;
  border-radius: var(--r);
  font-size: 0.82rem;
  text-align: center;
  margin-top: 0.5rem;
}
.form-status.success { background: rgba(200,240,74,0.1); color: var(--accent); border: 1px solid rgba(200,240,74,0.3); }
.form-status.error { background: rgba(255,107,53,0.1); color: var(--accent2); border: 1px solid rgba(255,107,53,0.3); }

/* =============================================
   FOOTER
   ============================================= */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}
.footer__inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
}
.footer__logo {
  font-family: var(--font-head);
  font-size: 1.4rem;
  color: var(--accent);
}
.footer__copy {
  font-size: 0.72rem;
  color: var(--fg-dim);
}
.heart { color: var(--accent2); }
.footer__back {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  transition: color 0.2s;
}
.footer__back:hover { color: var(--accent); }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__burger { display: flex; }
  .hero__counter { display: none; }
  .about__layout { grid-template-columns: 1fr; gap: 3rem; }
  .about__img-placeholder { width: 220px; height: 260px; }
  .projects__grid { grid-template-columns: 1fr; }
  .skills__grid { grid-template-columns: 1fr; gap: 2rem; }
  .contact__layout { grid-template-columns: 1fr; gap: 3rem; }
  .hero__name { font-size: clamp(5rem, 20vw, 8rem); }
}

@media (max-width: 600px) {
  .section { padding: 5rem 0; }
  .hero { padding: 5rem 1.5rem 4rem; }
  .hero__scroll { display: none; }
  .about__facts { grid-template-columns: 1fr; }
  .footer__inner { flex-direction: column; text-align: center; }
  body { cursor: auto; }
  .cursor, .cursor-dot { display: none; }
}
