/* ============================================================
   Javier Santos — Obra
   Sistema de diseño: papel / tinta / cochinilla
   ============================================================ */

:root {
  --paper: #f7f5f0;
  --paper-dim: #efece4;
  --ink: #1b1815;
  --stone: #6b655c;
  --stone-light: #9a938a;
  --line: #ddd8cd;
  --cochineal: #8a2432;
  --cochineal-dim: #b96e77;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Work Sans", "Helvetica Neue", Arial, sans-serif;
  --font-caption: "Newsreader", Georgia, serif;

  --measure: 46rem;
  --gutter: clamp(1.25rem, 5vw, 4rem);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration-color: var(--cochineal-dim);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--cochineal);
}

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

/* ---------- Header / Nav ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem var(--gutter);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.site-mark {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.site-mark img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(15%);
}

.site-mark span {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.site-nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.site-nav a {
  text-decoration: none;
  color: var(--stone);
  position: relative;
  padding-bottom: 2px;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  border-bottom: 1.5px solid var(--cochineal);
}

/* ---------- Layout shells ---------- */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

.gallery {
  max-width: 68rem;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4.5rem) var(--gutter) 5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 2.75rem);
}

.gallery figure {
  margin: 0;
  width: 100%;
  max-width: 44rem;
}

.gallery figure img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cochineal);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}

.eyebrow::before {
  content: "";
  width: 14px;
  height: 1.5px;
  background: var(--cochineal);
  display: inline-block;
}

.work-embed {
  position: relative;
  width: 100%;
  max-width: 44rem;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  background: var(--ink);
}

.work-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.caption-block {
  max-width: var(--measure);
  text-align: center;
  font-family: var(--font-caption);
  font-style: italic;
  color: var(--stone);
  font-size: 1.08rem;
  line-height: 1.7;
  padding: 0 1rem;
}

.next-work {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  width: 100%;
}

.next-work figure {
  margin: 0;
  width: 100%;
  max-width: 44rem;
  transition: opacity 0.2s ease;
}

.next-work:hover figure {
  opacity: 0.85;
}

.next-work img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

.next-work .eyebrow {
  color: var(--stone-light);
}

.next-work:hover .eyebrow {
  color: var(--cochineal);
}

/* ---------- Home hero ---------- */

.hero {
  max-width: 60rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 5rem) var(--gutter) 5rem;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin: 0 0 2.5rem;
  color: var(--ink);
}

.hero figure {
  margin: 0;
}

.hero img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

/* ---------- CV page ---------- */

.cv-wrap {
  max-width: 78rem;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4.5rem) var(--gutter) 5rem;
  display: grid;
  grid-template-columns: minmax(220px, 26%) 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
}

@media (max-width: 720px) {
  .cv-wrap {
    grid-template-columns: 1fr;
  }
}

.cv-sidebar {
  position: sticky;
  top: 2rem;
  align-self: start;
}

.cv-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 0 0 0.15rem;
}

.cv-alias {
  font-family: var(--font-caption);
  font-style: italic;
  color: var(--cochineal);
  font-size: 1.05rem;
  margin: 0 0 1.4rem;
}

.cv-bio {
  color: var(--stone);
  font-size: 0.96rem;
  line-height: 1.75;
  margin: 0 0 1.6rem;
}

.cv-contact {
  font-size: 0.9rem;
  border-top: 1px solid var(--line);
  padding-top: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cv-contact a {
  text-decoration: none;
  color: var(--ink);
}

.cv-section {
  margin-bottom: 2.6rem;
}

.cv-section h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  margin: 0 0 1.1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}

.cv-section h3 {
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone-light);
  margin: 1.6rem 0 0.8rem;
}

.cv-section h3:first-of-type {
  margin-top: 0;
}

.cv-entry {
  display: flex;
  gap: 1rem;
  padding: 0.45rem 0;
  font-size: 0.94rem;
  line-height: 1.6;
  border-bottom: 1px dotted var(--line);
}

.cv-entry:last-child {
  border-bottom: none;
}

.cv-year {
  flex: 0 0 auto;
  min-width: 4.6rem;
  color: var(--cochineal);
  font-variant-numeric: tabular-nums;
  font-size: 0.88rem;
}

.cv-desc {
  color: var(--ink);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.75rem var(--gutter);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--stone-light);
}

.site-footer a {
  color: var(--stone);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--cochineal);
}

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