/* ===========================================================================
   Enrique "Gato" Piedfort — homenaje
   "The waterline": todo se ordena respecto de la superficie del agua.
   Sistema propio por encima de Bootstrap 5.3.
   =========================================================================== */

:root {
  --deep:   #04263A;   /* fondo profundo: hero, testimonios, footer */
  --pool:   #0B6E8F;   /* azul pileta */
  --shallow:#3FC1C9;   /* turquesa, luz sobre el agua */
  --deck:   #EDF1F2;   /* cemento mojado: secciones claras */
  --paper:  #F7F9FA;   /* fondo base */
  --gold:   #E8B04B;   /* boya / medalla: su nombre y la acción */
  --gold-d: #C88F2E;
  --ink:    #0D1B24;
  --ink-soft:#3A4B55;

  /* mismos colores en triplete RGB, para rgba(var(--x-rgb), α) */
  --deep-rgb:    4, 38, 58;
  --pool-rgb:    11, 110, 143;
  --shallow-rgb: 63, 193, 201;
  --gold-rgb:    232, 176, 75;
  --light-rgb:   255, 255, 255;

  --ff-display: "Anton", "Barlow Condensed", Impact, sans-serif;
  --ff-head:    "Barlow Condensed", "Arial Narrow", sans-serif;
  --ff-body:    "Source Serif 4", Georgia, "Times New Roman", serif;
  --ff-util:    "Barlow", system-ui, sans-serif;

  --nav-h: 64px;

  /* tarjeta "hundida": borde y sombra compartidos por retrato y QR */
  --card-border: 1px solid rgba(var(--pool-rgb), .25);
  --card-shadow: 0 24px 48px -24px rgba(var(--deep-rgb), .5);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: 1.075rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

[hidden] { display: none !important; }

::selection { background: var(--gold); color: var(--deep); }

.skip.skip {
  position: fixed; top: 8px; left: 8px; z-index: 2000;
  background: var(--gold); color: var(--deep);
  padding: .5rem .9rem; border-radius: 4px; font-family: var(--ff-util); font-weight: 600;
}

/* --- eyebrows / titles ---------------------------------------------------- */

.eyebrow {
  font-family: var(--ff-util);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: .78rem;
  color: var(--pool);
  margin: 0 0 1.4rem;
}
.eyebrow::before { content: ""; display: inline-block; width: 26px; height: 2px; background: var(--gold); vertical-align: middle; margin-right: .7em; transform: translateY(-.18em); }
.eyebrow-light { color: var(--shallow); }

.section-title {
  font-family: var(--ff-head);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.005em;
  font-size: clamp(1.9rem, 4.6vw, 3rem);
  margin: 0 0 1.4rem;
  text-wrap: balance;
}
.section-title-light { color: #fff; }

.section-lead { color: var(--ink-soft); max-width: 46ch; margin: 0 0 2.4rem; }

/* --- nav ---------------------------------------------------------------- */

.site-nav {
  background: transparent;
  padding-block: .55rem;
  transition: background-color .3s ease, box-shadow .3s ease, backdrop-filter .3s ease;
}
.site-nav.scrolled {
  background: rgba(var(--deep-rgb),.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(var(--shallow-rgb),.25);
}
.navbar-brand {
  font-family: var(--ff-head);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 1.05rem;
  color: #fff;
}
.navbar-brand span { color: var(--gold); }
.navbar-brand:hover, .navbar-brand:focus { color: #fff; }
.site-nav .nav-link {
  font-family: var(--ff-util);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .8rem;
  color: rgba(var(--light-rgb),.8);
}
.site-nav .nav-link:hover, .site-nav .nav-link:focus { color: #fff; }
.navbar-toggler {
  border-color: rgba(var(--light-rgb),.4);
}
.navbar-toggler:focus { box-shadow: 0 0 0 .2rem rgba(var(--gold-rgb),.5); }
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.85)' stroke-width='2.5' stroke-linecap='round' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
@media (max-width: 991.98px) {
  .site-nav .navbar-collapse {
    background: rgba(var(--deep-rgb),.97);
    margin: .55rem calc(-1 * var(--bs-gutter-x, .75rem)) -.55rem;
    padding: .5rem 1.25rem 1rem;
    border-top: 1px solid rgba(var(--shallow-rgb),.2);
  }
}

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

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-block: calc(var(--nav-h) + 3rem) 4rem;
  background: linear-gradient(180deg, #072f47 0%, var(--deep) 55%, #021a29 100%);
  color: #fff;
  overflow: hidden;
}
.hero-water { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.caustic {
  position: absolute;
  width: 70vmax; height: 70vmax;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .16;
  mix-blend-mode: screen;
}
.caustic.c1 {
  top: -25%; left: -15%;
  background: radial-gradient(circle at 40% 40%, var(--shallow), transparent 62%);
  animation: drift1 26s ease-in-out infinite alternate;
}
.caustic.c2 {
  bottom: -30%; right: -20%;
  background: radial-gradient(circle at 50% 50%, var(--pool), transparent 60%);
  animation: drift2 32s ease-in-out infinite alternate;
}
@keyframes drift1 { to { transform: translate3d(8vw, 6vh, 0) scale(1.15); } }
@keyframes drift2 { to { transform: translate3d(-7vw, -5vh, 0) scale(1.2); } }

.hero-inner { position: relative; z-index: 1; }

.hero-name {
  font-family: var(--ff-display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: .92;
  letter-spacing: .005em;
  font-size: clamp(3.2rem, 13vw, 8.5rem);
  margin: 0;
  /* la superficie: sólido arriba, luz de agua abajo */
  background: linear-gradient(180deg, #ffffff 0%, #ffffff 51%, var(--shallow) 52%, #8fd9de 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* en dos columnas (≥992px) la foto comparte el ancho: bajamos el tope */
@media (min-width: 992px) {
  .hero-name { font-size: clamp(3.2rem, 8vw, 6.5rem); }
}
.hero-name > span { display: block; }
.hero-name .nick { color: transparent; font-size: .62em; letter-spacing: .02em; white-space: nowrap; }

.hero-media { text-align: center; }
.hero-portrait { margin: 0; }
.hero-media picture { display: block; }
.hero-media img {
  width: 100%;
  max-width: 420px;
  margin-inline: auto;
  border-radius: 2px;
  border: 1px solid var(--gold);
  /* anillo dorado tenue (box-shadow, no outline: no lo recorta el overflow del hero) */
  box-shadow:
    0 0 0 7px rgba(var(--gold-rgb),.12),
    0 40px 70px -28px rgba(2, 20, 33, .85);
}
@media (max-width: 991.98px) {
  .hero-media { margin-top: 2.5rem; }
  .hero-media img { max-width: 320px; }
}

.hero-dates {
  font-family: var(--ff-util);
  font-weight: 600;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  letter-spacing: .04em;
  line-height: 1;
  color: var(--gold);
  margin: 1.1rem 0 1.6rem;
}
.hero-thesis {
  max-width: 34ch;
  font-size: clamp(1.05rem, 2.4vw, 1.45rem);
  line-height: 1.55;
  color: rgba(var(--light-rgb),.9);
  margin: 0 0 2.6rem;
}
.hero-thesis .hl { color: var(--gold); white-space: nowrap; }

.hero-cue {
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--ff-util); font-weight: 600;
  text-transform: uppercase; letter-spacing: .16em; font-size: .78rem;
  color: #fff; text-decoration: none;
}
.hero-cue::after {
  content: ""; width: 1px; height: 34px;
  background: linear-gradient(var(--gold), transparent);
  animation: cue 2.2s ease-in-out infinite;
}
@keyframes cue { 0%,100% { transform: scaleY(.5); transform-origin: top; opacity: .4; } 50% { transform: scaleY(1); opacity: 1; } }

/* --- lane rope divider ------------------------------------------------- */

.rope {
  height: 12px;
  background:
    repeating-linear-gradient(90deg,
      var(--gold) 0 16px,
      #f4f6f7 16px 24px,
      var(--pool) 24px 40px,
      #f4f6f7 40px 48px);
  background-color: var(--deep);
}

/* --- sections base --------------------------------------------------- */

.section { padding-block: clamp(3.5rem, 9vw, 7rem); }
.section-story,
.section-gallery { background: var(--paper); }
.section-quotes { background: var(--deep); color: rgba(var(--light-rgb),.9); }
.section-timeline { background: var(--deck); }
.section-share { background: var(--deck); }

/* --- historia ------------------------------------------------------- */

.prose p { margin: 0 0 1.3rem; max-width: 62ch; }
.prose .ph, .section-lead .ph, .foot-meta .ph,
.portrait .ph, .pull .ph, .hero-thesis .ph {
  color: var(--gold-d);
  font-style: italic;
}
.section-quotes .ph { color: var(--gold); }

.portrait { margin: 0; }
.portrait img {
  width: 100%;
  border-radius: 2px;
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}
.portrait figcaption,
.hero-portrait figcaption {
  font-family: var(--ff-util);
  font-size: .82rem;
  letter-spacing: .04em;
  color: var(--ink-soft);
  margin-top: .7rem;
}
.hero-portrait figcaption {
  color: rgba(var(--light-rgb),.72);
}

.pull {
  margin: 3.4rem 0 0;
  padding-left: 1.4rem;
  border-left: 3px solid var(--gold);
}
.pull p {
  font-family: var(--ff-display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 1.06;
  letter-spacing: .01em;
  font-size: clamp(1.5rem, 4.2vw, 2.6rem);
  color: var(--deep);
  margin: 0;
  max-width: 20ch;
}

/* --- testimonios --------------------------------------------------- */

.quote-grid { margin-top: 1rem; }
.quote-card {
  height: 100%;
  margin: 0;
  background: rgba(var(--light-rgb),.04);
  border: 1px solid rgba(var(--shallow-rgb),.22);
  border-top: 3px solid var(--gold);
  border-radius: 2px;
  padding: 1.8rem 1.6rem 1.5rem;
}
.quote-card p {
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.6;
  color: #eef6f7;
  margin: 0 0 1.1rem;
}
.quote-card cite {
  display: block;
  font-family: var(--ff-util);
  font-style: normal;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .76rem;
  color: var(--shallow);
}
.quote-card cite span { display: block; color: rgba(var(--light-rgb),.55); letter-spacing: .06em; margin-top: .2rem; }

/* --- galeria ----------------------------------------------------- */

.gallery { columns: 3 220px; column-gap: 14px; }
.shot {
  break-inside: avoid;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  width: 100%;
  background: none;
  cursor: pointer;
  display: block;
  position: relative;
  border-radius: 2px;
  overflow: hidden;
}
.shot img {
  width: 100%;
  transition: transform .5s ease, filter .5s ease;
  background: var(--pool);
}
.shot::after {
  content: attr(data-year);
  position: absolute;
  left: 10px; bottom: 10px;
  font-family: var(--ff-util); font-weight: 600;
  font-size: .74rem; letter-spacing: .1em;
  color: #fff;
  background: rgba(var(--deep-rgb),.72);
  padding: .2rem .5rem;
  border-radius: 2px;
  opacity: 0;
  transition: opacity .35s ease;
}
.shot:hover img, .shot:focus-visible img { transform: scale(1.05); filter: saturate(1.1); }
.shot:hover::after, .shot:focus-visible::after { opacity: 1; }
.shot:focus-visible { outline: 3px solid var(--pool); outline-offset: 2px; }
/* touch/sin mouse: no hay :hover, así que el año se muestra siempre en vez de sólo al pasar el cursor */
@media (hover: none) { .shot::after { opacity: 1; } }
@media (max-width: 575.98px) { .gallery { columns: 2 140px; } }

/* --- trayectoria: timeline vertical con fichas alternadas --------------- */

.section-timeline .container { max-width: 960px; }

.timeline {
  list-style: none;
  margin: 3rem 0 0;
  padding: 0;
  position: relative;
}
/* la soga */
.timeline::before {
  content: "";
  position: absolute;
  top: 4px; bottom: 4px;
  left: 20px;
  width: 8px;
  border-radius: 4px;
  background: repeating-linear-gradient(180deg,
    var(--gold) 0 12px, #fff 12px 18px, var(--pool) 18px 30px, #fff 30px 36px);
}

.t-item {
  position: relative;
  padding: 0 0 2.2rem 62px;
}
.t-item:last-child { padding-bottom: 0; }

/* boya */
.t-item::before {
  content: "";
  position: absolute;
  left: 10px; top: 6px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gold);
  border: 4px solid var(--deck);
  box-shadow: 0 0 0 2px var(--gold);
}
/* conector ficha → soga */
.t-item::after {
  content: "";
  position: absolute;
  left: 38px; top: 19px;
  width: 24px; height: 2px;
  background: var(--gold);
}

.t-card {
  background: #fff;
  border: 1px solid rgba(var(--pool-rgb),.22);
  border-radius: 4px;
  padding: 1.3rem 1.4rem;
  box-shadow: 0 18px 40px -26px rgba(var(--deep-rgb),.45);
}
.t-year {
  display: block;
  font-family: var(--ff-head);
  font-weight: 700;
  font-size: 1.65rem;
  line-height: 1;
  letter-spacing: .02em;
  color: var(--pool);
  margin-bottom: .85rem;
}
.t-media {
  margin: 0 0 .95rem;
  border-radius: 3px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--pool);
}
.t-media img { width: 100%; height: 100%; object-fit: cover; }
.t-label { margin: 0; color: var(--ink-soft); }

/* coda: el ∞ que cierra la soga */
.t-item-coda::after { display: none; }
.t-item-coda .t-card {
  background: none;
  border: 0;
  box-shadow: none;
  padding: .2rem 0;
}
.t-item-coda .t-year {
  font-family: var(--ff-display);
  font-size: 2.6rem;
  color: var(--gold);
  margin-bottom: .5rem;
}

@media (min-width: 768px) {
  .timeline::before { left: 50%; margin-left: -4px; }

  .t-item {
    width: 100%;
    padding: 0 0 2.8rem 0;
    display: flex;
  }
  .t-item .t-card { width: calc(50% - 42px); }
  .t-item:nth-child(odd) { justify-content: flex-start; }
  .t-item:nth-child(odd) .t-card { text-align: right; }
  .t-item:nth-child(even) { justify-content: flex-end; }

  .t-item::before { left: 50%; margin-left: -14px; top: 8px; }
  .t-item::after { top: 21px; width: 42px; }
  .t-item:nth-child(odd)::after { left: calc(50% - 42px); }
  .t-item:nth-child(even)::after { left: 50%; }

  .t-item-coda { justify-content: center; padding-top: 1.2rem; }
  .t-item-coda .t-card { width: auto; text-align: center; }
  .t-item-coda::before { top: -4px; }
}

/* --- compartir ------------------------------------------- */

.qr-card {
  display: inline-block;
  margin: 0;
  padding: 1.1rem;
  background: #fff;
  border: var(--card-border);
  border-radius: 4px;
  box-shadow: var(--card-shadow);
}
.qr-card img { width: 240px; height: 240px; max-width: 100%; }

.share-buttons { display: flex; flex-wrap: wrap; gap: .9rem; }

.share-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  color: var(--deep);
  background: #fff;
  border: 1px solid rgba(var(--deep-rgb),.2);
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.share-btn svg { width: 1.35rem; height: 1.35rem; display: block; }
.share-btn:hover, .share-btn:focus-visible {
  background: var(--deep);
  border-color: var(--deep);
  color: #fff;
  transform: translateY(-2px);
}

/* tooltip */
.share-btn::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + .6rem);
  left: 50%;
  white-space: nowrap;
  font-family: var(--ff-util);
  font-weight: 600;
  font-size: .74rem;
  letter-spacing: .01em;
  color: #fff;
  background: var(--deep);
  padding: .35rem .6rem;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity .18s ease, transform .18s ease;
}
.share-btn::before {
  content: "";
  position: absolute;
  top: calc(100% + .2rem);
  left: 50%;
  border: 5px solid transparent;
  border-bottom-color: var(--deep);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity .18s ease, transform .18s ease;
}
.share-btn:hover::after, .share-btn:focus-visible::after, .share-btn.copied::after,
.share-btn:hover::before, .share-btn:focus-visible::before, .share-btn.copied::before {
  opacity: 1;
  transform: translate(-50%, 0);
}
.share-btn.copied::after { content: attr(data-tip-done); background: var(--pool); }
.share-btn.copied::before { border-bottom-color: var(--pool); }

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

.site-footer {
  background: var(--deep);
  color: rgba(var(--light-rgb),.7);
  padding-block: 3rem;
}
.foot-name {
  font-family: var(--ff-head);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #fff;
  font-size: 1.1rem;
  margin: 0 0 .6rem;
}
.foot-meta { font-family: var(--ff-util); font-size: .9rem; margin: .2rem 0; }
.foot-meta a { color: var(--shallow); }
.foot-dim { color: rgba(var(--light-rgb),.4); }

/* --- lightbox --------------------------------------------- */

.lightbox .modal-content {
  background: var(--deep);
  border: 1px solid rgba(var(--shallow-rgb),.3);
  border-radius: 2px;
  padding: 0;
  position: relative;
}
.lightbox img { width: 100%; border-radius: 2px 2px 0 0; }
.lightbox-caption {
  font-family: var(--ff-util);
  font-size: .9rem;
  color: rgba(var(--light-rgb),.8);
  padding: .9rem 1.2rem;
  margin: 0;
}
.lightbox-close {
  position: absolute;
  top: .7rem; right: .7rem;
  z-index: 3;
  background-color: rgba(var(--deep-rgb),.6);
  border-radius: 50%;
  padding: .6rem;
}

/* --- reveal --------------------------------------------- */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .caustic, .hero-cue::after { animation: none; }
}

/* --- focus visibility ---------------------------------- */

a:focus-visible, .btn:focus-visible, button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.section-quotes a:focus-visible, .hero a:focus-visible {
  outline-color: #fff;
}
