@import url('https://fonts.googleapis.com/css2?family=Coral+Pixels&family=Chelsea+Market&family=Quicksand:wght@300..700&family=IBM+Plex+Mono:wght@500&display=swap');

:root {
  --white: #ffffff;
  --ink: #101112;
  --ink-soft: #767679;
  --ink-faint: #a9a9ac;
  --hair: #e7e7e9;
  --blue: #0006db;
  --nav-h: 60px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--white);
  color: var(--ink);
  font-family: "Quicksand", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}

/* ---------- page curtain transition (4 panels, split at the grid-lines) ---------- */

.page-curtain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  pointer-events: none;
}

.page-curtain .curtain-panel {
  flex: 0 0 25%;
  height: 100%;
  background: var(--ink);
  transform: scaleX(1);
  transform-origin: left;
  border-right: 2px solid rgba(255, 255, 255, 0.1);
}

.page-curtain .curtain-panel:last-child {
  border-right: none;
}

.page-curtain.curtain-anim .curtain-panel {
  transition: transform 0.52s cubic-bezier(0.76, 0, 0.24, 1);
}

/* ---------- cursor follower ("scroll down") ---------- */

.cursor-follow {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  transform: translate(-50%, calc(-100% - 14px));
  font-family: "Quicksand", sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  background: transparent;
  padding: 0;
  border: none;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  white-space: nowrap;
  will-change: transform;
}

.cursor-follow.is-visible {
  opacity: 1;
}

@media (hover: none) {
  .cursor-follow {
    display: none;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 0 120px;
}

.shell-inner {
  padding: 0 40px;
  max-width: 900px;
  margin: 0 auto;
}

.entries-wrap {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding: 0 40px;
  max-width: none;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .shell-inner,
  .entries-wrap {
    padding: 0 20px;
  }
}

/* ---------- grid guide lines (full page height) ---------- */

.grid-lines {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.grid-lines span {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(16, 17, 18, 0.14);
}

.grid-lines-h {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: -1;
  pointer-events: none;
}

.grid-lines-h span {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(16, 17, 18, 0.14);
}

/* ---------- top nav (3 columns, full width) ---------- */

.topnav3 {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--nav-h);
  display: grid;
  grid-template-columns: 50% 25% 25%;
  border-bottom: 1px solid var(--hair);
  background: var(--white);
}

.nav-cell {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  border-right: 1px solid var(--hair);
}

.topnav3 a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  font-family: "Coral Pixels", monospace;
  font-weight: 500;
  font-size: 0.92rem;
}

@media (max-width: 640px) {
  :root {
    --nav-h: 138px;
  }
  .topnav3 {
    grid-template-columns: 1fr;
    height: auto;
  }
  .nav-cell {
    border-right: none;
    border-bottom: 1px solid var(--hair);
  }
  .nav-cell:last-child {
    border-bottom: none;
  }
  /* en desktop este margen negativo mete el texto detrás de la línea del
     grid a la mitad/75% de la pantalla; apiladas en una sola columna ya
     no hay línea que cruzar, así que se resetea para no recortar el texto */
  .topnav3 a[href="fotos.html"],
  .topnav3 a[href="aham.html"] {
    margin-left: 0;
  }
}

.nav-cell:last-child {
  border-right: none;
}

.topnav3 a[href="fotos.html"],
.topnav3 a[href="aham.html"] {
  margin-left: -34px;
}

.topnav3 a:hover {
  color: var(--blue);
}

.nav-dot {
  width: 6px;
  height: 6px;
  background: var(--ink);
  flex-shrink: 0;
  visibility: hidden;
}

.topnav3 a.current .nav-dot {
  visibility: visible;
  background: var(--blue);
  animation: blink 0.55s steps(1) infinite;
}

@keyframes blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .topnav3 a.current .nav-dot {
    animation: none;
    opacity: 1;
  }
}

.page-shell {
  position: relative;
  z-index: 1;
  max-width: none;
  padding: 0;
}

.page-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 0 100px;
}

/* ---------- hero / intro statement ---------- */

.hero {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 40px 0 70px;
  border-bottom: 1px solid var(--hair);
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.hero-ascii {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-52.63%, -51.04%);
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.83rem;
  line-height: 1.05;
  color: var(--ink-faint);
  opacity: 0.85;
  white-space: pre;
  pointer-events: none;
  user-select: none;
  z-index: -1;
  animation: ascii-float 7s ease-in-out infinite;
}

@keyframes ascii-float {
  0%, 100% { transform: translate(-52.63%, -51.04%) translateY(0) rotate(0deg); }
  50%      { transform: translate(-52.63%, -51.04%) translateY(-14px) rotate(0.6deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-ascii {
    animation: none;
  }
}

@media (max-width: 900px) {
  .hero-ascii {
    font-size: 0.44rem;
  }
}

@media (max-width: 640px) {
  .hero-ascii {
    font-size: 0.28rem;
  }
}

.hero-inner {
  padding: 0 8px;
}

.hero-kicker {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  color: var(--blue);
  margin: 0 0 18px;
  letter-spacing: 0.01em;
}

.hero-statement {
  font-family: "Coral Pixels", monospace;
  font-weight: 500;
  font-size: clamp(2.35rem, 5.6vw, 5rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0;
  max-width: none;
}

.hero-statement .accent {
  color: var(--blue);
}

/* ---------- scroll reveal (aparece con fade + deslizamiento al entrar en pantalla) ---------- */

.reveal {
  opacity: 0;
  transform: translateY(48px);
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- entradas del diario: se "abren" desde una línea central ----------
   en vez de aparecer con el mismo deslizamiento que las fotos (que puede
   sentirse como un simple cambio de pestaña), cada fila se despliega desde
   el centro hacia arriba y abajo, como si se desdoblara. */

.entry-row.reveal {
  opacity: 0;
  transform: none;
  clip-path: inset(50% 0 50% 0);
  transition: clip-path 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.45s ease;
}

.entry-row.reveal.is-visible {
  opacity: 1;
  clip-path: inset(0 0 0 0);
}

@media (prefers-reduced-motion: reduce) {
  .entry-row.reveal {
    clip-path: none;
    opacity: 1;
    transition: none;
  }
}

/* ---------- section groups (by year) ---------- */

.entries-tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  color: var(--ink-faint);
  text-transform: lowercase;
  margin: 0 0 8px;
  padding-top: 140px;
}

@media (max-width: 640px) {
  .entries-tag {
    padding-top: 64px;
  }
}

.year-group {
  padding-top: 32px;
}

.year-group:first-of-type {
  padding-top: 0;
}

.year-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  color: var(--ink-faint);
  margin: 0 0 4px;
}

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

.entry-row {
  border-bottom: 1px solid var(--hair);
}

.entry-row:first-child {
  border-top: 1px solid var(--hair);
}

.entry-card {
  display: grid;
  grid-template-columns: 84px 1fr auto 28px;
  align-items: center;
  gap: 20px;
  padding: 22px 16px;
  margin: 0 -16px;
  color: var(--ink);
  transition: background 0.18s ease, color 0.18s ease;
}

.entry-card:hover {
  background: var(--ink);
  color: var(--white);
}

.entry-date {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  color: var(--ink-faint);
  transition: color 0.18s ease;
}

.entry-card:hover .entry-date {
  color: var(--white);
}

.entry-title {
  font-family: "Chelsea Market", cursive;
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 0;
}

.entry-card:hover .entry-title {
  color: var(--white);
}

.entry-mood {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  color: var(--ink-faint);
  white-space: nowrap;
  transition: color 0.18s ease;
}

.entry-card:hover .entry-mood {
  color: var(--white);
}

.entry-plus {
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.1rem;
  text-align: right;
  color: var(--ink-faint);
  transition: transform 0.18s ease, color 0.18s ease;
}

.entry-card:hover .entry-plus {
  color: var(--white);
  transform: rotate(90deg);
}

.empty-state {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.7;
  border: 1px dashed var(--hair);
  border-radius: 4px;
  padding: 30px;
  margin-top: 24px;
}

/* ---------- single post page ---------- */

.back-link {
  display: inline-block;
  font-size: 0.86rem;
  color: var(--ink-soft);
  padding: 34px 0 0;
}

.back-link:hover {
  color: var(--blue);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 46px 0 18px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.post-title {
  font-family: "Chelsea Market", cursive;
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
  margin: 0 0 40px;
  max-width: 26ch;
}

.post-body {
  max-width: 62ch;
  border-top: 1px solid var(--hair);
  padding-top: 36px;
}

.post-body p {
  font-size: 1.02rem;
  line-height: 1.85;
  color: #33343a;
  margin: 0 0 22px;
}

.not-found {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding: 40px 0;
}

/* ---------- footer ---------- */

.site-footer {
  margin-top: 100px;
  padding-top: 24px;
  border-top: 1px solid var(--hair);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: var(--ink-faint);
  font-size: 0.8rem;
}

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

@media (max-width: 560px) {
  .entry-card {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 18px 16px;
    margin: 0 -16px;
  }
  .entry-mood {
    order: 3;
  }
  .entry-plus {
    display: none;
  }
  .site-footer {
    flex-direction: column;
    gap: 8px;
  }
}

/* ---------- fotos page ---------- */

.fotos-hero {
  position: relative;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding: 60px 28px 50px;
  overflow: hidden;
}

@media (max-width: 640px) {
  .fotos-hero {
    padding: 40px 20px 36px;
  }
}

.ascii-art {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 6px;
  line-height: 6px;
  color: var(--ink);
  opacity: 0.16;
  white-space: pre;
  pointer-events: none;
  user-select: none;
}

.fotos-statement {
  position: relative;
  font-family: "Coral Pixels", monospace;
  font-size: clamp(2.3rem, 5.4vw, 3.05rem);
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: 0;
  max-width: none;
  margin: 0;
}

.fotos-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding: 0 18px;
  border-top: 1px solid var(--hair);
  padding-top: 14px;
}

@media (max-width: 767px) {
  .fotos-grid {
    grid-template-columns: repeat(3, 1fr);
    padding: 14px 14px 0;
    gap: 10px;
  }
}

.fotos-grid figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  cursor: pointer;
  grid-column: span 1;
}

/* al tocar una foto, ocupa más espacio en la cuadrícula y el resto se
   reacomoda a su alrededor (la animación real la hace render-fotos.js,
   aquí solo se define el tamaño final) */
.fotos-grid figure.is-active {
  grid-column: span 2;
  z-index: 2;
}

.fotos-grid .photo-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--hair);
}

.fotos-grid .photo-frame[data-orientation="portrait"] { aspect-ratio: 3 / 4; }
.fotos-grid .photo-frame[data-orientation="landscape"] { aspect-ratio: 4 / 3; }
.fotos-grid .photo-frame[data-orientation="square"] { aspect-ratio: 1 / 1; }

.fotos-grid img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fotos-grid figcaption {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  color: var(--ink-faint);
  padding: 10px 14px 12px;
}

.fotos-empty {
  padding: 60px 28px;
  color: var(--ink-soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
}

/* ---------- acerca page ---------- */

.acerca-body {
  max-width: 62ch;
  padding: 56px 28px 0;
}

@media (max-width: 640px) {
  .acerca-body {
    padding: 40px 20px 0;
  }
}

.acerca-body p {
  font-size: 1.05rem;
  line-height: 1.85;
  color: #33343a;
  margin: 0 0 22px;
}

/* ---------- statement de ancho completo, pegado abajo, en aham.html ---------- */

.acerca-inner {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--nav-h));
}

.diary-statement {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-top: auto;
  padding: 0 24px 40px;
  font-family: "Coral Pixels", monospace;
  font-size: clamp(1.4rem, 4vw, 2.6rem);
  line-height: 1.35;
  color: var(--ink);
}

@media (max-width: 640px) {
  .diary-statement {
    padding: 0 20px 32px;
  }
}
