/* ============================================================
   HECTOR RODRIGUEZ — styles.css
   Mobile-first. No frameworks. No !important. No gradients.
   ============================================================ */

/* --- Variables --- */
:root {
  --white:       #ffffff;
  --black:       #0a0a0a;
  --gray-light:  #f5f4f2;
  --gray-mid:    #666666;
  --gray-dark:   #333333;
  --accent:      #b8421f;
  --border:      #e8e8e6;

  --size-hero:   clamp(3.5rem, 10vw, 8rem);
  --size-h2:     clamp(2rem, 5vw, 4.5rem);
  --size-h3:     clamp(1.25rem, 2vw, 1.75rem);
  --size-body:   1rem;
  --size-label:  0.72rem;

  --max-width:   1100px;
  --gutter:      clamp(1.5rem, 6vw, 5rem);
  --section-gap: clamp(6rem, 14vw, 12rem);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* --- Base --- */
body {
  background: var(--white);
  color: var(--black);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: var(--size-body);
  font-weight: 300;
  line-height: 1.6;
}

/* --- Skip link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 200;
  background: var(--black);
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* --- Focus rings — never outline: none --- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ============================================================
   NAV
   ============================================================ */

#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem var(--gutter);
  background: transparent;
  transition: background 300ms ease, backdrop-filter 300ms ease;
}

#nav.scrolled {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--black);
  text-decoration: none;
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
}

.nav-links a {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--black);
  text-decoration: none;
  transition: color 200ms ease;
}

.nav-links a:hover {
  color: var(--accent);
}

.js .nav-item {
  opacity: 0;
}

/* ============================================================
   HERO
   ============================================================ */

#hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem var(--gutter) 4rem;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

#hero-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: var(--size-hero);
  color: var(--black);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

#hero-tagline {
  margin-top: 1.25rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--gray-dark);
}

/* Hero name chars are split by JS — hide until animated */
.js #hero-name {
  opacity: 1;
}

.js #hero-name .char {
  display: inline-block;
  opacity: 0;
}

.js #hero-tagline {
  opacity: 0;
}

#hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.cta-link {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 1rem;
  color: var(--black);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 200ms ease;
}

.js .cta-link {
  opacity: 0;
}

.cta-link:hover {
  color: var(--gray-mid);
}

.cta-accent {
  color: var(--accent);
}

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

/* ============================================================
   SECTIONS — COMMON
   ============================================================ */

section {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--section-gap) var(--gutter);
}

.section-label {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: var(--size-label);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.section-headline {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: var(--size-h2);
  color: var(--black);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 3rem;
}

/* Scroll-reveal base state — JS animates to opacity 1, translateY 0 */
.reveal {
  opacity: 0;
  transform: translateY(30px);
}

/* ============================================================
   WORK
   ============================================================ */

#work {
  padding-bottom: 0;
}

.project-list {
  list-style: none;
  border-top: 1px solid var(--border);
  width: 100%;
}

.project-row {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 200ms ease;
}

.project-row:hover {
  background: var(--gray-light);
}

.project-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1.25rem 0;
  flex-wrap: wrap;
  transition: padding-left 200ms ease;
}

.project-row:hover .project-header {
  padding-left: 1rem;
}

.project-row:hover .project-name {
  color: var(--accent);
}

.project-index {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: var(--size-label);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  min-width: 2rem;
  flex-shrink: 0;
}

.project-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: var(--size-h3);
  color: var(--black);
  flex: 1;
  transition: color 200ms ease;
}

.project-meta {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 0.85rem;
  color: var(--gray-mid);
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.project-year {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 0.85rem;
  color: var(--gray-mid);
  margin-left: auto;
  flex-shrink: 0;
}

.project-detail {
  overflow: hidden;
  height: 0;
}

.project-detail-inner {
  padding: 0 0 2rem 3rem;
}

.project-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: 1.25rem;
  background: var(--gray-light);
}

.project-description {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 0.95rem;
  color: var(--gray-dark);
  line-height: 1.7;
  margin-bottom: 1rem;
  max-width: 55ch;
}

.project-link {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 200ms ease;
}

.project-link:hover {
  color: var(--black);
}

/* ============================================================
   ABOUT
   ============================================================ */

.about-headline {
  margin-bottom: 2.5rem;
}

.about-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.about-photo {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
}

.about-body p {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 1rem;
  color: var(--gray-dark);
  line-height: 1.75;
  max-width: 55ch;
  margin-bottom: 1.25rem;
}

.about-body p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   CONTACT
   ============================================================ */

#contact {
  background: var(--gray-light);
  max-width: 100%;
  padding: var(--section-gap) var(--gutter);
}

#contact > * {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  display: block;
}

.contact-sub {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 1rem;
  color: var(--gray-mid);
  margin-bottom: 2.5rem;
}

#contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 680px;
  margin-bottom: 2rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#contact-form input,
#contact-form textarea {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 1rem;
  color: var(--black);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 0.85rem 1rem;
  width: 100%;
  transition: border-color 200ms ease;
  -webkit-appearance: none;
  appearance: none;
}

#contact-form input:focus,
#contact-form textarea:focus {
  outline: 2px solid var(--black);
  outline-offset: -1px;
  border-color: var(--black);
}

#contact-form textarea {
  min-height: 8rem;
  resize: vertical;
}

#contact-form input::placeholder,
#contact-form textarea::placeholder {
  color: var(--gray-mid);
}

.btn-submit {
  align-self: flex-start;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--white);
  background: var(--accent);
  border: none;
  border-radius: 0;
  padding: 0.9rem 2rem;
  cursor: pointer;
  transition: background 200ms ease;
}

.btn-submit:hover {
  background: var(--black);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#form-success {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 1rem;
  color: var(--gray-dark);
  padding: 1.5rem 0;
  max-width: 680px;
}

.hidden {
  display: none;
}

.contact-direct {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  max-width: 680px;
}

.contact-direct-label {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: var(--size-label);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray-mid);
}

.contact-direct-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.contact-email,
.contact-phone {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 1rem;
  color: var(--gray-dark);
  text-decoration: none;
  transition: color 200ms ease;
}

.contact-email:hover,
.contact-phone:hover {
  color: var(--accent);
}

/* ============================================================
   FOOTER
   ============================================================ */

#footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem var(--gutter);
  border-top: 1px solid var(--border);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 0.85rem;
  color: var(--gray-mid);
}

/* ============================================================
   DESKTOP BREAKPOINTS
   ============================================================ */

@media (min-width: 768px) {
  .form-row {
    flex-direction: row;
  }

  .about-grid {
    flex-direction: row;
    gap: clamp(3rem, 6vw, 5rem);
    align-items: flex-start;
  }

  .about-photo {
    max-width: 260px;
  }

  .about-body {
    flex: 1;
  }

  .contact-direct {
    flex-direction: row;
    gap: 2rem;
  }
}
