/* ============================================
   Hernán Grieco Portfolio — Design System
   Mobile-first · Light mode default · Dark mode via [data-theme="dark"]
   Stack: HTML + CSS + JS vanilla, no frameworks
   ============================================ */

/* ---------- Design tokens: Light mode (default) ---------- */
:root {
  /* Backgrounds */
  --bg-primary:    #ffffff;
  --bg-secondary:  #f7f7f7;
  --bg-tertiary:   #eeeeee;

  /* Accent (muted green — professional, not neon) */
  --accent:        #5a7d61;
  --accent-hover:  #4a6b51;

  /* Text */
  --text-primary:   #111111;
  --text-secondary: #555555;
  --text-muted:     #888888;

  /* Borders & surfaces */
  --border:     #e0e0e0;
  --card-bg:    #f9f9f9;
  --nav-bg:     rgba(255, 255, 255, 0.95);

  /* Typography */
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Spacing — mobile base values */
  --section-padding-y:  4rem;
  --section-padding-x:  1.25rem;
  --section-header-mb:  3rem;
  --container-max:      1200px;
  --gap-md:             1.5rem;
  --gap-lg:             1.5rem;

  /* Motion */
  --ease:       0.2s ease;
  --ease-slow:  0.4s ease;
}

/* ---------- Design tokens: Dark mode ---------- */
[data-theme="dark"] {
  --bg-primary:    #0e0e10;
  --bg-secondary:  #111113;
  --bg-tertiary:   #141416;

  --accent:        #6b8f71;
  --accent-hover:  #7a9e80;

  --text-primary:   #e8e8ec;
  --text-secondary: #a0a0aa;
  --text-muted:     #8a8a96;

  --border:     #2a2a2e;
  --card-bg:    #111113;
  --nav-bg:     rgba(14, 14, 16, 0.95);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 1.25rem var(--section-padding-x);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  z-index: 1000;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav__container {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.nav__logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.5px;
  transition: color var(--ease);
}

.nav__logo:hover {
  color: var(--accent);
}

/* Mobile: menu hidden, hamburger visible */
.nav__menu {
  display: none;
  list-style: none;
}

.nav__menu.is-open {
  display: flex;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  gap: 0;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem var(--section-padding-x);
  backdrop-filter: blur(12px);
}

.nav__menu li {
  border-bottom: 1px solid var(--border);
}

.nav__menu li:last-child {
  border-bottom: none;
}

.nav__menu a {
  display: block;
  padding: 0.875rem 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 400;
  font-size: 0.9rem;
  transition: color var(--ease);
}

.nav__menu a:hover {
  color: var(--text-primary);
}

/* Nav controls */
.nav__controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle,
.lang-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: color var(--ease), border-color var(--ease);
  line-height: 1;
}

.theme-toggle:hover,
.lang-toggle:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* Show moon in light mode, sun in dark mode */
.theme-toggle__sun  { display: none; }
.theme-toggle__moon { display: block; }

[data-theme="dark"] .theme-toggle__sun  { display: block; }
[data-theme="dark"] .theme-toggle__moon { display: none; }

.lang-sep {
  color: var(--text-muted);
}

.lang-current {
  font-weight: 600;
  color: var(--text-primary);
}

.lang-other {
  color: var(--text-muted);
}

/* Mobile: hamburger visible */
.nav__mobile-btn {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

/* ---------- Hero — mobile base: single column ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 6rem var(--section-padding-x) 4rem;
}

.hero__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

/* Mobile: photo on top, circular */
.hero__photo-wrap {
  order: -1;
  flex-shrink: 0;
  position: relative;
  width: fit-content;
}

.hero__photo-wrap::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 10px;
  width: 100%;
  height: 100%;
  background: var(--accent);
  opacity: 0.18;
  border-radius: 50%;
  z-index: 0;
}

.hero__photo {
  position: relative;
  z-index: 1;
  width: 140px;
  height: 140px;
  object-fit: cover;
  object-position: center 8%;
  border-radius: 50%;
  display: block;
  border: 1px solid var(--border);
}

.hero__content {
  width: 100%;
}

.hero__tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent);
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
  padding: 0.5rem 1.2rem;
}

.hero__title {
  font-size: clamp(2.2rem, 8vw, 5.5rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

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

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ---------- CTAs ---------- */
.cta-button {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background: var(--text-primary);
  color: var(--bg-primary);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 8px;
  text-decoration: none;
  transition: opacity var(--ease), transform var(--ease);
}

.cta-button:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

.cta-button--secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.cta-button--secondary:hover {
  border-color: var(--text-muted);
  opacity: 1;
}

/* ---------- Container ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
}

/* ---------- Section common ---------- */
.section {
  padding: var(--section-padding-y) var(--section-padding-x);
}

.section--about      { background: var(--bg-primary); }
.section--services   { background: var(--bg-secondary); }
.section--experience { background: var(--bg-primary); }
.section--contact    { background: var(--bg-secondary); }

.section__header {
  text-align: center;
  margin-bottom: var(--section-header-mb);
}

.section__tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  padding: 0.5rem 1.2rem;
}

.section__title {
  font-size: clamp(1.6rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section__subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* ---------- Scroll reveal ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- About ---------- */
.about-content {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.about-content__p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.9;
}

/* ---------- Services — mobile base: 1 column ---------- */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-md);
}

.service-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: transform var(--ease), border-color var(--ease);
}

.service-card:hover {
  transform: translateY(-4px);
  border-color: var(--text-muted);
}

.service-card__badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

.service-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
  color: var(--text-primary);
}

.service-card__text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ---------- Experience / Portfolio — mobile base: 1 column ---------- */
.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-md);
}

.portfolio-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: transform var(--ease), border-color var(--ease);
}

.portfolio-item:hover {
  transform: translateY(-4px);
  border-color: var(--text-muted);
}

.portfolio-item__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.portfolio-item__type {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.portfolio-item__number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--bg-tertiary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.portfolio-item__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.portfolio-item__title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--ease);
}

.portfolio-item__title a:hover {
  color: var(--accent);
}

.portfolio-item__link-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color var(--ease), transform var(--ease);
}

.portfolio-item:hover .portfolio-item__link-icon {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.portfolio-item__desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

.portfolio-item__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
}

.tag {
  padding: 0.25rem 0.6rem;
  background: var(--bg-tertiary);
  border-radius: 4px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* Separador entre proyectos profesionales y de práctica */
.portfolio-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 3rem 0 2rem;
}

.portfolio-divider::before,
.portfolio-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.portfolio-divider__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* Grid compacto para proyectos de práctica — mobile: 2 col */
.portfolio-grid--compact {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.portfolio-item--compact {
  padding: 1.25rem;
}

.portfolio-item--compact .portfolio-item__number {
  font-size: 1.5rem;
}

.portfolio-item--compact .portfolio-item__title {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

/* ---------- Contact ---------- */
.contact-content {
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

.contact-info {
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.1rem 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 400;
  font-size: 0.95rem;
  transition: border-color var(--ease), transform var(--ease);
}

.contact-item:hover {
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

.contact-item__icon {
  color: var(--accent);
  display: flex;
  align-items: center;
}

/* ---------- Footer ---------- */
.footer {
  padding: 2rem var(--section-padding-x);
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer__text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ============================================================
   BREAKPOINT: 768px — tablet / small desktop
   ============================================================ */
@media (min-width: 768px) {

  :root {
    --section-padding-y:  6rem;
    --section-padding-x:  5%;
    --section-header-mb:  4rem;
    --gap-md:             2rem;
    --gap-lg:             2.5rem;
  }

  /* Nav: show full menu, hide hamburger */
  .nav__menu {
    display: flex;
    gap: 2rem;
    position: static;
    flex-direction: row;
    background: none;
    border: none;
    padding: 0;
    backdrop-filter: none;
  }

  .nav__menu li {
    border-bottom: none;
  }

  .nav__menu a {
    display: inline;
    padding: 0;
    position: relative;
  }

  .nav__menu a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width var(--ease);
  }

  .nav__menu a:hover::after {
    width: 100%;
  }

  .nav__mobile-btn {
    display: none;
  }

  /* Hero: two-column, photo on the right */
  .hero {
    padding-top: 8rem;
    padding-bottom: 6rem;
  }

  .hero__inner {
    grid-template-columns: 1fr auto;
    gap: 4rem;
  }

  .hero__photo-wrap {
    order: 0;
    width: auto;
  }

  .hero__photo-wrap::before {
    border-radius: 16px;
    top: 14px;
    left: 14px;
  }

  .hero__photo {
    width: 320px;
    height: 320px;
    border-radius: 16px;
  }

  .hero__desc {
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    margin-bottom: 2.5rem;
  }

  .cta-button {
    padding: 0.9rem 2rem;
    font-size: 0.95rem;
  }

  /* Services: 2 columns */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .service-card {
    padding: 2rem;
  }

  .service-card__title {
    font-size: 1.2rem;
  }

  /* Portfolio: 2 columns */
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap-lg);
  }

  /* Practice grid: 4 columns en desktop */
  .portfolio-grid--compact {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }

  .portfolio-item {
    padding: 2rem;
  }

  .portfolio-item__title {
    font-size: 1.4rem;
  }

  .portfolio-item__number {
    font-size: 2.5rem;
  }

  .about-content__p {
    font-size: 1.15rem;
  }
}

/* ============================================================
   BREAKPOINT: 1024px — wide desktop
   ============================================================ */
@media (min-width: 1024px) {

  /* Services: stays 2 columns even on wide screens */
}