/* ─── Custom properties ──────────────────────────── */
:root {
  --bg:           #151515;
  --text:         #b8b8b8;
  --text-muted:   #888;
  --text-dim:     #5a5a5a;
  --text-dimmer:  #505050;
  --accent:       #D66D79;
  --link:         #B04475;
  --border:       #222;
  --border-mid:   #2a2a2a;
  --white:        #e8e8e8;
}

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

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

/* ─── Base ───────────────────────────────────────── */
body {
  font-family: 'Titillium Web', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 1.8rem;
  line-height: 1.7;
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: var(--white);
}

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

p a {
  color: var(--link);
  border-bottom: 1px solid rgba(214, 109, 121, 0.3);
  transition: border-color 0.2s, color 0.2s;
}
p a:hover {
  border-color: var(--link);
  color: var(--white);
}

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

p { margin: 0 0 1.3rem; }

h1, h2, h3, h4 { margin: 0; padding: 0; font-weight: 600; }

/* ─── Layout ─────────────────────────────────────── */
#site {
  max-width: 900px;
  margin: 5rem auto 6rem;
  padding: 0 3rem;
}

@media (max-width: 640px) {
  #site {
    margin: 2rem auto 4rem;
    padding: 0 2rem;
  }
}

/* ─── Footer ─────────────────────────────────────── */
#footer {
  display: flex;
  gap: 2rem;
  margin-top: 6rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--border);
}

#footer a {
  font-size: 1.4rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

#footer a:hover { color: var(--text); }

/* ─── Header ─────────────────────────────────────── */
#header {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-bottom: 4rem;
}

#title {
  font-size: 1rem;
  font-weight: 400;
  flex-shrink: 0;
}

#title a {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--white);
  transition: opacity 0.2s;
}

#title a:hover { opacity: 0.75; }

#title svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.site-name {
  font-size: 1.7rem;
  line-height: 1.3;
  color: var(--white);
}

.site-sub {
  color: var(--text-muted);
  font-weight: 300;
}

/* ─── Nav ────────────────────────────────────────── */
#menu { margin-top: 2px; }

#menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.6rem;
  flex-wrap: wrap;
}

#menu a {
  color: var(--text-dim);
  font-size: 1.6rem;
  transition: color 0.2s;
}

#menu a:hover { color: #ccc; }
#menu .active a { color: var(--accent); }

/* ─── Prose typography ───────────────────────────── */
/* Shared styles for blog posts, project descriptions and static pages */
:is(.post-body, .project-body, .page-body) {
  font-size: 1.9rem;
  line-height: 1.8;
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
}

:is(.post-body, .project-body, .page-body) h2 {
  font-size: 2.2rem;
  font-weight: 600;
  color: #fff;
  margin: 3.2rem 0 1rem;
  line-height: 1.3;
}

:is(.post-body, .project-body, .page-body) h3 {
  font-size: 1.9rem;
  font-weight: 600;
  color: #e0e0e0;
  margin: 2.6rem 0 0.8rem;
  line-height: 1.35;
}

:is(.post-body, .project-body, .page-body) h4 {
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 2rem 0 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

:is(.post-body, .project-body, .page-body) p { margin: 0 0 1.8rem; }

:is(.post-body, .project-body, .page-body) strong { font-weight: 600; color: #e8e8e8; }

:is(.post-body, .project-body, .page-body) em { font-style: italic; }

:is(.post-body, .project-body, .page-body) ul,
:is(.post-body, .project-body, .page-body) ol {
  margin: 0 0 1.4rem;
  padding-left: 2rem;
}

:is(.post-body, .project-body, .page-body) ul { list-style: none; padding-left: 0; }

:is(.post-body, .project-body, .page-body) ul li {
  padding-left: 1.6rem;
  position: relative;
  margin-bottom: 0.5rem;
}

:is(.post-body, .project-body, .page-body) ul li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--text-dimmer);
}

:is(.post-body, .project-body, .page-body) ol li { margin-bottom: 0.5rem; }

:is(.post-body, .project-body, .page-body) blockquote {
  margin: 2rem 0;
  padding: 1.2rem 1.6rem;
  border-left: 3px solid var(--accent);
  background: rgba(239, 36, 0, 0.04);
  color: var(--text-muted);
  font-style: italic;
}

:is(.post-body, .project-body, .page-body) blockquote p { margin: 0; }

:is(.post-body, .project-body, .page-body) code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
  background: #1e1e1e;
  color: #ccc;
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

:is(.post-body, .project-body, .page-body) pre {
  background: #1a1a1a;
  border: 1px solid var(--border-mid);
  border-radius: 4px;
  padding: 1.4rem 1.6rem;
  margin: 0 0 1.8rem;
  overflow-x: auto;
  line-height: 1.6;
}

:is(.post-body, .project-body, .page-body) pre code {
  background: none;
  padding: 0;
  font-size: 1.4rem;
  color: #ccc;
}

:is(.post-body, .project-body, .page-body) hr {
  border: none;
  border-top: 1px solid var(--border-mid);
  width: 4rem;
  margin: 2.8rem 0;
}

:is(.post-body, .project-body, .page-body) img {
  width: 100%;
  height: auto;
  margin: 0.8rem 0 3.2rem;
}

:is(.post-body, .project-body, .page-body) figcaption {
  font-size: 1.3rem;
  color: var(--text-dim);
  margin-top: -1rem;
  margin-bottom: 1.6rem;
}

:is(.post-body, .project-body, .page-body) a {
  color: var(--link);
  border-bottom: 1px solid rgba(214, 109, 121, 0.3);
  transition: border-color 0.2s, color 0.2s;
}

:is(.post-body, .project-body, .page-body) a:hover {
  color: var(--white);
  border-color: var(--link);
}

/* ─── Home sections ──────────────────────────────── */
.home-section {
  margin-bottom: 1rem;
}

.home-section .hero-label {
  display: block;
  margin-bottom: 1.6rem;
}

/* ─── Projects grid ──────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2.4rem 2rem;
}

.project-card {
  display: block;
  outline: none;
}

.project-thumb {
  width: 100%;
  aspect-ratio: 320 / 188;
  overflow: hidden;
  background: #000;
  margin-bottom: 0.8rem;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.25s, transform 0.35s;
}

.project-card:hover .project-thumb img {
  opacity: 0.8;
  transform: scale(1.02);
}

.project-card-title {
  display: block;
  font-size: 1.6rem;
  color: var(--text-muted);
  line-height: 1.3;
  transition: color 0.2s;
}

.project-title-main {
  display: inline;
}

.project-title-company {
  text-transform: uppercase;
  display: inline-block;
  margin-left: 0.55rem;
  font-size: 0.6em;
  line-height: 1;
  color: var(--text-dim);
  font-weight: 400;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.project-card:hover .project-card-title { color: var(--text); }

.project-card-tags {
  display: block;
  font-size: 1.3rem;
  color: var(--text-dimmer);
  margin-top: 0.3rem;
}

/* ─── Project detail ──────────────────────────────── */
#main {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 0 4rem;
  align-items: start;
}

/* min-width: 0 prevents grid children from overflowing their cell */
#main > * { min-width: 0; }

#main:has(.projects-grid),
#main:has(.post-list),
#main:has(.post-detail),
#main:has(.page-body) {
  grid-template-columns: 1fr;
}

.project-detail { min-width: 0; }

.project-intro { margin-bottom: 1.6rem; }

.project-title {
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.6rem;
}

.project-title .project-title-company {
  color: var(--text-muted);
}

.tags {
  font-size: 1.3rem;
  color: var(--text-dim);
  margin-bottom: 1.6rem;
}

.tags a { color: var(--text-dimmer); transition: color 0.2s; }
.tags a:hover { color: var(--text-muted); }
.tag { color: var(--text-dimmer); }

/* ─── Project slider ──────────────────────────────── */
.project-slider {
  overflow: hidden;
  margin-bottom: 2.4rem;
}

.slider-track {
  display: flex;
  transition: transform 0.3s ease;
}

.slide {
  flex: 0 0 100%;
  width: 100%;
}

.slide img {
  width: 100%;
  height: auto;
  display: block;
}

.slider-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin-top: 1rem;
}

.slider-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  line-height: 1;
  transition: color 0.2s;
}

.slider-btn:hover { color: var(--text); }

.slider-dots {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.slider-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-mid);
  border: 1px solid var(--text-dim);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, border-color 0.2s;
}

.slider-dot.active {
  background: var(--link);
  border-color: var(--link);
}

.project-body {
  margin-top: 2rem;
  max-width: 640px;
}

/* ─── Project sidebar ─────────────────────────────── */
.project-sidebar {
  position: sticky;
  top: 2rem;
}

.sidebar-label {
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dimmer);
  margin-bottom: 1.2rem;
}

.project-list-sidebar {
  list-style: none;
  margin: 0;
  padding: 0;
}

.project-list-sidebar li { margin-bottom: 0.6rem; }

.project-list-sidebar a {
  font-size: 1.3rem;
  color: var(--text-dim);
  transition: color 0.2s;
  line-height: 1.3;
  display: block;
}

.project-list-sidebar a:hover { color: #ccc; }
.project-list-sidebar li.active a { color: var(--accent); }

@media (max-width: 720px) {
  #main { grid-template-columns: 1fr !important; }

  .project-sidebar {
    position: static;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-mid);
  }

  .project-list-sidebar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.2rem;
  }
}

/* ─── Home hero ───────────────────────────────────── */
.home-hero { margin-bottom: 4rem; }

.hero-link { display: block; }

.hero-img {
  width: 100%;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  background: #000;
  margin-bottom: 1.2rem;
}

.hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.25s, transform 0.4s;
}

.hero-link:hover .hero-img img {
  opacity: 0.85;
  transform: scale(1.015);
}

.hero-label {
  display: block;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 0.4rem;
  transition: color 0.2s;
}

.hero-title .project-title-company {
  color: var(--text-muted);
}

.hero-link:hover .hero-title { color: var(--white); }

.hero-tags {
  font-size: 1.3rem;
  color: var(--text-dimmer);
}

/* ─── Home "ver todos" ───────────────────────────── */
.home-more {
  margin-top: 2.4rem;
  margin-bottom: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.home-more-link {
  font-size: 1.4rem;
  color: var(--accent);
  transition: color 0.2s;
}

.home-more-link:hover { color: var(--white); }

/* ─── Home featured post ─────────────────────────── */
.home-post-feature {
  margin-bottom: 3.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.post-feature-link { display: block; }

.post-feature-title {
  font-size: 2.1rem;
  font-weight: 400;
  color: var(--text-muted);
  margin: 0.4rem 0;
  transition: color 0.2s;
}

.post-feature-link:hover .post-feature-title { color: var(--text); }

/* ─── Blog list ───────────────────────────────────── */
.post-list { max-width: 640px; }

.post-summary { margin-bottom: 3.2rem; }

.post-summary-thumb {
  display: block;
  margin-bottom: 1rem;
  overflow: hidden;
  max-width: 480px;
}

.post-summary-thumb img {
  width: 100%;
  height: auto;
  transition: opacity 0.25s, transform 0.35s;
}

.post-summary-thumb:hover img {
  opacity: 0.8;
  transform: scale(1.02);
}

.post-summary .post-title {
  font-size: 2.1rem;
  font-weight: 400;
  margin-bottom: 0.4rem;
}

.post-summary .post-title a { transition: color 0.2s; }
.post-summary .post-title a:hover { color: var(--accent); }

.post-date {
  display: block;
  font-size: 1.3rem;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}

.post-more {
  font-size: 1.5rem;
  color: var(--accent);
  transition: color 0.2s;
}

.post-more:hover { color: var(--text-muted); }

/* ─── Blog post detail ────────────────────────────── */
.post-detail { max-width: 720px; }

.post-header { margin-bottom: 2.4rem; }

.post-detail .post-title {
  font-size: 2.8rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.8rem;
}

@media (max-width: 640px) {
  .post-detail .post-title { font-size: 2.2rem; }
  .hero-title { font-size: 2.2rem; }
}

/* ─── Static pages ────────────────────────────────── */
.page-body {
  max-width: 680px;
  width: 100%;
}

.page-body > img:first-child {
  width: auto;
  max-width: min(300px, 100%);
  height: auto;
  margin: 0 0 2.4rem;
}

/* ─── Filter bar ─────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--border-mid);
  color: var(--text-muted);
  padding: 0.3rem 1rem;
  border-radius: 2px;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.4rem;
  line-height: 1.6;
  transition: color 0.2s, border-color 0.2s;
}

.filter-btn:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

.filter-btn.active {
  color: var(--link);
  border-color: var(--link);
}

/* ─── 404 ────────────────────────────────────────── */
.error-page {
  padding: 4rem 0;
}

.error-code {
  display: block;
  font-size: 10rem;
  font-weight: 600;
  color: var(--text-dimmer);
  line-height: 1;
  margin-bottom: 1.6rem;
}

.error-msg {
  color: var(--text-muted);
  margin-bottom: 2.4rem;
}

.error-links {
  display: flex;
  gap: 2rem;
}

.error-links a {
  color: var(--link);
  font-size: 1.4rem;
  transition: color 0.2s;
}

.error-links a:hover { color: var(--white); }

/* ─── Video ───────────────────────────────────────── */
.videoWrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin-bottom: 2.6rem;
}

.videoWrapper iframe,
.videoWrapper video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.videoWrapper video {
  object-fit: cover;
  background: #000;
}

/* ─── About / Sobre mí ────────────────────────────── */
.about-photo {
  width: 100% !important;
  max-width: 100% !important;
  height: auto;
  display: block;
  margin-bottom: 2rem;
}
