/* Marina Owens — una sola familia tipográfica (Raleway, variable 100–900 + itálicas) */
@font-face {
  font-family: "Raleway";
  src: url("../fonts/raleway-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Raleway";
  src: url("../fonts/raleway-italic.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
}

:root {
  --ink: #111;
  --paper: #fff;
  --muted: #767676;
  --line: #e6e6e6;
  --pad: clamp(16px, 4vw, 56px);
  --top: 72px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.7 "Raleway", system-ui, sans-serif;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 300; }
p { margin: 0 0 1em; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

/* Etiquetas en mayúsculas espaciadas: el "sello" tipográfico de la web */
.brand, .home__name, .home__nav a, .menu a, .tile__label, .crumbs, .cat-nav,
.project__links h3, .contact__data dt, .form label, .form button, .link, .counter {
  text-transform: uppercase; letter-spacing: .28em; font-size: 12px; font-weight: 500;
}

.page-title {
  font-weight: 200; text-transform: uppercase; letter-spacing: .18em;
  font-size: clamp(28px, 4.6vw, 56px); line-height: 1.1; margin-bottom: clamp(28px, 5vw, 64px);
}

.link { border-bottom: 1px solid currentColor; padding-bottom: 2px; margin-right: 2em; }
.link:hover { font-weight: 700; }

/* ---------- Cabecera + menú hamburguesa ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad); background: var(--paper);
}
.brand { position: relative; z-index: 60; font-weight: 600; letter-spacing: .38em; }

.burger {
  position: relative; z-index: 60; width: 44px; height: 44px; margin-right: -10px;
  background: none; border: 0; cursor: pointer; color: var(--ink);
}
.burger span {
  position: absolute; left: 10px; right: 10px; height: 1.5px; background: currentColor;
  transition: transform .35s var(--ease), top .35s var(--ease);
}
.burger span:nth-child(1) { top: 17px; }
.burger span:nth-child(2) { top: 26px; }
.menu-open .burger span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.menu-open .burger span:nth-child(2) { top: 21px; transform: rotate(-45deg); }

.menu {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 55; width: min(360px, 100%);
  padding: calc(var(--top) + 24px) var(--pad) 32px;
  background: var(--paper); border-left: 1px solid var(--line);
  transform: translateX(100%); visibility: hidden;
  transition: transform .45s var(--ease), visibility 0s linear .45s;
}
.menu-open .menu { transform: none; visibility: visible; transition: transform .45s var(--ease); }
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu__main > li > a { display: flex; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.menu a:hover { font-weight: 700; }
.chev { font-size: 18px; line-height: 1; letter-spacing: 0; transition: transform .3s; }
.menu__sub a { display: block; padding: 9px 0 9px 16px; font-size: 11px; font-weight: 400; color: var(--muted); }
.menu__sub a:hover { color: var(--ink); }

@media (hover: hover) and (min-width: 900px) {
  /* Escritorio: al pasar sobre "Porfolio" se despliega la columna de categorías junto al panel */
  .has-sub { position: relative; }
  .menu__sub {
    position: absolute; top: 0; right: calc(100% + var(--pad)); width: 250px;
    padding: 8px 20px !important; background: var(--paper); border: 1px solid var(--line);
    opacity: 0; visibility: hidden; transform: translateX(8px);
    transition: opacity .25s, transform .25s var(--ease), visibility 0s linear .25s;
  }
  .has-sub:hover .menu__sub, .has-sub:focus-within .menu__sub {
    opacity: 1; visibility: visible; transform: none; transition: opacity .25s, transform .25s var(--ease);
  }
  .menu__sub a { padding-left: 0; }
  .has-sub:hover .chev { transform: translateX(-4px); }
}
@media not ((hover: hover) and (min-width: 900px)) {
  .chev { transform: rotate(90deg); }
}
@media (max-width: 600px) {
  .menu { width: 100%; border-left: 0; }
}

/* ---------- Inicio ---------- */
.is-home { overflow: hidden; }
.home {
  height: 100vh; height: 100dvh;
  display: grid; grid-template-rows: auto 1fr auto;
}
.home__name { padding: 28px var(--pad); font-size: 13px; letter-spacing: .5em; font-weight: 600; }
.home__logo { display: grid; place-items: center; min-height: 0; padding: 2vh var(--pad); }
.home__logo img {
  width: auto; height: auto; max-width: min(520px, 70vw); max-height: 100%;
  animation: rise 1.2s var(--ease) both;
}
.home__nav { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--ink); }
.home__nav a {
  display: grid; place-items: center; height: 92px; color: var(--paper);
  font-size: 13px; transition: letter-spacing .4s var(--ease), font-weight .2s;
}
.home__nav a:hover, .home__nav a:focus-visible { letter-spacing: .42em; font-weight: 700; outline: none; }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

@media (max-width: 700px) {
  .home__name { text-align: center; padding-top: 32px; }
  .home__logo img { max-width: 78vw; }
  .home__nav { grid-template-columns: 1fr; }
  .home__nav a { height: 64px; border-top: 1px solid #2a2a2a; }
}

/* ---------- Páginas interiores ---------- */
main:not(.home) { padding: calc(var(--top) + clamp(24px, 6vw, 72px)) var(--pad) clamp(48px, 8vw, 120px); }

/* Sobre mí */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.about__photo { margin: 0; position: sticky; top: calc(var(--top) + 24px); }
.about__photo img { width: 100%; }
.about__text { max-width: 560px; padding-top: 8px; }
.about__text p { font-size: 17px; font-weight: 300; }
.about__text p:first-of-type { font-size: 21px; font-weight: 400; line-height: 1.5; }
.about__cta { margin-top: 40px; }
@media (max-width: 800px) {
  .about { grid-template-columns: 1fr; }
  .about__photo { position: static; }
}

/* Porfolio: botones de categoría con la foto en transparencia */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.tile { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 7; overflow: hidden; background: var(--paper); }
.tile img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: .22; filter: grayscale(1); transform: scale(1.02);
  transition: opacity .6s var(--ease), filter .6s var(--ease), transform 1.2s var(--ease);
}
.tile__label { position: relative; font-size: 14px; font-weight: 600; text-align: center; padding: 0 16px; transition: color .4s; }
.tile:hover img, .tile:focus-visible img { opacity: .85; filter: none; transform: scale(1.06); }
.tile:hover .tile__label, .tile:focus-visible .tile__label { color: var(--paper); text-shadow: 0 1px 12px rgba(0,0,0,.5); }
@media (max-width: 700px) {
  .tiles { grid-template-columns: 1fr; }
  .tile { aspect-ratio: 16 / 6; }
  .tile img { opacity: .3; }
}

/* Categoría: proyectos separados */
.crumbs { color: var(--muted); margin-bottom: 12px; }
.crumbs a:hover { color: var(--ink); }
.project {
  display: grid; grid-template-columns: minmax(240px, 1fr) 2.4fr; gap: clamp(28px, 5vw, 80px);
  padding: clamp(40px, 6vw, 88px) 0; border-top: 1px solid var(--line);
}
.project__info { position: sticky; top: calc(var(--top) + 24px); align-self: start; }
.project__title { font-size: clamp(20px, 2vw, 26px); font-weight: 500; line-height: 1.25; margin-bottom: 6px; }
.project__date { font-style: italic; font-weight: 300; color: var(--muted); margin-bottom: 18px; }
.project__info > p:not(.project__date) { font-weight: 300; }
.project__links { margin-top: 24px; }
.project__links h3 { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.project__links ul { list-style: none; margin: 0; padding: 0; }
.project__links li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.4; }
.project__links a::after { content: " ↗"; font-size: 12px; }
.project__links a:hover { font-weight: 600; }

.gallery { columns: 2; column-gap: 12px; }
.slide { margin: 0 0 12px; break-inside: avoid; cursor: zoom-in; overflow: hidden; background: #f4f4f4; }
.slide img { width: 100%; transition: transform .8s var(--ease); }
.slide:hover img { transform: scale(1.03); }
.project__media[data-count="1"] .gallery { columns: 1; }
.carousel-ui { display: none; }

.cat-nav { display: flex; justify-content: space-between; gap: 16px; padding-top: 40px; border-top: 1px solid var(--line); }
.cat-nav a:hover { font-weight: 700; }

@media (max-width: 800px) {
  .project { grid-template-columns: 1fr; gap: 20px; }
  .project__info { position: static; }
  /* Móvil: imágenes en carrusel, se deslizan de lado a lado */
  .gallery {
    columns: auto; display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad); scrollbar-width: none;
  }
  .gallery::-webkit-scrollbar { display: none; }
  .slide { flex: 0 0 100%; margin: 0; scroll-snap-align: center; cursor: default; display: grid; place-items: center; aspect-ratio: 1; background: none; }
  .slide img { width: 100%; height: 100%; object-fit: contain; }
  .slide:hover img { transform: none; }
  .carousel-ui { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
  .project__media[data-count="1"] .carousel-ui { display: none; }
  .carousel-ui button { width: 44px; height: 44px; font: 300 26px/1 "Raleway", sans-serif; background: none; border: 0; color: var(--ink); cursor: pointer; }
  .counter { color: var(--muted); font-size: 11px; }
}

/* Visor a pantalla completa (escritorio) */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(255,255,255,.97);
  display: grid; place-items: center; padding: 56px 72px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 112px); width: auto; object-fit: contain; }
.lightbox button { position: absolute; background: none; border: 0; cursor: pointer; color: var(--ink); font: 200 40px/1 "Raleway", sans-serif; width: 56px; height: 56px; }
.lb-close { top: 12px; right: 16px; }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); }

/* Contacto */
.contact__grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(40px, 8vw, 120px); align-items: start; }
.contact__lead { font-size: clamp(20px, 2.2vw, 28px); font-weight: 300; line-height: 1.45; max-width: 520px; margin-bottom: 48px; }
.contact__data { display: grid; grid-template-columns: auto 1fr; gap: 14px 32px; margin: 0; align-items: baseline; }
.contact__data dt { font-size: 11px; color: var(--muted); }
.contact__data dd { margin: 0; overflow-wrap: anywhere; }
.contact__data a:hover { border-bottom: 1px solid currentColor; }

.form { display: grid; gap: 22px; }
.form label { display: grid; gap: 6px; font-size: 11px; color: var(--muted); }
.form input, .form textarea {
  font: 400 16px/1.5 "Raleway", sans-serif; color: var(--ink); letter-spacing: 0; text-transform: none;
  border: 0; border-bottom: 1px solid #bbb; border-radius: 0; background: transparent; padding: 8px 0;
  transition: border-color .2s;
}
.form textarea { resize: vertical; border: 1px solid #bbb; padding: 10px 12px; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--ink); }
.form button {
  justify-self: start; padding: 16px 40px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  cursor: pointer; transition: background .25s, color .25s;
}
.form button:hover { background: var(--paper); color: var(--ink); }
.form button:disabled { opacity: .5; cursor: wait; }
.form__status { min-height: 1.7em; font-size: 14px; margin: 0; }
.form__status a { border-bottom: 1px solid currentColor; }
.hp { position: absolute; left: -9999px; }

@media (max-width: 800px) {
  .contact__grid { grid-template-columns: 1fr; }
  .contact__info { text-align: center; }
  .contact__lead { margin-inline: auto; }
  .contact__data { grid-template-columns: 1fr; gap: 2px; margin-bottom: 8px; }
  .contact__data dd { margin-bottom: 14px; }
  .form button { justify-self: stretch; }
}

/* 404 */
.notfound { min-height: 70vh; }
.notfound p { font-weight: 300; }

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